public JavaDebugProperty(IDebugProperty2 parent, EvaluatedExpression evaluatedExpression) { Contract.Requires<ArgumentNullException>(evaluatedExpression != null, "evaluatedExpression"); _parent = parent; _evaluatedExpression = evaluatedExpression; }
public JavaDebugProperty(IDebugProperty2 parent, string name, string fullName, IType propertyType, IValue value, bool hasSideEffects, IField field = null, IMethod method = null) { Contract.Requires<ArgumentNullException>(name != null, "name"); Contract.Requires<ArgumentNullException>(fullName != null, "fullName"); Contract.Requires<ArgumentNullException>(propertyType != null, "propertyType"); IObjectReference referencer = null; IType valueType = propertyType; bool strongReference = false; _evaluatedExpression = new EvaluatedExpression(name, fullName, default(ILocalVariable), referencer, field, method, default(int?), value, valueType, strongReference, hasSideEffects); }
public static QueryContainer CreateContainer(EvaluatedExpression evaluatedExpression) { return(evaluatedExpression switch { EvaluatedExpression e when e.Operation == ExpressionType.Call || e.CallMethod != null => HandleMethodCalls(evaluatedExpression), EvaluatedExpression e when e.Operation == ExpressionType.Equal || e.Operation == ExpressionType.NotEqual => new QueryContainer(new MatchQuery() { Field = new Field(evaluatedExpression.PropertyName.ToLowerCamelCase() + ((evaluatedExpression.Value is string) ? ".keyword" : string.Empty)), Query = evaluatedExpression.Value.ToStringExtendend() }), EvaluatedExpression e when e.Value.IsNumeric() => HandleNumeric(evaluatedExpression), EvaluatedExpression e when e.Value is DateTime => HandleDateTime(evaluatedExpression), _ => null });
private JavaDebugProperty(JavaDebugProperty parent, string name, IType type) { Contract.Requires<ArgumentNullException>(parent != null, "parent"); Contract.Requires<ArgumentNullException>(name != null, "name"); Contract.Requires<ArgumentNullException>(type != null, "type"); Contract.Requires<ArgumentException>(!string.IsNullOrEmpty(name)); _parent = parent; _evaluatedExpression = new EvaluatedExpression( name, parent._evaluatedExpression.FullName, parent._evaluatedExpression.LocalVariable, parent._evaluatedExpression.Referencer, parent._evaluatedExpression.Field, parent._evaluatedExpression.Method, parent._evaluatedExpression.Index, parent._evaluatedExpression.Value, type, parent._evaluatedExpression.StrongReference, parent._evaluatedExpression.HasSideEffects); _useRawValues = parent._useRawValues; _preventMostDerived = parent._preventMostDerived; }
private IDebugProperty2 EvaluateImpl(enum_EVALFLAGS flags) { ITreeNodeStream input = new CommonTreeNodeStream(_expression); DebugExpressionEvaluatorWalker walker = new DebugExpressionEvaluatorWalker(input, _context.StackFrame.StackFrame); EvaluatedExpression evaluatedExpression = walker.standaloneExpression(); // make sure the Name and FullName of the evaluated expression match what the user typed evaluatedExpression = new EvaluatedExpression( _expressionText, _expressionText, evaluatedExpression.LocalVariable, evaluatedExpression.Referencer, evaluatedExpression.Field, evaluatedExpression.Method, evaluatedExpression.Index, evaluatedExpression.Value, evaluatedExpression.ValueType, evaluatedExpression.StrongReference, evaluatedExpression.HasSideEffects); return new JavaDebugProperty(null, evaluatedExpression); }