예제 #1
0
        public static int Main(string[] args)
        {
            AntlrTool antlr = new AntlrTool(args);

            if (args.Length == 0)
            {
                antlr.Help();
                return(0);
            }

            try
            {
                antlr.ProcessGrammarsOnCommandLine();
            }
            finally
            {
                if (antlr.log)
                {
                    try
                    {
                        string logname = antlr.logMgr.Save();
                        System.Console.WriteLine("wrote " + logname);
                    }
                    catch (IOException ioe)
                    {
                        antlr.errMgr.ToolError(ErrorType.INTERNAL_ERROR, ioe);
                    }
                }
            }

            if (antlr.errMgr.GetNumErrors() > 0)
            {
                return(1);
            }

            return(0);
        }
예제 #2
0
 public UndefChecker(AntlrTool tool, Grammar g, IDictionary <string, RuleAST> ruleToAST)
 {
     this.tool      = tool;
     this.g         = g;
     this.ruleToAST = ruleToAST;
 }
예제 #3
0
 public UndefChecker(AntlrTool tool, Grammar g, IDictionary<string, RuleAST> ruleToAST)
 {
     this.tool = tool;
     this.g = g;
     this.ruleToAST = ruleToAST;
 }
예제 #4
0
 private static void Main(string[] args)
 {
     Environment.ExitCode = AntlrTool.Main(args);
 }
예제 #5
0
        public static int Main(string[] args)
        {
            AntlrTool antlr = new AntlrTool(args);
            if (args.Length == 0)
            {
                antlr.Help();
                return 0;
            }

            try
            {
                antlr.ProcessGrammarsOnCommandLine();
            }
            finally
            {
                if (antlr.log)
                {
                    try
                    {
                        string logname = antlr.logMgr.Save();
                        System.Console.WriteLine("wrote " + logname);
                    }
                    catch (IOException ioe)
                    {
                        antlr.errMgr.ToolError(ErrorType.INTERNAL_ERROR, ioe);
                    }
                }
            }

            if (antlr.errMgr.GetNumErrors() > 0)
            {
                return 1;
            }

            return 0;
        }