Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangAtom


        this.target = target;
    }

    public String formatError(final OtpErlangObject object) {
        final OtpErlangTuple err = (OtpErlangTuple) object;
        final OtpErlangAtom mod = (OtpErlangAtom) err.elementAt(1);
        final OtpErlangObject arg = err.elementAt(2);

        String res;
        try {
            OtpErlangObject r = target.call(mod.atomValue(), "format_error", "x", arg);
            r = target.call("lists", "flatten", "x", r);
            res = ((OtpErlangString) r).stringValue();
        } catch (final Exception e) {
            ErlLogger.error(e);
            res = err.toString();
View Full Code Here


            return new OtpErlangList(new OtpErlangObject[] { defs });
        }
    }

    private static OtpErlangTuple make2Tuple(final OtpErlangAtom atom, final String s) {
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s) });
    }
View Full Code Here

    private static final OtpErlangAtom UNDEFINED = new OtpErlangAtom("undefined");

    private static OtpErlangObject make3Tuple(final OtpErlangAtom atom, final String s,
            final int a) {
        if (a >= 0) {
            return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s),
                    new OtpErlangLong(a) });
        }
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s),
                UNDEFINED });

    }
View Full Code Here

    }

    private static OtpErlangObject make3Tuple(final OtpErlangAtom atom, final String a1,
            final String a2) {
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(a1),
                new OtpErlangAtom(a2) });
    }
View Full Code Here

    private static OtpErlangObject make4Tuple(final OtpErlangAtom atom, final String s1,
            final String s2, final int a) {
        if (a >= 0) {
            return new OtpErlangTuple(new OtpErlangObject[] { atom,
                    new OtpErlangAtom(s1), new OtpErlangAtom(s2), new OtpErlangLong(a) });
        }
        return new OtpErlangTuple(new OtpErlangObject[] { atom, new OtpErlangAtom(s1),
                new OtpErlangAtom(s2), UNDEFINED });
    }
View Full Code Here

        }
        terminated = true;

        if (backend != null) {
            if (backend.getOtpRpc() != null) {
                backend.getOtpRpc().send("dbg_mon", new OtpErlangAtom("stop"));
            }
            final DebugPlugin dbgPlugin = DebugPlugin.getDefault();
            if (dbgPlugin != null) {
                dbgPlugin.getBreakpointManager().removeBreakpointListener(this);
            }
View Full Code Here

                debuggerModules.size());
        for (final String module : debuggerModules) {
            final OtpErlangBinary b = getDebuggerBeam(module);
            if (b != null) {
                final OtpErlangString filename = new OtpErlangString(module + ".erl");
                final OtpErlangTuple t = OtpErlang.mkTuple(new OtpErlangAtom(module),
                        filename, b);
                modules.add(t);
            } else {
                ErlLogger.warn("Could not find debugger module %s", module);
            }
View Full Code Here

    private void addNodesAsDebugTargets(final ILaunch aLaunch) {
        final OtpErlangList nodes = ErlideDebug.nodes(backend.getOtpRpc());
        if (nodes != null) {
            for (int i = 1, n = nodes.arity(); i < n; ++i) {
                final OtpErlangAtom a = (OtpErlangAtom) nodes.elementAt(i);
                final IDebugTarget edn = new ErlangDebugNode(this, a.atomValue());
                aLaunch.addDebugTarget(edn);
            }
        }
    }
View Full Code Here

        private static int getSeverity(final OtpErlangTuple data) {
            int sev = IMarker.SEVERITY_INFO;
            final OtpErlangObject sev_tag = data.elementAt(3);
            if (sev_tag instanceof OtpErlangAtom) {
                final OtpErlangAtom tag = (OtpErlangAtom) sev_tag;
                if (tag.equals(ERROR)) {
                    sev = IMarker.SEVERITY_ERROR;
                } else if (tag.equals(WARNING)) {
                    sev = IMarker.SEVERITY_WARNING;
                }
            } else {
                final OtpErlangLong tag = (OtpErlangLong) sev_tag;
                try {
                    switch (tag.intValue()) {
                    case 0:
                        sev = IMarker.SEVERITY_ERROR;
                        break;
                    case 1:
                        sev = IMarker.SEVERITY_WARNING;
View Full Code Here

        this.name = name;
        arity = ANY_ARITY;
    }

    public ErlangFunction(final OtpErlangTuple tuple) {
        OtpErlangAtom a;
        arity = 0;
        if (tuple.arity() == 2) {
            a = (OtpErlangAtom) tuple.elementAt(0);
            final OtpErlangLong l = (OtpErlangLong) tuple.elementAt(1);
            try {
                arity = l.intValue();
            } catch (final OtpErlangRangeException e) {
            }
        } else {
            a = (OtpErlangAtom) tuple.elementAt(2);
            final OtpErlangObject parameters = tuple.elementAt(3);
            if (parameters instanceof OtpErlangLong) {
                final OtpErlangLong l = (OtpErlangLong) parameters;
                try {
                    arity = l.intValue();
                } catch (final OtpErlangRangeException e) {
                }
            } else if (parameters instanceof OtpErlangList) {
                final OtpErlangList l = (OtpErlangList) parameters;
                arity = l.arity();
            }
        }
        name = a.atomValue();
    }
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.