Red de conocimientos turísticos - Información de alquiler - No sé cómo generar un programa C flexible

No sé cómo generar un programa C flexible

A continuación se muestra un programa scanner.l que escribí antes

Puedes probarlo, debería funcionar.

{

#include lt; stdio.hgt;

#include lt;

dígito [0-9]

número {dígito}

pinta (" ")?{número}

menta "-"{número}

número real (" "|"-")?{número}"." ?{número}

verdadero "VERDADERO"

falso "FALSO"

letra [a-zA-Z]

identificador {letra}

nueva línea \n

espacio en blanco [ \t] <

p>

"PROGRAMA" {regresar PROGRAMA;}

"COMENZAR" {regresar COMENZAR;}

"FIN" {return END;}

"CONST" {return CONST;}

" INTEGER" {return INTEGER;}

"REAL" {return REAL;}

"BOOLEAN" {return BOOLEAN;}

"ARRAY" {return ARRAY;}

"IF" {return IF;}

"ENTONCES" {regresar ENTONCES;}

"ELSE" {regresar ELSE;}

"ENDIF" {regresar ENDIF;}

"MIENTRAS" {regresar MIENTRAS;}

"HACER" {regresar HACER;}

"REPETIR" {regresar REPETIR;}

"UNTIL" {regresar HASTA;}

"PARA" {regresar PARA;}

"TO" {regresar A;}

"LEER" {regresar LEER )}

"ESCRIBIR" {regresar ESCRIBIR;}

":=" {strcpy(yylval.}

"lt;" {strcpy(yylval.cval, yytext); regresar LT ;}

"lt;=" {strcpy(yylval.cval, yytext); devuelve NMT;}

"lt;gt;" {strcpy(yylval.cval, yytext) ; devolver NEQ;}

"gt;" {strcpy(yylval.cval, yytext); devolver MT;}

"gt;=" {strcpy(yylval.cval, yytext) ); return NLT; }

" " {strcpy(yylval.cval, yytext); retorno MÁS;}

"-" {strcpy(yylval.cval, yytext); MENOS;}

" p>

"*" {strcpy(yylval .cval, yytext); return MULTIPLY;}

>"/" {strcpy(yylval.cval, yytext); retorno SOBRE;}

"Y" {strcpy(yylval.cval, yytexto); O" {strcpy(yylval.cval, yytext); retorno O;}

"NO" {strcpy(yylval.cval, yytext); retorno NO;}

":" {return COLON;}

"#" {return STOP;}

"," {strcpy(yylval.cval, yytext; return COMMA;}

";" {regresar SEMI;}

"[" {regresar LSB;}

"]"{ regresar RSB;}

"(" { Devuelve LPAREN;}

")"{return RPAREN;}

{pint}{strcpy(yylval.cval, yytext; devuelve PINT;}

); {mint}{strcpy(yylval.cval,yytext);return MINT;}

{realnumber} {strcpy(yylval.cval,yytext);return REALNUMBER;}

{true }{strcpy(yylval.cval, yytext); devuelve VERDADERO;}

{false} {strcpy(yylval.cval, yytext); devuelve FALSO;}

{identificador} { strcpy(yylval. yytext); ID de retorno;}

{newline} {}

{whitespace}{}

{return ERROR;}

int yywrap()

{

devuelve 1;

}

.