A Lexer for The Parser

A Lexer for The Parser

%{

#include “y.tab.h”

%}

%%

[0-9]+ {yylval = atoi(yytext); return NUMBER; }

[ \t] ; /* ignore whitespace */

\n return 0; /* logical EOF */

. return yytext[0]; /* return any other char */

%%

Previous slide Next slide Back to the first slide View Graphic Version