Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangString


            if (resindicator.atomValue().equals("ok")) {

                final OtpErlangList modList = (OtpErlangList) restuple.elementAt(1);
                modules = createErlModuleList(modList);
            } else {
                final OtpErlangString s = (OtpErlangString) restuple.elementAt(1);
                MessageDialog.openError(shell, "Error", s.stringValue());
                return;
            }
        } catch (final Exception e) {
            ErlLogger.error(e);
        }
View Full Code Here


        return returnRefsAndOrDefs(refs, defs);
    }

    protected static OtpErlangObject makeIncludePatternObject(final String s) {
        return new OtpErlangTuple(new OtpErlangObject[] { INCLUDE_REF_ATOM,
                new OtpErlangString(s) });
    }
View Full Code Here

    public OtpErlangObject getSearchObject() {
        final OtpErlangObject t = makeSPatternObject(VARIABLE_DEF_ATOM,
                VARIABLE_REF_ATOM, name);
        return new OtpErlangTuple(new OtpErlangObject[] { VARIABLE_PATTERN_ATOM, t,
                new OtpErlangAtom(functionName), new OtpErlangLong(arity),
                new OtpErlangString(head) });
    }
View Full Code Here

        final List<OtpErlangTuple> modules = new ArrayList<OtpErlangTuple>(
                debuggerModules.size());
        for (final String module : debuggerModules) {
            final OtpErlangBinary b = getDebuggerBeam(module);
            if (b != null) {
                final OtpErlangString filename = new OtpErlangString(module + ".erl");
                final OtpErlangTuple t = OtpErlang.mkTuple(new OtpErlangAtom(module),
                        filename, b);
                modules.add(t);
            } else {
                ErlLogger.warn("Could not find debugger module %s", module);
View Full Code Here

    }

    protected OtpErlangList getFieldsName() {
        final ArrayList<OtpErlangString> f = new ArrayList<OtpErlangString>();
        for (final String s : fieldsNames) {
            f.add(new OtpErlangString(s));
        }
        return new OtpErlangList(f.toArray(new OtpErlangString[0]));

    }
View Full Code Here

    protected void parseRefactoringMessage(final OtpErlangTuple resultTuple)
            throws WranglerException {

        final OtpErlangObject wranglerResult = resultTuple.elementAt(1);
        if (!resultTuple.elementAt(0).toString().equals("ok")) {
            final OtpErlangString msg = (OtpErlangString) wranglerResult;
            setUnsuccessful(msg.stringValue());
        } else {
            if (wranglerResult.toString().equals("non_tuple")) {
                fieldCount = 1;
            } else {
                try {
View Full Code Here

                changedFiles = parseFileList((OtpErlangList) wranglerResult);
                setSuccessful();
                return;
            }
        } else {
            final OtpErlangString msg = (OtpErlangString) wranglerResult;
            if (tuple.elementAt(0).toString().equals("warning")) {
                setWarning(msg.stringValue());
            } else if (tuple.elementAt(0).toString().equals("question")) {
                setQuestion(msg.stringValue());
            } else {
                setUnsuccessful(msg.stringValue());
            }
            return;
        }

        throw new WranglerRpcParsingException(tuple.toString());
View Full Code Here

                changedFiles = parseFileList((OtpErlangList) wranglerResult);
                setSuccessful();
                return;
            }
        } else if (state.equals("error")) {
            final OtpErlangString msg = (OtpErlangString) wranglerResult;
            setUnsuccessful(msg.stringValue());
            return;

        } else if (state.equals("multiple_instances")) {
            parameters = new HashMap<GenFunReturnParameterName, OtpErlangObject>();
            final OtpErlangTuple pars = (OtpErlangTuple) wranglerResult;
View Full Code Here

        final List<OtpErlangObject> erlModules = new LinkedList<OtpErlangObject>();
        while (modules != null && modules.hasMoreElements()) {
            final String next = modules.nextElement().toString();
            final String module = next.substring(next.lastIndexOf('/') + 1,
                    next.lastIndexOf('.'));
            erlModules.add(new OtpErlangString(module));
        }

        RpcResult res = WranglerBackendManager.getRefactoringBackend().callWithoutParser(
                "get_user_refactorings", "x",
                new OtpErlangList(erlModules.toArray(new OtpErlangObject[0])));
View Full Code Here

    protected ArrayList<ChangedFile> parseFileList(final OtpErlangList fileList) {
        final ArrayList<ChangedFile> ret = new ArrayList<ChangedFile>();

        OtpErlangTuple e;
        OtpErlangString oldPath, newPath;
        for (int i = 0; i < fileList.arity(); ++i) {
            e = (OtpErlangTuple) fileList.elementAt(i);
            oldPath = (OtpErlangString) e.elementAt(0);
            newPath = (OtpErlangString) e.elementAt(1);
            final String newContent = OtpErlang.asString(e.elementAt(2));

            ret.add(new ChangedFile(oldPath.stringValue(), newPath.stringValue(),
                    newContent));
        }
        return ret;
    }
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.