Example #1
0
    public static TreeNode parse(string gfile, string ifile)
    {
        var       g      = new Grammar(gfile);
        LL1Parser p      = new LL1Parser(g);
        var       tokens = g.tokenize(ifile);

        return(p.parse(tokens));
    }
Example #2
0
        public void Test_fail()
        {
            var parser = new LL1Parser(_grammar);

            Assert.False(parser.ProcessText(" a + adasda ^ ( b + c )"));
        }
Example #3
0
        public void Test_ok()
        {
            var parser = new LL1Parser(_grammar);

            Assert.True(parser.ProcessText(" a + b >= ( b + c )"));
        }