|Is it possible to start a parse from a sub-rule? [message #778190]
||Wed, 11 January 2012 15:14
| Thomas Williams
Registered: January 2012
I come from an antlr background where it was possible to start a parse from a sub-rule when under certain circumstances we just needed to parse a fragment from a much larger language, e.g. validating a single expression that the user has entered via a dialog before inserting it into a larger (language described) mathematical model.
Is this possible with Xtext? It seems that the parse always needs to start from the first rule?
I suppose it would be possible to augment the first rule to accept the language fragments we needed to be able to parse separately and then as a post-processing step analyse the semantic model to check that what has been parsed was appropriate to the context (i.e. whether we thought we were parsing a fragment or parsing a complete language text) ?
[Updated on: Wed, 11 January 2012 15:15]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01514 seconds