Пример #1
0
        internal static RegExpParser GetParser(RegExpNotation notation)
        {
            switch (notation)
            {
                case RegExpNotation.POSIXNotation:
                    return new POSIXRegExpParser(Encoding.ASCII);
                case RegExpNotation.MicrosoftNotation:
                    break;
            }

            throw new InvalidOperationException("Not supported regular expression noation!");
        }
Пример #2
0
 public Terminal UseTerminal(string regexp, Func<Token, bool> lexicalAction = null, RegExpNotation notation = RegExpNotation.POSIXNotation)
 {
     tokensNumber++;
     RegExpNotation = notation;
     var regExpObj = mRegexpParser.Parse(regexp);
     return mTokenizer.UseTerminal(regExpObj, lexicalAction);
 }
Пример #3
0
 public void IgnoreTerminal(string ignoree, Func<Token, bool> lexicalAction = null, RegExpNotation notation = RegExpNotation.POSIXNotation)
 {
     tokensNumber++;
     RegExpNotation = notation;
     var regExpObj = mRegexpParser.Parse(ignoree);
     mTokenizer.IgnoreTerminal(regExpObj, lexicalAction);
 }