]> pd.if.org Git - pccts/commitdiff
auto commit for import
authorTerence Parr <>
Thu, 14 Sep 1995 00:39:24 +0000 (19:39 -0500)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 26 Feb 2017 02:16:51 +0000 (20:16 -0600)
testcpp/8/test.g [new file with mode: 0755]

diff --git a/testcpp/8/test.g b/testcpp/8/test.g
new file mode 100755 (executable)
index 0000000..d7af59e
--- /dev/null
@@ -0,0 +1,22 @@
+/* This is test.g which tests a simple DLG-based scanner, but with
+ * a main() in another file.
+ */
+
+#header <<
+#include "AToken.h"                                            // what's ANTLRCommonToken look like?
+typedef ANTLRCommonToken ANTLRToken;   // by placing in header, Expr.h gets it
+>>
+
+#token "[\ \t\n]+"     <<skip();>>
+#token Eof "@"
+
+class Expr {                           /* Define a grammar class */
+
+e      :       IDENTIFIER NUMBER Eof
+               <<fprintf(stderr, "text is %s,%s\n", $1->getText(), $2->getText());>>
+       ;
+
+}
+
+#token IDENTIFIER      "[a-z]+"
+#token NUMBER          "[0-9]+"