Exemple #1
0
        public void SquareAndCountry()
        {
            var parser = new AntlrStrictParser();

            parser.StartFromRoot = AntlrStrictParser.StartFromRootEnum.square_and_country;
            TestCase(parser, "square_and_country.txt");
        }
        void ParseRealtiesByAntlr(string ownTypeByColumn, string cellText, Person person)
        {
            var parser = new AntlrStrictParser();

            foreach (var item in parser.Parse(cellText))
            {
                RealtyFromText realty = (RealtyFromText)item;
                if (realty.RealtyType != null && realty.RealtyType.Length > 0)
                {
                    RealEstateProperty realEstateProperty = new RealEstateProperty();
                    realEstateProperty.Text         = realty.GetSourceText();
                    realEstateProperty.type_raw     = realty.RealtyType;
                    realEstateProperty.square       = realty.Square;
                    realEstateProperty.country_raw  = realty.Country;
                    realEstateProperty.own_type_raw = realty.OwnType;
                    //???  = realty.RealtyShare; // nowhere to write to
                    realEstateProperty.own_type_by_column = ownTypeByColumn;
                    person.RealEstateProperties.Add(realEstateProperty);
                }
            }
        }
Exemple #3
0
        static void Main(string[] args)
        {
            string input  = ParseArgs(args);
            var    output = input + ".result";
            var    texts  = AntlrCommon.ReadTestCases(input);
            GeneralAntlrParserWrapper parser = null;

            Console.Error.Write(String.Format("Grammar {0}\n", ParseType));
            if (ParseType == "realty_all")
            {
                parser = new AntlrStrictParser();
            }
            else if (ParseType == "country")
            {
                parser = new AntlrCountryListParser();
            }
            else
            {
                Debug.Assert(false);
            }
            parser.BeVerbose();
            AntlrCommon.WriteTestCaseResultsToFile(parser, texts, output);
        }