Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangAtom


    }

    @Override
    public OtpErlangObject getProcessInfo(final IOtpRpc b, final OtpErlangPid pid) {
        if (b == null) {
            return new OtpErlangAtom("error");
        }
        try {
            return b.call(MODULE_NAME, "get_process_info", "p", pid);
        } catch (final Exception e) {
            ErlLogger.warn(e);
        }
        return new OtpErlangAtom("error");
    }
View Full Code Here


    @Override
    public OtpErlangTuple mkContext(final String externalModules,
            final String externalIncludes, final OtpErlangList pathVars,
            final Collection<IPath> extraSourcePaths,
            final Collection<OtpErlangObject> imports) {
        final OtpErlangAtom tag = new OtpErlangAtom("open_context");
        final OtpErlangAtom UNDEFINED = new OtpErlangAtom("undefined");

        final List<OtpErlangObject> result = Lists.newArrayList();
        // order must match definition of #open_context !
        // TODO use a proplist instead?
        result.add(tag);
View Full Code Here

                        .arity());
                for (final OtpErlangObject i : l) {
                    t = (OtpErlangTuple) i;
                    final String parentPath = Util.stringValue(t.elementAt(0));
                    final String path = Util.stringValue(t.elementAt(1));
                    final OtpErlangAtom isModuleA = (OtpErlangAtom) t.elementAt(2);
                    result.add(new ExternalTreeEntry(parentPath, path, isModuleA
                            .atomValue().equals("module")));
                }
                final String msg = "open:external_module_tree <- " + stopwatch;
                if (stopwatch.elapsed(TimeUnit.SECONDS) > 5) {
                    ErlLogger.warn("WARNING " + msg);
View Full Code Here

        }
        return fContextType;
    }

    private String moduleName(final String fileName) {
        return new OtpErlangAtom(fileName).toString();
    }
View Full Code Here

        module.open(null);
        final IErlElement element = module.getElementAtLine(0);
        final IErlAttribute attribute = (IErlAttribute) element;
        final IErlElement element2 = module.getElementAtLine(1);
        final IErlAttribute attribute2 = (IErlAttribute) element2;
        final OtpErlangAtom xx = new OtpErlangAtom("xx");
        final OtpErlangString yyHrl = new OtpErlangString("yy.hrl");
        assertEquals(xx, attribute.getValue());
        assertEquals(yyHrl, attribute2.getValue());
    }
View Full Code Here

        final OtpErlangLong arityL = ((OtpErlangLong) _elementAt_2);
        final int arity = arityL.intValue();
        OtpErlangObject _elementAt_3 = modLineT.elementAt(3);
        final String clauseHead = Util.stringValue(_elementAt_3);
        OtpErlangObject _elementAt_4 = modLineT.elementAt(4);
        final OtpErlangAtom subClause = ((OtpErlangAtom) _elementAt_4);
        OtpErlangObject _elementAt_5 = modLineT.elementAt(5);
        final OtpErlangLong offsetL = ((OtpErlangLong) _elementAt_5);
        OtpErlangObject _elementAt_6 = modLineT.elementAt(6);
        final OtpErlangLong lengthL = ((OtpErlangLong) _elementAt_6);
        OtpErlangObject _elementAt_7 = modLineT.elementAt(7);
        final OtpErlangAtom isDef = ((OtpErlangAtom) _elementAt_7);
        String name = null;
        if ((nameO instanceof OtpErlangAtom)) {
          String _atomValue = ((OtpErlangAtom)nameO).atomValue();
          name = _atomValue;
        } else {
          String _stringValue = Util.stringValue(nameO);
          name = _stringValue;
        }
        int _intValue = offsetL.intValue();
        int _intValue_1 = lengthL.intValue();
        String _atomValue_1 = subClause.atomValue();
        boolean _parseBoolean = Boolean.parseBoolean(_atomValue_1);
        String _atomValue_2 = isDef.atomValue();
        boolean _parseBoolean_1 = Boolean.parseBoolean(_atomValue_2);
        ModuleLineFunctionArityRef _moduleLineFunctionArityRef = new ModuleLineFunctionArityRef(modName, _intValue, _intValue_1, name, arity, clauseHead, _parseBoolean, _parseBoolean_1);
        result.add(_moduleLineFunctionArityRef);
      }
    }
View Full Code Here

        return new OtpErlangList(result);
    }

    private OtpErlangTuple make2Tuple(final String scannerModuleName, final String path) {
        return new OtpErlangTuple(new OtpErlangObject[] {
                new OtpErlangAtom(scannerModuleName), new OtpErlangString(path) });
    }
View Full Code Here

    private static void processResult(final IOtpRpc backend, final OtpErlangObject o)
            throws DialyzerErrorException {
        if (o instanceof OtpErlangTuple) {
            final OtpErlangTuple t = (OtpErlangTuple) o;
            final OtpErlangAtom whatA = (OtpErlangAtom) t.elementAt(0);
            final String what = whatA.toString();
            final OtpErlangObject result = t.elementAt(1);

            if ("warnings".equals(what)) {
                DialyzerMarkerUtils.addDialyzerWarningMarkersFromResultList(backend,
                        (OtpErlangList) result);
View Full Code Here

    }

    public static boolean isErlideProcess(final IOtpRpc backend, final OtpErlangPid pid) {
        boolean res = false;
        try {
            final OtpErlangAtom eres = (OtpErlangAtom) backend.call(ERLIDE_DEBUG,
                    "is_erlide_process", "p", pid);
            res = Boolean.parseBoolean(eres.atomValue());
        } catch (final Exception e) {
        }
        return res;
    }
View Full Code Here

                    moduleName, options, distributed, interpret);
            if (res instanceof OtpErlangTuple) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangObject o = t.elementAt(0);
                if (o instanceof OtpErlangAtom) {
                    final OtpErlangAtom moduleAtom = (OtpErlangAtom) o;
                    return moduleAtom.atomValue().equals("module");
                }
            }
            return Util.isOk(res);
        } catch (final RpcException e) {
            ErlLogger.warn(e);
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangAtom

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.