nitcc: add test/lexer-any.sablecc
authorJean Privat <jean@pryen.org>
Wed, 17 Feb 2016 21:26:17 +0000 (16:26 -0500)
committerJean Privat <jean@pryen.org>
Wed, 17 Feb 2016 21:26:17 +0000 (16:26 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

contrib/nitcc/tests/lexer-any.input [new file with mode: 0644]
contrib/nitcc/tests/lexer-any.sablecc [new file with mode: 0644]
contrib/nitcc/tests/sav/lexer-any.input.res [new file with mode: 0644]

diff --git a/contrib/nitcc/tests/lexer-any.input b/contrib/nitcc/tests/lexer-any.input
new file mode 100644 (file)
index 0000000..955bebf
--- /dev/null
@@ -0,0 +1,4 @@
+aa
+bb
+cc
+dd
diff --git a/contrib/nitcc/tests/lexer-any.sablecc b/contrib/nitcc/tests/lexer-any.sablecc
new file mode 100644 (file)
index 0000000..5b248a6
--- /dev/null
@@ -0,0 +1,15 @@
+Grammar y;
+
+Lexer
+
+a = 'a' Any;
+b = 'b' (Any - 'b');
+c = 'c' (#0..'c');
+d = 'd' (Any-(#0..'c'));
+
+blank = #10 | #13 | #32;
+Parser
+Ignored blank;
+
+p = t+;
+t = a | b | c | d;
diff --git a/contrib/nitcc/tests/sav/lexer-any.input.res b/contrib/nitcc/tests/sav/lexer-any.input.res
new file mode 100644 (file)
index 0000000..6cc0cff
--- /dev/null
@@ -0,0 +1,12 @@
+Start
+  p
+    Nodes[Nt]
+      t_0
+        a@(1:1-1:3)='aa'
+      t_1
+        b@(2:1-2:3)='bb'
+      t_2
+        c@(3:1-3:3)='cc'
+      t_3
+        d@(4:1-4:3)='dd'
+  Eof@(5:1-5:1)=''