Package org.python.pydev.parser.grammarcommon

Examples of org.python.pydev.parser.grammarcommon.ExtraArg


                return funcDef;
            case JJTDEFAULTARG:
                value = (arity == 1) ? null : ((exprType) stack.popNode());
                return new DefaultArg(((exprType) stack.popNode()), value, n.getId());
            case JJTEXTRAARGLIST:
                return new ExtraArg(makeName(NameTok.VarArg), JJTEXTRAARGLIST);
            case JJTEXTRAKEYWORDLIST:
                return new ExtraArg(makeName(NameTok.KwArg), JJTEXTRAKEYWORDLIST);
            case JJTCLASSDEF:
                suite = (Suite) stack.popNode();
                body = suite.body;
                exprType[] bases = makeExprs(stack.nodeArity() - 1);
                nameTok = makeName(NameTok.ClassName);
View Full Code Here


        NameTok varg = null;
        NameTok kwarg = null;
        for (Iterator<SimpleNode> iter = args.iterator(); iter.hasNext();) {
            SimpleNode node = iter.next();
            if (node.getId() == JJTEXTRAKEYWORDLIST) {
                ExtraArg a = (ExtraArg) node;
                kwarg = a.tok;
                addSpecialsAndClearOriginal(a, kwarg);

            } else if (node.getId() == JJTEXTRAARGLIST) {
                ExtraArg a = (ExtraArg) node;
                varg = a.tok;
                addSpecialsAndClearOriginal(a, varg);
            }
        }
        return new NameTok[] { varg, kwarg };
