/// <summary> /// Constructs an LSLCodeValidator using the given <see cref="ILSLCodeValidatorStrategies" />. /// </summary> /// <see cref="ILSLCodeValidatorStrategies" /> /// <param name="validatorStrategies">The <see cref="ILSLCodeValidatorStrategies" /> to use.</param> /// <exception cref="ArgumentException"> /// If one or more of <paramref name="validatorStrategies" /> properties are /// <c>null</c>. /// </exception> /// <exception cref="ArgumentNullException"><paramref name="validatorStrategies" /> is <c>null</c>.</exception> public LSLCodeValidator(ILSLCodeValidatorStrategies validatorStrategies) { if (validatorStrategies == null) { throw new ArgumentNullException("validatorStrategies"); } ValidatorStrategies = validatorStrategies; string describeNulls; if (!validatorStrategies.IsComplete(out describeNulls)) { throw new ArgumentException(typeof(ILSLCodeValidatorStrategies).Name + " is incomplete:" + Environment.NewLine + Environment.NewLine + describeNulls); } _validatorVisitor = new LSLCodeValidatorVisitor(validatorStrategies); _antlrParserErrorHandler = new LSLAntlrErrorHandler(validatorStrategies.SyntaxErrorListener); }