Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangAtom


    @Override
    public void execute(final ErlangDebugTarget debugTarget) {
        final OtpErlangTuple t = (OtpErlangTuple) cmds[1];
        final OtpErlangPid pid = (OtpErlangPid) t.elementAt(0);
        final ErlangProcess erlangProcess = debugTarget.getOrCreateErlangProcess(pid);
        final OtpErlangAtom statusA = (OtpErlangAtom) t.elementAt(2);
        final String status = statusA.atomValue();
        erlangProcess.setStatus(status);
        final OtpErlangTuple initialCall = (OtpErlangTuple) t.elementAt(1);
        erlangProcess.setInitialCall(new ErlangFunctionCall(initialCall));
        erlangProcess.fireCreationEvent();
    }
View Full Code Here


                final DebugTraceEvent dt = (DebugTraceEvent) element;
                final OtpErlangTuple t = dt.getTuple();
                final OtpErlangTuple t2 = (OtpErlangTuple) t.elementAt(1);
                switch (columnIndex) {
                case 0:
                    final OtpErlangAtom w = (OtpErlangAtom) t.elementAt(0);
                    final String what = w.atomValue();
                    s = what;
                    break;
                case 1:
                    final OtpErlangTuple ieval = (OtpErlangTuple) t2.elementAt(0);
                    final OtpErlangAtom mod = (OtpErlangAtom) ieval.elementAt(3);
                    final String module = mod.atomValue();
                    final OtpErlangLong lin = (OtpErlangLong) ieval.elementAt(2);
                    s = module;
                    try {
                        final int line = lin.intValue();
                        s += ":" + line; //$NON-NLS-1$
View Full Code Here

        // then
        // they should be returned
        assertEquals(2, children.size());
        assertEquals(1, imports2.size());
        assertEquals(1, imports.size());
        final OtpErlangAtom listAtom = new OtpErlangAtom("lists");
        assertEquals(new OtpErlangTuple(new OtpErlangObject[] {
                listAtom,
                new OtpErlangList(new OtpErlangObject[] { makeTuple2("reverse", 1),
                        makeTuple2("foldl", 3) }) }), imports.get(0));
    }
View Full Code Here

                        .getProject(preprocessorDef), project);
    }

    private OtpErlangTuple makeTuple2(final String functionName, final int arity) {
        return new OtpErlangTuple(new OtpErlangObject[] {
                new OtpErlangAtom(functionName), new OtpErlangLong(arity) });
    }
View Full Code Here

    @Override
    public OtpErlangObject getSearchObject() {
        if (moduleName == null || moduleName.length() == 0) {
            return makeFAPatternObject(FUNCTION_DEF_ATOM, FUNCTION_CALL_ATOM, name, arity);
        }
        final OtpErlangAtom defA = matchAnyFunctionDefinition ? FUNCTION_DEF_ATOM
                : FUNCTION_DEF_MOD_ATOM;
        return makeMFAPatternObject(defA, EXTERNAL_CALL_ATOM, moduleName, name, arity,
                matchAnyFunctionDefinition);
    }
View Full Code Here

    @Override
    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

    private ArrayList<IErlElement> processFunctionResult(final Shell shell,
            final RpcResult result) throws OtpErlangRangeException {
        final ArrayList<IErlElement> elements = new ArrayList<IErlElement>();
        final OtpErlangObject obj = result.getValue();
        final OtpErlangTuple restuple = (OtpErlangTuple) obj;
        final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
        if (resindicator.atomValue().equals("ok")) {
            final OtpErlangList erlangFunctionList = (OtpErlangList) restuple
                    .elementAt(1);
            for (int i = 0; i < erlangFunctionList.arity(); ++i) {
                final OtpErlangTuple fTuple = (OtpErlangTuple) erlangFunctionList
                        .elementAt(i);
View Full Code Here

            ArrayList<IErlElement> modules1 = new ArrayList<IErlElement>();
            ArrayList<IErlElement> modules2 = new ArrayList<IErlElement>();

            final OtpErlangObject obj = res.getValue();
            final OtpErlangTuple restuple = (OtpErlangTuple) obj;
            final OtpErlangAtom resindicator = (OtpErlangAtom) restuple.elementAt(0);
            if (resindicator.atomValue().equals("ok")) {
                final OtpErlangTuple listtuple = (OtpErlangTuple) restuple.elementAt(1);
                final OtpErlangList modList1 = (OtpErlangList) listtuple.elementAt(0);
                final OtpErlangList modList2 = (OtpErlangList) listtuple.elementAt(1);
                modules1 = createErlModuleList(modList1);
                modules2 = createErlModuleList(modList2);
View Full Code Here

                final Object o = getSelectedInTree();
                if (o instanceof OtpErlangTuple) {
                    final OtpErlangTuple t = (OtpErlangTuple) o;
                    final OtpErlangTuple t2 = (OtpErlangTuple) t.elementAt(1);
                    final OtpErlangTuple ieval = (OtpErlangTuple) t2.elementAt(0);
                    final OtpErlangAtom mod = (OtpErlangAtom) ieval.elementAt(3);
                    final String module = mod.atomValue();
                    final OtpErlangLong lin = (OtpErlangLong) ieval.elementAt(2);
                    try {
                        final int line = lin.intValue();
                        gotoModuleLine(module, line);
                    } catch (final OtpErlangRangeException e1) {
View Full Code Here

        String name = "";
        if (m instanceof OtpErlangString) {
            final OtpErlangString element = (OtpErlangString) m;
            name = element.stringValue();
        } else if (m instanceof OtpErlangAtom) {
            final OtpErlangAtom atom = (OtpErlangAtom) m;
            name = atom.atomValue();
        }
        final String[] modNameParts = name.split("/");
        final IErlModule mod = ErlangEngine.getInstance().getModel()
                .findModule(modNameParts[modNameParts.length - 1]);
        return mod;
View Full Code Here

TOP

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

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.