Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangList$Itr


    private OtpErlangObject buildRpcCastMsg(final OtpErlangObject gleader,
            final String module, final String fun, final OtpErlangObject[] args) {
        final OtpErlangObject m = new OtpErlangAtom(module);
        final OtpErlangObject f = new OtpErlangAtom(fun);
        final OtpErlangObject a = new OtpErlangList(args);
        final OtpErlangAtom castTag = new OtpErlangAtom("$gen_cast");
        return OtpErlang.mkTuple(castTag,
                OtpErlang.mkTuple(new OtpErlangAtom("cast"), m, f, a, gleader));
    }
View Full Code Here


    @Test
    public void parse_1() {
        final String input = "a. 1. [c].";
        final List<OtpErlangObject> expected = Lists.newArrayList(new OtpErlangAtom("a"),
                new OtpErlangLong(1), new OtpErlangList(new OtpErlangAtom("c")));
        final List<OtpErlangObject> actual = parser.parse(input);
        assertThat(actual, contains(expected.toArray()));
    }
View Full Code Here

    private final ErlangFunction function;

    public ErlangUninterpretedStackFrame(final String module,
            final ErlangFunction function, final ErlangProcess erlangProcess,
            final IDebugTarget target) {
        super(module, erlangProcess, target, -1, function, new OtpErlangList(), -1);
        this.function = function;
    }
View Full Code Here

            final OtpErlangString os = (OtpErlangString) theValue;
            final String s = os.stringValue();
            // TODO real encoding?
            final byte[] b = s.getBytes(Charsets.ISO_8859_1);
            if (!looksLikeAscii(b)) {
                return new OtpErlangList(s);
            }
        }
        return null;
    }
View Full Code Here

                }
            }
            final OtpErlangTuple t = (OtpErlangTuple) o;
            return getTupleValueString(t);
        } else if (o instanceof OtpErlangList) {
            final OtpErlangList l = (OtpErlangList) o;
            return getListValueString(l);
        } else {
            return o.toString();
        }
    }
View Full Code Here

        if (value instanceof OtpErlangTuple) {
            final OtpErlangTuple t = (OtpErlangTuple) value;
            final int ofs = record != null ? 1 : 0;
            return t.elementAt(index + ofs);
        } else if (value instanceof OtpErlangList) {
            final OtpErlangList l = (OtpErlangList) value;
            return l.elementAt(index);
        } else if (value instanceof OtpErlangBinary) {
            final OtpErlangBinary bs = (OtpErlangBinary) value;
            int j = bs.binaryValue()[index];
            if (j < 0) {
                j += 256;
View Full Code Here

    protected int getArity() {
        if (value instanceof OtpErlangTuple) {
            final OtpErlangTuple t = (OtpErlangTuple) value;
            return t.arity();
        } else if (value instanceof OtpErlangList) {
            final OtpErlangList l = (OtpErlangList) value;
            return l.arity();
        } else if (value instanceof OtpErlangBinary) {
            final OtpErlangBinary bs = (OtpErlangBinary) value;
            return bs.size();
        } else if (list != null) {
            return list.arity();
View Full Code Here

        assertEquals(1, imports2.size());
        assertEquals(1, imports.size());
        final OtpErlangAtom listAtom = new OtpErlangAtom("lists");
        assertEquals(new OtpErlangTuple(new OtpErlangObject[] {
                listAtom,
                new OtpErlangList(new OtpErlangObject[] { makeTuple2("reverse", 1),
                        makeTuple2("foldl", 3) }) }), imports.get(0));
    }
View Full Code Here

        final ArrayList<IErlElement> elements = new ArrayList<IErlElement>();
        final OtpErlangObject obj = result.getValue();
        final OtpErlangTuple restuple = (OtpErlangTuple) obj;
        final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
        if (resindicator.atomValue().equals("ok")) {
            final OtpErlangList erlangFunctionList = (OtpErlangList) restuple
                    .elementAt(1);
            for (int i = 0; i < erlangFunctionList.arity(); ++i) {
                final OtpErlangTuple fTuple = (OtpErlangTuple) erlangFunctionList
                        .elementAt(i);
                IErlFunctionClause f;
                try {
                    f = extractFunction(fTuple);
                    elements.add(f);
View Full Code Here

            final OtpErlangObject obj = res.getValue();
            final OtpErlangTuple restuple = (OtpErlangTuple) obj;
            final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
            if (resindicator.atomValue().equals("ok")) {
                final OtpErlangTuple listtuple = (OtpErlangTuple) restuple.elementAt(1);
                final OtpErlangList modList1 = (OtpErlangList) listtuple.elementAt(0);
                final OtpErlangList modList2 = (OtpErlangList) listtuple.elementAt(1);
                modules1 = createErlModuleList(modList1);
                modules2 = createErlModuleList(modList2);
            } else {
                final OtpErlangString s = (OtpErlangString) restuple.elementAt(1);
                MessageDialog.openError(shell, "Error", s.stringValue());
View Full Code Here

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangList$Itr

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.