Package net.sf.jmatchparser.template.engine

Examples of net.sf.jmatchparser.template.engine.CallStackFrame


    this.returnLabel = returnLabel;
  }

  @Override
  public OperationResult execute(ParserState state) {
    state.setCallStack(new CallStackFrame(state.getCallStack(), returnLabel.getDestination()));
    state.setNextInstruction(templateLabel.getDestination());
    return OperationResult.CONTINUE;
  }
View Full Code Here


    super(templatePosition);
  }

  @Override
  public OperationResult execute(ParserState state) {
    CallStackFrame frame = state.getCallStack();
    if (frame == null)
      throw new RuntimeException("Return without call");
    frame = frame.restoreVariables(state);
    state.setCallStack(frame.getNextFrame());
    state.setNextInstruction(frame.getReturnAddress());
    return OperationResult.CONTINUE;
  }
View Full Code Here

  @Override
  public OperationResult execute(ParserState state) {
    String name = varname.getString(state);
    String v = value == null ? null : value.getString(state);
    CallStackFrame frame = state.getCallStack();
    if (frame == null)
      throw new RuntimeException("SETLOCAL command cannot be used outside DEFTEMPLATE");
    if (!frame.containsName(name)) {
      String oldvalue = state.getLocal(name);
      state.setCallStack(new CallStackFrame(frame, name, oldvalue));
    }
    if (v != null)
      state.setLocal(name, v);
    return OperationResult.CONTINUE;
  }
View Full Code Here

TOP

Related Classes of net.sf.jmatchparser.template.engine.CallStackFrame

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.