Package org.noname.designer.core.interfaces

Examples of org.noname.designer.core.interfaces.VariableContext


   * @param OK
   *            | CONTINUE | BREAK | RETURN | THROW | RETURN_VALUE
   */
  @Override
  public int evaluate(EvaluationContext context) {
    VariableContext varCtx = new VariableContext();
    context.peek().push(varCtx);
    List statements = block.statements();
    try {
      if (statements != null && !statements.isEmpty()) {
        for (int i = 0; i < statements.size(); i++) {
View Full Code Here


  private EvaluationContext createContext() {
    Object thisObj = createObject(componentType);
    EvaluationContext context = new EvaluationContext(thisObj);
    FrameContext frame = new FrameContext();
    context.push(frame);
    VariableContext arguments = new VariableContext();
    frame.push(arguments);
    return context;
  }
View Full Code Here

   */
  @Override
  public int evaluate(EvaluationContext context) {
    Expression expression = invocation.getExpression();
    FrameContext frame = context.peek();
    VariableContext ctx = frame.peek();
    Stack<Object> stack = ctx.getStack();
    if (expression != null && !(expression instanceof ThisExpression)) {
      IEvaluator evaluator = (IEvaluator) Platform.getAdapterManager()
          .getAdapter(expression, IEvaluator.class);
      int result = evaluator.evaluate(context);
      switch (result) {
View Full Code Here

  private int evaluateMethodInvocation(EvaluationContext context,
      MethodDeclaration mi) {
    FrameContext frame = new FrameContext();
    context.push(frame);
    VariableContext arguments = new VariableContext();
    frame.push(arguments);
    IEvaluator evaluator = (IEvaluator) Platform.getAdapterManager()
        .getAdapter(mi, IEvaluator.class);
    int ret = evaluator.evaluate(context);
    frame = context.popup();
    Object result = frame.getResult();
    switch (ret) {
    case THROW:
      context.peek().setResult(result);
      return THROW;
    case RETURN:
      return OK;
    }
    frame = context.peek();
    VariableContext varCtx = frame.peek();
    Stack<Object> stack = varCtx.getStack();
    stack.addElement(result);
    return OK;
  }
View Full Code Here

TOP

Related Classes of org.noname.designer.core.interfaces.VariableContext

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.