ubuntu - A Proper Explanation for the following lex/yacc example -


i having difficulty understanding following code.if possible suggest me site can read through documentations or explain code please every detail.

%{ int yylineno; %} %% ^(.*)\n    printf("%4d\t%s", ++yylineno, yytext); %% int main(int argc, char *argv[]) { yyin = fopen(argv[1], "r"); yylex(); fclose(yyin); } 

the code you've posted lex (or flex) code. specification lexical analyser lex (or similar flex) program generate. these days, flex more used lex although believe they're pretty compatible each other.

the official flex documentation good:

http://flex.sourceforge.net/manual/

and here's link page in manual simple examples 1 you've given explained:

http://flex.sourceforge.net/manual/simple-examples.html#simple-examples

hope helps.


Comments

Popular posts from this blog

jquery - How do you format the date used in the popover widget title of FullCalendar? -

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -