|
Re: Combining two grammars problem [message #1706080 is a reply to message #1706031] |
Fri, 21 August 2015 22:05 |
|
Hey Mario,
it's really hard to help you without some examples and more details on your YANG language and how it should use xPath. Where and how should xPath be embedded and what will it query?
In general it is possible to combine languages. The effort it will take depends on what your language should look like. That's why we need more information first.
Cheers,
Stefan
|
|
|
|
Re: Combining two grammars problem [message #1706156 is a reply to message #1706138] |
Mon, 24 August 2015 09:13 |
|
Hey Mario,
I must be missing something: Why would I want to split the XPath? At least in the examples above it doesn't make sense.
If you drop the splitting idea, then your proposal of replacing Quoted_String with the XPath parser rule would just work.
Cheers,
Stefan
|
|
|
|
Re: Combining two grammars problem [message #1706192 is a reply to message #1706161] |
Mon, 24 August 2015 15:28 |
|
Oh I didn't know that your team does not control the langauge =)
In that case you'll have to parse the xPath as Strings in your grammar and then evaluate them in the different Xtext services (Validator, HighlightingCalculator, ProposalProvider etc.).
You can use the IDerivedStateComputer/DerivedStateAwareResource to hook into Xtext's lifecycle before all the services are run. There you parse all the xPath expressions and add them as secondary contents to your resource. You will want to keep track of where each parsed expression came from in the original yang source tree. Then you can use these parsed models to do validation, highlighting etc.
Cheers,
Stefan
|
|
|
|
|
Re: Combining two grammars problem [message #1706704 is a reply to message #1706636] |
Fri, 28 August 2015 20:37 |
|
Hi Richard,
1) Yes, I would also create an xpath-language and use that to parse the converted string. Note that you will need to keep an offset mapping to translate all the highlighting and validation markers back to the original locations (which might be different due to concatenation)
2) Navigation can be customized through the IHyperLinkHelper interface. Have a look at the default implementations and the domain model example language. If you return several hyperlinks at one position, the user will get a dropdown.
Cheers,
Stefan
|
|
|
Powered by
FUDForum. Page generated in 0.05326 seconds