This project has moved and is read-only. For the latest updates, please go here.

statement across 2 lines

Jun 27, 2014 at 8:11 PM
Edited Jun 27, 2014 at 8:12 PM

this language allows multiple statements on the same line or one statement spread out across multiple lines, such as

a=1 b=2


there is no end delimiter such as semi ";" to denote end of a statement

I use
StatementList.Rule = MakePlusRule(StatementList, null, Statement);

combined with functions definition, I got a lot of conflicts

Shift-reduce conflict. State S8, lookaheads [(]. Selected shift as preferred action. S8
Shift-reduce conflict. State S9, lookaheads [identifier number ( string]. Selected shift as preferred action. S9
Shift-reduce conflict. State S11, lookaheads [endmacro identifier number ( string]. Selected shift as preferred action. S11

How do i fix this? thanks much
Jun 30, 2014 at 5:33 PM
not sure about particular conflicts you have, but I think you should try the following. Use ImpliedSymbolTerminal to express a 'virtual' statement terminator. Use this terminal in expression for statement. This terminal is injected automatically by parser when it sees that it is appropriate and there are no alternatives - read more in comments in source file for the terminal.