public VarAddress locate(String name, int fromUpstair, boolean force, int line, int column) { // local var/const for (; fromUpstair < stairStack.size(); fromUpstair++) { VarAddress address = stairStack.peek(fromUpstair).locate(name); if (address != null) { return address; } } // global var/const final GlobalManager globalMgr = this.globalManager; final int index = globalMgr.getGlobalIndex(name); if (index >= 0) { return global(index); } if (globalMgr.hasConst(name)) { return constValue(globalMgr.getConst(name)); } // failed if (force) { throw new ParseException("Can't locate vars: ".concat(name), line, column); } // assign at root return context(root.assignVar(name, line, column)); }
public VarAddress locateAtUpstair(String name, int upstair, int line, int column) { VarAddress address = stairStack.peek(upstair).locate(name); if (address != null) { return address; } throw new ParseException("Can't locate vars: ".concat(name), line, column); }
public void assignConst(String name, Object value, int line, int column) { stairStack.peek().assignConst(name, value, line, column); }
public int assignVariant(String name, int line, int column) { return stairStack.peek().assignVar(name, line, column); }
public int pop() { return stairStack.pop().id; }
public void push() { push(stairStack.peek().id); }