Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » xText Standalone Setup Parsing a DSL from a File
xText Standalone Setup Parsing a DSL from a File [message #637014] Wed, 03 November 2010 18:37 Go to next message
Christian Ammann is currently offline Christian AmmannFriend
Messages: 21
Registered: July 2010
Junior Member
Hello everybody,

i have developed a DSL and tried to load it into memory with the EMF/Xtext APIs. According to the Xtext Docs at:

http://www.eclipse.org/Xtext/documentation/latest/xtext.html

i used the following code snippet (my DSl is called "udl"):

new UDLStandaloneSetup().createInjectorAndDoEMFRegistration();
ResourceSet rs = new ResourceSetImpl();
Resource resource = rs.getResource(URI.createURI(input_file), true);
System.out.println(resource.getErrors());


I have modified my test case dsl files a little bit, that they contain some errors. The problem is: When i open them with the generated eclipse editor plugin, the parsing errors are detected and marked, when i parse my dsl files with code above, some parsing errors aren't reported. My question is: Why does the code above miss some parser errors? Is some init code missing in the code above?

I tried to reproduce the problem with a very simple grammar but without success. My original grammar is very big and complex so im not posting it here (yet Wink ).

Christian

PS: I also tried this method:

http://www.vorburger.ch/blog1/2009/08/xtext-standalone-setup -parsing-dsl-from.html

but with the same results :-/
Re: xText Standalone Setup Parsing a DSL from a File [message #637050 is a reply to message #637014] Wed, 03 November 2010 22:56 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Christian,

please try to invoke EcoreUtil.resolveAll(resource) before you query the
resource for errors. This will add linking problems to the resource's
error list.

Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 03.11.10 19:37, schrieb Christian Ammann:
> Hello everybody,
>
> i have developed a DSL and tried to load it into memory with the
> EMF/Xtext APIs. According to the Xtext Docs at:
>
> http://www.eclipse.org/Xtext/documentation/latest/xtext.html
>
> i used the following code snippet (my DSl is called "udl"):
>
>
> new UDLStandaloneSetup().createInjectorAndDoEMFRegistration();
> ResourceSet rs = new ResourceSetImpl();
> Resource resource = rs.getResource(URI.createURI(input_file), true);
> System.out.println(resource.getErrors());
>
>
> I have modified my test case dsl files a little bit, that they contain
> some errors. The problem is: When i open them with the generated eclipse
> editor plugin, the parsing errors are detected and marked, when i parse
> my dsl files with code above, some parsing errors aren't reported. My
> question is: Why does the code above miss some parser errors? Is some
> init code missing in the code above?
>
> I tried to reproduce the problem with a very simple grammar but without
> success. My original grammar is very big and complex so im not posting
> it here (yet ;) ).
>
> Christian
>
> PS: I also tried this method:
>
> http://www.vorburger.ch/blog1/2009/08/xtext-standalone-setup -parsing-dsl-from.html
>
>
> but with the same results :-/
>
Re: xText Standalone Setup Parsing a DSL from a File [message #637138 is a reply to message #637050] Thu, 04 November 2010 10:28 Go to previous message
Christian Ammann is currently offline Christian AmmannFriend
Messages: 21
Registered: July 2010
Junior Member
Hi Sebastian,

it is now working as intended. Great Smile. Maybe this call should be mentioned in the xtext documentation.

Best regards,

Christian
Previous Topic:Problem with the end of the line
Next Topic:Memory consumption
Goto Forum:
  


Current Time: Thu Apr 25 20:11:56 GMT 2024

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

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

Back to the top