Search in sources :

Example 1 with EmptySuiteException

use of org.python.pydev.parser.grammarcommon.EmptySuiteException in project Pydev by fabioz.

the class PythonGrammar25 method suite.

// suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT
public final void suite() throws ParseException {
    /*@bgen(jjtree) suite */
    SimpleNode jjtn000 = builder.openNode(JJTSUITE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
    jjtreeOpenNodeScope(jjtn000);
    try {
        try {
            switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case LPAREN:
                case LBRACE:
                case LBRACKET:
                case PLUS:
                case MINUS:
                case NOT:
                case NOT_BOOL:
                case LAMBDA:
                case PRINT:
                case PASS:
                case BREAK:
                case CONTINUE:
                case RETURN:
                case YIELD:
                case IMPORT:
                case FROM:
                case DEL:
                case RAISE:
                case GLOBAL:
                case EXEC:
                case ASSERT:
                case AS:
                case WITH:
                case NAME:
                case DECNUMBER:
                case HEXNUMBER:
                case OCTNUMBER:
                case FLOAT:
                case COMPLEX:
                case SINGLE_STRING:
                case SINGLE_STRING2:
                case TRIPLE_STRING:
                case TRIPLE_STRING2:
                case SINGLE_USTRING:
                case SINGLE_USTRING2:
                case TRIPLE_USTRING:
                case TRIPLE_USTRING2:
                case 136:
                    simple_stmt();
                    break;
                case NEWLINE:
                    try {
                        try {
                            jj_consume_token(NEWLINE);
                        } catch (ParseException e) {
                            handleNoNewline(e);
                        }
                        jj_consume_token(INDENT);
                    } catch (ParseException e) {
                        handleErrorInIndent(e);
                    }
                    label_17: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case PLUS:
                            case MINUS:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case CLASS:
                            case PRINT:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case EXEC:
                            case ASSERT:
                            case AS:
                            case WITH:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                            case 136:
                                ;
                                break;
                            default:
                                jj_la1[68] = jj_gen;
                                break label_17;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                case INDENT:
                    jj_consume_token(INDENT);
                    handleNoNewlineInSuiteFound();
                    label_18: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case PLUS:
                            case MINUS:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case CLASS:
                            case PRINT:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case EXEC:
                            case ASSERT:
                            case AS:
                            case WITH:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                            case 136:
                                ;
                                break;
                            default:
                                jj_la1[69] = jj_gen;
                                break label_18;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                default:
                    jj_la1[70] = jj_gen;
                    jj_consume_token(-1);
                    throw new ParseException();
            }
        } catch (ParseException e) {
            handleNoSuiteMatch(e);
        } catch (EmptySuiteException e) {
        }
    } catch (Throwable jjte000) {
        if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
        } else {
            jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
            {
                if (true)
                    throw (RuntimeException) jjte000;
            }
        }
        if (jjte000 instanceof ParseException) {
            {
                if (true)
                    throw (ParseException) jjte000;
            }
        }
        {
            if (true)
                throw (Error) jjte000;
        }
    } finally {
        if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtreeCloseNodeScope(jjtn000);
        }
    }
}
Also used : EmptySuiteException(org.python.pydev.parser.grammarcommon.EmptySuiteException) ParseException(org.python.pydev.parser.jython.ParseException) SimpleNode(org.python.pydev.parser.jython.SimpleNode)

Example 2 with EmptySuiteException

use of org.python.pydev.parser.grammarcommon.EmptySuiteException in project Pydev by fabioz.

the class PythonGrammar27 method suite.

// suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT
public final void suite() throws ParseException {
    /*@bgen(jjtree) suite */
    SimpleNode jjtn000 = builder.openNode(JJTSUITE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
    jjtreeOpenNodeScope(jjtn000);
    try {
        try {
            switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case LPAREN:
                case LBRACE:
                case LBRACKET:
                case PLUS:
                case MINUS:
                case NOT:
                case NOT_BOOL:
                case LAMBDA:
                case PRINT:
                case PASS:
                case BREAK:
                case CONTINUE:
                case RETURN:
                case YIELD:
                case IMPORT:
                case FROM:
                case DEL:
                case RAISE:
                case GLOBAL:
                case EXEC:
                case ASSERT:
                case NAME:
                case DECNUMBER:
                case HEXNUMBER:
                case OCTNUMBER:
                case BINNUMBER:
                case FLOAT:
                case COMPLEX:
                case SINGLE_STRING:
                case SINGLE_STRING2:
                case TRIPLE_STRING:
                case TRIPLE_STRING2:
                case SINGLE_BSTRING:
                case SINGLE_BSTRING2:
                case TRIPLE_BSTRING:
                case TRIPLE_BSTRING2:
                case SINGLE_USTRING:
                case SINGLE_USTRING2:
                case TRIPLE_USTRING:
                case TRIPLE_USTRING2:
                case 151:
                    simple_stmt();
                    break;
                case NEWLINE:
                    try {
                        try {
                            jj_consume_token(NEWLINE);
                        } catch (ParseException e) {
                            handleNoNewline(e);
                        }
                        jj_consume_token(INDENT);
                    } catch (ParseException e) {
                        handleErrorInIndent(e);
                    }
                    label_18: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case PLUS:
                            case MINUS:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case CLASS:
                            case PRINT:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case EXEC:
                            case ASSERT:
                            case WITH:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                            case 151:
                                ;
                                break;
                            default:
                                jj_la1[71] = jj_gen;
                                break label_18;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                case INDENT:
                    jj_consume_token(INDENT);
                    handleNoNewlineInSuiteFound();
                    label_19: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case PLUS:
                            case MINUS:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case CLASS:
                            case PRINT:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case EXEC:
                            case ASSERT:
                            case WITH:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                            case 151:
                                ;
                                break;
                            default:
                                jj_la1[72] = jj_gen;
                                break label_19;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                default:
                    jj_la1[73] = jj_gen;
                    jj_consume_token(-1);
                    throw new ParseException();
            }
        } catch (ParseException e) {
            handleNoSuiteMatch(e);
        } catch (EmptySuiteException e) {
        }
    } catch (Throwable jjte000) {
        if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
        } else {
            jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
            {
                if (true)
                    throw (RuntimeException) jjte000;
            }
        }
        if (jjte000 instanceof ParseException) {
            {
                if (true)
                    throw (ParseException) jjte000;
            }
        }
        {
            if (true)
                throw (Error) jjte000;
        }
    } finally {
        if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtreeCloseNodeScope(jjtn000);
        }
    }
}
Also used : EmptySuiteException(org.python.pydev.parser.grammarcommon.EmptySuiteException) ParseException(org.python.pydev.parser.jython.ParseException) SimpleNode(org.python.pydev.parser.jython.SimpleNode)

Example 3 with EmptySuiteException

use of org.python.pydev.parser.grammarcommon.EmptySuiteException in project Pydev by fabioz.

the class PythonGrammar38 method suite.

// suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT
public final void suite() throws ParseException {
    /*@bgen(jjtree) suite */
    SimpleNode jjtn000 = builder.openNode(JJTSUITE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
    jjtreeOpenNodeScope(jjtn000);
    try {
        try {
            switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case LPAREN:
                case LBRACE:
                case LBRACKET:
                case DOT:
                case PLUS:
                case MINUS:
                case MULTIPLY:
                case NOT:
                case NOT_BOOL:
                case LAMBDA:
                case ASYNC:
                case AWAIT:
                case PASS:
                case BREAK:
                case CONTINUE:
                case RETURN:
                case YIELD:
                case IMPORT:
                case FROM:
                case DEL:
                case RAISE:
                case GLOBAL:
                case NONLOCAL:
                case ASSERT:
                case FALSE:
                case TRUE:
                case NONE:
                case NAME:
                case DECNUMBER:
                case HEXNUMBER:
                case OCTNUMBER:
                case BINNUMBER:
                case FLOAT:
                case COMPLEX:
                case SINGLE_STRING:
                case SINGLE_STRING2:
                case TRIPLE_STRING:
                case TRIPLE_STRING2:
                case SINGLE_BSTRING:
                case SINGLE_BSTRING2:
                case TRIPLE_BSTRING:
                case TRIPLE_BSTRING2:
                case SINGLE_FSTRING:
                case SINGLE_FSTRING2:
                case TRIPLE_FSTRING:
                case TRIPLE_FSTRING2:
                case SINGLE_USTRING:
                case SINGLE_USTRING2:
                case TRIPLE_USTRING:
                case TRIPLE_USTRING2:
                    simple_stmt();
                    break;
                case NEWLINE:
                    try {
                        try {
                            jj_consume_token(NEWLINE);
                        } catch (ParseException e) {
                            handleNoNewline(e);
                        }
                        jj_consume_token(INDENT);
                    } catch (ParseException e) {
                        handleErrorInIndent(e);
                    }
                    label_23: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case DOT:
                            case PLUS:
                            case MINUS:
                            case MULTIPLY:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case ASYNC:
                            case AWAIT:
                            case CLASS:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case NONLOCAL:
                            case ASSERT:
                            case WITH:
                            case FALSE:
                            case TRUE:
                            case NONE:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_FSTRING:
                            case SINGLE_FSTRING2:
                            case TRIPLE_FSTRING:
                            case TRIPLE_FSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                                ;
                                break;
                            default:
                                jj_la1[97] = jj_gen;
                                break label_23;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                case INDENT:
                    jj_consume_token(INDENT);
                    handleNoNewlineInSuiteFound();
                    label_24: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case DOT:
                            case PLUS:
                            case MINUS:
                            case MULTIPLY:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case ASYNC:
                            case AWAIT:
                            case CLASS:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case NONLOCAL:
                            case ASSERT:
                            case WITH:
                            case FALSE:
                            case TRUE:
                            case NONE:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_FSTRING:
                            case SINGLE_FSTRING2:
                            case TRIPLE_FSTRING:
                            case TRIPLE_FSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                                ;
                                break;
                            default:
                                jj_la1[98] = jj_gen;
                                break label_24;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                default:
                    jj_la1[99] = jj_gen;
                    jj_consume_token(-1);
                    throw new ParseException();
            }
        } catch (ParseException e) {
            handleNoSuiteMatch(e);
        } catch (EmptySuiteException e) {
        }
    } catch (Throwable jjte000) {
        if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
        } else {
            jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
            {
                if (true)
                    throw (RuntimeException) jjte000;
            }
        }
        if (jjte000 instanceof ParseException) {
            {
                if (true)
                    throw (ParseException) jjte000;
            }
        }
        {
            if (true)
                throw (Error) jjte000;
        }
    } finally {
        if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtreeCloseNodeScope(jjtn000);
        }
    }
}
Also used : EmptySuiteException(org.python.pydev.parser.grammarcommon.EmptySuiteException) ParseException(org.python.pydev.parser.jython.ParseException) SimpleNode(org.python.pydev.parser.jython.SimpleNode)

Example 4 with EmptySuiteException

use of org.python.pydev.parser.grammarcommon.EmptySuiteException in project Pydev by fabioz.

the class PythonGrammar26 method suite.

// suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT
public final void suite() throws ParseException {
    /*@bgen(jjtree) suite */
    SimpleNode jjtn000 = builder.openNode(JJTSUITE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
    jjtreeOpenNodeScope(jjtn000);
    try {
        try {
            switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case LPAREN:
                case LBRACE:
                case LBRACKET:
                case PLUS:
                case MINUS:
                case NOT:
                case NOT_BOOL:
                case LAMBDA:
                case PRINT:
                case PASS:
                case BREAK:
                case CONTINUE:
                case RETURN:
                case YIELD:
                case IMPORT:
                case FROM:
                case DEL:
                case RAISE:
                case GLOBAL:
                case EXEC:
                case ASSERT:
                case NAME:
                case DECNUMBER:
                case HEXNUMBER:
                case OCTNUMBER:
                case BINNUMBER:
                case FLOAT:
                case COMPLEX:
                case SINGLE_STRING:
                case SINGLE_STRING2:
                case TRIPLE_STRING:
                case TRIPLE_STRING2:
                case SINGLE_BSTRING:
                case SINGLE_BSTRING2:
                case TRIPLE_BSTRING:
                case TRIPLE_BSTRING2:
                case SINGLE_USTRING:
                case SINGLE_USTRING2:
                case TRIPLE_USTRING:
                case TRIPLE_USTRING2:
                case 151:
                    simple_stmt();
                    break;
                case NEWLINE:
                    try {
                        try {
                            jj_consume_token(NEWLINE);
                        } catch (ParseException e) {
                            handleNoNewline(e);
                        }
                        jj_consume_token(INDENT);
                    } catch (ParseException e) {
                        handleErrorInIndent(e);
                    }
                    label_17: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case PLUS:
                            case MINUS:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case CLASS:
                            case PRINT:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case EXEC:
                            case ASSERT:
                            case WITH:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                            case 151:
                                ;
                                break;
                            default:
                                jj_la1[70] = jj_gen;
                                break label_17;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                case INDENT:
                    jj_consume_token(INDENT);
                    handleNoNewlineInSuiteFound();
                    label_18: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case PLUS:
                            case MINUS:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case CLASS:
                            case PRINT:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case EXEC:
                            case ASSERT:
                            case WITH:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                            case 151:
                                ;
                                break;
                            default:
                                jj_la1[71] = jj_gen;
                                break label_18;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                default:
                    jj_la1[72] = jj_gen;
                    jj_consume_token(-1);
                    throw new ParseException();
            }
        } catch (ParseException e) {
            handleNoSuiteMatch(e);
        } catch (EmptySuiteException e) {
        }
    } catch (Throwable jjte000) {
        if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
        } else {
            jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
            {
                if (true)
                    throw (RuntimeException) jjte000;
            }
        }
        if (jjte000 instanceof ParseException) {
            {
                if (true)
                    throw (ParseException) jjte000;
            }
        }
        {
            if (true)
                throw (Error) jjte000;
        }
    } finally {
        if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtreeCloseNodeScope(jjtn000);
        }
    }
}
Also used : EmptySuiteException(org.python.pydev.parser.grammarcommon.EmptySuiteException) ParseException(org.python.pydev.parser.jython.ParseException) SimpleNode(org.python.pydev.parser.jython.SimpleNode)

Example 5 with EmptySuiteException

use of org.python.pydev.parser.grammarcommon.EmptySuiteException in project Pydev by fabioz.

the class PythonGrammar30 method suite.

// suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT
public final void suite() throws ParseException {
    /*@bgen(jjtree) suite */
    SimpleNode jjtn000 = builder.openNode(JJTSUITE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);
    jjtreeOpenNodeScope(jjtn000);
    try {
        try {
            switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                case LPAREN:
                case LBRACE:
                case LBRACKET:
                case DOT:
                case PLUS:
                case MINUS:
                case MULTIPLY:
                case NOT:
                case NOT_BOOL:
                case LAMBDA:
                case ASYNC:
                case AWAIT:
                case PASS:
                case BREAK:
                case CONTINUE:
                case RETURN:
                case YIELD:
                case IMPORT:
                case FROM:
                case DEL:
                case RAISE:
                case GLOBAL:
                case NONLOCAL:
                case ASSERT:
                case FALSE:
                case TRUE:
                case NONE:
                case NAME:
                case DECNUMBER:
                case HEXNUMBER:
                case OCTNUMBER:
                case BINNUMBER:
                case FLOAT:
                case COMPLEX:
                case SINGLE_STRING:
                case SINGLE_STRING2:
                case TRIPLE_STRING:
                case TRIPLE_STRING2:
                case SINGLE_BSTRING:
                case SINGLE_BSTRING2:
                case TRIPLE_BSTRING:
                case TRIPLE_BSTRING2:
                case SINGLE_USTRING:
                case SINGLE_USTRING2:
                case TRIPLE_USTRING:
                case TRIPLE_USTRING2:
                    simple_stmt();
                    break;
                case NEWLINE:
                    try {
                        try {
                            jj_consume_token(NEWLINE);
                        } catch (ParseException e) {
                            handleNoNewline(e);
                        }
                        jj_consume_token(INDENT);
                    } catch (ParseException e) {
                        handleErrorInIndent(e);
                    }
                    label_22: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case DOT:
                            case PLUS:
                            case MINUS:
                            case MULTIPLY:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case ASYNC:
                            case AWAIT:
                            case CLASS:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case NONLOCAL:
                            case ASSERT:
                            case WITH:
                            case FALSE:
                            case TRUE:
                            case NONE:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                                ;
                                break;
                            default:
                                jj_la1[82] = jj_gen;
                                break label_22;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                case INDENT:
                    jj_consume_token(INDENT);
                    handleNoNewlineInSuiteFound();
                    label_23: while (true) {
                        try {
                            stmt();
                        } catch (ParseException e) {
                            handleErrorInStmt(e);
                        }
                        switch((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                            case LPAREN:
                            case LBRACE:
                            case LBRACKET:
                            case DOT:
                            case PLUS:
                            case MINUS:
                            case MULTIPLY:
                            case NOT:
                            case NOT_BOOL:
                            case LAMBDA:
                            case IF:
                            case WHILE:
                            case FOR:
                            case TRY:
                            case DEF:
                            case ASYNC:
                            case AWAIT:
                            case CLASS:
                            case PASS:
                            case BREAK:
                            case CONTINUE:
                            case RETURN:
                            case YIELD:
                            case IMPORT:
                            case FROM:
                            case DEL:
                            case RAISE:
                            case GLOBAL:
                            case NONLOCAL:
                            case ASSERT:
                            case WITH:
                            case FALSE:
                            case TRUE:
                            case NONE:
                            case AT:
                            case NAME:
                            case DECNUMBER:
                            case HEXNUMBER:
                            case OCTNUMBER:
                            case BINNUMBER:
                            case FLOAT:
                            case COMPLEX:
                            case SINGLE_STRING:
                            case SINGLE_STRING2:
                            case TRIPLE_STRING:
                            case TRIPLE_STRING2:
                            case SINGLE_BSTRING:
                            case SINGLE_BSTRING2:
                            case TRIPLE_BSTRING:
                            case TRIPLE_BSTRING2:
                            case SINGLE_USTRING:
                            case SINGLE_USTRING2:
                            case TRIPLE_USTRING:
                            case TRIPLE_USTRING2:
                                ;
                                break;
                            default:
                                jj_la1[83] = jj_gen;
                                break label_23;
                        }
                    }
                    try {
                        jj_consume_token(DEDENT);
                    } catch (ParseException e) {
                        handleErrorInDedent(e);
                    }
                    break;
                default:
                    jj_la1[84] = jj_gen;
                    jj_consume_token(-1);
                    throw new ParseException();
            }
        } catch (ParseException e) {
            handleNoSuiteMatch(e);
        } catch (EmptySuiteException e) {
        }
    } catch (Throwable jjte000) {
        if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
        } else {
            jjtree.popNode();
        }
        if (jjte000 instanceof RuntimeException) {
            {
                if (true)
                    throw (RuntimeException) jjte000;
            }
        }
        if (jjte000 instanceof ParseException) {
            {
                if (true)
                    throw (ParseException) jjte000;
            }
        }
        {
            if (true)
                throw (Error) jjte000;
        }
    } finally {
        if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtreeCloseNodeScope(jjtn000);
        }
    }
}
Also used : EmptySuiteException(org.python.pydev.parser.grammarcommon.EmptySuiteException) ParseException(org.python.pydev.parser.jython.ParseException) SimpleNode(org.python.pydev.parser.jython.SimpleNode)

Aggregations

EmptySuiteException (org.python.pydev.parser.grammarcommon.EmptySuiteException)7 ParseException (org.python.pydev.parser.jython.ParseException)7 SimpleNode (org.python.pydev.parser.jython.SimpleNode)7