Allow variable names on elements

db4
Chris Double 2008-03-31 14:03:16 +13:00
parent 55a69392fa
commit ee2194d1dc
1 changed files with 7 additions and 1 deletions

View File

@ -102,7 +102,7 @@ C: <ebnf> ebnf
"]" syntax ,
] seq* [ first >string <ebnf-range> ] action ;
: 'element' ( -- parser )
: ('element') ( -- parser )
#! An element of a rule. It can be a terminal or a
#! non-terminal but must not be followed by a "=".
#! The latter indicates that it is the beginning of a
@ -120,6 +120,12 @@ C: <ebnf> ebnf
] choice* ,
] seq* [ first ] action ;
: 'element' ( -- parser )
[
[ ('element') , ":" syntax , "a-zA-Z" range-pattern repeat1 [ >string ] action , ] seq* [ first2 <ebnf-var> ] action ,
('element') ,
] choice* ;
DEFER: 'choice'
: grouped ( quot suffix -- parser )