Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangTuple


        }
        return new OtpErlangList(result);
    }

    private OtpErlangTuple make2Tuple(final String scannerModuleName, final String path) {
        return new OtpErlangTuple(new OtpErlangObject[] {
                new OtpErlangAtom(scannerModuleName), new OtpErlangString(path) });
    }
View Full Code Here


            final IErlImport erlImport, final boolean arityOnly) {
        if (res instanceof OtpErlangList) {
            final OtpErlangList resl = (OtpErlangList) res;
            for (final OtpErlangObject i : resl) {
                // {FunWithArity, FunWithParameters, [{Offset, Length}], Doc}
                final OtpErlangTuple f = (OtpErlangTuple) i;
                final String funWithArity = ((OtpErlangString) f.elementAt(0))
                        .stringValue();
                if (!filterImported(erlImport, funWithArity)) {
                    continue;
                }
                String funWithParameters = arityOnly ? funWithArity
                        : ((OtpErlangString) f.elementAt(1)).stringValue();
                final OtpErlangList parOffsets = (OtpErlangList) f.elementAt(2);
                String docStr = null;
                if (f.arity() > 3) {
                    final OtpErlangObject elt = f.elementAt(3);
                    if (elt instanceof OtpErlangString) {
                        docStr = HTMLPrinter.asHtml(Util.stringValue(elt));
                    }
                }
View Full Code Here

    }

    void addOffsetsAndLengths(final OtpErlangList parOffsets,
            final int replacementOffset, final List<Point> result) {
        for (final OtpErlangObject i : parOffsets) {
            final OtpErlangTuple t = (OtpErlangTuple) i;
            final OtpErlangLong offset = (OtpErlangLong) t.elementAt(0);
            final OtpErlangLong length = (OtpErlangLong) t.elementAt(1);
            try {
                result.add(new Point(offset.intValue() + replacementOffset, length
                        .intValue()));
            } catch (final OtpErlangRangeException e) {
            }
View Full Code Here

        if (result == null) {
            return;
        }
        final List<String> warnings = ErlideDialyze.formatWarnings(backend, result);
        for (int i = 0; i < warnings.size(); i++) {
            final OtpErlangTuple t = (OtpErlangTuple) result.elementAt(i);
            final OtpErlangTuple fileLine = (OtpErlangTuple) t.elementAt(1);
            final String filename = Util.stringValue(fileLine.elementAt(0));
            final OtpErlangLong lineL = (OtpErlangLong) fileLine.elementAt(1);
            if (!filename.isEmpty()) {
                int line = 1;
                try {
                    line = lineL.intValue();
                } catch (final OtpErlangRangeException e) {
View Full Code Here

    }

    private static void processResult(final IOtpRpc backend, final OtpErlangObject o)
            throws DialyzerErrorException {
        if (o instanceof OtpErlangTuple) {
            final OtpErlangTuple t = (OtpErlangTuple) o;
            final OtpErlangAtom whatA = (OtpErlangAtom) t.elementAt(0);
            final String what = whatA.toString();
            final OtpErlangObject result = t.elementAt(1);

            if ("warnings".equals(what)) {
                DialyzerMarkerUtils.addDialyzerWarningMarkersFromResultList(backend,
                        (OtpErlangList) result);
            } else if ("dialyzer_error".equals(what)) {
View Full Code Here

        if (result == null) {
            throw new DialyzerErrorException(
                    "Could not execute dialyzer, please check settings.");
        }
        if (result instanceof OtpErlangTuple) {
            final OtpErlangTuple t = (OtpErlangTuple) result;
            if (t.arity() > 0) {
                final OtpErlangObject element = t.elementAt(0);
                if (element instanceof OtpErlangLong) {
                    final OtpErlangLong l = (OtpErlangLong) element;
                    try {
                        final int d = l.intValue();
                        if (d == 0 || d == 1 || d == 2) {
                            return;
                        }
                    } catch (final OtpErlangRangeException e) {
                    }
                }
            }
            final String s = Util.ioListToString(t.elementAt(1), MAX_MSG_LEN + 10);
            final String r = s.replaceAll("\\\\n", "\n");
            if (s.length() > MAX_MSG_LEN) {
                ErlLogger.error("%s", s);
            }
            throw new DialyzerErrorException(r);
View Full Code Here

          final OtpErlangObject source0 = OtpErlang.parse(src);
          final OtpErlangList source = ((OtpErlangList) source0);
          OtpErlangObject[] _elements = source.elements();
          for (final OtpErlangObject item0 : _elements) {
            {
              final OtpErlangTuple item = ((OtpErlangTuple) item0);
              OtpErlangObject _elementAt = item.elementAt(0);
              final String tag = ((OtpErlangAtom) _elementAt).atomValue();
              OtpErlangObject _elementAt_1 = item.elementAt(1);
              String _stringValue = ((OtpErlangString) _elementAt_1).stringValue();
              final String message = _stringValue.replaceAll("\\\\n", "\n");
              final int myarity = ErlProblems.arity(message);
              final ProblemData problemData = new ProblemData(tag, message, myarity);
              this.data.add(problemData);
View Full Code Here

            res = backend.call(ERLIDE_DEBUG, "start_debug", "i", debugFlags);
        } catch (final RpcException e) {
            ErlLogger.warn(e);
        }
        if (res instanceof OtpErlangTuple) {
            final OtpErlangTuple t = (OtpErlangTuple) res;
            final OtpErlangObject o = t.elementAt(1);
            final IStatus s = new Status(IStatus.ERROR, BackendActivator.PLUGIN_ID,
                    DebugException.REQUEST_FAILED, o.toString(), null);
            throw new DebugException(s);
        }
        final OtpErlangPid pid = (OtpErlangPid) res;
View Full Code Here

            final OtpErlangPid jpid) {
        OtpErlangObject res = null;
        try {
            res = backend.call(ERLIDE_DEBUG, "attached", "xx", pid, jpid);
            if (res instanceof OtpErlangTuple) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangPid meta = (OtpErlangPid) t.elementAt(1);
                return meta;
            }
            return null;
        } catch (final RpcException e) {
            ErlLogger.warn(e);
View Full Code Here

            final OtpErlangPid pid, final String item) {
        try {
            final OtpErlangObject res = backend.call(ERLIDE_DEBUG, "process_info", "pa",
                    pid, item);
            if (res instanceof OtpErlangTuple) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                return t.elementAt(1);
            }
        } catch (final RpcException e) {
            ErlLogger.warn(e);
        }
        return null;
View Full Code Here

TOP

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

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.