Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangString


    private void refreshDirs(final IProject project, final OtpErlangObject element) {
        final OtpErlangList list = (OtpErlangList) element;
        final Map<IPath, String> paths = Maps.newHashMap();
        for (final OtpErlangObject ebeam : list) {
            final OtpErlangString beam = (OtpErlangString) ebeam;
            final String sbeam = beam.stringValue();
            IPath p = new Path(sbeam);
            p = p.removeLastSegments(1);
            p = p.removeFirstSegments(project.getLocation().segmentCount());
            p = p.setDevice(null);
            paths.put(p, sbeam);
View Full Code Here


        public OtpErlangObject toTerm(final Iterable<String> value) {
            final List<OtpErlangObject> result = Lists.newArrayList();
            for (final String path : value) {
                result.add(OtpErlang.mkTuple(new OtpErlangAtom(getName()),
                        new OtpErlangString(path)));
            }
            return OtpErlang.mkList(result);
        }
View Full Code Here

        OtpErlangObject res = null;
        final OtpErlangTuple input = new OtpErlangTuple(new OtpErlangObject[] {
                new OtpErlangAtom("external"),
                new OtpErlangAtom(functionCall.getModule()),
                new OtpErlangAtom(functionCall.getName()),
                new OtpErlangInt(functionCall.getArity()), new OtpErlangString("") });
        try {
            res = b.call(ERLIDE_OTP_DOC, "get_doc", "sxs", functionCall.getModule(),
                    input, stateDir);
        } catch (final RpcException e) {
            ErlLogger.warn(e);
View Full Code Here

                try {
                    final OtpErlangObject r1 = backend.call(module, fun, "sii", text,
                            offset, length);
                    return r1;
                } catch (final RpcException e) {
                    return new OtpErlangString("");
                }
            }
        };
    }
View Full Code Here

        final IErlElement element = module.getElementAtLine(0);
        final IErlAttribute attribute = (IErlAttribute) element;
        final IErlElement element2 = module.getElementAtLine(1);
        final IErlAttribute attribute2 = (IErlAttribute) element2;
        final OtpErlangAtom xx = new OtpErlangAtom("xx");
        final OtpErlangString yyHrl = new OtpErlangString("yy.hrl");
        assertEquals(xx, attribute.getValue());
        assertEquals(yyHrl, attribute2.getValue());
    }
View Full Code Here

        final List<OtpErlangObject> result = Lists.newArrayList();
        // order must match definition of #open_context !
        // TODO use a proplist instead?
        result.add(tag);
        result.add(externalModules != null ? new OtpErlangString(externalModules)
                : UNDEFINED);
        result.add(externalIncludes != null ? new OtpErlangString(externalIncludes)
                : UNDEFINED);
        result.add(pathVars != null ? pathVars : UNDEFINED);
        result.add(extraSourcePaths != null ? OtpErlang.mkStringList(extraSourcePaths)
                : UNDEFINED);
        result.add(imports != null ? OtpErlang.mkList(imports) : UNDEFINED);
View Full Code Here

        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

                .getModules(backend, prefix, names, includes);
        if (res instanceof OtpErlangList) {
            final OtpErlangList resList = (OtpErlangList) res;
            for (final OtpErlangObject o : resList) {
                if (o instanceof OtpErlangString) {
                    final OtpErlangString s = (OtpErlangString) o;
                    final String suffix = includes ? "" : ":";
                    final String cpl = quoted(s.stringValue() + suffix, kind);
                    final int prefixLength = prefix.length();
                    result.add(new CompletionProposal(cpl, offset - prefixLength,
                            prefixLength, cpl.length()));
                }
            }
View Full Code Here

        File _createTempDir = Files.createTempDir();
        final String tmpDir = _createTempDir.getAbsolutePath();
        final Function1<IPath, OtpErlangString> _function = new Function1<IPath, OtpErlangString>() {
          public OtpErlangString apply(final IPath it) {
            String _portableString = it.toPortableString();
            return new OtpErlangString(_portableString);
          }
        };
        Iterable<OtpErlangString> _map = IterableExtensions.<IPath, OtpErlangString>map(srcDirs, _function);
        final Function1<IPath, OtpErlangString> _function_1 = new Function1<IPath, OtpErlangString>() {
          public OtpErlangString apply(final IPath it) {
            String _portableString = it.toPortableString();
            return new OtpErlangString(_portableString);
          }
        };
        Iterable<OtpErlangString> _map_1 = IterableExtensions.<IPath, OtpErlangString>map(incDirs, _function_1);
        final Function1<String, OtpErlangString> _function_2 = new Function1<String, OtpErlangString>() {
          public OtpErlangString apply(final String it) {
            return new OtpErlangString(it);
          }
        };
        Iterable<OtpErlangString> _map_2 = IterableExtensions.<String, OtpErlangString>map(libIncs, _function_2);
        Iterable<OtpErlangString> _plus = Iterables.<OtpErlangString>concat(_map_1, _map_2);
        String _portableString = outDir.toPortableString();
        String _string = minOtpVsn.toString();
        final Function1<String, OtpErlangString> _function_3 = new Function1<String, OtpErlangString>() {
          public OtpErlangString apply(final String it) {
            return new OtpErlangString(it);
          }
        };
        Iterable<OtpErlangString> _map_3 = IterableExtensions.<String, OtpErlangString>map(libs, _function_3);
        _xblockexpression = OtpErlang.format(
          "{project_info,~s,~ls,~ls,~s,~x,~s,~ls,~s}", rootDir, _map, _plus, _portableString, opts, _string, _map_3, tmpDir);
View Full Code Here

    public final OtpErlangObject getValue() {
        return value;
    }

    public void setError(final String r) {
        setError(new OtpErlangString(r));
    }
View Full Code Here

TOP

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

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.