Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » about grammar
about grammar [message #1069306] Mon, 15 July 2013 16:27 Go to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
HI,

Inclusion:
'#include' '<' headFile = HeaderFile '>'
;

HeaderFile:
(QUALIFIED_NAME '/')* QUALIFIED_NAME '.h'
;

Why the editor does not accept code like: #include <a/b.h> ?
It only accepts #include <b.h>. Any idea to improve it ?

BTW, how can I use until token in xtext? just simply define it ?

terminal QUO:
'<' -> '>'
;
Re: about grammar [message #1069326 is a reply to message #1069306] Mon, 15 July 2013 17:13 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
ANY help?
Re: about grammar [message #1069343 is a reply to message #1069326] Mon, 15 July 2013 17:52 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

is your QUALIFIED_NAME a terminal if so you are lost in lexical space.

Inclusion:
'#include' '<' headFile = HeaderFile '>'
;

HeaderFile:
(QUALIFIED_NAME '/')* QUALIFIED_NAME '.h'
;

QUALIFIED_NAME: ID("." ID)*;



works for me.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about grammar [message #1069371 is a reply to message #1069343] Mon, 15 July 2013 19:06 Go to previous message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
Sorry, MY mistake~!
I forgot that i had another similar terminal rule which led ambiguity~
Previous Topic:about C macro
Next Topic:code completion
Goto Forum:
  


Current Time: Thu Apr 25 04:39:58 GMT 2024

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

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

Back to the top