Package org.python.pydev.parser.grammarcommon

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


                addSpecialsAndClearOriginal(suite, funcDef);
                setParentForFuncOrClass(body, funcDef);
                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:
View Full Code Here


        exprType fpargs[] = new exprType[def.length];
        exprType defaults[] = new exprType[def.length];
        int startofdefaults = 0;
        boolean defaultsSet = false;
        for (int i = 0; i < def.length; i++) {
            DefaultArg node = def[i];
            exprType parameter = node.parameter;
            fpargs[i] = parameter;

            if (node.specialsBefore != null && node.specialsBefore.size() > 0) {
                parameter.getSpecialsBefore().addAll(node.specialsBefore);
View Full Code Here

                }

                return new JfpDef(tfpdefName, typeDef);
            case JJTONLYKEYWORDARG2:
            case JJTDEFAULTARG2:
                DefaultArg defaultArg;
                JfpDef jfpDef;
                if (arity == 1) {
                    jfpDef = (JfpDef) stack.popNode();
                    defaultArg = new DefaultArg(jfpDef.nameNode, null, jfpDef.typeDef, n.getId());
                } else if (arity == 2) {
                    exprType defaultValue = (exprType) stack.popNode();
                    jfpDef = (JfpDef) stack.popNode();
                    defaultArg = new DefaultArg(jfpDef.nameNode, defaultValue, jfpDef.typeDef, n.getId());
                } else {
                    throw new RuntimeException("Unexpected arity: " + arity);
                }
                return defaultArg;
            case JJTONLYKEYWORDARG:
            case JJTDEFAULTARG:
                //no type definition in this case
                if (arity == 1) {
                    return new DefaultArg(((exprType) stack.popNode()), null, null, n.getId());
                }
                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);
                }
View Full Code Here

        java.util.List<exprType> kwonlyargs = new ArrayList<exprType>();
        java.util.List<exprType> kwonlyargsAnn = new ArrayList<exprType>();
        java.util.List<exprType> kwonlyargsDefaults = new ArrayList<exprType>();

        for (int i = 0; i < def.length; i++) {
            DefaultArg node = def[i];
            exprType parameter = node.parameter;

            if (node.id == JJTONLYKEYWORDARG || node.id == JJTONLYKEYWORDARG2) {
                ctx.setKwOnlyParam(parameter);
                kwonlyargs.add(parameter);
View Full Code Here

                addSpecialsAndClearOriginal(suite, funcDef);
                setParentForFuncOrClass(body, funcDef);
                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:
View Full Code Here

        exprType fpargs[] = new exprType[def.length];
        exprType defaults[] = new exprType[def.length];
        int startofdefaults = 0;
        boolean defaultsSet = false;
        for (int i = 0; i < def.length; i++) {
            DefaultArg node = def[i];
            exprType parameter = node.parameter;
            fpargs[i] = parameter;

            if (node.specialsBefore != null && node.specialsBefore.size() > 0) {
                parameter.getSpecialsBefore().addAll(node.specialsBefore);
View Full Code Here

                addSpecialsAndClearOriginal(suite, funcDef);
                setParentForFuncOrClass(body, funcDef);
                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:
View Full Code Here

        exprType fpargs[] = new exprType[def.length];
        exprType defaults[] = new exprType[def.length];
        int startofdefaults = 0;
        boolean defaultsSet = false;
        for (int i = 0; i < def.length; i++) {
            DefaultArg node = def[i];
            exprType parameter = node.parameter;
            fpargs[i] = parameter;

            if (node.specialsBefore != null && node.specialsBefore.size() > 0) {
                parameter.getSpecialsBefore().addAll(node.specialsBefore);
View Full Code Here

                addSpecialsAndClearOriginal(suite, funcDef);
                setParentForFuncOrClass(body, funcDef);
                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);
                /*
 
View Full Code Here

        exprType fpargs[] = new exprType[def.length];
        exprType defaults[] = new exprType[def.length];
        int startofdefaults = 0;
        boolean defaultsSet = false;
        for (int i = 0; i < def.length; i++) {
            DefaultArg node = def[i];
            exprType parameter = node.parameter;
            fpargs[i] = parameter;

            if (node.specialsBefore != null && node.specialsBefore.size() > 0) {
                parameter.getSpecialsBefore().addAll(node.specialsBefore);
View Full Code Here

TOP

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

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.