renames PetriNet to Petrinet and uses the parser as a resource in Main
[petrinet.git] / src / main / java / de / yasc / example / petrinet / PetrinetParser.java
index 9a70a42..21d63a8 100644 (file)
@@ -112,8 +112,8 @@ public final class PetrinetParser implements AutoCloseable {
         }
     }
 
         }
     }
 
-    public PetriNet read() throws IOException {
-        PetriNet result = null;
+    public Petrinet read() throws IOException {
+        Petrinet result = null;
 
         String input;
         int line = 0;
 
         String input;
         int line = 0;
@@ -125,7 +125,7 @@ public final class PetrinetParser implements AutoCloseable {
                     case COMMENT: break;
                     case PLACES:
                         if (result == null) {
                     case COMMENT: break;
                     case PLACES:
                         if (result == null) {
-                            result = new PetriNet(parsedLine.val0);
+                            result = new Petrinet(parsedLine.val0);
                         } else {
                             throw new IOException("places command must occur once");
                         }
                         } else {
                             throw new IOException("places command must occur once");
                         }
@@ -154,7 +154,7 @@ public final class PetrinetParser implements AutoCloseable {
     }
 
     @Override
     }
 
     @Override
-    public void close() throws Exception {
+    public void close() throws IOException {
         reader.close();
     }
 }
         reader.close();
     }
 }