예제 #1
0
        public void RealLife2()
        {
            string path = @"..\..\ParserTests\RealLife2.4gl";

            using (TextReader tr = new StreamReader(path))
            {
                GeneroParser p    = GeneroParserFactory.CreateParser(typeof(Genero4glParser), tr, po);
                var          node = p.ParseFile();
                int          i    = 0;
            }
        }
예제 #2
0
        public void EmptyFileTest()
        {
            string path = @"..\..\ParserTests\EmptyFile.4gl";

            using (TextReader tr = new StreamReader(path))
            {
                GeneroParser p    = GeneroParserFactory.CreateParser(typeof(Genero4glParser), tr, po);
                var          node = (Genero4glAst)p.ParseFile();
                Assert.IsNotNull(node);
                Assert.IsTrue(_errorSink.Errors.Count == 0);
                Assert.IsTrue(node.Body.Children.Count == 0);
            }
        }
예제 #3
0
        public void HardcodedParserTest()
        {
            //string codeSample = "globals\n\tdefine x, y record\n\tz smallint, a int\nend record\nend globals";
            //string codeSample = "globals\n\tdefine x, y record like tablename.*\nend globals";
            //string codeSample = "globals\n\tdefine x, y record like tablename.*\nend globals\n\n\nmain\n\tdefine x, y smallint\n\nend main";
            string codeSample = "globals\n\tdefine x, y like tablename.*\nend globals\n\n\nmain\n\tdefine x, y smallint\n\nend main";

            using (TextReader tr = new StringReader(codeSample))
            {
                GeneroParser p    = GeneroParserFactory.CreateParser(typeof(Genero4glParser), tr, po);
                var          node = p.ParseFile();
                int          i    = 0;
            }
        }