Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangLong


    }

    // functions creating nodes

    private ITreeNode processDropTrace(final OtpErlangTuple tuple) {
        final OtpErlangLong amount = (OtpErlangLong) tuple.elementAt(1);
        final ITreeNode node = new TreeNode("Dropped traces: " + amount.longValue(),
                Activator.getImage(Images.DROP_NODE));
        return node;
    }
View Full Code Here


                        startIndex = theStartIndex;
                        handler = new TraceEventHandler(tracerBackend.getName());
                        getBackend(true);
                        TraceCollections.getTracesList().clear();
                        tracerBackend.getNodeProxy().registerEventListener(handler);
                        final OtpErlangLong start = new OtpErlangLong(theStartIndex);
                        final OtpErlangLong stop = new OtpErlangLong(endIndex);
                        tracerBackend.getOtpRpc().call(Constants.ERLANG_HELPER_MODULE,
                                FUN_LOAD, "sii",
                                new OtpErlangString(activeResultSet.getFileName()),
                                start, stop);
                    } catch (final RpcException e) {
View Full Code Here

        final OtpErlangList erlStackFrames = (OtpErlangList) tuple.elementAt(2);
        final OtpErlangTuple t2 = (OtpErlangTuple) tuple.elementAt(1);
        final OtpErlangTuple ieval = (OtpErlangTuple) t2.elementAt(0);
        OtpErlangAtom m = (OtpErlangAtom) ieval.elementAt(3);
        OtpErlangList bindings = (OtpErlangList) t2.elementAt(t2.arity() - 1);
        OtpErlangLong l = (OtpErlangLong) ieval.elementAt(1);
        final List<IStackFrame> stackFrames = new ArrayList<IStackFrame>(
                erlStackFrames.arity() + 1);
        for (final OtpErlangObject o : erlStackFrames) {
            final OtpErlangTuple t = (OtpErlangTuple) o;
            final OtpErlangTuple ml = (OtpErlangTuple) t.elementAt(1);
            final OtpErlangObject ml0 = ml.elementAt(0);
            int stackFrameNo;
            final OtpErlangLong n = (OtpErlangLong) t.elementAt(3);
            try {
                stackFrameNo = n.intValue();
            } catch (final OtpErlangRangeException e) {
                stackFrameNo = -1;
            }
            final String module = m.atomValue();
            int line;
View Full Code Here

        if (!event.getTopic().equals(getTopic())) {
            return;
        }
        final OtpErlangTuple t = (OtpErlangTuple) event.getEvent();
        final OtpErlangAtom module = (OtpErlangAtom) t.elementAt(0);
        final OtpErlangLong line = (OtpErlangLong) t.elementAt(1);
        final OtpErlangAtom level = (OtpErlangAtom) t.elementAt(2);
        final OtpErlangObject logEvent = t.elementAt(3);
        String ss = "";
        if (t.arity() == 5) {
            final OtpErlangTuple backtrace_0 = (OtpErlangTuple) t.elementAt(4);
            final OtpErlangBinary backtrace = (OtpErlangBinary) backtrace_0.elementAt(1);
            ss = new String(backtrace.binaryValue());
        }
        try {
            ErlLogger.getInstance().erlangLog(module.atomValue() + ".erl",
                    line.uIntValue(), level.atomValue().toUpperCase(), "%s %s",
                    logEvent.toString(), ss);
        } catch (final Exception e) {
            ErlLogger.warn(e);
        }
    }
View Full Code Here

     * @param OtpErlangTuple
     *            token record from noparse
     * @return IErlComment
     */
    private IErlComment createComment(final IErlModule module, final OtpErlangTuple c) {
        final OtpErlangLong lineL = (OtpErlangLong) c.elementAt(LINE);
        final OtpErlangObject s = c.elementAt(TEXT);

        int line;
        int lastLine;
        try {
            line = lineL.intValue();
        } catch (final OtpErlangRangeException x) {
            line = 0;
        }
        lastLine = line;
        try {
            if (c.elementAt(LAST_LINE) instanceof OtpErlangLong) {
                final OtpErlangLong lastLineL = (OtpErlangLong) c.elementAt(LAST_LINE);
                lastLine = lastLineL.intValue();
            }
        } catch (final OtpErlangRangeException e1) {
            lastLine = line;
        }
        final ErlComment comment = new ErlComment(module, Util.stringValue(s),
View Full Code Here

     * @return ErlFunction
     */
    private ErlFunction makeErlFunction(final IErlModule module, final OtpErlangTuple el) {
        final OtpErlangTuple pos = (OtpErlangTuple) el.elementAt(1);
        final OtpErlangAtom name = (OtpErlangAtom) el.elementAt(2);
        final OtpErlangLong arity = (OtpErlangLong) el.elementAt(3);
        final OtpErlangList parameters = (OtpErlangList) el.elementAt(4);
        final OtpErlangObject head = el.elementAt(5);
        final OtpErlangTuple namePos = (OtpErlangTuple) el.elementAt(7);
        ErlFunction f = null;
        final OtpErlangAtom exportedA = (OtpErlangAtom) el.elementAt(8);
        final boolean exported = Boolean.parseBoolean(exportedA.atomValue());
        try {
            f = new ErlFunction(module, name.atomValue(), arity.intValue(),
                    Util.stringValue(head), exported, parameters);
        } catch (final OtpErlangRangeException e) {
            return f;
        }
        setPos(f, pos);
View Full Code Here

            // pos=
            // {{Line, LastLine, Offset}, PosLength} or
            // {{Line, Offset}, PosLength}
            final OtpErlangTuple tpos = (OtpErlangTuple) pos;
            final OtpErlangTuple tpos1 = (OtpErlangTuple) tpos.elementAt(0);
            final OtpErlangLong lenL = (OtpErlangLong) tpos.elementAt(1);
            final OtpErlangLong lineL = (OtpErlangLong) tpos1.elementAt(0);
            final OtpErlangLong lastLineL = (OtpErlangLong) tpos1.elementAt(1);
            final int line = lineL.intValue();
            int lastLine = lastLineL.intValue();
            int ofs;
            if (tpos1.arity() > 2) {
                ofs = ((OtpErlangLong) tpos1.elementAt(2)).intValue();
            } else {
                ofs = lastLine;
View Full Code Here

            @Override
            public void start(final OtpErlangObject msg) {
                if (fSearchResult != null) {
                    fSearchResult.removeAll();
                }
                final OtpErlangLong progressMaxL = (OtpErlangLong) msg;
                int progressMax;
                try {
                    progressMax = progressMaxL.intValue();
                } catch (final OtpErlangRangeException e) {
                    progressMax = 10;
                }
                monitor.beginTask("Searching", progressMax);
            }

            @Override
            public void stop(final OtpErlangObject msg) {
                monitor.done();
                stopped = true;
                synchronized (locker) {
                    locker.notifyAll();
                }
            }

            @Override
            public void progress(final OtpErlangObject msg) {
                final OtpErlangTuple t = (OtpErlangTuple) msg;
                final OtpErlangPid backgroundSearchPid = (OtpErlangPid) t.elementAt(0);
                final OtpErlangLong progressL = (OtpErlangLong) t.elementAt(1);
                final OtpErlangObject resultO = t.elementAt(2);
                int progress = 1;
                try {
                    progress = progressL.intValue();
                    final List<ModuleLineFunctionArityRef> result = Lists.newArrayList();
                    SearchUtil.addSearchResult(result, resultO);
                    addMatches(result);
                } catch (final OtpErlangRangeException e) {
                }
View Full Code Here

    }

    @Test
    public void testMatch_sig_i() throws Exception {
        final Bindings r = OtpErlang.match("W:i", "222");
        Assert.assertEquals(r.get("W"), new OtpErlangLong(222));
    }
View Full Code Here

    private final TermParser termParser = OtpErlang.getTermParser();

    @Test
    public void int_1() throws TermParserException {
        final OtpErlangLong r = (OtpErlangLong) termParser.parse("34");
        Assert.assertEquals(r.longValue(), 34);
    }
View Full Code Here

TOP

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

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.