Permalink
Browse files

oneof vs one of

git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@799 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information...
grammarware committed May 9, 2010
1 parent 0e306f8 commit badd58c9b585489f3e47f9e26bee7ce7d0380e14
Showing with 11 additions and 1 deletion.
  1. +11 −1 topics/extraction/bnf2bgf/pdf2lll.py
@@ -62,12 +62,14 @@ def readTerminalsList(f):
(
('opt',' OPTIONALITYMETASYMBOL'),
('','"-"'),
('ñ','"-"'),
('˜','"~"'),
('','fi'),
('[',' ['),
('(',' ('),
(']',' ]'),
(')',' )'),
(')',' )')
# ('oneof',' one of'),
)
oneof = False
@@ -95,6 +97,14 @@ def processline(line):
double[current] = grammar[current][:]
grammar[current] = []
return
if rline.find('oneof')>0:
oneof = True
assignNewCurrent(rline.replace('oneof','').strip()[:-1].split()[-1])
if current in grammar.keys():
#print 'Warning: double declaration of',current,': the first one',grammar[current],'discarded'
double[current] = grammar[current][:]
grammar[current] = []
return
if oneof:
for t in rline.split():
grammar[current].append(' '.join(processLineTokens(t)))

0 comments on commit badd58c

Please sign in to comment.