Examples of FunctionDef


Examples of org.eclipse.sapphire.sdk.extensibility.FunctionDef

                new Comparator<Element>()
                {
                    public int compare( final Element a,
                                        final Element b )
                    {
                        final FunctionDef x = (FunctionDef) a;
                        final FunctionDef y = (FunctionDef) b;
                       
                        return comp( x.getName().content(), y.getName().content() );
                    }
                }
            );
        }
View Full Code Here

Examples of org.python.antlr.ast.FunctionDef

        } else {
            a = new arguments(t, new ArrayList<expr>(), (Name)null, null, new ArrayList<expr>());
        }
        List<stmt> s = castStmts(funcStatements);
        List<expr> d = castExprs(decorators);
        return new FunctionDef(t, n, a, s, d);
    }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

    }

    @SuppressWarnings("unchecked")
    /*default*/void checkAttrFound(Call callNode, TokenFoundStructure found) throws Exception,
            CompletionRecursionException {
        FunctionDef functionDefinitionReferenced;
        SourceToken nameToken;
        boolean callingBoundMethod;
        if (found != null && found.defined && found.token instanceof SourceToken) {
            nameToken = (SourceToken) found.token;
            String rep = nameToken.getRepresentation();
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

    }

    private final Map<ClassDef, SimpleNode> defToConsideredInit = new HashMap<ClassDef, SimpleNode>();

    /*default*/void checkNameFound(Call callNode, SourceToken sourceToken) throws Exception {
        FunctionDef functionDefinitionReferenced;
        boolean callingBoundMethod = false;
        SimpleNode ast = sourceToken.getAst();
        if (ast instanceof FunctionDef) {
            functionDefinitionReferenced = (FunctionDef) ast;
            analyzeCallAndFunctionMatch(callNode, functionDefinitionReferenced, sourceToken, callingBoundMethod);
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

        if (stack.size() > 0) {
            if (!scope.getPrevScopeItems().getIsInSubSubScope()) {
                String exists = stack.peek().get(name);
                if (exists != null) {
                    if (node instanceof FunctionDef) {
                        FunctionDef functionDef = (FunctionDef) node;
                        if (functionDef.decs != null && functionDef.decs.length > 0) {
                            for (decoratorsType dec : functionDef.decs) {
                                if (dec.func != null) {
                                    String fullRepresentationString = NodeUtils.getFullRepresentationString(dec.func);
                                    if (fullRepresentationString.startsWith(name + ".")) {
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

            Tuple<Expected, FunctionDef> tup = maybeNoSelfDefinedItems.peek().get(rep);
            if (tup == null) {
                return;
            }

            FunctionDef def = tup.o2;
            if (def == null) {
                return;
            }

            //ok, it may be a staticmethod, let's check its value (should be a call)
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

                if (type == IAnalysisPreferences.TYPE_UNUSED_PARAMETER) {
                    // just add unused parameters in methods that have some content (not only 'pass' and 'strings')

                    if (node instanceof FunctionDef) {
                        addMessage = false;
                        FunctionDef def = (FunctionDef) node;
                        for (stmtType b : def.body) {
                            if (b instanceof Pass) {
                                continue;
                            }
                            if (b instanceof Expr) {
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

    @Override
    protected SimpleNode getEditNode() {
        List<stmtType> body = initExtractedBody();
        List<exprType> argsList = initExtractedMethodArguments();
        addReturnValue(body);
        FunctionDef extractedMethod = initExtractedMethod(body, argsList);
        applyRenamedVariables(extractedMethod);

        return extractedMethod;
    }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

    private FunctionDef initExtractedMethod(List<stmtType> body, List<exprType> argsList) {
        argumentsType args = new argumentsType(argsList.toArray(new exprType[0]), null, null, null, null, null, null,
                null, null, null);

        FunctionDef extractedMethod = new FunctionDef(new NameTok(methodName, NameTok.FunctionName), args,
                body.toArray(new stmtType[0]), null, null);
        return extractedMethod;
    }
View Full Code Here

Examples of org.python.pydev.parser.jython.ast.FunctionDef

            Assign initParam = initParam1;
            body.add(initParam);
        }

        //create function def
        return new FunctionDef(new NameTok(NodeHelper.KEYWORD_INIT, NameTok.FunctionName), args,
                body.toArray(new stmtType[0]), null, null);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.