/// <inheritdoc/> public BaseValidator(IUserDefinedExpression userDefinedExpression) { _script = userDefinedExpression.Script; var actualTree = _script.GetCompilation().SyntaxTrees; _model = _script.GetCompilation().GetSemanticModel(actualTree.Single()); // formulas expect a single root element! _root = (CompilationUnitSyntax)_model.SyntaxTree.GetRoot(); _expression = userDefinedExpression.Expression; }
/// <inheritdoc/> public BaseSyntaxTreeValidator(IUserDefinedExpression userDefinedExpression) : base(userDefinedExpression) { _walker = new SyntaxTreeWalker(this, this._expression, _model); }
/// <inheritdoc/> public StrictWhiteListTypeValidator(IUserDefinedExpression userDefinedExpression) : base(userDefinedExpression) { _typesValidator = new TypesValidator(); }
/// <inheritdoc/> public StrictWhiteListTypeValidator(IUserDefinedExpression userDefinedExpression, TypesValidator typesValidator) : base(userDefinedExpression) { _typesValidator = typesValidator; }
/// <inheritdoc/> public SimpleWhiteListValidator(IUserDefinedExpression userDefinedExpression) : base(userDefinedExpression) { _typesValidator = new TypesValidator(); }
/// <inheritdoc/> public SimpleWhiteListValidator(IUserDefinedExpression userDefinedExpression, TypesValidator typesValidator) : base(userDefinedExpression) { _typesValidator = typesValidator; }