Examples of ThrowStatement


Examples of anvil.script.statements.ThrowStatement

  final public void ThrowStatement() throws ParseException {
  Token t;
  Statement stmt;
    t = jj_consume_token(THROW);
    ListExpression();
    stmt = new ThrowStatement(flowPeek(), toLocation(t), (Expression)pop());
    StatementModifier(stmt);
  }
View Full Code Here

Examples of com.bacoder.parser.java.api.ThrowStatement

    return synchronizedStatement;
  }

  protected ThrowStatement processThrowStatement(StatementContext context) {
    ThrowStatement throwStatement = createNode(context, ThrowStatement.class);

    ExpressionContext expressionContext = getChild(context, ExpressionContext.class);
    if (expressionContext != null) {
      throwStatement.setExpression(getAdapter(ExpressionAdapter.class).adapt(expressionContext));
    }

    return throwStatement;
  }
View Full Code Here

Examples of com.dragome.compiler.ast.ThrowStatement

          //        Log.getLogger().error(msg + "\n" + Utils.stackTraceToString(ex));
        }

      }
      Block body= new Block();
      ThrowStatement throwStmt= new ThrowStatement();
      /*
      MethodBinding binding= MethodBinding.lookup("java.lang.RuntimeException", "<init>", "(java/lang/String)V;");
      ClassInstanceCreation cic= new ClassInstanceCreation(methodDecl, binding);
      cic.addArgument(new StringLiteral("Unresolved decompilation problem"));
      throwStmt.setExpression(cic);
View Full Code Here

Examples of com.dragome.compiler.ast.ThrowStatement

      }

      case Const.ATHROW:
      {

        ThrowStatement throwStmt= new ThrowStatement();
        throwStmt.setExpression(stack.pop());
        instruction= throwStmt;
        break;
      }

      case Const.ICONST_M1:
View Full Code Here

Examples of com.google.minijoe.compiler.ast.ThrowStatement

  }

  private Statement parseThrowStatement() throws CompilerException {
    readToken(Token.KEYWORD_THROW);

    return new ThrowStatement(parseExpression(true));
  }
View Full Code Here

Examples of com.google.minijoe.compiler.ast.ThrowStatement

    super(name);
  }

  public void testThrowStatement() throws CompilerException {
    assertParserOutput(
        new ThrowStatement(
            new BooleanLiteral(true)
        ),
        "throw true;"
    );
    assertParserOutput(
        new ThrowStatement(
            new Identifier("something")
        ),
        "throw something;"
    );
  }
View Full Code Here

Examples of org.allspice.structured.statement.ThrowStatement

  public static interface TryFinally {
    public int meth(Exception arg0) ;
  }
  public void test1() throws Exception {
    TryFinally obj = makeObject(TryFinally.class,new TryCatchStatement(
        new FIFO<Statement>(new ThrowStatement(ARG0,null)),
        new FIFO<CatchBlock>(new CatchBlock(
            new VarDecl("java.lang.Exception","ex"),
            new FIFO<Statement>(
                new ReturnStatement(new ConstExpr(Integer.valueOf(1),null),null)
            )
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.ThrowStatement

        final String name = fNode.getName();
        Expression value = findArg(name);
        return new IfStatement(
                equalsNullExpr(value),
                new EmptyStatement(),
                new ThrowStatement(new ConstructorCallExpression(READONLYEXCEPTION_TYPE,
                        new ArgumentListExpression(new ConstantExpression(name),
                                new ConstantExpression(cNode.getName())))));
    }
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.ThrowStatement

        invokeArguments.addExpression(caughtExceptionVariableExpression);
        final MethodCallExpression invokeExceptionHandlerMethodExpression = new MethodCallExpression(new VariableExpression(exceptionHandlerMethodVariableName), "invoke", invokeArguments);
        applyDefaultMethodTarget(invokeExceptionHandlerMethodExpression, reflectMethodClassNode);
       
        final Statement returnStatement = new ReturnStatement(invokeExceptionHandlerMethodExpression);
        final Statement throwCaughtExceptionStatement = new ThrowStatement(caughtExceptionVariableExpression);
        final Statement ifExceptionHandlerMethodExistsStatement = new IfStatement(new BooleanExpression(exceptionHandlerMethodExpression), returnStatement, throwCaughtExceptionStatement);
        catchBlockCode.addStatement(new ExpressionStatement(declareExceptionHandlerMethod));
        catchBlockCode.addStatement(ifExceptionHandlerMethodExistsStatement);

        final CatchStatement catchStatement = new CatchStatement(new Parameter(new ClassNode(Exception.class), caughtExceptionArgumentName), catchBlockCode);
View Full Code Here

Examples of org.codehaus.groovy.ast.stmt.ThrowStatement

        MethodCallExpression methodCallExpression = new MethodCallExpression(delegate, methodName, arguments);
        methodCallExpression.setMethodTarget(declaredMethod);
       
        if(!noNullCheck) {
            ThrowStatement missingMethodException = createMissingMethodThrowable(classNode, declaredMethod);
            VariableExpression apiVar = addApiVariableDeclaration(delegate, declaredMethod, methodBody);
            IfStatement ifStatement = createIfElseStatementForApiMethodCall(methodCallExpression, apiVar, missingMethodException);
            methodBody.addStatement(ifStatement);
        } else {
            methodBody.addStatement(new ExpressionStatement(methodCallExpression));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.