Search in sources :

Example 1 with ContinueStatement

use of org.codehaus.groovy.ast.stmt.ContinueStatement in project groovy by apache.

the class AntlrParserPlugin method statement.

// Statements
//-------------------------------------------------------------------------
protected Statement statement(AST node) {
    Statement statement = null;
    int type = node.getType();
    switch(type) {
        case SLIST:
        case LITERAL_finally:
            statement = statementList(node);
            break;
        case METHOD_CALL:
            statement = methodCall(node);
            break;
        case VARIABLE_DEF:
            statement = variableDef(node);
            break;
        case LABELED_STAT:
            return labelledStatement(node);
        case LITERAL_assert:
            statement = assertStatement(node);
            break;
        case LITERAL_break:
            statement = breakStatement(node);
            break;
        case LITERAL_continue:
            statement = continueStatement(node);
            break;
        case LITERAL_if:
            statement = ifStatement(node);
            break;
        case LITERAL_for:
            statement = forStatement(node);
            break;
        case LITERAL_return:
            statement = returnStatement(node);
            break;
        case LITERAL_synchronized:
            statement = synchronizedStatement(node);
            break;
        case LITERAL_switch:
            statement = switchStatement(node);
            break;
        case LITERAL_try:
            statement = tryStatement(node);
            break;
        case LITERAL_throw:
            statement = throwStatement(node);
            break;
        case LITERAL_while:
            statement = whileStatement(node);
            break;
        default:
            statement = new ExpressionStatement(expression(node));
    }
    if (statement != null) {
        configureAST(statement, node);
    }
    return statement;
}
Also used : CaseStatement(org.codehaus.groovy.ast.stmt.CaseStatement) ForStatement(org.codehaus.groovy.ast.stmt.ForStatement) CatchStatement(org.codehaus.groovy.ast.stmt.CatchStatement) IfStatement(org.codehaus.groovy.ast.stmt.IfStatement) AssertStatement(org.codehaus.groovy.ast.stmt.AssertStatement) BlockStatement(org.codehaus.groovy.ast.stmt.BlockStatement) Statement(org.codehaus.groovy.ast.stmt.Statement) WhileStatement(org.codehaus.groovy.ast.stmt.WhileStatement) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement) ThrowStatement(org.codehaus.groovy.ast.stmt.ThrowStatement) ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement) BreakStatement(org.codehaus.groovy.ast.stmt.BreakStatement) ReturnStatement(org.codehaus.groovy.ast.stmt.ReturnStatement) SynchronizedStatement(org.codehaus.groovy.ast.stmt.SynchronizedStatement) EmptyStatement(org.codehaus.groovy.ast.stmt.EmptyStatement) SwitchStatement(org.codehaus.groovy.ast.stmt.SwitchStatement) TryCatchStatement(org.codehaus.groovy.ast.stmt.TryCatchStatement) ExpressionStatement(org.codehaus.groovy.ast.stmt.ExpressionStatement)

Example 2 with ContinueStatement

use of org.codehaus.groovy.ast.stmt.ContinueStatement in project groovy by apache.

the class AntlrParserPlugin method continueStatement.

protected Statement continueStatement(AST node) {
    ContinueStatement continueStatement = new ContinueStatement(label(node));
    configureAST(continueStatement, node);
    return continueStatement;
}
Also used : ContinueStatement(org.codehaus.groovy.ast.stmt.ContinueStatement)

Aggregations

ContinueStatement (org.codehaus.groovy.ast.stmt.ContinueStatement)2 AssertStatement (org.codehaus.groovy.ast.stmt.AssertStatement)1 BlockStatement (org.codehaus.groovy.ast.stmt.BlockStatement)1 BreakStatement (org.codehaus.groovy.ast.stmt.BreakStatement)1 CaseStatement (org.codehaus.groovy.ast.stmt.CaseStatement)1 CatchStatement (org.codehaus.groovy.ast.stmt.CatchStatement)1 EmptyStatement (org.codehaus.groovy.ast.stmt.EmptyStatement)1 ExpressionStatement (org.codehaus.groovy.ast.stmt.ExpressionStatement)1 ForStatement (org.codehaus.groovy.ast.stmt.ForStatement)1 IfStatement (org.codehaus.groovy.ast.stmt.IfStatement)1 ReturnStatement (org.codehaus.groovy.ast.stmt.ReturnStatement)1 Statement (org.codehaus.groovy.ast.stmt.Statement)1 SwitchStatement (org.codehaus.groovy.ast.stmt.SwitchStatement)1 SynchronizedStatement (org.codehaus.groovy.ast.stmt.SynchronizedStatement)1 ThrowStatement (org.codehaus.groovy.ast.stmt.ThrowStatement)1 TryCatchStatement (org.codehaus.groovy.ast.stmt.TryCatchStatement)1 WhileStatement (org.codehaus.groovy.ast.stmt.WhileStatement)1