Package com.ericsson.otp.erlang

Examples of com.ericsson.otp.erlang.OtpErlangTuple.arity()


     */
    public static ChangesToGraph load(OtpErlangObject obj)
    {
      ChangesToGraph recorder = new ChangesToGraph();
      OtpErlangTuple difference = (OtpErlangTuple)obj;
      if (difference.arity() != 7)
        throw new IllegalArgumentException("expected 7 components in diff");
      if (!((OtpErlangAtom)difference.elementAt(0)).atomValue().equals("statemachinedifference"))
        throw new IllegalArgumentException("first element of a record should be \"statemachinedifference\"");
      OtpErlangList addedTransitions = (OtpErlangList)difference.elementAt(1),removedTransitions = (OtpErlangList)difference.elementAt(2),addedStates = (OtpErlangList)difference.elementAt(3);
      OtpErlangAtom initial_state = (OtpErlangAtom)difference.elementAt(6);     
View Full Code Here


    if (!(obj instanceof OtpErlangTuple))
      throw new IllegalArgumentException("expected a tuple, parsed "+ obj);
    OtpErlangTuple tuple = (OtpErlangTuple) obj;

    ErlangLabel outcome = null;
    switch (tuple.arity()) {
    case 2:
      if (!(tuple.elementAt(0) instanceof OtpErlangAtom))
        throw new IllegalArgumentException(
            "function name should be an atom, got "
                + tuple.elementAt(0));
View Full Code Here

    try
    {
      if (elementAt instanceof OtpErlangTuple)
      {// multi-arg constructor, turn elements of the tuple into arguments for the constructor.
        OtpErlangTuple argTuple = (OtpErlangTuple)elementAt;
        if (argTuple.arity() < 2) throw new IllegalArgumentException("invalid type argument: a list with arity of less than two");
        final int argumentNumber = argTuple.arity()-1;
        Class<OtpErlangList> []argTypes = new Class[argumentNumber];
        for(int i=0;i<argumentNumber;++i) argTypes[i]=OtpErlangList.class;
        @SuppressWarnings("unchecked")
        Class<Signature> sigClass = (Class<Signature>)Class.forName("statechum.analysis.Erlang.Signatures."+((OtpErlangAtom)argTuple.elementAt(0)).atomValue()+"Signature");
View Full Code Here

    {
      if (elementAt instanceof OtpErlangTuple)
      {// multi-arg constructor, turn elements of the tuple into arguments for the constructor.
        OtpErlangTuple argTuple = (OtpErlangTuple)elementAt;
        if (argTuple.arity() < 2) throw new IllegalArgumentException("invalid type argument: a list with arity of less than two");
        final int argumentNumber = argTuple.arity()-1;
        Class<OtpErlangList> []argTypes = new Class[argumentNumber];
        for(int i=0;i<argumentNumber;++i) argTypes[i]=OtpErlangList.class;
        @SuppressWarnings("unchecked")
        Class<Signature> sigClass = (Class<Signature>)Class.forName("statechum.analysis.Erlang.Signatures."+((OtpErlangAtom)argTuple.elementAt(0)).atomValue()+"Signature");
        Constructor<Signature> constructor = sigClass.getConstructor(argTypes);
View Full Code Here

          tuple.elementAt(2), tuple.elementAt(3));
      break;
    default:
      throw new IllegalArgumentException(
          "expected Erlang label, got tuple of arity "
              + tuple.arity() + " in " + tuple);
    }

    // now assign a function name
    ErlangModule mod = ErlangModule
        .findModule(config.getErlangModuleName());
View Full Code Here

    }
    OtpErlangList trace = (OtpErlangList) result.elementAt(2);
    ErlangLabel[] answerDetails = new ErlangLabel[trace.arity()];
    for (int i = 0; i < trace.arity(); ++i) {
      OtpErlangTuple elemAti = (OtpErlangTuple) trace.elementAt(i);
      if (elemAti.arity() < 2 || elemAti.arity() > 3)
        throw new IllegalArgumentException("received tuple " + elemAti
            + " of invalid arity");
      if (elemAti.arity() == 3) {
        if (config.getUseErlangOutputs()) {
          answerDetails[i] = new ErlangLabel(
View Full Code Here

    }
    OtpErlangList trace = (OtpErlangList) result.elementAt(2);
    ErlangLabel[] answerDetails = new ErlangLabel[trace.arity()];
    for (int i = 0; i < trace.arity(); ++i) {
      OtpErlangTuple elemAti = (OtpErlangTuple) trace.elementAt(i);
      if (elemAti.arity() < 2 || elemAti.arity() > 3)
        throw new IllegalArgumentException("received tuple " + elemAti
            + " of invalid arity");
      if (elemAti.arity() == 3) {
        if (config.getUseErlangOutputs()) {
          answerDetails[i] = new ErlangLabel(
View Full Code Here

    for (int i = 0; i < trace.arity(); ++i) {
      OtpErlangTuple elemAti = (OtpErlangTuple) trace.elementAt(i);
      if (elemAti.arity() < 2 || elemAti.arity() > 3)
        throw new IllegalArgumentException("received tuple " + elemAti
            + " of invalid arity");
      if (elemAti.arity() == 3) {
        if (config.getUseErlangOutputs()) {
          answerDetails[i] = new ErlangLabel(
              questionDetails[i].function,
              questionDetails[i].callName,
              questionDetails[i].input, elemAti.elementAt(2));
View Full Code Here

      name = nameTag.atomValue();
        fields = new TreeMap<String, Signature>();
        for(OtpErlangObject obj:fieldDetails)
        {
          OtpErlangTuple nameValue = (OtpErlangTuple)obj;
          if (nameValue.arity() != 2) throw new IllegalArgumentException("Invalid name-type field "+obj+" passed to RecordSignature");
          Signature sig = Signature.buildFromType(nameValue.elementAt(1));
          orderedSignatures.add(sig);
          fields.put(((OtpErlangAtom)nameValue.elementAt(0)).atomValue(),sig);
        }
    }
View Full Code Here

    OtpErlangTuple fileDetails = (OtpErlangTuple) analysisResults.elementAt(0);
    OtpErlangList typeInformation = (OtpErlangList) fileDetails.elementAt(3);
    for (int i = 0; i < typeInformation.arity(); ++i) {
      //System.out.print("\n" + typeInformation.elementAt(i).toString());
      OtpErlangTuple functionDescr = (OtpErlangTuple) typeInformation.elementAt(i);
      if (functionDescr.arity() > 3)
      {
        FuncSignature s = new FuncSignature(config,typeInformation.elementAt(i), null);
        sigs.put(s.getQualifiedName(), s);
      }
      else
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.