Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xtext] Generated Antlr parser artifacts
[Xtext] Generated Antlr parser artifacts [message #638548] Thu, 11 November 2010 15:44 Go to next message
Rafael Angarita is currently offline Rafael AngaritaFriend
Messages: 94
Registered: November 2010
Member
Hello, I am still struggling with calling Xtext/Xpand from a Java project.

The Xtext editor is working fine with the grammar I defined. I exported the Xtext project as a plugin and added the Xtext Nature to my Java project.

Now, I would like to programmatically parse the files containing my language, for example, to check if it is correct or to get the names of the entities and save them in a data base. For example, if the file containg code written in my DSL looks like:

entity name_1 (
)
entity name_2 (
)


I would like to get "name_1" and "name_2" in my java code.

I have been looking to the generated classes in myproject.parser.antlr and I am wondering if maybe a class like MyprojectParser could be used for my purposes.

Thank you very much for your help.
Re: [Xtext] Generated Antlr parser artifacts [message #638611 is a reply to message #638548] Thu, 11 November 2010 19:05 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14076
Registered: July 2009
Senior Member
Hello Rafael,

have a look into the docs: http://www.eclipse.org/Xtext/documentation/1_0_1/xtext.html# processing_Xtext_models

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/it-services/methods-and-tools/xtext
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[Xtend] Support for http://www.eclipse.org/emf/2003/XMLType dataTypes
Next Topic:[xpand] how to list elements of a containment reference (Ecore model)
Goto Forum:
  


Current Time: Fri Oct 22 10:04:46 GMT 2021

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

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

Back to the top