Package org.python.pydev.parser.jython

Examples of org.python.pydev.parser.jython.ParseException


                        t = jj_consume_token(PRINT);
                        break;
                    default:
                        jj_la1[105] = jj_gen;
                        jj_consume_token(-1);
                        throw new ParseException();
                }
            } catch (ParseException e) {
                t = handleErrorInName(e);
            }
            ((Name) jjtn000).id = t.image;
View Full Code Here


                }
                break;
            default:
                jj_la1[106] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
        }
    }
View Full Code Here

        jj_add_error_token(0, 0);
        int[][] exptokseq = new int[jj_expentries.size()][];
        for (int i = 0; i < jj_expentries.size(); i++) {
            exptokseq[i] = jj_expentries.get(i);
        }
        return new ParseException(token, exptokseq, tokenImage);
    }
View Full Code Here

                stmts[i] = (stmtType) node;
            } catch (ClassCastException e) {
                if (node instanceof Yield) {
                    stmts[i] = new Expr((Yield) node); //recover from it with a valid node!
                    String msg = "Error. Found yield out of scope.";
                    final ParseException e2 = new ParseException(msg, node);
                    this.stack.getGrammar().addAndReport(e2, msg);
                } else {
                    recoverFromClassCastException(node, e);
                    stmts[i] = new Pass(); //recover from it with a valid node!
                }
View Full Code Here

    protected final void recoverFromClassCastException(SimpleNode node, ClassCastException e) throws ParseException {
        //something invalid happened (but let's keep it alive, just adding it as a parse error!
        String msg = "ClassCastException: was: " + e.getMessage() + " (" + node
                + "). Expected: stmtType";
        final ParseException e2 = new ParseException(msg, node);
        this.stack.getGrammar().addAndReport(e2, msg);
    }
View Full Code Here

            addSpecialsAndClearOriginal(n, t);
            return t;
        } catch (ClassCastException e) {
            if (e.getMessage().equals(ExtraArgValue.class.getName())) {
                this.stack.getGrammar().addAndReport(
                        new ParseException("Token: '*' is not expected inside tuples.", lastPop),
                        "Treated class cast exception on tuple");
            }
            this.stack.getGrammar().addAndReport(new ParseException("Syntax error while detecting tuple.", lastPop),
                    "Treated class cast exception on tuple");

            while (stack.nodeArity() > 0) {
                //clear whatever we had in this construct...
                stack.popNode();
View Full Code Here

        for (int i = l - 1; i >= 0; i--) {
            SimpleNode popped = stack.popNode();
            try {
                list.add((DefaultArg) popped);
            } catch (ClassCastException e) {
                throw new ParseException("Internal error (ClassCastException):" + e.getMessage() + "\n" + popped,
                        popped);
            }
        }
        Collections.reverse(list);//we get them in reverse order in the stack
        return makeArguments((DefaultArg[]) list.toArray(new DefaultArg[0]), stararg, kwarg);
View Full Code Here

                        stmt();
                        break;
                    default:
                        jj_la1[1] = jj_gen;
                        jj_consume_token(-1);
                        throw new ParseException();
                }
            }
            try {
                jj_consume_token(0);
            } catch (ParseException e) {
View Full Code Here

                            ExtraKeywordList2();
                            break;
                        default:
                            jj_la1[8] = jj_gen;
                            jj_consume_token(-1);
                            throw new ParseException();
                    }
                } else {
                    ;
                }
                switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case COMMA:
                        grammarActions.findTokenAndAdd(",");
                        jj_consume_token(COMMA);
                        break;
                    default:
                        jj_la1[9] = jj_gen;
                        ;
                }
                break;
            case MULTIPLY:
                ExtraArgList2();
                label_5: while (true) {
                    if (jj_2_4(2)) {
                        ;
                    } else {
                        break label_5;
                    }
                    grammarActions.findTokenAndAdd(",");
                    jj_consume_token(COMMA);
                    onlykeywordarg2();
                }
                if (jj_2_5(2)) {
                    grammarActions.findTokenAndAdd(",");
                    jj_consume_token(COMMA);
                    ExtraKeywordList2();
                } else {
                    ;
                }
                switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case COMMA:
                        grammarActions.findTokenAndAdd(",");
                        jj_consume_token(COMMA);
                        break;
                    default:
                        jj_la1[10] = jj_gen;
                        ;
                }
                break;
            case POWER:
                ExtraKeywordList2();
                switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case COMMA:
                        grammarActions.findTokenAndAdd(",");
                        jj_consume_token(COMMA);
                        break;
                    default:
                        jj_la1[11] = jj_gen;
                        ;
                }
                break;
            default:
                jj_la1[12] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
        }
    }
View Full Code Here

                            ExtraKeywordList();
                            break;
                        default:
                            jj_la1[17] = jj_gen;
                            jj_consume_token(-1);
                            throw new ParseException();
                    }
                } else {
                    ;
                }
                switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case COMMA:
                        grammarActions.findTokenAndAdd(",");
                        jj_consume_token(COMMA);
                        break;
                    default:
                        jj_la1[18] = jj_gen;
                        ;
                }
                break;
            case MULTIPLY:
                ExtraArgList();
                label_8: while (true) {
                    if (jj_2_10(2)) {
                        ;
                    } else {
                        break label_8;
                    }
                    grammarActions.findTokenAndAdd(",");
                    jj_consume_token(COMMA);
                    onlykeywordarg();
                }
                if (jj_2_11(2)) {
                    grammarActions.findTokenAndAdd(",");
                    jj_consume_token(COMMA);
                    ExtraKeywordList();
                } else {
                    ;
                }
                switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case COMMA:
                        grammarActions.findTokenAndAdd(",");
                        jj_consume_token(COMMA);
                        break;
                    default:
                        jj_la1[19] = jj_gen;
                        ;
                }
                break;
            case POWER:
                ExtraKeywordList();
                switch ((jj_ntk == -1) ? jj_ntk() : jj_ntk) {
                    case COMMA:
                        grammarActions.findTokenAndAdd(",");
                        jj_consume_token(COMMA);
                        break;
                    default:
                        jj_la1[20] = jj_gen;
                        ;
                }
                break;
            default:
                jj_la1[21] = jj_gen;
                jj_consume_token(-1);
                throw new ParseException();
        }
    }
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.jython.ParseException

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.