use of org.antlr.v4.codegen.model.chunk.RulePropertyRef in project antlr4 by antlr.
the class ActionTranslator method getRulePropertyRef.
RulePropertyRef getRulePropertyRef(Token x, Token prop) {
Grammar g = factory.getGrammar();
try {
Class<? extends RulePropertyRef> c = rulePropToModelMap.get(prop.getText());
Constructor<? extends RulePropertyRef> ctor = c.getConstructor(StructDecl.class, String.class);
RulePropertyRef ref = ctor.newInstance(nodeContext, getRuleLabel(x.getText()));
return ref;
} catch (Exception e) {
g.tool.errMgr.toolError(ErrorType.INTERNAL_ERROR, e, prop.getText());
}
return null;
}
Aggregations