Exemple #1
0
 /// <summary>
 /// Indicates all sources should be captured in a certain group.
 /// </summary>
 /// <param name="captureGroup">The group.</param>
 /// <returns>The current pattern.</returns>
 public PhiStatementPattern <TInstruction> CaptureSources(CaptureGroup captureGroup)
 {
     foreach (var source in Sources)
     {
         source.CaptureAs(captureGroup);
     }
     return(this);
 }
Exemple #2
0
        /// <summary>
        /// Indicates all variables should be captured in a certain group.
        /// </summary>
        /// <param name="captureGroup">The group.</param>
        /// <returns>The current pattern.</returns>
        public AssignmentStatementPattern <TInstruction> CaptureVariables(CaptureGroup captureGroup)
        {
            foreach (var variable in Variables)
            {
                variable.CaptureAs(captureGroup);
            }

            return(this);
        }
        /// <summary>
        /// Indicates all arguments should be captured in a certain group.
        /// </summary>
        /// <param name="captureGroup">The group.</param>
        /// <returns>The current pattern.</returns>
        public InstructionExpressionPattern <TInstruction> CaptureArguments(CaptureGroup captureGroup)
        {
            foreach (var argument in Arguments)
            {
                argument.CaptureAs(captureGroup);
            }

            return(this);
        }
Exemple #4
0
        /// <summary>
        /// Adds an extracted object to a capture group.
        /// </summary>
        /// <param name="captureGroup">The capture group to add it to.</param>
        /// <param name="value">The extracted object to add.</param>
        public void AddCapturedObject(CaptureGroup captureGroup, object value)
        {
            if (!Captures.TryGetValue(captureGroup, out var objects))
            {
                objects = new List <object>();
                Captures.Add(captureGroup, objects);
            }

            objects.Add(value);
        }
Exemple #5
0
 /// <summary>
 /// Captures the embedded variable.
 /// </summary>
 /// <param name="captureGroup">The capture group to add the extracted variable to.</param>
 /// <returns>The current pattern.</returns>
 public Pattern <Expression <TInstruction> > CaptureVariable(CaptureGroup captureGroup)
 {
     Variable.CaptureAs(captureGroup);
     return(this);
 }