in reply to PRD parser problem: How to deal with mutiple lines
You could start that like:
Then define a descriptionsection_content: description |
Finally a statementdescription: 'DESCRIPTION' '=' statement | 'DESCRIPTION' '=' '{' statement(s) '}'
statement: ...
The key is to think: what are the choices for a valid description or statement or whatever? Each choice is an alternative. Each alternative is made of pieces which themselves might have choices.
p.s. Normal conventions of grammars have us use upper case on the left side of a rule only if we are defining a token. Other left sides, which are built from other things, are usually lower case.
Phil
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: PRD parser problem: How to deal with mutiple lines
by Hanken (Acolyte) on Jun 16, 2008 at 08:47 UTC | |
by philcrow (Priest) on Jun 17, 2008 at 14:53 UTC |