Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangObject


  public TextRange getPos() {
    try {
      TextRange _xblockexpression = null;
      {
        Iterable<OtpErlangObject> _tail = IterableExtensions.<OtpErlangObject>tail(this.items);
        OtpErlangObject _head = IterableExtensions.<OtpErlangObject>head(_tail);
        final Bindings pos = OtpErlang.match("{{Line,Offset,FileOffset},Len}", _head);
        int _int = pos.getInt("FileOffset");
        int _int_1 = pos.getInt("Len");
        _xblockexpression = new TextRange(_int, _int_1);
      }
View Full Code Here


  }
 
  public String getName() {
    Iterable<OtpErlangObject> _tail = IterableExtensions.<OtpErlangObject>tail(this.items);
    Iterable<OtpErlangObject> _tail_1 = IterableExtensions.<OtpErlangObject>tail(_tail);
    OtpErlangObject _head = IterableExtensions.<OtpErlangObject>head(_tail_1);
    return ((OtpErlangAtom) _head).atomValue();
  }
View Full Code Here

  public int getArg() {
    try {
      Iterable<OtpErlangObject> _tail = IterableExtensions.<OtpErlangObject>tail(this.items);
      Iterable<OtpErlangObject> _tail_1 = IterableExtensions.<OtpErlangObject>tail(_tail);
      Iterable<OtpErlangObject> _tail_2 = IterableExtensions.<OtpErlangObject>tail(_tail_1);
      OtpErlangObject _head = IterableExtensions.<OtpErlangObject>head(_tail_2);
      return ((OtpErlangLong) _head).intValue();
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
View Full Code Here

    private void handleEvent(final OtpErlangObject msg) throws TermParserException,
            OtpErlangException {
        final OtpErlangTuple tuple = (OtpErlangTuple) msg;
        final String tag = ((OtpErlangAtom) tuple.elementAt(0)).atomValue();
        final OtpErlangObject value = tuple.elementAt(1);

        TestCaseData test;
        if ("init".equals(tag)) {
            // value = {Dir, Suite, Case}
            label.setText("Started: " + formatTitle(value)
                    + ". Compiling files, please wait...");
            treeViewer.getTree().setCursor(
                    treeViewer.getTree().getShell().getDisplay()
                            .getSystemCursor(SWT.CURSOR_WAIT));
        } else if ("start_failed".equals(tag)) {
            // value = ?
        } else if ("log_started".equals(tag)) {
            // value = Dir
            treeViewer.getTree().setCursor(
                    treeViewer.getTree().getShell().getDisplay()
                            .getSystemCursor(SWT.CURSOR_ARROW));
        } else if ("start".equals(tag)) {
            // value = {Module, Function}
            final Bindings bindings = OtpErlang.match("{M:a,F:a}", value);
            final String mod = bindings.getAtom("M");
            final String fun = bindings.getAtom("F");
            test = findCase(mod, fun);
            test.setRunning();
        } else if ("result".equals(tag)) {
            // value = {Module, Function, Result}
            final Bindings bindings = OtpErlang.match("{M:a,F:a,R}", value);
            final String mod = bindings.getAtom("M");
            final String fun = bindings.getAtom("F");
            final OtpErlangObject result = bindings.get("R");
            test = findCase(mod, fun);
            if (result instanceof OtpErlangAtom) {
                test.setSuccesful();
                // } else {
                // final BindingsImpl bindings =
                // OtpErlang.match("{failure,{M:a,F:a},L,R}", result);
                // final OtpErlangObject locations = bindings.get("L");
                // final OtpErlangObject reason = bindings.get("R");
                // test.setFailed(reason, locations);
            }
        } else if ("fail".equals(tag)) {
            // value = {{Module, Function}, [Locations], Reason
            final Bindings bindings = OtpErlang.match("{{M:a,F:a},L,R}", value);
            final String mod = bindings.getAtom("M");
            final String fun = bindings.getAtom("F");
            final Collection<OtpErlangObject> locations = bindings.getList("L");
            final OtpErlangObject reason = bindings.get("R");
            test = findCase(mod, fun);
            test.setFailed(reason, locations);
        } else if ("skip".equals(tag)) {
            // value = {Module, Function, Comment
            final Bindings bindings = OtpErlang.match("{M:a,F:a,C}", value);
            final String mod = bindings.getAtom("M");
            final String fun = bindings.getAtom("F");
            final OtpErlangObject reason = bindings.get("C");
            test = findCase(mod, fun);
            test.setSkipped(reason);
        } else if ("done".equals(tag)) {
            // value = Module, Log, {Successful,Failed,Skipped}, [Results]}
            final Bindings bindings = OtpErlang.match("{M,L,{S:i,F:i,K:i},R}", value);
View Full Code Here

        // TODO should use some kind of notification!
        while (!waiting.isEmpty()) {
            for (final Entry<RpcFuture, IResource> result : waiting) {
                notifier.checkCancel();
                OtpErlangObject r;
                try {
                    r = result.getKey().get(100, TimeUnit.MILLISECONDS);
                } catch (final Exception e) {
                    r = null;
                }
View Full Code Here

                    final ErlSearchScope scope = new ErlSearchScope();
                    scope.addModule(theModule);
                    final List<ModuleLineFunctionArityRef> findRefs = Lists
                            .newArrayList();
                    // TODO: should run in background
                    final OtpErlangObject refs = ErlangEngine
                            .getInstance()
                            .getSearchServerService()
                            .findRefs(pattern, scope,
                                    ErlangEngine.getInstance().getStateDir(), true);
                    if (refs != null) {
View Full Code Here

public class TypeConverterTest {

    private void test(final Object o, final String sig, final OtpErlangObject expect)
            throws SignatureException {
        final OtpErlangObject result = TypeConverter.java2erlang(o, sig);
        assertTrue(expect.equals(result));
    }
View Full Code Here

    }

    @Test
    public void cvtConvertible_2() throws SignatureException {
        final Object x = "hej";
        final OtpErlangObject obj = new OtpErlangAtom("hej d�");
        final Object y = TypeConverter.erlang2java(obj, Cvt.class);
        assertTrue(x.equals(y));
    }
View Full Code Here

     * @return
     */
    @Override
    public ErlProjectImport importProject(final String prefix,
            final List<String> importSources) {
        OtpErlangObject res = null;
        try {
            res = backend.call("erlide_import", "import", "sls", prefix, importSources);
            return new ErlProjectImport(res);
        } catch (final RpcException e) {
            ErlLogger.warn(e);
View Full Code Here

        final ITextSelection selection = extendSelectionToWholeLines(document,
                (ITextSelection) sel);
        final ITextSelection getSelection = getTextSelection(document, selection,
                textEditor);
        String text;
        OtpErlangObject r1 = null;
        try {
            text = document.get(getSelection.getOffset(), getSelection.getLength());
            // call erlang, with selection within text
            r1 = callErlang(selection.getOffset() - getSelection.getOffset(),
                    selection.getLength(), text);
View Full Code Here

TOP

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

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.