0
@Inject
protected void setInjectedParser(IParser parser) {
    this.parser = parser;
}

I want to manually run the xtext engine and i'm not sure when and where the setInjectedParser is being called.

thanks,

Dana Klein
  • 159
  • 1
  • 12

1 Answers1

1

Guice will call the #setInjectedParser(IParser) while constructing an instance of XtextResource to inject it somewhere else. This is done by Guice because the setter is annotated with @Inject.

manually run the xtext engine

What do you mean by this?

Alex
  • 186
  • 2
  • until now i used the 'launch runtime eclipse' to run the xtext as plugin. now i want to use some of it's method in external application which will do it in command line and not eclipse plugin – Dana Klein Dec 05 '12 at 11:45
  • In general I have my dsl as plugin and I want to create a new app that use my dsl. so i tried to write this code: JsonParser p = new JsonParser(); IParseResult r = p.parse(new StringReader("{}")); //once that work it will be the file data instead of {} but when i do the parse the node model builder is null and the following line has exception:return doParse(ruleName, in, nodeModelBuilder.get(), 0); and i'm not sure how to init nodeModelBuilder i'm sure i missing some steps but i'm not quite familiar with the xtext process. – Dana Klein Dec 05 '12 at 11:46