MCPcopy Index your code
hub / github.com/antlr/codebuff / refAttr

Method refAttr

output/java8/1.4.16/CompilationState.java:76–94  ·  view source on GitHub ↗
(Token templateToken, CommonTree id)

Source from the content-addressed store, hash-verified

74 }
75
76 public void refAttr(Token templateToken, CommonTree id) {
77 String name = id.getText();
78 if ( impl.formalArguments !=null && impl.formalArguments.get(name)!=null ) {
79 FormalArgument arg = impl.formalArguments.get(name);
80 int index = arg.index;
81 emit1(id, Bytecode.INSTR_LOAD_LOCAL, index);
82 }
83 else {
84 if ( Interpreter.predefinedAnonSubtemplateAttributes.contains(name) ) {
85 errMgr.compileTimeError(ErrorType.REF_TO_IMPLICIT_ATTRIBUTE_OUT_OF_SCOPE,
86 templateToken,
87 id.token);
88 emit(id, Bytecode.INSTR_NULL);
89 }
90 else {
91 emit1(id, Bytecode.INSTR_LOAD_ATTR, name);
92 }
93 }
94 }
95
96 public void setOption(CommonTree id) {
97 Interpreter.Option O = Compiler.supportedOptions.get(id.getText());

Callers

nothing calls this directly

Calls 6

emit1Method · 0.95
emitMethod · 0.95
getTextMethod · 0.65
getMethod · 0.65
containsMethod · 0.65
compileTimeErrorMethod · 0.65

Tested by

no test coverage detected