[Xtext] Embedding ANTLR code into XText? [message #1706123] |
Sun, 23 August 2015 17:49  |
Eclipse User |
|
|
|
Dear all, I am currently working on an importer for transforming C code into EMF models (no validation required, I just want to have models for playing around). I have found that XText does not support semantic predicates (yet) which are required to, e.g., distinguish between typedefs types and variable names:
typedef int number;
number x;
int y;
It is possible to write a valid ANTLR grammar which is able to parse the example above correctly by using @header , @members, the semantic predicate for the rule type_id:
{isTypeName(input.LT(1).getText())}? IDENTIFIER
and other directives in ANTLR.
My question now is: As semantic predicates are not (yet) supported by XText, is it somehow possible to embed these ANTLR parser directives into XText?
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.12873 seconds