Home | History | Annotate | Download | only in executable
      1 package annotations.tests.executable;
      2 
      3 /*>>>
      4 import org.checkerframework.checker.nullness.qual.NonNull;
      5 */
      6 
      7 import java.io.*;
      8 
      9 import annotations.el.*;
     10 import annotations.io.*;
     11 
     12 public class RegurgitateDemo {
     13     public static void main(/*@NonNull*/ String /*@NonNull*/ [] args) {
     14         // String sampleIndexFile = "package pkg: annotation @A: int value class
     15         // foo: @pkg.A(value=dinglewompus)";
     16         /*@NonNull*/ AScene scene = new AScene();
     17         try {
     18             LineNumberReader in = new LineNumberReader(new FileReader("test2-2.jaif"));
     19             IndexFileParser.parse(in, scene);
     20 
     21             System.out.println("regurgitating:");
     22             IndexFileWriter.write(scene, new FileWriter("test2-3.jaif"));
     23         } catch (ParseException p) {
     24             p.printStackTrace(System.err);
     25         } catch (DefException p) {
     26             p.printStackTrace(System.err);
     27         } catch (IOException e) {
     28             // won't happen for a StringReader
     29             assert false;
     30         }
     31         // set a breakpoint here to inspect the scene
     32         System.out.println("finished");
     33     }
     34 }
     35