Examples of LabelledStatement


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

    // block. we should consider doing something similar here if handling a
    // labelled try block proves problematic.

    if (expression instanceof Identifier && nextToken == Token.OPERATOR_COLON) {
      readToken(Token.OPERATOR_COLON);
      return new LabelledStatement((Identifier) expression, parseStatement());
    } else {
      readTokenSemicolon();
      return new ExpressionStatement(expression);
    }
  }
View Full Code Here

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

    super(name);
  }

  public void testLabelledStatement() throws CompilerException {
    assertParserOutput(
        new LabelledStatement(
            new Identifier("foo"),
            new EmptyStatement()
        ),
        "foo: ;"
    );
    assertParserOutput(
        new LabelledStatement(
            new Identifier("foo"),
            new LabelledStatement(
                new Identifier("bar"),
                new EmptyStatement()
            )
        ),
        "foo: bar: ;"
    );
    assertParserOutput(
        new LabelledStatement(
            new Identifier("foo"),
            new LabelledStatement(
                new Identifier("bar"),
                new WhileStatement(
                    new BooleanLiteral(true),
                    new BlockStatement(
                        new Statement[] {
View Full Code Here

Examples of lombok.ast.LabelledStatement

      labelNames = Lists.newArrayList(labelNames);
      Collections.reverse(labelNames);
      for (Node n : labelNames) {
        if (n != null) {
          Position pos = current == null ? null : new Position(n.getPosition().getStart(), current.getPosition().getEnd());
          current = new LabelledStatement().astLabel(createIdentifierIfNeeded(n, currentPos())).rawStatement(current);
          current.setPosition(pos);
        }
      }
    }
    return current;
View Full Code Here

Examples of lombok.ast.LabelledStatement

      set(node, i);
    }
   
    @Override public void visitLabelled(JCLabeledStatement node) {
      Identifier lbl = new Identifier().astValue(node.getLabel().toString());
      set(node, new LabelledStatement().rawStatement(toTree(node.getStatement())).astLabel(lbl));
    }
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.