Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365045 - sub-structuring terminals results in EOF error
Summary: sub-structuring terminals results in EOF error
Status: CLOSED INVALID
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-29 07:10 EST by Robin CLA
Modified: 2011-11-29 07:13 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin CLA 2011-11-29 07:10:10 EST
Build Identifier: I20110613-1736

I use the grammar:

grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals

generate myDsl "hxxp://www.xtext.org/example/mydsl/MyDsl" 

Model:
	(entries+=Entry)*;
	
Entry :
	INFO_TOKEN_START
	info=Info 
	TOKEN_END;
	
Info:
	name=ID;

terminal TOKEN_START:
	'<TOKEN';
	
terminal TOKEN_START_CLOSE:
	'>';
	
terminal INFO_TOKEN_START:
	TOKEN_START MARKER Y_COORDINATE NON_ITALIC TOKEN_START_CLOSE;

terminal TOKEN_END:
	'</TOKEN>';
	
terminal MARKER:
	('startX=114.24' | 'startX=311.24');

terminal Y_COORDINATE:
	'startY=' INT '.' INT;
	
terminal NON_ITALIC:
	'italicAngle=0.0';

I get an "missing EOF at '<TOKEN'" error, when I run this grammar in a new Eclipse instance with the language instance:

<TOKEN startX=311.24 startY=431.84 italicAngle=0.0>asd</TOKEN>


Reproducible: Always

Steps to Reproduce:
1. make a new xtext project and use the above grammar
2. generate the code with MWE2 workflow
3. run as new Eclipse instance
4. make a new project containing a .mydsl-file which contains the line "<TOKEN startX=311.24 startY=431.84 italicAngle=0.0>asd</TOKEN>" and add the xtext nature to the project
5. the error is shown
Comment 1 Sebastian Zarnekow CLA 2011-11-29 07:13:09 EST
Please note that terminal rules are order dependent (see the docs). I bet that INFO_TOKEN_START is never matched - it does not even state that a space (' ') is allowed. You should consider to use data type rules instead and refer to the docs for details.