Search in sources :

Example 1 with TokenPropertyRef

use of org.antlr.v4.codegen.model.chunk.TokenPropertyRef in project antlr4 by antlr.

the class ActionTranslator method getTokenPropertyRef.

TokenPropertyRef getTokenPropertyRef(Token x, Token y) {
    try {
        Class<? extends TokenPropertyRef> c = tokenPropToModelMap.get(y.getText());
        Constructor<? extends TokenPropertyRef> ctor = c.getConstructor(StructDecl.class, String.class);
        TokenPropertyRef ref = ctor.newInstance(nodeContext, getTokenLabel(x.getText()));
        return ref;
    } catch (Exception e) {
        factory.getGrammar().tool.errMgr.toolError(ErrorType.INTERNAL_ERROR, e);
    }
    return null;
}
Also used : TokenPropertyRef(org.antlr.v4.codegen.model.chunk.TokenPropertyRef)

Aggregations

TokenPropertyRef (org.antlr.v4.codegen.model.chunk.TokenPropertyRef)1