Esempio n. 1
0
            public TokenInterQuantifier OneOrMore(QuantifierMode mode = QuantifierMode.Greedy)
            {
                if (Mode == mode && mode == QuantifierMode.Greedy && QuantifierHelper.CanCollapse(Kind, QuantifierKind.OneOrMore))
                {
                    return(new TokenInterQuantifier(PrimitiveEntry, QuantifierHelper.Collapse(Kind, QuantifierKind.OneOrMore), Mode));
                }

                return(new TokenInterQuantifier(AsFragment(), QuantifierKind.OneOrMore, mode));
            }
            public ParserQuantifierEntry ZeroOrMore(QuantifierMode mode = QuantifierMode.Greedy)
            {
                if (Mode == mode && mode == QuantifierMode.Greedy && QuantifierHelper.CanCollapse(Kind, QuantifierKind.ZeroOrMore))
                {
                    return(new ParserQuantifierEntry(PrimitiveEntry, QuantifierHelper.Collapse(Kind, QuantifierKind.ZeroOrMore), Mode));
                }

                return(new ParserQuantifierEntry(AsFragment(), QuantifierKind.ZeroOrMore, mode));
            }