コード例 #1
0
        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);
 }
コード例 #4
0
 public RxNode <TLetter> Accept(RegexAccept node, Context context)
 {
     return(new RxAccept <TLetter>(node.Inner.Visit(this, context), node.Symbol, node.Precedence));
 }