Examples of OtpErlangAtom


Examples of com.ericsson.otp.erlang.OtpErlangAtom

     *            name_pos, comment, exported}).
     * @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;
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

        // }

        // final ErlAttribute a = new ErlAttribute(parent, nameS, val1, null);
        OtpErlangObject o = val;
        if (o instanceof OtpErlangAtom) {
            final OtpErlangAtom u = (OtpErlangAtom) o;
            if ("u".equals(u.atomValue())) {
                o = null;
            }
        }
        final ErlAttribute a = new ErlAttribute(module, nameS, o, Util.stringValue(extra));
        setPos(a, pos);
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

                    final List<ErlRecordField> children = Lists
                            .newArrayListWithCapacity(fields.arity());
                    for (final OtpErlangObject o : fields) {
                        if (o instanceof OtpErlangTuple) {
                            final OtpErlangTuple fieldTuple = (OtpErlangTuple) o;
                            final OtpErlangAtom fieldNameAtom = (OtpErlangAtom) fieldTuple
                                    .elementAt(0);
                            final String fieldName = fieldNameAtom.atomValue();
                            final ErlRecordField field = new ErlRecordField(r, fieldName);
                            final OtpErlangTuple posTuple = (OtpErlangTuple) fieldTuple
                                    .elementAt(1);
                            if (fieldTuple.arity() > 2) {
                                final OtpErlangObject fieldExtra = fieldTuple
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

    private IErlImport addImportAttribute(final IErlModule module,
            final OtpErlangObject pos, final OtpErlangObject val) {
        final OtpErlangTuple t = (OtpErlangTuple) val;
        if (t.elementAt(0) instanceof OtpErlangAtom
                && t.elementAt(1) instanceof OtpErlangList) {
            final OtpErlangAtom importModule = (OtpErlangAtom) t.elementAt(0);
            final OtpErlangList functionList = (OtpErlangList) t.elementAt(1);
            final ErlImport imp = new ErlImport(module, importModule.atomValue(),
                    functionList);
            setPos(imp, pos);
            return imp;
        }
        return null;
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

    }

    @Test
    public void testMatch() throws Exception {
        final Bindings r = OtpErlang.match("[W, V]", "[a, b]");
        Assert.assertEquals(r.get("W"), new OtpErlangAtom("a"));
        Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

    }

    @Test
    public void testMatch_0() throws Exception {
        final Bindings b = new BindingsImpl();
        b.put("W", new OtpErlangAtom("a"));
        final Bindings r = OtpErlang.match("[W, V]", "[a, b]", b);
        Assert.assertNotNull(r);
        Assert.assertEquals(r.get("V"), new OtpErlangAtom("b"));
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

    }

    @Test
    public void testMatch_same() throws Exception {
        final Bindings r = OtpErlang.match("[W, {V}]", "[a, {a}]");
        Assert.assertEquals(r.get("W"), new OtpErlangAtom("a"));
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

    }

    @Test
    public void testMatch_sig_a() throws Exception {
        final Bindings r = OtpErlang.match("W:a", "zzz");
        Assert.assertEquals(r.get("W"), new OtpErlangAtom("zzz"));
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

    @Test
    public void testMatch_ellipsis_2() throws Exception {
        final Bindings r = OtpErlang.match("[X | T]", "[x,y,z]");
        Assert.assertNotNull(r);
        Assert.assertEquals(new OtpErlangAtom("x"), r.get("X"));
        Assert.assertEquals(termParser.parse("[y,z]"), r.get("T"));
    }
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangAtom

        Assert.assertEquals(r.longValue(), -34);
    }

    @Test
    public void atom_1() throws TermParserException {
        final OtpErlangAtom r = (OtpErlangAtom) termParser.parse("hello");
        Assert.assertEquals(r.atomValue(), "hello");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.