Package com.google.minijoe.compiler.ast

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


    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

TOP

Related Classes of com.google.minijoe.compiler.ast.LabelledStatement

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.