1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | /* SI 413 Fall 2011 * Lab 6 * Scanner specification for the pat language (part 2) * YOUR NAME HERE * PARTNER NAME HERE */ %{ #include <iostream> using namespace std; #include "pat2.tab.hpp" %} %option noyywrap %% [a-z][a-zA-Z0-9]* { return SYM; } "*" { return FOLD; } ";" { return STOP; } ":" { return COLON; } [A-Z][a-zA-Z0-9]* { return NAME; } "_r" { return REV; } "[" { return LB; } "]" { return RB; } <<EOF>> { return 0; } [ \t\n]+ { } . { errout << "Unrecognized token starting with" << yytext << endl; exit(1); } %% |