| 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, |
| 84 | templateToken, |
| 85 | id.token); |
| 86 | emit(id, Bytecode.INSTR_NULL); |
| 87 | } |
| 88 | else { |
| 89 | emit1(id, Bytecode.INSTR_LOAD_ATTR, name); |
| 90 | } |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | public void setOption(CommonTree id) { |
| 95 | Interpreter.Option O = Compiler.supportedOptions.get(id.getText()); |