public static RegexExpression Parse(string regex, SymbolId?acceptSymbol, bool ignorePatternWhitespace = true, bool breakOnSlash = false)
        {
            var state = new RegexParser(null, ignorePatternWhitespace, breakOnSlash);

            RegexLexer.Create(state.ProcessTerminal).Push(regex.Append(Utf16Chars.EOF));
            var result = state.Flush();

            return(acceptSymbol.HasValue ? RegexAccept.Create(result, acceptSymbol.Value) : result);
        }
Пример #2
0
 public RegexExpression MatchGrapheme(RegexMatchGrapheme node, KeyValuePair <SymbolId, int?> context)
 {
     return(RegexAccept.Create(node, context.Key, context.Value));
 }
Пример #3
0
 public RegexExpression Accept(RegexAccept node, KeyValuePair <SymbolId, int?> context)
 {
     return(node);
 }
 public RxNode <TLetter> Accept(RegexAccept node, Context context)
 {
     return(new RxAccept <TLetter>(node.Inner.Visit(this, context), node.Symbol, node.Precedence));
 }