Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to know the information of project during Lexical analyzing
icon5.gif  How to know the information of project during Lexical analyzing [message #893934] Fri, 06 July 2012 06:45 Go to next message
Kevin Sun is currently offline Kevin SunFriend
Messages: 32
Registered: August 2010
Location: China
Member

During lexical analyzing, I want to determine which file the lexer works on. How can I get this information during the Lexcial analyzing?
Re: How to know the information of project during Lexical analyzing [message #894036 is a reply to message #893934] Fri, 06 July 2012 13:02 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14670
Registered: July 2009
Senior Member
Hi,

what about calling CharString.getSourceName?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Fri, 06 July 2012 13:02]

Report message to a moderator

Re: How to know the information of project during Lexical analyzing [message #894395 is a reply to message #894036] Mon, 09 July 2012 05:37 Go to previous messageGo to next message
Kevin Sun is currently offline Kevin SunFriend
Messages: 32
Registered: August 2010
Location: China
Member

Hi Christian,

Thanks for your reply.
I have tried by the following code
@Override
	public void mTokens() throws RecognitionException {
		// TODO Auto-generated method stub
		super.mTokens();
		System.out.println("name = " + input.getSourceName());
	}

And, the result is "null".
Actually, I prefer to get the instance of IProject in the lexer.
Re: How to know the information of project during Lexical analyzing [message #894397 is a reply to message #894395] Mon, 09 July 2012 06:13 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14670
Registered: July 2009
Senior Member
Hi

the first one sounds like a bug to me (please file a bugzilla)
the second one like an enhancement request.

~Christian

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext@xxxxxxxx


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How to run an MWE2 workflow from Java
Next Topic:automatically adding a xtext nature to an existing file
Goto Forum:
  


Current Time: Sat Apr 27 04:10:33 GMT 2024

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

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

Back to the top