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

Method refAttr

output/java8/1.4.13/CompilationState.java:74–90  ·  view source on GitHub ↗
(Token templateToken, CommonTree id)

Source from the content-addressed store, hash-verified

72 }
73
74 public void refAttr(Token templateToken, CommonTree id) {
75 String name = id.getText();
76 if ( impl.formalArguments !=null && impl.formalArguments.get(name)!=null ) {
77 FormalArgument arg = impl.formalArguments.get(name);
78 int index = arg.index;
79 emit1(id, Bytecode.INSTR_LOAD_LOCAL, index);
80 }
81 else {
82 if ( Interpreter.predefinedAnonSubtemplateAttributes.contains(name) ) {
83 errMgr.compileTimeError(ErrorType.REF_TO_IMPLICIT_ATTRIBUTE_OUT_OF_SCOPE, templateToken, id.token);
84 emit(id, Bytecode.INSTR_NULL);
85 }
86 else {
87 emit1(id, Bytecode.INSTR_LOAD_ATTR, name);
88 }
89 }
90 }
91
92 public void setOption(CommonTree id) {
93 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