Grammar problems, "No viable alternative at input..." [message #1698581] |
Tue, 16 June 2015 13:44 |
Anton Bergman Messages: 34 Registered: June 2015 |
Member |
|
|
As a project for the summer, I am implementing a DSL for the PlantUML Eclipse plugin.
I am currently working on the grammar for the notes, as described on the plantUML website. I quote:
Quote:It is possible to put notes on message using the note left or note right keywords just after the message.
You can have a multi-line note using the end note keywords.
It is also possible to place notes relative to participant with note left of , note right of or note over keywords.
It is possible to highlight a note by changing its background color.
You can also have a multi-line note using the end note keywords.
My rule for notes currently looks like this:
Note:
'note' (('right' ('of' ID (',' ID)*)?)|('left' ('of' ID(',' ID)*)?)|('over' ID(',' ID)*)) (Color)* (':' ID| (NEWLINE ID)* NEWLINE 'end note')
;
The problem I am facing is that both the keywords "left" and "right" get bolded on their own, instead of the entire "node left" and "node right". Also I get errors on "left" and "right" saying "No viable alternative at input left/right".
The only other rule I have that uses those keywords are:
Legend:
'legend' ('right' | 'left' | 'center')? ((NEWLINE ID|NEWLINE)?)* NEWLINE 'endlegend'
;
Does anyone know what can be the problem, or what I can do to find the problematic rule? I am somewhat new to Xtext. Thanks!
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03520 seconds