Package org.erlide.engine.model.erlang

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


    public IErlPreprocessorDef findPreprocessorDef(final String definedName,
            final ErlElementKind kind) {
        synchronized (getModelLock()) {
            for (final IErlElement m : internalGetChildren()) {
                if (m instanceof IErlPreprocessorDef) {
                    final IErlPreprocessorDef pd = (IErlPreprocessorDef) m;
                    if (pd.getKind() == kind && pd.getDefinedName().equals(definedName)) {
                        return pd;
                    }
                }
            }
        }
View Full Code Here


    public Collection<IErlPreprocessorDef> getPreprocessorDefs(final ErlElementKind kind) {
        final List<IErlPreprocessorDef> result = Lists.newArrayList();
        synchronized (getModelLock()) {
            for (final IErlElement e : internalGetChildren()) {
                if (e instanceof IErlPreprocessorDef) {
                    final IErlPreprocessorDef pd = (IErlPreprocessorDef) e;
                    if (pd.getKind() == kind || kind == ErlElementKind.PROBLEM) {
                        result.add(pd);
                    }
                }
            }
        }
View Full Code Here

                    if (comment.length() == 0) {
                        return null;
                    }
                    result.append(HTMLPrinter.asHtml(comment));
                } else if (found instanceof IErlPreprocessorDef) {
                    final IErlPreprocessorDef preprocessorDef = (IErlPreprocessorDef) found;
                    result.append(preprocessorDef.getExtra());
                }
            }
        } catch (final Exception e) {
            ErlLogger.warn(e);
            return null;
View Full Code Here

            final String definedName, final ErlElementKind kind) throws CoreException {
        for (final IErlProject project : projects) {
            if (project != null) {
                final IErlModule module = project.getModule(moduleName);
                if (module != null) {
                    final IErlPreprocessorDef def = findPreprocessorDef(module,
                            definedName, kind);
                    if (def != null) {
                        return def;
                    }
                }
View Full Code Here

                .getInstance().getModelFindService().findAllIncludedFiles(module));
        allIncludedFiles.add(0, module);
        for (final IErlModule includedFile : allIncludedFiles) {
            for (final String name : names) {
                includedFile.open(null);
                final IErlPreprocessorDef preprocessorDef = includedFile
                        .findPreprocessorDef(name, kind);
                if (preprocessorDef != null) {
                    return preprocessorDef;
                }
            }
View Full Code Here

    public String resolveMacroValue(final String definedName, final IErlModule module) {
        if (module != null) {
            if ("?MODULE".equals(definedName)) {
                return module.getModuleName();
            }
            final IErlPreprocessorDef def = module.findPreprocessorDef(
                    StringUtils.withoutInterrogationMark(definedName),
                    ErlElementKind.MACRO_DEF);
            if (def != null) {
                final String extra = def.getExtra();
                final int p = extra.indexOf(',');
                if (p != -1) {
                    final String s = extra.substring(p + 1).trim();
                    if (s.length() > 0) {
                        return s;
View Full Code Here

            sb.append(a.getName());
            if (a.getValue() != null) {
                sb.append(a.getValue().toString());
            }
        } else if (kind == ErlElementKind.RECORD_DEF || kind == ErlElementKind.MACRO_DEF) {
            final IErlPreprocessorDef pd = (IErlPreprocessorDef) e;
            sb.append(pd.getDefinedName());
        }

        // xMODULE, xATTRIBUTE, xFUNCTION, xCLAUSE, EXPORT, IMPORT,
        // EXPORTFUNCTION, HEADERCOMMENT, COMMENT, xRECORD_DEF, xMACRO_DEF,
        // FOLDER, TYPESPEC
View Full Code Here

            out.print(" " + form.getKind() + " ");
            if (form instanceof IErlImportExport) {
                final IErlImportExport export = (IErlImportExport) form;
                out.println(export.getFunctions().size());
            } else if (form instanceof IErlPreprocessorDef) {
                final IErlPreprocessorDef def = (IErlPreprocessorDef) form;
                out.println(fix(def.getDefinedName()));
            } else if (form instanceof IErlTypespec) {
                final IErlTypespec attribute = (IErlTypespec) form;
                out.println("TYPESPEC " + fix(attribute.getName()));
            } else if (form instanceof IErlAttribute) {
                final IErlAttribute attribute = (IErlAttribute) form;
View Full Code Here

    }
  }
 
  protected Object _findOpenResult(final RecordOpenResult openResult, final IErlModule module, final IErlProject project, final IErlElement element, final IErlElementLocator model, final IErlElementLocator.Scope scope, final ITextEditor editor) {
    try {
      IErlPreprocessorDef _xblockexpression = null;
      {
        final ErlElementKind kind = ErlElementKind.RECORD_DEF;
        String _name = openResult.getName();
        _xblockexpression = this.modelFindService.findPreprocessorDef(module, _name, kind);
      }
View Full Code Here

    }
  }
 
  protected Object _findOpenResult(final MacroOpenResult openResult, final IErlModule module, final IErlProject project, final IErlElement element, final IErlElementLocator model, final IErlElementLocator.Scope scope, final ITextEditor editor) {
    try {
      IErlPreprocessorDef _xblockexpression = null;
      {
        final ErlElementKind kind = ErlElementKind.MACRO_DEF;
        String _name = openResult.getName();
        _xblockexpression = this.modelFindService.findPreprocessorDef(module, _name, kind);
      }
View Full Code Here

TOP

Related Classes of org.erlide.engine.model.erlang.IErlPreprocessorDef

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.