Examples of ErrorFatal


Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

    }

    /** Helper method to write out a full XML file. */
    public void writeXML(PrintWriter writer, Iterable<Func> macros, Map<String,String> sourceFiles) throws Err {
        A4SolutionWriter.writeInstance(null, this, writer, macros, sourceFiles);
        if (writer.checkError()) throw new ErrorFatal("Error writing the solution XML file.");
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

    }

    /** Helper method to write out a full XML file. */
    public void writeXML(A4Reporter rep, PrintWriter writer, Iterable<Func> macros, Map<String,String> sourceFiles) throws Err {
        A4SolutionWriter.writeInstance(rep, this, writer, macros, sourceFiles);
        if (writer.checkError()) throw new ErrorFatal("Error writing the solution XML file.");
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

          int lastSize = (-1);
          while(true) {
             A4TupleSet ts = (A4TupleSet)(sol.eval(expr.minus(sum)));
             int n = ts.size();
             if (n<=0) break;
             if (lastSize>0 && lastSize<=n) throw new ErrorFatal("An internal error occurred in the evaluator.");
             lastSize=n;
             Type extra = ts.iterator().next().type();
             type = type.merge(extra);
             sum = sum.plus(extra.toExpr());
          }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

           if (sol!=null && x!=Sig.UNIV && x!=Sig.SIGINT && x!=Sig.SEQIDX) {
              ts = (A4TupleSet)(sol.eval(x));
              for(A4Tuple t: ts.minus(ts2))  Util.encodeXMLs(out, "   <atom label=\"", t.atom(0), "\"/>\n");
           }
       } catch(Throwable ex) {
           throw new ErrorFatal("Error evaluating sig " + x.label, ex);
       }
       if (x instanceof SubsetSig) for(Sig p:((SubsetSig)x).parents) Util.encodeXMLs(out, "   <type ID=\"", map(p), "\"/>\n");
       out.print("</sig>\n");
       for(Field field: x.getFields()) writeField(field);
       return ts;
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

          if (x.isMeta!=null) out.print("\" meta=\"yes");
          out.print("\">\n");
          writeExpr("", x);
          out.print("</field>\n");
       } catch(Throwable ex) {
          throw new ErrorFatal("Error evaluating field "+x.sig.label+"."+x.label, ex);
       }
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

          if (x.type().hasNoTuple()) return;   // we do not allow "none" in the XML file's type declarations
          StringBuilder sb = new StringBuilder();
          Util.encodeXMLs(sb, "\n<skolem label=\"", x.label, "\" ID=\"", map(x), "\">\n");
          if (writeExpr(sb.toString(), x)) { out.print("</skolem>\n"); }
       } catch(Throwable ex) {
          throw new ErrorFatal("Error evaluating skolem "+x.label, ex);
       }
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

                StringBuilder sb = new StringBuilder();
                Util.encodeXMLs(sb, "\n<skolem label=\"", label, "\" ID=\"m"+m+"\">\n");
                if (writeExpr(sb.toString(), f.call())) { out.print("</skolem>\n"); }
                m++;
            } catch(Throwable ex) {
                throw new ErrorFatal("Error evaluating skolem "+label, ex);
            }
        }
        out.print("\n</instance>\n");
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

            if (sources!=null) for(Map.Entry<String,String> e: sources.entrySet()) {
                Util.encodeXMLs(out, "\n<source filename=\"", e.getKey(), "\" content=\"", e.getValue(), "\"/>\n");
            }
            out.print("\n</alloy>\n");
        } catch(Throwable ex) {
            if (ex instanceof Err) throw (Err)ex; else throw new ErrorFatal("Error writing the solution XML file.", ex);
        }
        if (out.checkError()) throw new ErrorFatal("Error writing the solution XML file.");
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

    /** Write the metamodel as &lt;instance&gt;..&lt;/instance&gt; in XML format. */
    public static void writeMetamodel(ConstList<Sig> sigs, String originalFilename, PrintWriter out) throws Err {
        try {
            new A4SolutionWriter(null, null, sigs, 4, 4, "show metamodel", originalFilename, out, null);
        } catch(Throwable ex) {
            if (ex instanceof Err) throw (Err)ex; else throw new ErrorFatal("Error writing the solution XML file.", ex);
        }
        if (out.checkError()) throw new ErrorFatal("Error writing the solution XML file.");
    }
View Full Code Here

Examples of edu.mit.csail.sdg.alloy4.ErrorFatal

            Map<String,String> fc = new LinkedHashMap<String,String>();
            fc.put("", content);
            CompModule u=CompParser.alloy_parseStream(new ArrayList<Object>(), null, fc, null, 0, "", "", 1);
            return ConstList.make(u.getAllCommands());
        } catch(IOException ex) {
            throw new ErrorFatal("IOException occurred: "+ex.getMessage(), ex);
        } catch(Throwable ex) {
            if (ex instanceof Err) throw (Err)ex; else throw new ErrorFatal("Unknown exception occurred: "+ex, ex);
        }
    }
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.