public class CompilerContext
extends com.github.liuyehcf.framework.compile.engine.cfg.lr.Context
| 构造器和说明 |
|---|
CompilerContext(com.github.liuyehcf.framework.compile.engine.cfg.lr.Context context,
ExpressionCode expressionCode) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addByteCode(ByteCode byteCode)
为当前方法增加指令
|
void |
addProperty(String propertyName) |
<T> T |
getAttr(int stackOffset,
AttrName attrName)
获取属性值
|
int |
getByteCodeSize()
获取当前方法的指令偏移量
|
String |
getValue(int stackOffset)
获取语法树节点的词法值,该值由词法分析器提供
|
void |
setAttr(int stackOffset,
AttrName attrName,
Object value)
设置属性
|
void |
setAttrToLeftNode(AttrName attrName,
Object value)
为产生之左部的语法树节点设置属性
|
public CompilerContext(com.github.liuyehcf.framework.compile.engine.cfg.lr.Context context,
ExpressionCode expressionCode)
public void setAttr(int stackOffset,
AttrName attrName,
Object value)
stackOffset - 偏移量,相对于语法树栈attrName - 属性名value - 属性值public void setAttrToLeftNode(AttrName attrName, Object value)
attrName - 属性名value - 属性值public <T> T getAttr(int stackOffset,
AttrName attrName)
T - 属性值类型stackOffset - 偏移量,相对于语法树栈attrName - 属性名public String getValue(int stackOffset)
stackOffset - 偏移量,相对于语法树栈public void addByteCode(ByteCode byteCode)
byteCode - 指令public int getByteCodeSize()
public void addProperty(String propertyName)
Copyright © 2020. All rights reserved.