Need help getting started on a grammar (again) (SOLVED) [message #1380003] |
Sun, 25 May 2014 00:14 |
Jordan Wallet Messages: 16 Registered: December 2013 |
Junior Member |
|
|
Some of you may remember me from earlier this year in that I was completely unable to get Xtext working at all and managed to waste quite a fair bit of people's time in the process. The thread ended with a resolution to buy Lorenzo Bettini's book, Implementing Domain-Specific Languages with Xtext and Xtend.
I finally had a chance this weekend to crack open the book and follow along, and I'm running into a problem. I learned from my last shot at this that trying to fix it myself without some expert advice isn't going to get me anywhere.
Here's my grammar resulting from following the book through about halfway down page 38:
grammar org.example.entities.Entities with org.eclipse.xtext.common.Terminals
generate entities "http://www.example.org/entities/Entities"
Model:
entities += Entity*;
Entity:
'entity' name = ID ('extends' superType=[Entity])? '{'
attributes += Attribute*
'}'
;
Attribute:
type=[Entity] array?=('[' ']')? name=ID ';'
;
The grammar was previously working; since, the only modification was to change '[]' to '[' ']' to allow arbitrary whitespace between the square brackets.
I get a syntax error under ']' claiming: extraneous input "]" expecting ')'
I've dug around the web a little and found examples of this sort of putting two string literals right next to each other, so I suspect it's not so much an issue with the grammar as a problem with my setup. Any ideas on how to proceed would be greatly appreciated.
[Updated on: Sun, 25 May 2014 00:16] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02628 seconds