Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » How to readline grammars
How to readline grammars [message #652826] Mon, 07 February 2011 08:48 Go to next message
Preeyavis Pringsulaka is currently offline Preeyavis PringsulakaFriend
Messages: 8
Registered: February 2011
Junior Member
Hi,
I created my own grammars. What I would like to do is read those grammars line by line as string. Is that possible to create java file to read those grammars in.

Thanks
Re: How to readline grammars [message #653137 is a reply to message #652826] Tue, 08 February 2011 16:02 Go to previous message
Chris Ainsley is currently offline Chris AinsleyFriend
Messages: 78
Registered: March 2010
Location: UK
Member
Isn't this just vanilla Java (pardon my lack of exception handing here)?

BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(myGrammarFile), "UTF-8"));
String line = null;
while ((line = br.readLine()) != null) {
	processLine( line);
}
br.close();
Previous Topic:Inferred superclasses
Next Topic:[XPAND, MWE2] Dependencies again..
Goto Forum:
  


Current Time: Fri Apr 26 05:13:08 GMT 2024

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

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

Back to the top