linux - Lex file unrecognized rule -


i trying run following program, , getting unrecognized rule: 37. not sure why giving me error in line 37.

command: $ lex mycsv2html.l

%{                      //definition section   #include <stdin.h>                          #include <stdout.h> int c; extern int yylval; %}   %%                      // rule section " "       ; [\n]     {             c = yytext[0];             yylval = c - '\n';             return(br);           } ["]     {             c = yytext[0];             yylval = c - '';             return('');           } [<]     {             c = yytext[0];             yylval = c - '';             return('&lt');           }  [>]     {             c = yytext[0];             yylval = c - '';             return('&gt');           }  int main(void)                            //c code section {     /* call lexer, quit. */     yylex();     return 0; } 

you should add %% between second part (rules) , third part(c codes).

..... [>]     {         c = yytext[0];         yylval = c - '';         return('&gt');       }  %% // here  int main(void)                            //c code section ..... 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -