
Hi,
I have a grammar which has the following form:
'command' ('option1'|'option2'|'option3') 'commandtail1' 'commandtail2'
I am trying to use ReportSyntaxError() so I can display syntax error with the error wavy line.
What I can do without any problem is the following:
1: 'command'
2: ('option1'|'option2'|'option3')
3: 'commandtail1<- this.ReportSyntaxError("'commandtail1' expected."); return false; ->'
4: 'commandtail2<- this.ReportSyntaxError("'commandtail2' expected."); return false; ->'
but I don't know how to work on the alternations in line 2.
I know that in yacc you can have a fourth alternation of error and call ReportSyntaxError () in there as follows:
2: ('option1'|'option2'|'option3'|'ErrorToken<+ this.ReportSyntaxError("'option1', 'option2', or 'option3' expected."); return false; +>')
Is the same feature available in your grammar generator or there is another way to handle the same thing?
I have a grammar which has the following form:
'command' ('option1'|'option2'|'option3') 'commandtail1' 'commandtail2'
I am trying to use ReportSyntaxError() so I can display syntax error with the error wavy line.
What I can do without any problem is the following:
1: 'command'
2: ('option1'|'option2'|'option3')
3: 'commandtail1<- this.ReportSyntaxError("'commandtail1' expected."); return false; ->'
4: 'commandtail2<- this.ReportSyntaxError("'commandtail2' expected."); return false; ->'
but I don't know how to work on the alternations in line 2.
I know that in yacc you can have a fourth alternation of error and call ReportSyntaxError () in there as follows:
2: ('option1'|'option2'|'option3'|'ErrorToken<+ this.ReportSyntaxError("'option1', 'option2', or 'option3' expected."); return false; +>')
Is the same feature available in your grammar generator or there is another way to handle the same thing?