Example #1
0
    static void PrintFile(FileInfo file)
    {
        string fileName = file.FullName;
        //Console.WriteLine ("parsing {0}", fileName);
        Parser p = new Parser();
        p.Parse (new Lexer (new FileReader (fileName)));

        if (p.Errors.count == 0) {
            ErrorVisitor ev = new ErrorVisitor();
            ev.Visit(p.compilationUnit, null);
        }

        if (p.Errors.count == 0 && errorMode) {
            Console.WriteLine ("no errors in {0}", file.Name);
        } else if (p.Errors.count > 0 && !errorMode) {
            Console.WriteLine ("errors in {0}", file.Name);
            foreach (ErrorInfo error in p.Errors.ErrorInformation)
                Console.WriteLine (error.ToString ());
        }
    }
Example #2
0
 public static bool ContainsError(ISymbol symbol)
 {
     return(_instance.Visit(symbol));
 }
Example #3
0
 public static bool ContainsError(ISymbol symbol)
 => s_instance.Visit(symbol);