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 04:30 Go to next message
Federico Tomassetti is currently offline Federico Tomassetti
Messages: 186
Registered: July 2009
Location: Torino
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 06:23 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1759
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


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [xtext] mismatched input '{' expecting '{' [message #500661 is a reply to message #500660] Fri, 27 November 2009 06:28 Go to previous message
Federico Tomassetti is currently offline Federico Tomassetti
Messages: 186
Registered: July 2009
Location: Torino
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 Aug 01 02:06:45 EDT 2014

Powered by FUDForum. Page generated in 0.01907 seconds