Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Only read specific data types with MWE Reader
Only read specific data types with MWE Reader [message #1448908] Mon, 20 October 2014 16:13 Go to next message
David Baum is currently offline David BaumFriend
Messages: 20
Registered: August 2014
Junior Member
Hello,

I've build my own DSL with Xtext. Now I want to read the DSL from a txt file:

component = org.eclipse.xtext.mwe.Reader {
		path = "input"
		register = org.svis.xtext.MyDSLStandaloneSetup {}
		loadResource = {
			slot = "mydsl"
		}
	}


But I'm only interesed in some parts of the DSL, so to speak in specific data types. Is there a way to "discard/reject" the unwanted parts of the read file?

Thanks in Advance!
Re: Only read specific data types with MWE Reader [message #1448959 is a reply to message #1448908] Mon, 20 October 2014 17:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
do you mean "read" or "process"?
cant you simply ignore the stuff you dont want?

besides the loadResource you can add a load statment which allows you to specify a type (name of eclass) to be filtered.
of course you cant use igenerator anymore.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Only read specific data types with MWE Reader [message #1449392 is a reply to message #1448959] Tue, 21 October 2014 09:32 Go to previous messageGo to next message
David Baum is currently offline David BaumFriend
Messages: 20
Registered: August 2014
Junior Member
I have to deal with very big files. Sometimes they cause out of memory errors, so I thaught it might be helpful to discard irrelevant parts of the files.
Re: Only read specific data types with MWE Reader [message #1449429 is a reply to message #1449392] Tue, 21 October 2014 10:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14664
Registered: July 2009
Senior Member
hi,

this wont work through the reader, if you have memory problem you should profile them and/or increase memory.
maybe a custom lexer can help to lex some parts of the model file to /dev/null respectively a whitespace token.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Only read specific data types with MWE Reader [message #1449441 is a reply to message #1449429] Tue, 21 October 2014 11:01 Go to previous message
David Baum is currently offline David BaumFriend
Messages: 20
Registered: August 2014
Junior Member
Okay, I'll have look at the lexer.

A file can be >100 MB and it's not possible to read it with the reader on a machine with 8 GB RAM.
Previous Topic:How to add custom compiler settings?
Next Topic:How ImportURI is used in Xtext
Goto Forum:
  


Current Time: Tue Apr 16 11:43:31 GMT 2024

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

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

Back to the top