Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Parsing *some* comments
Parsing *some* comments [message #1752953] Tue, 31 January 2017 09:32
Chris Bryan is currently offline Chris BryanFriend
Messages: 3
Registered: April 2016
Junior Member
I'm trying to parse a language where some (but not all) single-line comments are semantically important.

MyRule:
	comments+=SL_COMMENT*
	info=Revision
	comments+=SL_COMMENT*;

Revision:
	'--' 'Revision' INT;

terminal INT returns ecore::EInt:
	'-'? ('0'..'9' | '_')+;
terminal SL_COMMENT:
	'--' !('\n' | '\r')* NL?;
terminal NL:
	('\r'? '\n') (WS | '\r' | '\n')*;


SL_COMMENT is *not* hidden.

I was hoping that the '--' keyword in Revision would override the SL_COMMENT terminal at lexing, but this doesn't seem to be the case. Can anyone explain why?
Previous Topic:emfcompare and 'outline view' for DSL's defined using xtext
Next Topic:Xtext tutorial unexpected result
Goto Forum:
  


Current Time: Wed Dec 11 16:14:23 GMT 2024

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

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

Back to the top