/// <summary> /// Indicates the pattern should match on instances with the provided number of arguments. /// </summary> /// <param name="argumentCount">The number of arguments the expression should have.</param> /// <returns>The current pattern.</returns> public InstructionExpressionPattern <TInstruction> WithArguments(int argumentCount) { Arguments.Clear(); for (int i = 0; i < argumentCount; i++) { Arguments.Add(ExpressionPattern.Any <TInstruction>()); } return(this); }
/// <summary> /// Creates a new pattern that matches on instances of <see cref="ExpressionStatement{TInstruction}"/> that /// contain instances of <see cref="InstructionExpression{TInstruction}"/>. /// </summary> /// <param name="instruction">The instruction pattern to match on.</param> /// <returns>The pattern.</returns> public static ExpressionStatementPattern <TInstruction> Instruction <TInstruction>(Pattern <TInstruction> instruction) { return(new ExpressionStatementPattern <TInstruction>(ExpressionPattern.Instruction(instruction))); }