1 /* This is test.g which tests a simple DLG-based scanner, but with
2 * a main() in another file.
6 #include "AToken.h" // what's ANTLRCommonToken look like?
7 typedef ANTLRCommonToken ANTLRToken; // by placing in header, Expr.h gets it
10 #token "[\ \t\n]+" <<skip();>>
13 class Expr { /* Define a grammar class */
15 e : IDENTIFIER NUMBER Eof
16 <<fprintf(stderr, "text is %s,%s\n", $1->getText(), $2->getText());>>
21 #token IDENTIFIER "[a-z]+"
22 #token NUMBER "[0-9]+"