Ejemplo n.º 1
0
 /// <summary>Annotates the AST with information on quantifiers and capturing groups.</summary>
 /// <param name="info">Collects information from the AST in which this is embedded.</param>
 public override void Annotate(AnnotationVisitor info)
 {
 }
Ejemplo n.º 2
0
 /// <summary>Annotates the AST with information on quantifiers and capturing groups.</summary>
 /// <param name="info">Collects information from the AST in which this is embedded.</param>
 public override void Annotate(AnnotationVisitor info)
 {
     info.backrefs = true;
     if (CaptureID < 0 || Name == null)
         info.SetCaptureInfo(ref CaptureID, ref Name, position);
 }
Ejemplo n.º 3
0
 /// <summary>Annotates the AST with information on quantifiers and capturing groups.</summary>
 /// <param name="info">Collects information from the AST in which this is embedded.</param>
 public override void Annotate(AnnotationVisitor info)
 {
     if (Property == Unicode7.Property.TextBegin) info.anchor = true;
 }
Ejemplo n.º 4
0
 /// <summary>Initializes and compiles a regular expression, with options that modify the pattern.</summary>
 /// <param name="regexRep">The pattern to be compiled.</param>
 /// <param name="opts">The options desired.</param>
 /// <exception cref="ArgumentException"><paramref name="regexRep"/> is an ill-formed pattern.</exception>
 internal NFABuilder(string regexRep, RegexOptions opts)
 {
     pending = new Queue<ASTTransition>();
     visited = new Dictionary<RegexAST, int>();
     instructIndex = ast =>
     {
         Instructions.Add(ast.ToInstruction(this));
         return Instructions.Count - 1;
     };
     instructIndex = instructIndex.Memoize();
     ParseInfo = new AnnotationVisitor(regexRep);
     SyntaxTree = Parser.Parse(regexRep, opts);
     SyntaxTree.Annotate(ParseInfo);
     IgnoreCase = (opts & RegexOptions.IgnoreCase) != 0;
 }
Ejemplo n.º 5
0
 /// <summary>Annotates the AST with information on quantifiers and capturing groups.</summary>
 /// <param name="info">Collects information from the AST in which this is embedded.</param>
 public override void Annotate(AnnotationVisitor info)
 {
     base.Annotate(info);
     info.backrefs = true;
     if (Index < 0 || Name == null)
         info.SetCaptureInfo(ref Index, ref Name, position);
 }