Skip to main content



      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 12:13 Go to next message
Eclipse UserFriend
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 13:56 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Only read specific data types with MWE Reader [message #1449392 is a reply to message #1448959] Tue, 21 October 2014 05:32 Go to previous messageGo to next message
Eclipse UserFriend
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 06:39 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Only read specific data types with MWE Reader [message #1449441 is a reply to message #1449429] Tue, 21 October 2014 07:01 Go to previous message
Eclipse UserFriend
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: Sat Jul 05 09:58:58 EDT 2025

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

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

Back to the top