Package com.ericsson.otp.erlang

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


                        .getProcessInfo(getBackend().getOtpRpc(), pid);
                if (r instanceof OtpErlangList) {
                    final OtpErlangList l = (OtpErlangList) r;
                    final StringBuilder s = new StringBuilder();
                    for (int i = 0; i < l.arity(); i++) {
                        final OtpErlangTuple e = (OtpErlangTuple) l.elementAt(i);
                        s.append(' ').append(e.elementAt(0).toString()).append("\t= ")
                                .append(e.elementAt(1).toString()).append('\n');
                    }
                    showMessage(s.toString());
                } else {
View Full Code Here


                return new OtpErlangObject[] {};
            }
            final OtpErlangObject[] ss = new OtpErlangObject[r.elements().length];

            for (int i = 0; i < r.elements().length; i++) {
                final OtpErlangTuple e = (OtpErlangTuple) r.elementAt(i);
                ss[i] = e;
            }

            return ss;
        }
View Full Code Here

            final OtpErlangList procList = (OtpErlangList) backend.call(MODULE_NAME,
                    FUNCTION_NAME, "x", nodesList);
            final TracedProcess[] processes = new TracedProcess[procList.arity()];

            for (int i = 0; i < procList.arity(); i++) {
                final OtpErlangTuple tuple = (OtpErlangTuple) procList.elementAt(i);
                processes[i] = new TracedProcess(tuple);
            }
            return processes;
        } catch (final RpcException e) {
            ErlLogger.error(e);
View Full Code Here

                    final OtpErlangTuple errorTuple = (OtpErlangTuple) tuple.elementAt(2);
                    final StringBuilder builder = new StringBuilder("Line ");
                    builder.append(errorTuple.elementAt(0)).append(": ");
                    final OtpErlangList errorList = (OtpErlangList) errorTuple
                            .elementAt(2);
                    builder.append(((OtpErlangString) errorList.elementAt(0))
                            .stringValue());
                    if (errorList.elementAt(1) instanceof OtpErlangString) {
                        builder.append(((OtpErlangString) errorList.elementAt(1))
                                .stringValue());
                    }
View Full Code Here

                    builder.append(errorTuple.elementAt(0)).append(": ");
                    final OtpErlangList errorList = (OtpErlangList) errorTuple
                            .elementAt(2);
                    builder.append(((OtpErlangString) errorList.elementAt(0))
                            .stringValue());
                    if (errorList.elementAt(1) instanceof OtpErlangString) {
                        builder.append(((OtpErlangString) errorList.elementAt(1))
                                .stringValue());
                    }
                    return builder.toString();
                } else if (errorType.atomValue().equals("not_fun")) {
View Full Code Here

                    final OtpErlangList errorList = (OtpErlangList) errorTuple
                            .elementAt(2);
                    builder.append(((OtpErlangString) errorList.elementAt(0))
                            .stringValue());
                    if (errorList.elementAt(1) instanceof OtpErlangString) {
                        builder.append(((OtpErlangString) errorList.elementAt(1))
                                .stringValue());
                    }
                    return builder.toString();
                } else if (errorType.atomValue().equals("not_fun")) {
                    return "Given expression is not a function";
View Full Code Here

            if (arityOrArgs instanceof OtpErlangList) {
                // last element is a list of arguments
                final OtpErlangList arguments = (OtpErlangList) arityOrArgs;
                final StringBuilder builder = new StringBuilder("arguments: ");
                for (int i = 1; i < arguments.arity(); i++) {
                    builder.append(arguments.elementAt(i)).append(", ");
                }
                arityValue = arguments.arity() - 1;
                argsNode.setLabel(builder.substring(0, builder.length() - 2));
            } else {
                // last element is arity
View Full Code Here

            final ErlFunction f = makeErlFunction(module, el);
            final OtpErlangList clauses = (OtpErlangList) el.elementAt(6);
            final List<ErlFunctionClause> cls = Lists.newArrayListWithCapacity(clauses
                    .arity());
            for (int i = 0; i < clauses.arity(); i++) {
                final OtpErlangTuple clause = (OtpErlangTuple) clauses.elementAt(i);
                final ErlFunctionClause cl = makeErlFunctionClause(f, i, clause);
                cls.add(cl);
            }
            f.setChildren(cls);
            return f;
View Full Code Here

            setPos(r, pos);
            // r.setParseTree(val);
            return r;
        } else if (val instanceof OtpErlangList) {
            final OtpErlangList macroList = (OtpErlangList) val;
            if (macroList.elementAt(0) instanceof OtpErlangTuple) {
                final OtpErlangTuple macroNameTuple = (OtpErlangTuple) macroList
                        .elementAt(0);
                OtpErlangObject o = macroNameTuple.elementAt(2);
                if (o instanceof OtpErlangTuple) {
                    o = ((OtpErlangTuple) o).elementAt(2);
View Full Code Here

            // r.setParseTree(val);
            return r;
        } else if (val instanceof OtpErlangList) {
            final OtpErlangList macroList = (OtpErlangList) val;
            if (macroList.elementAt(0) instanceof OtpErlangTuple) {
                final OtpErlangTuple macroNameTuple = (OtpErlangTuple) macroList
                        .elementAt(0);
                OtpErlangObject o = macroNameTuple.elementAt(2);
                if (o instanceof OtpErlangTuple) {
                    o = ((OtpErlangTuple) o).elementAt(2);
                }
View Full Code Here

TOP
Copyright © 2015 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.