// Token: 0x06000460 RID: 1120 RVA: 0x0000FA84 File Offset: 0x0000DC84 public MonadFilter(string filterText, PSCmdlet cmdlet, ObjectSchema schema, QueryParser.Capabilities capabilities) { QueryParser.EvaluateVariableDelegate evalDelegate = null; QueryParser.ConvertValueFromStringDelegate convertDelegate = new QueryParser.ConvertValueFromStringDelegate(MonadFilter.ConvertValueFromString); if (cmdlet != null) { evalDelegate = new QueryParser.EvaluateVariableDelegate(cmdlet.GetVariableValue); } QueryParser queryParser = new QueryParser(filterText, schema, capabilities, evalDelegate, convertDelegate); this.innerFilter = queryParser.ParseTree; }
internal QueryParser(string query, ObjectSchema schema, QueryParser.Capabilities capabilities, QueryParser.EvaluateVariableDelegate evalDelegate, QueryParser.ConvertValueFromStringDelegate convertDelegate) { if (schema == null) { throw new ArgumentNullException("schema"); } Hashtable allFilterable = new Hashtable(schema.AllFilterableProperties.Count, StringComparer.OrdinalIgnoreCase); foreach (PropertyDefinition propertyDefinition in schema.AllFilterableProperties) { allFilterable.Add(propertyDefinition.Name, propertyDefinition); } this.parser = new Parser(query, capabilities, (string propName) => (PropertyDefinition)allFilterable[propName], null, evalDelegate, convertDelegate); }
private void CheckCapability(QueryParser.Capabilities capability) { if ((this.Capabilities & capability) == (QueryParser.Capabilities) 0) { switch (capability) { case QueryParser.Capabilities.Or: throw new ParsingInvalidFilterOperator("-or", this.query, this.CurPos + 1); case QueryParser.Capabilities.Like: throw new ParsingInvalidFilterOperator("-like", this.query, this.CurPos + 1); case QueryParser.Capabilities.NotLike: throw new ParsingInvalidFilterOperator("-notlike", this.query, this.CurPos + 1); } throw new ParsingInvalidFilterOperator("Unknown", this.query, this.CurPos + 1); } }
internal Parser(string query, QueryParser.Capabilities capabilities, QueryParser.LookupPropertyDelegate schemaLookupDelegate, QueryParser.ListKnownPropertiesDelegate listKnownPropertiesDelegate, QueryParser.EvaluateVariableDelegate evalDelegate, QueryParser.ConvertValueFromStringDelegate convertDelegate) { if (query == null) { throw new ArgumentNullException("query"); } if (convertDelegate == null) { throw new ArgumentNullException("convertDelegate", DataStrings.StringConversionDelegateNotSet); } if (schemaLookupDelegate == null) { throw new ArgumentNullException("schemaLookupDelegate", DataStrings.StringConversionDelegateNotSet); } this.query = query; this.Capabilities = capabilities; this.Variables = new HashSet <string>(); this.schemaLookupDelegate = schemaLookupDelegate; this.listKnownPropertiesDelegate = listKnownPropertiesDelegate; this.evalDelegate = evalDelegate; this.convertDelegate = convertDelegate; this.scanner = new Scanner(query); base.Parse(); }
internal QueryParser(string query, QueryParser.Capabilities capabilities, QueryParser.LookupPropertyDelegate schemaLookupDelegate, QueryParser.ListKnownPropertiesDelegate listKnownPropertiesDelegate, QueryParser.EvaluateVariableDelegate evalDelegate, QueryParser.ConvertValueFromStringDelegate convertDelegate) { this.parser = new Parser(query, capabilities, schemaLookupDelegate, listKnownPropertiesDelegate, evalDelegate, convertDelegate); }