statement across 2 lines

Jun 27, 2014 at 7:11 PM
Edited Jun 27, 2014 at 7:12 PM
Hi

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

a=1 b=2

c
=
1

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
Coordinator
Jun 30, 2014 at 4: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.