Package com.ericsson.otp.erlang

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


        Assert.assertEquals(r, ss);
    }

    @Test
    public void sublist_4b() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3,4]");
        final OtpErlangObject ss = r.getNthTail(4);
        Assert.assertEquals(new OtpErlangList(), ss);
    }
View Full Code Here


        Assert.assertEquals(new OtpErlangList(), ss);
    }

    @Test
    public void sublist_4c() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3,4]");
        final OtpErlangObject ss = r.getNthTail(5);
        Assert.assertEquals(null, ss);
    }
View Full Code Here

        Assert.assertEquals(null, ss);
    }

    @Test
    public void sublist_4d() throws TermParserException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3|4]");
        final OtpErlangObject s = termParser.parse("4");
        final OtpErlangObject ss = r.getNthTail(3);
        Assert.assertEquals(s, ss);
    }
View Full Code Here

        Assert.assertEquals(s, ss);
    }

    @Test
    public void sublist_5() throws TermParserException, IOException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3,4]");
        final OtpErlangObject ss = r.getNthTail(2);
        final OtpOutputStream out = new OtpOutputStream();
        ss.encode(out);
        final byte[] contents1 = out.toByteArray();
        out.reset();
        final OtpErlangList s = (OtpErlangList) termParser.parse("[3,4]");
        s.encode(out);
        final byte[] contents2 = out.toByteArray();
        out.close();

        Assert.assertEquals(contents2.length, contents1.length);
        for (int i = 0; i < contents1.length; i++) {
View Full Code Here

        }
    }

    @Test
    public void sublist_6() throws TermParserException, IOException {
        final OtpErlangList r = (OtpErlangList) termParser.parse("[1,2,3|4]");
        final OtpErlangObject ss = r.getNthTail(2);
        final OtpOutputStream out = new OtpOutputStream();
        ss.encode(out);
        final byte[] contents1 = out.toByteArray();
        out.reset();
        final OtpErlangList s = (OtpErlangList) termParser.parse("[3|4]");
        s.encode(out);
        final byte[] contents2 = out.toByteArray();
        out.close();

        Assert.assertEquals(contents2.length, contents1.length);
        for (int i = 0; i < contents1.length; i++) {
View Full Code Here

        List<ExternalTreeEntry> externalModuleTree = cache
                .getExternalTree(externalModules);
        List<ExternalTreeEntry> externalIncludeTree = cache
                .getExternalTree(externalIncludes);
        if (externalModuleTree == null || externalIncludeTree == null) {
            final OtpErlangList pathVars = ErlangEngine.getInstance().getModel()
                    .getPathVars(project.getWorkspaceProject());
            final IOtpRpc backend = OtpRpcFactory.getOtpRpcForProject(project);
            if (externalModuleTree == null && externalModules.length() > 0) {
                if (pm != null) {
                    pm.worked(1);
View Full Code Here

        }
        return true;
    }

    private void addExternalEntries(final IProgressMonitor pm, final IOtpRpc backend) {
        final OtpErlangList structure = ErlangEngine.getInstance()
                .getService(OpenService.class).getOtpLibStructure(backend);
        mkOtpStructureMap(structure);
    }
View Full Code Here

    private void mkOtpStructureMap(final OtpErlangList input) {
        for (final OtpErlangObject o : input) {
            final OtpErlangTuple t = (OtpErlangTuple) o;
            final String lib = ((OtpErlangString) t.elementAt(0)).stringValue();
            final OtpErlangList dirs = (OtpErlangList) t.elementAt(1);
            final String group = OtpErlang.asString(t.elementAt(2));

            final ErlExternalReferenceEntry extLib = new ErlExternalReferenceEntry(this,
                    getLibName(lib), lib, true, false);
            extLib.setGroup(group);
            addChild(extLib);

            for (final OtpErlangObject dir : dirs.elements()) {
                final OtpErlangTuple tdir = (OtpErlangTuple) dir;
                final String dname = ((OtpErlangString) tdir.elementAt(0)).stringValue();
                final OtpErlangList files = (OtpErlangList) tdir.elementAt(1);

                final ErlExternalReferenceEntry subdir = new ErlExternalReferenceEntry(
                        extLib, getLibName(dname), dname, true, includePath(dname));
                extLib.addChild(subdir);

                for (final OtpErlangObject fn : files.elements()) {
                    final String sfn = ((OtpErlangString) fn).stringValue();
                    final IErlModule ext = new ErlModule(subdir, getModuleName(sfn), sfn,
                            Charsets.ISO_8859_1.toString(), null);
                    subdir.addChild(ext);
                }
View Full Code Here

            for (final ErlangFunction f : functions) {
                funsT[j] = f.getNameArityTuple();
                j++;
            }
            final OtpErlangTuple modFunsT = new OtpErlangTuple(new OtpErlangObject[] {
                    new OtpErlangAtom(i.getImportModule()), new OtpErlangList(funsT) });
            result.add(modFunsT);
        }
        return result;
    }
View Full Code Here

    private void handleErlangFiles(final IErlProject erlProject,
            final @NonNull IProject project, final BuildKind kind,
            final IResourceDelta resourceDelta, final BuildNotifier notifier)
            throws CoreException, BackendException {
        final OtpErlangList compilerOptions = CompilerOptions.get(project);

        final Set<BuildResource> resourcesToBuild = getResourcesToBuild(kind, project,
                resourceDelta, notifier);
        final int n = resourcesToBuild.size();
        // if (BuilderHelper.isDebugging()) {
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.