Tutorial Lex/Yacc - capsl
Tutorial Lex/Yacc - capsl
Tutorial Lex/Yacc - capsl
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
[0-9]+ {<br />
}<br />
[A-Za-z]+ {<br />
}<br />
Flex Example<br />
/*Code*/<br />
yylval.dval = atof(yytext);<br />
return NUMBER;<br />
Match one or more<br />
alphabetical characters.<br />
/*Code*/<br />
struct symtab *sp = symlook(yytext);<br />
yylval.symp = sp;<br />
return WORD;<br />
. { return yytext[0]; }<br />
2/17/2012<br />
CAPSL<br />
22