#include int points=0, paths=0, ind, starti; POINT "." COMMA "," DOTC ";" SIGN "-" DIGITS [0-9]+ SPACE [ \t]+ POSINUM {DIGITS}(({POINT}{DIGITS})?) COORD ({SIGN}?){POSINUM} PAIR "("{COORD}{COMMA}{COORD}")" ENDOFLIN "\n" THEND "endfig;" THEI {ENDOFLIN}"fill "|{ENDOFLIN}"draw " THEC {PAIR}({SPACE}?){ENDOFLIN}{SPACE}"--cycle" THEB "beginfig(1);" THER .|\n|\r %x g %x t %% <*>{THEB} { printf( "%% Modified by L. Nobre G's Lex scanner %%%%%%%%%%%%%%%%%%%%% \n" ); printf( "randomseed := 1010; \n" ); printf( "vardef renewcolore = \n" ); printf( " color tmpcolo; \n" ); printf( " tmpcolo = (uniformdeviate(0.8),uniformdeviate(0.8),uniformdeviate(0.8)); \n" ); printf( " drawoptions( withcolor tmpcolo ); \n" ); printf( "enddef; \n" ); printf( "defaultscale := 0.16; \n" ); printf( "beginfig(1);\n path PreeditedPath[];" ); } <*>{THEI} { paths++; printf( "\n PreeditedPath%d = ", paths ); starti = points+1; BEGIN g; } {PAIR} points++; printf( "hide(z%d=%s)z%d", points, yytext, points ); {THEC} printf( "cycle" ); {DOTC} { printf( ";\n renewcolore;\n " ); printf( "draw PreeditedPath%d;\n", paths ); printf( " dotlabels.rt(" ); for ( ind=starti; ind{THER} ECHO; %% main() { yylex(); }