how to reference runtime code with dsl grammar element in xtext - xtext

I am working in xtext dsl but getting errors. I have dsl from existing ecore model.
Please see the image and guide me about the error. I shall be thankful.
This is my model

Related

How to show errors and warnings form an external validation tool in an Xtext editor?

I want to integrate an existing parser into my Xtext language that can produce errors and warnings with the exact position (line and column) in the source file.
Is it possible to add errors and warnings at specific locations in an Xtext language?
Context: there is an existing parser that can produce detailed problem reports. It would be fine to show the errors only if the user explicitly triggers a validation (because it might take a while to run).

Building Rascal from source

I'm thinking it might be easiest if I modify the Java syntax used in Rascal to better fit our Java-like language.
Is there a way I can build Rascal from the source? I've cloned the repo from Github and imported it as a project into Eclipse but there are some compilation errors regarding org.eclipse.imp. Before I head down the rabbit-hole of trying to get this all to work in Eclipse I thought I would post here to see if there is an easy way to handle this.
Thanks!
Sure you could build Rascal from scratch; following the developer instructions at https://github.com/cwi-swat/rascal/wiki/Rascal-Developers-Setup---Step-by-Step
On the other hand, if you wish to simply adapt the Java syntax definition it would be better to clone it into your own files. Grammars may look modular, but in reality there are complex interactions between different parts of the grammar. Better to clone and manage the whole thing as your own than depend on two co-evolving definitions.
If you clone the Java grammar Rascal will generate new parsers for you on-the-fly. If this generation becomes cumbersome, a "cached parser" can help you to optimize the deployment of your tools. Please contact us if you need help with that.

xText parser usage during runtime configuration

I want to use the runtime configuration for running an xText parser. In an example xText project I get the standalone and the runtime configuration for using the parser.
Please can somebody indicate the steps needed to use the parser during runtime in another Eclipse plug-in project. I have no experience with the plugin.xml file and I know I need to create there some extension points.
The xText sample project contain also an ui project which uses the obtained parser during runtime. Still I was not able to understand what things I need from that configuration an what not.
Help is highly appreciated.

example of using Woodstox to parse a simple XML

Can anyone give me an example of using the Woodstox parser to parser an XML file? Or point me to a place where I can look at some examples?
Thanks
The below link would be a good resource to look into to compare the whole parsing thing along with JAXB and their comparisons. The author has also mentioned about the jaxb2 maven plugin to generate xjc sources as part of your build in case you are inclined towards maven.
xml-unmarshalling-benchmark

What's the relationshiop between Xtext and ANTLR?

I heard that Xtext ultimately uses ANTLR but their grammar specification files have somewhat different formats. So what's the relationship between the two?
Xtext relies on the Antlr parser generator for the parsing of input files. On top of that the framework provides lot's of added value such as strongly typed ASTs, abstractions for linking and static analysis as well as IDE integration for Eclipse.
For that purpose, Xtext generates two Antlr grammars. One for the production parsing where the actual AST is produced, and a second grammar that is used to consume events to compute the content proposals for the Eclipse editor.
ANTLR grammar is generated from Xtext. You may find it in src-gen/org/example/dsl/parser/antlr/internal/InternalDsl.g.

Resources