Examples of FuncSignature


Examples of statechum.analysis.Erlang.Signatures.FuncSignature

   
    Iterator<Label> lblIter = gr.pathroutines.computeAlphabet().iterator();
    ErlangLabel lbl1 = (ErlangLabel)lblIter.next(),lbl2 = (ErlangLabel)lblIter.next();
   
    // now mess up the name of the function,
    FuncSignature fun2 = mod.sigs.get(lbl2.callName);
    mod.sigs.put(lbl1.callName,fun2);// mess up behaviour
    checkForCorrectException(new whatToRun() { public @Override void run() {
      gr.transform.interpretLabelsOnGraph(mod.behaviour.new ConverterErlToMod());
    }},IllegalArgumentException.class,"label already has a function assigned");
  }
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

      ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(file));
      Assert.assertTrue(mod.behaviour instanceof OTPGenServerBehaviour);
      Assert.assertTrue(mod.behaviour.dependencies.isEmpty());
      for(FuncSignature s:mod.sigs.values())
      {
           FuncSignature newSig = new FuncSignature(defaultConfig, ErlangLabel.parseText(s.toErlangTerm()),null);
           Assert.assertEquals(s, newSig);
           Assert.assertEquals(s, new FuncSignature(defaultConfig, ErlangLabel.parseText(newSig.toErlangTerm()),null));
      }
    }
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

              resultValue.add(a);
            }

        }
        assert !resultValue.isEmpty();
        FuncSignature result = new FuncSignature("UNKNOWN",name,argList,
            resultValue.size()>1?new AltSignature(resultValue):resultValue.get(0));
        System.out.println("Args: " + result.instantiateAllArgs().size() + " possibilities");
       
        boolean firstline = true;
        for (List<OtpErlangObject> a : result.instantiateAllArgs()) {
          if (!firstline) {
          System.out.println("|");
          } else {
          firstline = false;
          }
          System.out.println(a);
        }
        System.out.println();
        System.out.println("Result: " + result.instantiateAllResults().size() + " possibilities");

        return result;
    }
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

    {
      String buf = bufArg;
      Map<String,FuncSignature> sigs=  new TreeMap<String,FuncSignature>();
        String spec = getFirstSpec(buf);
        while (spec != null) {
            FuncSignature sig;
            try {
                sig = parseSignatureSpec(spec);
                //sig.argInstances.addAll(seekUsages(sig.funcName, f));
                sigs.put(sig.getName(), sig);
            } catch (FailedToParseException e) {
                sig = null;
            }
            buf = buf.substring(spec.length());
            spec = getFirstSpec(buf);
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

        Assert.assertEquals(1,analysisResults.arity());
        OtpErlangTuple fileDetails = (OtpErlangTuple)analysisResults.elementAt(0);
        OtpErlangList typeInformation = (OtpErlangList) fileDetails.elementAt(3);
        for(int i=0;i<typeInformation.arity();++i)
        {
          FuncSignature s = new FuncSignature(typeInformation.elementAt(i));
          sigs.put(s.toString(), s);
        }

        BufferedReader input = new BufferedReader(new FileReader(f));
        String line = input.readLine();
        while (line != null && !line.startsWith(behaviourToken)) {
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

      }
    }

    public void loadInitArgs() {
        initArgs = new LinkedList<List<OtpErlangObject>>();
        FuncSignature initSig = parent.sigs.get(parent.getName()+":init/1");
        if (initSig != null) // stopgap solution
          initArgs.addAll(initSig.instantiateAllArgs());
        /*
        if (initSig != null) {
            for (String a : initSig.instantiateAllArgs()) {
                // Skip values with variables since we can't instantiate them...
                if ((!(a.matches("^[_A-Z].*") || a.matches(".* [_A-Z].*")))&&(a.length() > 0)) {
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

   
    Iterator<Label> lblIter = gr.pathroutines.computeAlphabet().iterator();
    ErlangLabel lbl1 = (ErlangLabel)lblIter.next(),lbl2 = (ErlangLabel)lblIter.next();
   
    // now mess up the name of the function,
    FuncSignature fun2 = mod.sigs.get(lbl2.callName);
    mod.sigs.put(lbl1.callName,fun2);// mess up behaviour
    final LearnerGraph outcome = new LearnerGraph(gr.config);
    checkForCorrectException(new whatToRun() { public @Override void run() {
      AbstractLearnerGraph.interpretLabelsOnGraph(gr,outcome,mod.behaviour.new ConverterErlToMod());
    }},IllegalArgumentException.class,"label already has a function assigned");
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

      ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(file));
      Assert.assertTrue(mod.behaviour instanceof OTPGenServerBehaviour);
      Assert.assertTrue(mod.behaviour.dependencies.isEmpty());
      for(FuncSignature s:mod.sigs.values())
      {
           FuncSignature newSig = new FuncSignature(defaultConfig, ErlangLabel.parseText(s.toErlangTerm()),null);
           Assert.assertEquals(s, newSig);
           Assert.assertEquals(s, new FuncSignature(defaultConfig, ErlangLabel.parseText(newSig.toErlangTerm()),null));
      }
    }
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

      ErlangModule mod = ErlangModule.loadModule(ErlangModule.setupErlangConfiguration(file));
      Assert.assertTrue(mod.behaviour instanceof OTPGenServerBehaviour);
      Assert.assertTrue(mod.behaviour.dependencies.isEmpty());
      for(FuncSignature s:mod.sigs.values())
      {
           FuncSignature newSig = new FuncSignature(defaultConfig, ErlangLabel.parseText(s.toErlangTerm()),null);
           Assert.assertEquals(s, newSig);
           Assert.assertEquals(s, new FuncSignature(defaultConfig, ErlangLabel.parseText(newSig.toErlangTerm()),null));
      }
    }
View Full Code Here

Examples of statechum.analysis.Erlang.Signatures.FuncSignature

   
    Iterator<Label> lblIter = gr.pathroutines.computeAlphabet().iterator();
    ErlangLabel lbl1 = (ErlangLabel)lblIter.next(),lbl2 = (ErlangLabel)lblIter.next();
   
    // now mess up the name of the function,
    FuncSignature fun2 = mod.sigs.get(lbl2.callName);
    mod.sigs.put(lbl1.callName,fun2);// mess up behaviour
    final LearnerGraph outcome = new LearnerGraph(gr.config);
    checkForCorrectException(new whatToRun() { public @Override void run() {
      AbstractLearnerGraph.interpretLabelsOnGraph(gr,outcome,mod.behaviour.new ConverterErlToMod());
    }},IllegalArgumentException.class,"label already has a function assigned");
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.