Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [xtext] mismatched input '{' expecting '{'
[xtext] mismatched input '{' expecting '{' [message #500639] Fri, 27 November 2009 09:30 Go to next message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

I encounteres this strange error message:

mismatched input '{' expecting '{'

with this text:

page MyPage

location body {
}

Language definition:

grammar it.tomassetti.mdwe.PageDsl with org.eclipse.xtext.common.Terminals

generate pageDsl "http://www.tomassetti.it/mdwe/PageDsl"

Page:
'page' name=ID
(locations+=Location)*;

Block:
'#block' name=ID '{'
(elements+=PageElement)*
'}';

Location:
'location' name=ID '{'
(elements+=PageElement)*
'}';

PageElement:
FormEl|TextEl|StringEl|ImageEl|Block|ListEl|TitleEl;

ListEl:
'#list' value=LimitedValue ' {'
(elements+=PageElement)*
'}';

ClassesDecl:
( '(' names+=ID(','names+=ID)* ')')? ;

FormEl:
'#form' name=ID;

TextEl:
'#text' classes=ClassesDecl value=Value;

TitleEl:
'#title' classes=ClassesDecl value=Value;

LimitedValue returns Value:
(ref=Reference)|(var=ID '=''['query=STRING']');

Value:
name=ID|ref=Reference|('['query=STRING']');

Reference:
'$'|('$.'field=CompositeId)|('@'modelName=ID);

CompositeId:
portions+=ID('.'portions+=ID)*;

StringEl:
'#string' classes=ClassesDecl value=Value;

ImageEl:
'#image' name=ID;



Re: [xtext] mismatched input '{' expecting '{' [message #500660 is a reply to message #500639] Fri, 27 November 2009 11:23 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
(I added the TMF newsgroup.)

Yes, it's a strange message.
I guess it is because of the whitespace within the ' {' keyword in the
following rule:


> ListEl:
> '#list' value=LimitedValue ' {' (elements+=PageElement)*
> '}';


Cheers,
Sven

--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: [xtext] mismatched input '{' expecting '{' [message #500661 is a reply to message #500660] Fri, 27 November 2009 11:28 Go to previous message
Federico Tomassetti is currently offline Federico TomassettiFriend
Messages: 190
Registered: July 2009
Location: Dublin
Senior Member

Yes it is the whitespace the reason. Anyway the message it is not that clear Smile

Thank you,
Federico



Previous Topic:Xpand: Cannot resolve the reference to a dependent model
Next Topic:Xpand Workspace Setup
Goto Forum:
  


Current Time: Fri Apr 19 09:35:53 GMT 2024

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

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

Back to the top