Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangAtom.atomValue()


        for (final OtpErlangObject o : bindings) {
            if (o instanceof OtpErlangTuple) {
                final OtpErlangTuple t = (OtpErlangTuple) o;
                final OtpErlangAtom nameA = (OtpErlangAtom) t.elementAt(0);
                final OtpErlangObject value = t.elementAt(1);
                framesReversed.add(new ErlangVariable(target, nameA.atomValue(), false,
                        value, parent, moduleName, stackFrameNo));
            }
        }
        final List<ErlangVariable> frames = new ArrayList<ErlangVariable>(
                framesReversed.size());
View Full Code Here


        if (entry.arity() != 2)
          throw new IllegalArgumentException("invalid trace: more than a pair of pos/neg and data");
       
        boolean positive = false;
        OtpErlangAtom traceType = (OtpErlangAtom)entry.elementAt(0);
        if (traceType.atomValue().equals("pos"))
          positive = true;
        else
          if (traceType.atomValue().equals("neg"))
            positive = false;
          else
View Full Code Here

        boolean positive = false;
        OtpErlangAtom traceType = (OtpErlangAtom)entry.elementAt(0);
        if (traceType.atomValue().equals("pos"))
          positive = true;
        else
          if (traceType.atomValue().equals("neg"))
            positive = false;
          else
            throw new IllegalArgumentException("invalid trace: got "+entry.elementAt(0)+" instead of pos/neg");
       
        OtpErlangList traceData = (OtpErlangList)entry.elementAt(1);
View Full Code Here

      {
        OtpErlangTuple transition = (OtpErlangTuple) transitionObj;
        if (transition.arity() != 3)
          throw new IllegalArgumentException("expected 3 components in transition "+transition);
        OtpErlangAtom from = (OtpErlangAtom)transition.elementAt(0),label = (OtpErlangAtom)transition.elementAt(1),to = (OtpErlangAtom)transition.elementAt(2);
        CmpVertex fromState = gr.findVertex(VertexID.parseID(from.atomValue())), toState = gr.findVertex(VertexID.parseID(to.atomValue()));
        if (fromState == null)
          if (!checkStates)
          {
            String state = from.atomValue();if (state.isEmpty()) throw new IllegalArgumentException("empty source state");
            fromState = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID( state), gr.config );
View Full Code Here

        OtpErlangAtom from = (OtpErlangAtom)transition.elementAt(0),label = (OtpErlangAtom)transition.elementAt(1),to = (OtpErlangAtom)transition.elementAt(2);
        CmpVertex fromState = gr.findVertex(VertexID.parseID(from.atomValue())), toState = gr.findVertex(VertexID.parseID(to.atomValue()));
        if (fromState == null)
          if (!checkStates)
          {
            String state = from.atomValue();if (state.isEmpty()) throw new IllegalArgumentException("empty source state");
            fromState = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID( state), gr.config );
            gr.transitionMatrix.put(fromState,gr.createNewRow());
          }
          else
              throw new IllegalArgumentException("invalid source state "+from.atomValue());
View Full Code Here

            String state = from.atomValue();if (state.isEmpty()) throw new IllegalArgumentException("empty source state");
            fromState = AbstractLearnerGraph.generateNewCmpVertex(VertexID.parseID( state), gr.config );
            gr.transitionMatrix.put(fromState,gr.createNewRow());
          }
          else
              throw new IllegalArgumentException("invalid source state "+from.atomValue());
       
        if (toState == null)
          if (!checkStates)
          {
            String state = to.atomValue();if (state.isEmpty()) throw new IllegalArgumentException("empty target state");
View Full Code Here

    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      OtpErlangAtom atom = (OtpErlangAtom) arg;
      resultHolder.append('\'');
      stringToText(atom.atomValue(), whatToQuoteForAtom, resultHolder);
      resultHolder.append('\'');
    }

    public void dump(String arg, StringBuffer resultHolder) {
      resultHolder.append('\'');
View Full Code Here

    @Override
    public void dump(OtpErlangObject arg, StringBuffer resultHolder) {
      OtpErlangAtom atom = (OtpErlangAtom) arg;
      resultHolder.append('\'');
      stringToText(atom.atomValue(), whatToQuoteForAtom, resultHolder);
      resultHolder.append('\'');
    }

    public void dump(String arg, StringBuffer resultHolder) {
      resultHolder.append('\'');
View Full Code Here

  @Test
  public void testParse1d()
  {
    String text = " \'this \\'is \\\"fh an \"atom\'   ";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals("this 'is \"fh an \"atom",atom.atomValue());
    checkResponse(runner, "\'this \\'is \"fh an \"atom\'",text);
  }
 
  /** Quoted characters. */
  @Test
 
View Full Code Here

  @Test
  public void testParse1e()
  {
    String text = " \'this \\' is \\\" fh an \"atom\'   ";
    OtpErlangAtom atom = (OtpErlangAtom)ErlangLabel.parseText(text);
    Assert.assertEquals("this ' is \" fh an \"atom",atom.atomValue());
    checkResponse(runner, "\'this \\' is \" fh an \"atom\'",text);
  }
 
  /** Quoted characters. */
  @Test
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.