Package anvil.script.statements

Examples of anvil.script.statements.Statement


    jj_consume_token(0);
  }

  final public void Statement() throws ParseException {
  String label = null;
    Statement current = _current;
    try {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case SEMICOLON:
        EmptyStatement();
        break;
View Full Code Here


  final public void StatementModifier(Statement stmt) throws ParseException {
  Token t;
  Expression expr;
  IfStatement ifStmt;
    Statement context = flowPeek();
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case IF:
      t = jj_consume_token(IF);
      Expression();
      jj_consume_token(SEMICOLON);
      ifStmt = new IfStatement(context, toLocation(t), (Expression)pop());
      ifStmt.setChildStatement(stmt);
      stmt.setParentStatement(ifStmt);
      context.setChildStatement(ifStmt);
      break;
    case WHILE:
      t = jj_consume_token(WHILE);
      Expression();
      jj_consume_token(SEMICOLON);
      WhileStatement whileStmt = new WhileStatement(context, toLocation(t), (Expression)pop(), null);
      whileStmt.setChildStatement(stmt);
      stmt.setParentStatement(whileStmt);
      context.setChildStatement(whileStmt);
      break;
    case SEMICOLON:
      t = jj_consume_token(SEMICOLON);
      context.setChildStatement(stmt);
      break;
    default:
      jj_la1[52] = jj_gen;
      jj_consume_token(-1);
      throw new ParseException();
View Full Code Here

  }

  final public void BlockStatement(String label) throws ParseException {
  Token t;
    t = jj_consume_token(BEGIN);
      Statement context = flowPeek();
      if (label != null) {
        flowPushChild(new ExplicitBlockStatement(context, toLocation(t), label));
      } else {
        flowPushChild(new ImplicitBlockStatement(context, toLocation(t)));
      }
View Full Code Here

      flowPop();
  }

  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

          types.setChild(count, ((Expression)pop()).getChild(0));
        }
      }
      Location location = toLocation(t);
      Expression assignment = (Expression)pop();
      Statement context = (trystmt != null) ? trystmt : flowPeek();
      if (trystmt == null) {
        trystmt = getEnclosingTryBlock();
      }
      CatchStatement catchstmt = new CatchStatement(trystmt, location, assignment, types);
      trystmt.addCatch(catchstmt);
View Full Code Here

  final public void FinallyStatement(TryStatement trystmt) throws ParseException {
  Token t;
  Token param;
    t = jj_consume_token(FINALLY);
      Location location = toLocation(t);
      Statement context = (trystmt != null) ? trystmt : flowPeek();
      if (trystmt == null) {
        trystmt = getEnclosingTryBlock();
      }
      FinallyStatement finallystmt = new FinallyStatement(trystmt, toLocation(t));
      trystmt.setFinally(finallystmt);
View Full Code Here

    Statement();
      flowPop();
  }

  final public void ExpressionStatement() throws ParseException {
  Statement stmt;
    Expression();
    Expression expr = (Expression)pop();
    stmt = new EvalStatement(flowPeek(), expr.getLocation(), expr);
    StatementModifier(stmt);
  }
View Full Code Here

  }

  final public void PrintStatement() throws ParseException {
  Token t;
  Expression[] list = null;
  Statement stmt;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case PRINT:
      t = jj_consume_token(PRINT);
      list = PrintValueList(null);
      stmt = new PrintStatement(flowPeek(), toLocation(t), list, false);
View Full Code Here

  }

  final public void BreakStatement() throws ParseException {
  Token t;
  Token s = null;
  Statement stmt;
    t = jj_consume_token(BREAK);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case SYMBOL:
      s = jj_consume_token(SYMBOL);
      break;
View Full Code Here

  Token t;
  Token s = null;
  String label = null;
  int target = 0;
  Expression expr = null;
  Statement stmt;
    t = jj_consume_token(CONTINUE);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case SYMBOL:
      s = jj_consume_token(SYMBOL);
                             label = s.image;
      break;
    default:
      jj_la1[78] = jj_gen;
      ;
    }
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case CASE:
    case _DEFAULT:
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case CASE:
        jj_consume_token(CASE);
        ValueExpression();
        target = Statement.ST_CASE;
        expr = (Expression)pop();
        break;
      case _DEFAULT:
        jj_consume_token(_DEFAULT);
        target = Statement.ST_DEFAULT;
        break;
      default:
        jj_la1[79] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
      break;
    default:
      jj_la1[80] = jj_gen;
      ;
    }
    stmt = flowPeek();
    int depth = 0;
    if ((target == 0) ? stmt.allowContinue() : stmt.allowBreak()) {
      if (label != null) {
        if (stmt.allowLabel(label)) {
          depth = stmt.getLabelDepth(label);
        } else {
          error(toLocation(t), "Label '"+label+"' is not declared");
        }
      }
    } else {
View Full Code Here

TOP

Related Classes of anvil.script.statements.Statement

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.