View Full Code Here

    private argumentsType makeArguments(int l) throws Exception {
        NameTok kwarg = null;
        NameTok stararg = null;
        if (l > 0 && stack.peekNode().getId() == JJTEXTRAKEYWORDLIST) {
            ExtraArg node = (ExtraArg) stack.popNode();
            kwarg = node.tok;
            l--;
            addSpecialsAndClearOriginal(node, kwarg);
        }
        if (l > 0 && stack.peekNode().getId() == JJTEXTRAARGLIST) {
            ExtraArg node = (ExtraArg) stack.popNode();
            stararg = node.tok;
            l--;
            addSpecialsAndClearOriginal(node, stararg);
        }
        ArrayList<SimpleNode> list = new ArrayList<SimpleNode>();
View Full Code Here

                exprType parameter = (exprType) stack.popNode();
                return new DefaultArg((exprType) stack.popNode(), parameter, null, n.getId());
            case JJTEXTRAARGLIST:
                if (arity == 0) {
                    //nothing here (just '*')
                    return new ExtraArg(null, JJTEXTRAARGLIST, null);
                }
                return new ExtraArg(makeName(NameTok.VarArg), JJTEXTRAARGLIST);
            case JJTEXTRAKEYWORDLIST:
                return new ExtraArg(makeName(NameTok.KwArg), JJTEXTRAKEYWORDLIST);
            case JJTEXTRAARGLIST2: //with type declaration
                if (arity == 0) {
                    //nothing here (just '*')
                    return new ExtraArg(null, JJTEXTRAARGLIST, null);
                }
                jfpDef = (JfpDef) stack.popNode();
                NameTok jfpDefName = makeName(NameTok.VarArg, jfpDef.nameNode);
                ExtraArg extra = new ExtraArg(jfpDefName, JJTEXTRAARGLIST, jfpDef.typeDef);
                return extra;
            case JJTEXTRAKEYWORDLIST2: //with type declaration
                jfpDef = (JfpDef) stack.popNode();
                return new ExtraArg(makeName(NameTok.KwArg, jfpDef.nameNode), JJTEXTRAKEYWORDLIST, jfpDef.typeDef);
            case JJTDECORATED:
                if (stack.nodeArity() != 2) {
                    throw new RuntimeException("Expected 2 nodes at this context, found: " + arity);
                }
                SimpleNode def = stack.popNode();
View Full Code Here

        ArrayList<SimpleNode> list = new ArrayList<SimpleNode>();
        for (int i = l - 1; i >= 0; i--) {
            SimpleNode popped = stack.popNode();
            try {
                if (popped.getId() == JJTEXTRAKEYWORDLIST) {
                    ExtraArg node = (ExtraArg) popped;
                    kwarg = node.tok;
                    kwargannotation = node.typeDef;
                    addSpecialsAndClearOriginal(node, kwarg);
                } else if (popped.getId() == JJTEXTRAARGLIST) {
                    ExtraArg node = (ExtraArg) popped;
                    stararg = node.tok;
                    varargannotation = node.typeDef;
                    if (stararg != null) {
                        //can happen, as in 3.0 we can have a single '*'
                        addSpecialsAndClearOriginal(node, stararg);
View Full Code Here

                return funcDef;
            case JJTDEFAULTARG:
                value = (arity == 1) ? null : ((exprType) stack.popNode());
                return new DefaultArg(((exprType) stack.popNode()), value, n.getId());
            case JJTEXTRAARGLIST:
                return new ExtraArg(makeName(NameTok.VarArg), JJTEXTRAARGLIST);
            case JJTEXTRAKEYWORDLIST:
                return new ExtraArg(makeName(NameTok.KwArg), JJTEXTRAKEYWORDLIST);
            case JJTCLASSDEF:
                suite = (Suite) stack.popNode();
                body = suite.body;
                exprType[] bases = makeExprs(stack.nodeArity() - 1);
                nameTok = makeName(NameTok.ClassName);
View Full Code Here

        NameTok varg = null;
        NameTok kwarg = null;
        for (Iterator<SimpleNode> iter = args.iterator(); iter.hasNext();) {
            SimpleNode node = iter.next();
            if (node.getId() == JJTEXTRAKEYWORDLIST) {
                ExtraArg a = (ExtraArg) node;
                kwarg = a.tok;
                addSpecialsAndClearOriginal(a, kwarg);

            } else if (node.getId() == JJTEXTRAARGLIST) {
                ExtraArg a = (ExtraArg) node;
                varg = a.tok;
                addSpecialsAndClearOriginal(a, varg);
            }
        }
        return new NameTok[] { varg, kwarg };
View Full Code Here

    private argumentsType makeArguments(int l) throws Exception {
        NameTok kwarg = null;
        NameTok stararg = null;
        if (l > 0 && stack.peekNode().getId() == JJTEXTRAKEYWORDLIST) {
            ExtraArg node = (ExtraArg) stack.popNode();
            kwarg = node.tok;
            l--;
            addSpecialsAndClearOriginal(node, kwarg);
        }
        if (l > 0 && stack.peekNode().getId() == JJTEXTRAARGLIST) {
            ExtraArg node = (ExtraArg) stack.popNode();
            stararg = node.tok;
            l--;
            addSpecialsAndClearOriginal(node, stararg);
        }
        ArrayList<SimpleNode> list = new ArrayList<SimpleNode>();
View Full Code Here

                return funcDef;
            case JJTDEFAULTARG:
                value = (arity == 1) ? null : ((exprType) stack.popNode());
                return new DefaultArg(((exprType) stack.popNode()), value, n.getId());
            case JJTEXTRAARGLIST:
                return new ExtraArg(makeName(NameTok.VarArg), JJTEXTRAARGLIST);
            case JJTEXTRAKEYWORDLIST:
                return new ExtraArg(makeName(NameTok.KwArg), JJTEXTRAKEYWORDLIST);
            case JJTCLASSDEF:
                suite = (Suite) stack.popNode();
                body = suite.body;
                exprType[] bases = makeExprs(stack.nodeArity() - 1);
                nameTok = makeName(NameTok.ClassName);
View Full Code Here

        NameTok varg = null;
        NameTok kwarg = null;
        for (Iterator<SimpleNode> iter = args.iterator(); iter.hasNext();) {
            SimpleNode node = iter.next();
            if (node.getId() == JJTEXTRAKEYWORDLIST) {
                ExtraArg a = (ExtraArg) node;
                kwarg = a.tok;
                addSpecialsAndClearOriginal(a, kwarg);

            } else if (node.getId() == JJTEXTRAARGLIST) {
                ExtraArg a = (ExtraArg) node;
                varg = a.tok;
                addSpecialsAndClearOriginal(a, varg);
            }
        }
        return new NameTok[] { varg, kwarg };
View Full Code Here

TOP

Related Classes of org.python.pydev.parser.grammarcommon.ExtraArg

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.