Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangTuple.elementAt()


    private IErlRecordDef addRecordDef(final IErlModule module,
            final OtpErlangObject pos, final OtpErlangObject val,
            final OtpErlangObject extra) {
        if (val instanceof OtpErlangTuple) {
            final OtpErlangTuple recordTuple = (OtpErlangTuple) val;
            if (recordTuple.elementAt(0) instanceof OtpErlangAtom) {
                final String s = extra instanceof OtpErlangString ? ((OtpErlangString) extra)
                        .stringValue() : null;
                final OtpErlangList fields = (OtpErlangList) recordTuple.elementAt(1);
                final ErlRecordDef r = new ErlRecordDef(module, null, s);
                setPos(r, pos);
View Full Code Here


        if (val instanceof OtpErlangTuple) {
            final OtpErlangTuple recordTuple = (OtpErlangTuple) val;
            if (recordTuple.elementAt(0) instanceof OtpErlangAtom) {
                final String s = extra instanceof OtpErlangString ? ((OtpErlangString) extra)
                        .stringValue() : null;
                final OtpErlangList fields = (OtpErlangList) recordTuple.elementAt(1);
                final ErlRecordDef r = new ErlRecordDef(module, null, s);
                setPos(r, pos);
                if (fields != null) {
                    final List<ErlRecordField> children = Lists
                            .newArrayListWithCapacity(fields.arity());
View Full Code Here

                    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);
View Full Code Here

    }

    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);
View Full Code Here

    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);
View Full Code Here

    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;
View Full Code Here

            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;
        }
View Full Code Here

            // {{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) {
View Full Code Here

            // {{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();
View Full Code Here

            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;
                lastLine = line;
            }
            final int len = lenL.intValue();
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.