protected internal ConditionalFormula(Formula test, Formula ifTrue, Formula ifFalse) : base(NodeType.Conditional, ifTrue.Type) { Test = test; IfTrue = ifTrue; IfFalse = ifFalse; }
protected internal MethodCallFormula(Formula instance, IMethodDeclaration method, ReadOnlyCollection<Formula> arguments) : base(NodeType.Call, method.ReturnType) { Instance = instance; Method = method; Arguments = arguments; }
protected internal BlockFormula(ReadOnlyCollection<Formula> formulas, Formula result, ReadOnlyCollection<Formula> variables) : base(NodeType.Block, result.Type) { Formulas = formulas; Result = result; Variables = variables; }
protected internal BinaryFormula(NodeType nodeType, Formula left, IMethodDeclaration method, Formula right) : base(nodeType, left.Type) { Left = left; Method = method; Right = right; }
public static MethodCallFormula Call(Formula instance, IMethodDeclaration method, IEnumerable<Formula> arguments) { return Call(instance, method, new ReadOnlyCollection<Formula>(arguments.ToArray())); }
public static PropertyFormula Property(Formula instance, IPropertyDeclaration property) { return new PropertyFormula(instance, property); }
public static PropertyFormula Property(Formula instance, PropertyInfo property) { return Property(instance, property.ToPropertyDecl()); }
public static FieldFormula Field(Formula instance, IFieldDeclaration field) { return new FieldFormula(instance, field); }
public static FieldFormula Field(Formula instance, FieldInfo field) { return Field(instance, field.ToFieldDecl()); }
void EvalConvertWithoutOperandEval(UnaryExpression exp, Formula operand, State state) { state.CurrentScope.PushFormula(Formula.Convert(operand, exp.Type)); }
protected internal UnaryFormula(NodeType nodeType, ITypeDeclaration type, IMethodDeclaration method, Formula operand) : base(nodeType, type) { Method = method; Operand = operand; }
public static MethodCallFormula Call(Formula instance, MethodInfo method, ReadOnlyCollection<Formula> arguments) { return Call(instance, method.ToMethodDecl(), arguments); }
public static MethodCallFormula Call(Formula instance, IMethodDeclaration method, ReadOnlyCollection<Formula> arguments) { return new MethodCallFormula(instance, method, arguments); }
public static AssignFormula Assign(Formula left, Formula right) { return new AssignFormula(left, null, right); }
protected internal PropertyFormula(Formula instance, IPropertyDeclaration property) : base(NodeType.Property, property.PropertyType, instance, property) { }
public void PushFormulaWithVariable(Formula variable) { PushFormula(variable); variables.Push(variable); }
public void PushFormula(Formula formula) { formulas.Push(formula); }
void EvalUnaryWithoutOperandEval(UnaryExpression exp, Formula operand, State state) { switch (exp.NodeType) { case ExpressionType.Convert: EvalConvertWithoutOperandEval(exp, operand, state); return; default: throw new NotImplementedException(); } }
protected internal FieldFormula(Formula instance, IFieldDeclaration field) : base(NodeType.Field, field.FieldType, instance, field) { }
public static ConvertFormula Convert(Formula operand, Type type) { return Convert(operand, type.ToTypeDecl()); }
public static ConvertFormula Convert(Formula operand, ITypeDeclaration type) { return new ConvertFormula(operand, type); }
protected internal ConvertFormula(Formula operand, ITypeDeclaration type) : base(NodeType.Convert, type, null, operand) { }