Ejemplo n.º 1
0
        public override List <GeneralParserPhrase> Parse(string inputText)
        {
            try {
                InitLexer(inputText);
                var parser = new Strict(CommonTokenStream, Output, ErrorOutput);
                Parser = parser;
                var visitor = new StrictVisitor(this);
                Antlr4.Runtime.Tree.IParseTree context;
                switch (StartFromRoot)
                {
                case StartFromRootEnum.square_and_country: context = parser.squareAndCountry(); break;

                default: context = parser.realty_list(); break;
                }
                if (StartFromRoot == StartFromRootEnum.square_and_country)
                {
                    parser.ErrorHandler = new BailErrorStrategy();
                }
                visitor.Visit(context);
                return(visitor.Lines);
            }
            catch (Exception e)
            {
                //Logger.Error("exception: {0}", e.Message);
                return(new List <GeneralParserPhrase>());
            }
        }
Ejemplo n.º 2
0
            /// <summary>
            ///     Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.
            /// </summary>
            /// <returns>
            ///     A signed integer that indicates the relative values of <paramref name="x" /> and <paramref name="y" />, as shown in
            ///     the following table.Value Meaning Less than zero<paramref name="x" /> is less than <paramref name="y" />.Zero
            ///     <paramref name="x" /> equals <paramref name="y" />.Greater than zero<paramref name="x" /> is greater than
            ///     <paramref name="y" />.
            /// </returns>
            /// <param name="x">The first object to compare.</param>
            /// <param name="y">The second object to compare.</param>
            public double Compare(Tag <TType> x, Tag <TType> y)
            {
                var res = Strict.Compare(x, y);

                if (res > 0)
                {
                    return(res);
                }
                if (HaveIntersection(x, y))
                {
                    return(1);
                }
                return(0);
            }
Ejemplo n.º 3
0
 public void ThrowExceptionWhenValueIsNull()
 {
     Assert.Throws <ArgumentNullException>(() => new Strict <string>(null));
     Assert.Throws <ArgumentNullException>(() => Strict.Of <string>(null));
 }
Ejemplo n.º 4
0
 public bool TestEqualityOperator <T>(Strict <T> l, Strict <T> r) where T : class
 {
     return(l == r);
 }
Ejemplo n.º 5
0
        public void KeepStringValue(string val)
        {
            var strict = Strict.Of(val);

            Assert.That(strict.Val, Is.EqualTo(val));
        }