Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Grammar problems, "No viable alternative at input..."
Grammar problems, "No viable alternative at input..." [message #1698581] Tue, 16 June 2015 13:44 Go to next message
Anton Bergman is currently offline Anton BergmanFriend
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!
Re: Grammar problems, "No viable alternative at input..." [message #1698592 is a reply to message #1698581] Tue, 16 June 2015 14:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

can you share a complete minimal grammar


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Grammar problems, "No viable alternative at input..." [message #1698665 is a reply to message #1698592] Wed, 17 June 2015 07:17 Go to previous message
Anton Bergman is currently offline Anton BergmanFriend
Messages: 34
Registered: June 2015
Member
I am an idiot. I forgot to use my rule in the beginning, so of course it was never used -.-.

Thanks anyway!

[Updated on: Wed, 17 June 2015 07:17]

Report message to a moderator

Previous Topic:Inject xbasecompiler
Next Topic:Grammar basics
Goto Forum:
  


Current Time: Tue Mar 19 07:07:22 GMT 2024

Powered by FUDForum. Page generated in 0.03520 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top