Examples of IErlFunction


Examples of org.erlide.engine.model.erlang.IErlFunction

            IErlModule module;
            try {
                module = ErlangEngine.getInstance().getModel().findModule(moduleName);

                final IErlFunction f = module.findFunction(new ErlangFunction(fs
                        .getLabel(), fs.getArity()));

                editor.setSelection(f);

            } catch (final ErlModelException e) {
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

            }
            return e.getKind().ordinal();
        case SORT_ON_EXPORT:
            if (e.getKind() == ErlElementKind.FUNCTION) {
                if (e instanceof IErlFunction) {
                    final IErlFunction f = (IErlFunction) e;
                    if (f.isExported()) {
                        return 500;
                    }
                }
                return 1000;
            }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

                out.println("TYPESPEC " + fix(attribute.getName()));
            } else if (form instanceof IErlAttribute) {
                final IErlAttribute attribute = (IErlAttribute) form;
                out.println(fix(attribute.getName()));
            } else if (form instanceof IErlFunction) {
                final IErlFunction function = (IErlFunction) form;
                int numClauses = function.getChildCount();
                numClauses = numClauses == 0 ? 1 : numClauses;
                out.println(fix(function.getName()) + " " + function.getArity() + " "
                        + numClauses);
            } else {
                out.println("?? " + form.getClass().getName());
            }
        }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

      return this.modelFindService.findTypespec(module, _fun);
    }
    String _fun_1 = res.getFun();
    int _arity = res.getArity();
    final ErlangFunction erlangFunction = new ErlangFunction(_fun_1, _arity);
    final IErlFunction foundElement = module.findFunction(erlangFunction);
    boolean _tripleNotEquals = (foundElement != null);
    if (_tripleNotEquals) {
      return foundElement;
    }
    OtpErlangObject res2 = null;
    String moduleName = null;
    final IErlImport ei = module.findImport(erlangFunction);
    boolean _tripleNotEquals_1 = (ei != null);
    if (_tripleNotEquals_1) {
      IErlangEngine _instance = ErlangEngine.getInstance();
      final IErlModel model = _instance.getModel();
      String _importModule = ei.getImportModule();
      moduleName = _importModule;
      IErlangEngine _instance_1 = ErlangEngine.getInstance();
      OpenService _service = _instance_1.<OpenService>getService(OpenService.class);
      IResource _resource = module.getResource();
      OtpErlangList _pathVars = model.getPathVars(_resource);
      ErlangProjectProperties _properties = erlProject.getProperties();
      String _externalModules = _properties.getExternalModules();
      OtpErlangObject _sourceFromModule = _service.getSourceFromModule(_pathVars, moduleName, _externalModules);
      res2 = _sourceFromModule;
    }
    if ((res2 instanceof OtpErlangString)) {
      boolean _tripleNotEquals_2 = (moduleName != null);
      if (_tripleNotEquals_2) {
        final String modulePath = ((OtpErlangString)res2).stringValue();
        IErlangEngine _instance_2 = ErlangEngine.getInstance();
        final IErlElementLocator model_1 = _instance_2.getModel();
        return this.modelFindService.findFunction(model_1, erlProject, module, moduleName, modulePath, erlangFunction, scope);
      }
    }
    IErlangEngine _instance_3 = ErlangEngine.getInstance();
    ModelFindService _modelFindService = _instance_3.getModelFindService();
    final Collection<IErlModule> allIncludedFiles = _modelFindService.findAllIncludedFiles(module);
    for (final IErlModule includedModule : allIncludedFiles) {
      {
        final IErlFunction function = includedModule.findFunction(erlangFunction);
        boolean _tripleNotEquals_3 = (function != null);
        if (_tripleNotEquals_3) {
          return function;
        }
      }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

    String _mod_1 = res.getMod();
    String _path_1 = res.getPath();
    String _fun_1 = res.getFun();
    int _arity = res.getArity();
    ErlangFunction _erlangFunction = new ErlangFunction(_fun_1, _arity);
    final IErlFunction result = this.modelFindService.findFunction(model, project, module, _mod_1, _path_1, _erlangFunction, scope);
    boolean _tripleNotEquals = (result != null);
    if (_tripleNotEquals) {
      return result;
    }
    String _mod_2 = res.getMod();
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

            final boolean unexportedOnly, final boolean arityOnly)
            throws ErlModelException {
        final List<ICompletionProposal> result = new ArrayList<ICompletionProposal>();
        for (final IErlElement e : module.getChildren()) {
            if (e instanceof IErlFunction) {
                final IErlFunction f = (IErlFunction) e;
                if (unexportedOnly && f.isExported()) {
                    continue;
                }
                addFunctionCompletion(offset, prefix, result, f, arityOnly);
            }
        }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        boolean result = false;
        try {
            m.open(null);
            for (final IErlElement e : m.getChildren()) {
                if (e instanceof IErlFunction) {
                    final IErlFunction f = (IErlFunction) e;
                    if (f.isExported()) {
                        addFunctionCompletion(offset, prefix, proposals, f, arityOnly);
                        result = true;
                    }
                }
            }
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

    }

    public ErlangSearchPattern getSearchPatternFromErlElementAndLimitTo(
            final IErlElement element, final LimitTo limitTo) {
        if (element instanceof IErlFunction) {
            final IErlFunction function = (IErlFunction) element;
            final String withoutExtension = SystemConfiguration.withoutExtension(function
                    .getModuleName());
            return new FunctionPattern(withoutExtension, function.getFunctionName(),
                    function.getArity(), limitTo, true,
                    modelUtilService.getModule(function), !function.isExported());
        } else if (element instanceof IErlMacroDef) {
            final IErlMacroDef m = (IErlMacroDef) element;
            final String unquoted = StringUtils.unquote(m.getDefinedName());
            return new MacroPattern(unquoted, limitTo);
        } else if (element instanceof IErlRecordDef) {
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

        final String mName = ((StatsTreeObject) getParent()).getLabel();
        IErlModule m;
        try {
            m = ErlangEngine.getInstance().getModel().findModule(mName);
            final IErlFunction f = m.findFunction(new ErlangFunction(getLabel(),
                    getArity()));

            lineStart = f.getLineStart();
        } catch (final ErlModelException e) {
            ErlLogger.error(e);
        }

        return lineStart;
View Full Code Here

Examples of org.erlide.engine.model.erlang.IErlFunction

                    if (e instanceof IErlFunctionClause) {
                        final IErlFunctionClause clause = (IErlFunctionClause) e;
                        clauseHead = clause.getFunctionName() + clause.getHead();
                    }
                } else if (function != null) {
                    final IErlFunction f = module.findFunction(function);
                    if (f != null) {
                        lineNumber = f.getLineStart() + 1;
                        clauseHead = f.getFunctionName() + f.getHead();
                    }
                }
            } catch (final ErlModelException e1) {
                ErlLogger.warn(e1);
            }
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.