Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangTuple


                n = 1;
            } else {
                n = Integer.parseInt(s);
            }
            final OtpErlangLong l = new OtpErlangLong(n);
            final OtpErlangTuple t = new OtpErlangTuple(new OtpErlangObject[] { a, l });
            result.add(t);
        }
        return result;
    }
View Full Code Here


    public static List<String> modules(final IOtpRpc backend) {
        final ArrayList<String> result = new ArrayList<String>();
        try {
            final OtpErlangObject res = backend.call(ERLIDE_XREF, "modules", "");
            if (Util.isOk(res)) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangList l = (OtpErlangList) t.elementAt(1);
                for (final OtpErlangObject i : l) {
                    if (i instanceof OtpErlangAtom) {
                        final OtpErlangAtom m = (OtpErlangAtom) i;
                        result.add(m.atomValue());
                    }
View Full Code Here

                : UNDEFINED);
        result.add(pathVars != null ? pathVars : UNDEFINED);
        result.add(extraSourcePaths != null ? OtpErlang.mkStringList(extraSourcePaths)
                : UNDEFINED);
        result.add(imports != null ? OtpErlang.mkList(imports) : UNDEFINED);
        return new OtpErlangTuple(result.toArray(new OtpErlangObject[] {}));
    }
View Full Code Here

        try {
            final OtpErlangObject res = backend.call(ERLIDE_OPEN,
                    "get_external_module_tree", "x",
                    mkContext(externalModules, null, pathVars, null, null));
            if (Util.isOk(res)) {
                OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangList l = (OtpErlangList) t.elementAt(1);
                final List<ExternalTreeEntry> result = Lists.newArrayListWithCapacity(l
                        .arity());
                for (final OtpErlangObject i : l) {
                    t = (OtpErlangTuple) i;
                    final String parentPath = Util.stringValue(t.elementAt(0));
                    final String path = Util.stringValue(t.elementAt(1));
                    final OtpErlangAtom isModuleA = (OtpErlangAtom) t.elementAt(2);
                    result.add(new ExternalTreeEntry(parentPath, path, isModuleA
                            .atomValue().equals("module")));
                }
                final String msg = "open:external_module_tree <- " + stopwatch;
                if (stopwatch.elapsed(TimeUnit.SECONDS) > 5) {
View Full Code Here

        final SortedSet<String> result = new TreeSet<String>();
        try {
            final OtpErlangObject res = backend.call("erlide_content_assist",
                    "get_variables", "ss", src, prefix);
            if (Util.isOk(res)) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangList l = (OtpErlangList) t.elementAt(1);
                return new TreeSet<String>(Util.asStringList(l));
            }
        } catch (final RpcException e) {
            ErlLogger.error(e);
        }
View Full Code Here

            final String prefix) {
        try {
            final OtpErlangObject res = buildBackend.call("erlide_content_assist",
                    "check_record", "s", prefix);
            if (Util.isOk(res)) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangTuple r = (OtpErlangTuple) t.elementAt(1);
                return new RecordCompletion(r);
            }
        } catch (final RpcException e) {
            ErlLogger.error(e);
        } catch (final OtpErlangRangeException e) {
View Full Code Here

    public OtpErlangList getOtpLibStructure(final IOtpRpc backend) {
        try {
            final OtpErlangObject res = backend.call("erlide_libraries",
                    "get_otp_lib_structure", "s", stateDir);
            if (Util.isOk(res)) {
                final OtpErlangTuple tres = (OtpErlangTuple) res;
                final OtpErlangList lot = (OtpErlangList) tres.elementAt(1);
                return lot;
            }
            ErlLogger.error(res.toString());
        } catch (final RpcException e) {
            ErlLogger.error(e);
View Full Code Here

    public List<String> getLibFiles(final String entry) {
        try {
            final OtpErlangObject res = ideBackend.call("erlide_libraries",
                    "get_lib_files", "ss", entry, stateDir);
            if (Util.isOk(res)) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangList l = (OtpErlangList) t.elementAt(1);
                return Util.asStringList(l);
            }
        } catch (final RpcException e) {
            ErlLogger.error(e);
        }
View Full Code Here

    public Collection<String> getIncludesInDir(final String directory) {
        try {
            final OtpErlangObject res = ideBackend.call(ERLIDE_OPEN, "get_hrls_in_dir",
                    "s", directory);
            if (Util.isOk(res)) {
                final OtpErlangTuple t = (OtpErlangTuple) res;
                final OtpErlangList l = (OtpErlangList) t.elementAt(1);
                return Util.asStringList(l);
            }
        } catch (final RpcException e) {
            ErlLogger.error(e);
        }
View Full Code Here

      }
    }
  }
 
  public static void addSearchResult(final List<ModuleLineFunctionArityRef> result, final OtpErlangObject r) throws OtpErlangRangeException {
    final OtpErlangTuple t = ((OtpErlangTuple) r);
    OtpErlangObject _elementAt = t.elementAt(1);
    final OtpErlangList l = ((OtpErlangList) _elementAt);
    for (final OtpErlangObject i : l) {
      {
        final OtpErlangTuple modLineT = ((OtpErlangTuple) i);
        OtpErlangObject _elementAt_1 = modLineT.elementAt(0);
        final String modName = Util.stringValue(_elementAt_1);
        final OtpErlangObject nameO = modLineT.elementAt(1);
        OtpErlangObject _elementAt_2 = modLineT.elementAt(2);
        final OtpErlangLong arityL = ((OtpErlangLong) _elementAt_2);
        final int arity = arityL.intValue();
        OtpErlangObject _elementAt_3 = modLineT.elementAt(3);
        final String clauseHead = Util.stringValue(_elementAt_3);
        OtpErlangObject _elementAt_4 = modLineT.elementAt(4);
        final OtpErlangAtom subClause = ((OtpErlangAtom) _elementAt_4);
        OtpErlangObject _elementAt_5 = modLineT.elementAt(5);
        final OtpErlangLong offsetL = ((OtpErlangLong) _elementAt_5);
        OtpErlangObject _elementAt_6 = modLineT.elementAt(6);
        final OtpErlangLong lengthL = ((OtpErlangLong) _elementAt_6);
        OtpErlangObject _elementAt_7 = modLineT.elementAt(7);
        final OtpErlangAtom isDef = ((OtpErlangAtom) _elementAt_7);
        String name = null;
        if ((nameO instanceof OtpErlangAtom)) {
          String _atomValue = ((OtpErlangAtom)nameO).atomValue();
          name = _atomValue;
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.