projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed tibdoc
[sbp.git]
/
tests
/
meta.g
diff --git
a/tests/meta.g
b/tests/meta.g
index
0d2be6f
..
062bf25
100644
(file)
--- a/
tests/meta.g
+++ b/
tests/meta.g
@@
-1,6
+1,12
@@
+
+// use 'a'-'z' or 'a-z' instead of [a-z]?
+// EOF token?
+// #include (with renaming?)
+// ANTLR uses ! and ^ suffixes
+
s = ws grammar:Grammar ws
Grammar = NonTerminal +/ ws
s = ws grammar:Grammar ws
Grammar = NonTerminal +/ ws
-NonTerminal = Word !wp ^"=" !wp RHS
+NonTerminal = Word ^"=" RHS /ws
RHS = (Sequence +/ (!ws "|" !ws)) +/ (!ws ">" !ws)
RHS = (Sequence +/ (!ws "|" !ws)) +/ (!ws ">" !ws)
@@
-8,12
+14,12
@@
Elements = e*/ws
PreSequence = ps:: Elements
| (Quoted|Word) ^"::" PreSequence /ws
PreSequence = ps:: Elements
| (Quoted|Word) ^"::" PreSequence /ws
- > PreSequence !wp ^"/" !ws e
- | PreSequence ^"->" e /ws
+ > PreSequence ^"/" e /ws
+ | PreSequence ^"->" e /ws
Sequence = psx:: PreSequence
Sequence = psx:: PreSequence
- | Sequence !ws ^"&" !ws Elements
- | Sequence !ws ^"&~" !ws Elements
+ | Sequence ^"&" Elements /ws
+ | Sequence ^"&~" Elements /ws
ec = ~[\-\]\\]
| escaped
ec = ~[\-\]\\]
| escaped
@@
-25,7
+31,7
@@
e = (Quoted|Word) ^":" e
> nonTerminal:: Word
| literal:: Quoted
| ^"()"
> nonTerminal:: Word
| literal:: Quoted
| ^"()"
- | ^"{" Sequence "}" /ws
+ | ^"{" PreSequence "}" /ws
| ^"[" Range* "]"
| e ^"++" /ws -> ~[/]
| e ^"+" /ws -> ~[+]
| ^"[" Range* "]"
| e ^"++" /ws -> ~[/]
| e ^"+" /ws -> ~[+]