Package org.python.pydev.parser.grammarcommon

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


            case JJTDECORATED:
                if (stack.nodeArity() != 2) {
                    throw new RuntimeException("Expected 2 nodes at this context, found: " + arity);
                }
                SimpleNode def = stack.popNode();
                Decorators decorators = (Decorators) stack.popNode();
                if (def instanceof ClassDef) {
                    ClassDef classDef = (ClassDef) def;
                    classDef.decs = decorators.exp;
                } else {
                    FunctionDef fDef = (FunctionDef) def;
View Full Code Here


            case JJTDECORATED:
                if (stack.nodeArity() != 2) {
                    throw new RuntimeException("Expected 2 nodes at this context, found: " + arity);
                }
                SimpleNode def = stack.popNode();
                Decorators decorators = (Decorators) stack.popNode();
                if (def instanceof ClassDef) {
                    ClassDef classDef = (ClassDef) def;
                    classDef.decs = decorators.exp;
                } else {
                    FunctionDef fDef = (FunctionDef) def;
View Full Code Here

            case JJTDECORATED:
                if (stack.nodeArity() != 2) {
                    throw new RuntimeException("Expected 2 nodes at this context, found: " + arity);
                }
                SimpleNode def = stack.popNode();
                Decorators decorators = (Decorators) stack.popNode();
                if (def instanceof ClassDef) {
                    ClassDef classDef = (ClassDef) def;
                    classDef.decs = decorators.exp;
                } else {
                    FunctionDef fDef = (FunctionDef) def;
View Full Code Here

                suite = (Suite) stack.popNode();
                body = suite.body;

                argumentsType arguments = makeArguments(stack.nodeArity() - 2);
                NameTok nameTok = makeName(NameTok.FunctionName);
                Decorators decs = (Decorators) stack.popNode();
                decoratorsType[] decsexp = decs.exp;
                FunctionDef funcDef = new FunctionDef(nameTok, arguments, body, decsexp, null);
                if (decs.exp.length == 0) {
                    addSpecialsBefore(decs, funcDef);
                }
View Full Code Here

                Suite suite = (Suite) stack.popNode();
                body = suite.body;

                argumentsType arguments = makeArguments(stack.nodeArity() - 2);
                NameTok nameTok = makeName(NameTok.FunctionName);
                Decorators decs = (Decorators) stack.popNode();
                decoratorsType[] decsexp = decs.exp;
                FunctionDef funcDef = new FunctionDef(nameTok, arguments, body, decsexp, null);
                if (decs.exp.length == 0) {
                    addSpecialsBefore(decs, funcDef);
                }
View Full Code Here

TOP

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

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.