Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
        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);
        }