Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangList$Itr


        test(3, "s", new OtpErlangLong(3));
    }

    @Test
    public void cvtListOk_1() throws SignatureException {
        test(new String[] { "a" }, "ls", new OtpErlangList(
                new OtpErlangObject[] { new OtpErlangString("a") }));
    }
View Full Code Here


    }

    @SuppressWarnings("boxing")
    @Test
    public void cvtListOk_2() throws SignatureException {
        test(new Object[] { "a", 35 }, "lx", new OtpErlangList(new OtpErlangObject[] {
                new OtpErlangString("a"), new OtpErlangLong(35) }));
    }
View Full Code Here

                new OtpErlangString("a"), new OtpErlangLong(35) }));
    }

    @Test(expected = SignatureException.class)
    public void cvtListFail_1() throws SignatureException {
        test(new String[] { "a" }, "li", new OtpErlangList(
                new OtpErlangObject[] { new OtpErlangString("a") }));
    }
View Full Code Here

    }

    @SuppressWarnings("boxing")
    @Test(expected = SignatureException.class)
    public void cvtListFail_2() throws SignatureException {
        test(new Object[] { "a", 35 }, "ls", new OtpErlangList(new OtpErlangObject[] {
                new OtpErlangString("a"), new OtpErlangLong(35) }));
    }
View Full Code Here

    // final IErlangFirstThat firstThat);

    // OtpErlangList getPathVars();
    @Test
    public void getPathVars() throws Exception {
        final OtpErlangList pathVars = model.getPathVars(project.getWorkspaceProject());
        final IPathVariableManager pvm = project.getCorrespondingResource()
                .getPathVariableManager();
        final String[] pathVariableNames = pvm.getPathVariableNames();
        final int n = pathVariableNames.length;
        assertEquals(n, pathVars.arity());

        final URI path = getTmpURIPath("");
        pvm.setURIValue(PV, path);
        final OtpErlangList pathVars2 = model.getPathVars(project.getWorkspaceProject());
        assertEquals(n + 1, pathVars2.arity());

        final OtpErlangTuple t = (OtpErlangTuple) pathVars2.elementAt(0);
        final String name = Util.stringValue(t.elementAt(0));
        final String value = pvm.getURIValue(name).getPath();
        String value2 = Util.stringValue(t.elementAt(1));
        if (!value2.startsWith("/")) {
            value2 = "/" + value2;
View Full Code Here

    private PreferencesHelper helper;

    public static OtpErlangList get(final IProject project) {
        final CompilerOptions prefs = new CompilerOptions(project);
        prefs.load();
        final OtpErlangList compilerOptions = prefs.export();
        return compilerOptions;
    }
View Full Code Here

                    if (val != null) {
                        result.add(val);
                    }
                } else if (option instanceof PathsOption) {
                    final Iterable<String> value = (Iterable<String>) optionValue;
                    final OtpErlangList val = (OtpErlangList) ((PathsOption) option)
                            .toTerm(value);
                    for (final OtpErlangObject inc : val.elements()) {
                        result.add(inc);
                    }
                } else if (option instanceof ModuleOption) {
                    final String value = (String) optionValue;
                    final OtpErlangObject val = ((ModuleOption) option).toTerm(value);
                    result.add(val);
                } else if (option instanceof RawOption) {
                    final String value = (String) optionValue;
                    final OtpErlangList val = (OtpErlangList) ((RawOption) option)
                            .toTerm(value);
                    for (final OtpErlangObject item : val.elements()) {
                        result.add(item);
                    }
                } else {
                    try {
                        final OtpErlangList val = ((DefineOption) option)
                                .toTerm((List<Pair<String, String>>) optionValue);
                        if (val != null) {
                            result.addAll(Lists.newArrayList(val.elements()));
                        }
                    } catch (final TermParserException e) {
                        ErlLogger.warn(e);
                    }
                }
            }
        }
        final OtpErlangList list = OtpErlang.mkList(result);
        return list;
    }
View Full Code Here

            final String[] dirList = new String[sd.size()];
            int j = 0;
            for (final IPath sp : sd) {
                dirList[j++] = project.getLocation().toPortableString() + "/" + sp;
            }
            final OtpErlangList res = getSourceClashes(backend, dirList);
            for (int i = 0; i < res.arity(); i++) {
                final OtpErlangTuple t = (OtpErlangTuple) res.elementAt(i);
                final String f1 = ((OtpErlangString) t.elementAt(0)).stringValue();
                final String f2 = ((OtpErlangString) t.elementAt(1)).stringValue();
                MarkerUtils.createProblemMarker(project, null,
                        "duplicated module name in " + f1 + " and " + f2, 0,
                        IMarker.SEVERITY_WARNING);
View Full Code Here

            refreshDirs(project, t.elementAt(2));
        }

        // process compilation messages
        if (t.elementAt(1) instanceof OtpErlangList) {
            final OtpErlangList l = (OtpErlangList) t.elementAt(1);
            MarkerUtils.addErrorMarkers(source, l);
        } else {
            ErlLogger.warn("bad result from builder: %s", t);
        }
View Full Code Here

        completeCompileForYrl(project, source, backend, compilerOptions);
    }

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

TOP

Related Classes of com.ericsson.otp.erlang.OtpErlangList$Itr

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.