package com.poco.StaticAnalysis;
import com.poco.PoCoParser.PoCoLexer;
import com.poco.PoCoParser.PoCoParser;
import org.antlr.v4.runtime.tree.*;
import org.antlr.v4.runtime.*;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;

public class StaticAnalysis {
    LinkedHashSet<String> methods = new LinkedHashSet<String>();

    public void StaticAnalysis(CharStream input, LinkedHashSet<String> possibleinputs)
    {
        Iterator<String> itr = possibleinputs.iterator();
        while (itr.hasNext()) {
            String method = itr.next().replaceAll("\\(.*\\)", "");
            method = method.substring(method.indexOf(' ') + 1);
            methods.add(method);
        }

        PoCoLexer lexer = new PoCoLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        PoCoParser parser = new PoCoParser(tokens);
        ParserRuleContext tree = parser.policy(); // parse
        ParseTreeWalker walker = new ParseTreeWalker(); // create standard walker
        try {
            UncoveredExecutionPaths uncoveredExecutionPaths = new UncoveredExecutionPaths(parser, methods);
            walker.walk(uncoveredExecutionPaths, tree);
        }
        catch(Exception ex){}
        try {
            NoMatchingActions noMatchingActions = new NoMatchingActions(parser, methods);
            walker.walk(noMatchingActions, tree);
        }
        catch(Exception ex){}
        try {
            UnusedBindings unusedBindings = new UnusedBindings(parser);
            walker.walk(unusedBindings, tree);
        }
        catch(Exception ex){}
    }
}

@@ -1278,34 +1278,143 @@
 h(Exception ex)%7B
+%0A            System.out.println(%22Error: There was an error performing 'Uncovered Execution Paths'%22);%0A        
 %7D%0A
-
         try %7B%0A  
@@ -1585,24 +1585,127 @@
 ception ex)%7B
+%0A            System.out.println(%22Error: There was an error performing 'No Matching Actions'%22);%0A        
 %7D%0A        tr
@@ -1829,32 +1829,32 @@
 ree);%0A        %7D%0A
-
         catch(Ex
@@ -1865,16 +1865,115 @@
 ion ex)%7B
+%0A            System.out.println(%22Error: There was an error performing 'Unused Bindings'%22);%0A        
 %7D%0A    %7D%0A

Add error messages to catch blocks