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!"); }
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); }
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); }