public static App ReadAppText(string inputString) { //var input = new Antlr4.Runtime.AntlrFileStream(filename); //"..\\..\\Tests\\simple.app" var input = new Antlr4.Runtime.AntlrInputStream(inputString); //"..\\..\\Tests\\simple.app" var lexer = new PreposeGesturesLexer(input); var tokens = new CommonTokenStream(lexer); var parser = new PreposeGesturesParser(tokens); var tree = parser.app(); // parse var visitor = new AppConverter(); var app = (App)visitor.Visit(tree); return(app); }
public static App ReadAppText(string inputString) { //var input = new Antlr4.Runtime.AntlrFileStream(filename); //"..\\..\\Tests\\simple.app" var input = new Antlr4.Runtime.AntlrInputStream(inputString); //"..\\..\\Tests\\simple.app" var lexer = new PreposeGesturesLexer(input); var tokens = new CommonTokenStream(lexer); var parser = new PreposeGesturesParser(tokens); var tree = parser.app(); // parse var visitor = new AppConverter(); var app = (App)visitor.Visit(tree); return app; }
private static App GestureAppFromAntlrInput(ICharStream input) { var lexer = new PreposeGesturesLexer(input); var tokens = new CommonTokenStream(lexer); var parser = new PreposeGesturesParser(tokens); parser.AddErrorListener((IAntlrErrorListener <IToken>) new ParserErrorListener <IToken>()); var tree = parser.app(); // parse var visitor = new AppConverter(); var app = (App)visitor.Visit(tree); return(app); }