PPT Slide
/*
* Parse slash-delimited book data.
*/
%%
%class lex
%standalone
%unicode
LineTerminator = \r|\n|\r\n
Slash = "/"
Field = [^/\r\n]+
%%
{Field} { System.out.print(yytext()); }
{Slash} { System.out.print("/"); }
{LineTerminator} { System.out.println(); }
<<EOF>> { return 0; }
mylexer.flex
Define the macros
Use the macros
See example02
Do Lab3
Previous slide
Next slide
Back to first slide
View graphic version