Search in sources :

Example 6 with AScene

use of scenelib.annotations.el.AScene in project checker-framework by typetools.

the class AddAnnotatedFor method main.

/**
 * Reads JAIF from the file indicated by the first element, or standard input if the argument
 * array is empty; inserts any appropriate {@code @AnnotatedFor} annotations, based on the
 * annotations defined in the input JAIF; and writes the augmented JAIF to standard output.
 */
public static void main(String[] args) throws IOException, DefException, ParseException {
    AScene scene = new AScene();
    String filename;
    Reader r;
    if (args.length > 0) {
        filename = args[0];
        r = new FileReader(filename);
    } else {
        filename = "System.in";
        r = new InputStreamReader(System.in);
    }
    IndexFileParser.parse(new LineNumberReader(r), filename, scene);
    scene.prune();
    addAnnotatedFor(scene);
    IndexFileWriter.write(scene, new PrintWriter(System.out, true));
}
Also used : AScene(scenelib.annotations.el.AScene) InputStreamReader(java.io.InputStreamReader) LineNumberReader(java.io.LineNumberReader) Reader(java.io.Reader) InputStreamReader(java.io.InputStreamReader) FileReader(java.io.FileReader) FileReader(java.io.FileReader) LineNumberReader(java.io.LineNumberReader) PrintWriter(java.io.PrintWriter)

Aggregations

AScene (scenelib.annotations.el.AScene)6 File (java.io.File)4 IOException (java.io.IOException)4 FileWriter (java.io.FileWriter)2 UserError (org.checkerframework.javacutil.UserError)2 DefException (scenelib.annotations.el.DefException)2 IndexFileWriter (scenelib.annotations.io.IndexFileWriter)2 FileInputStream (java.io.FileInputStream)1 FileOutputStream (java.io.FileOutputStream)1 FileReader (java.io.FileReader)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 LineNumberReader (java.io.LineNumberReader)1 OutputStream (java.io.OutputStream)1 PrintWriter (java.io.PrintWriter)1 Reader (java.io.Reader)1 Map (java.util.Map)1 AnnotationMirror (javax.lang.model.element.AnnotationMirror)1 AnnotationConverter (org.checkerframework.common.wholeprograminference.AnnotationConverter)1 ASceneWrapper (org.checkerframework.common.wholeprograminference.scenelib.ASceneWrapper)1