public static void Main(string[] args) { Stream inputStream = Console.OpenStandardInput(); ANTLRInputStream input = new ANTLRInputStream(inputStream); CalculatorLexer lexer = new CalculatorLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); CalculatorParser parser = new CalculatorParser(tokens); parser.stat(); }
public static void Main(string[] args) { Stream inputStream = Console.OpenStandardInput(); ANTLRInputStream input = new ANTLRInputStream(inputStream); CalculatorLexer lexer = new CalculatorLexer(input); CommonTokenStream tokens = new CommonTokenStream(lexer); CalculatorParser parser = new CalculatorParser(tokens); var tree = parser.stat().Tree; Console.WriteLine(tree.ToStringTree()); DumpTree(tree, "", " "); }