protected internal EqualFormulaRef(IFormulaRef left, IFormulaRef right, ITypeDeclaration type, IMethodDeclaration method, IFormulaRef parent) : base(left, right, type, method, parent) { this.parent = parent; this.left = left; this.right = right; }
public static IMethodCallFormulaRef Call(IFormulaRef instance, MethodInfo method, params IFormulaRef[] arguments) { if (instance == null) { return Call(method, arguments); } else { Required.NotDefault(method, () => method); Required.NotDefault(arguments, () => arguments); return Call(instance, method.ToMethodDecl(), new Collection<IFormulaRef>(arguments), method.ReturnType.ToTypeDecl(), null); } }
protected internal ConditionalFormulaRef( IFormulaRef test, IFormulaRef ifTrue, IFormulaRef ifFalse, ITypeDeclaration type, IFormulaRef parent) : base(test, ifTrue, ifFalse, type, parent) { this.parent = parent; this.test = test; this.ifTrue = ifTrue; this.ifFalse = ifFalse; }
protected internal MethodCallFormulaRef( IFormulaRef instance, IMethodDeclaration method, Collection<IFormulaRef> arguments, ITypeDeclaration type, IFormulaRef parent) : base(instance, method, arguments.ToReadOnlyWithCast<IFormula>(), type, parent) { this.parent = parent; this.instance = instance; this.arguments = arguments; }
protected internal BlockFormulaRef( IBlockFormulaRef parentBlock, Collection<IBlockFormulaRef> childBlocks, Collection<IFormulaRef> variables, Collection<IFormulaRef> formulas, IFormulaRef result, ITypeDeclaration type, IFormulaRef parent) : base(parentBlock, childBlocks.ToReadOnlyWithCast<IBlockFormula>(), variables.ToReadOnlyWithCast<IFormula>(), formulas.ToReadOnlyWithCast<IFormula>(), result, type, parent) { this.parent = parent; this.parentBlock = parentBlock; this.childBlocks = childBlocks; this.variables = variables; this.formulas = formulas; this.result = result; }
public static IAndAlsoFormulaRef AndAlso(IFormulaRef left, IFormulaRef right) { return AndAlso(left, right, typeof(bool)); }
public static IAddFormulaRef Add(IFormulaRef left, IFormulaRef right) { Required.NotDefault(left, () => left); return new AddFormulaRef(left, right, left.Type, null, null); }
public static IFormula Accept(IFormulaRef formula, IFormulaVisitor visitor) { throw new InvalidOperationException("Must convert this to an object implemented IFormula by calling Establish()."); }
public static IConstantFormulaRef Constant(object value, ITypeDeclaration type, IFormulaRef parent) { return new ConstantFormulaRef(value, type, parent); }
protected internal TypeAsFormulaRef(ITypeDeclaration type, IFormulaRef operand, IMethodDeclaration method, IFormulaRef parent) : base(type, operand, method, parent) { this.parent = parent; this.operand = operand; }
public static IConditionalFormulaRef Condition(IFormulaRef test) { return Condition(test, null, null); }
public static IMultiplyFormulaRef Multiply(IFormulaRef left, IFormulaRef right) { Required.NotDefault(left, () => left); return new MultiplyFormulaRef(left, right, left.Type, null, null); }
public static INotEqualFormulaRef NotEqual(IFormulaRef left, IFormulaRef right) { return NotEqual(left, right, typeof(bool)); }
public static IConvertFormulaRef Convert(ITypeDeclaration type, IFormulaRef operand, IMethodDeclaration method, IFormulaRef parent) { return new ConvertFormulaRef(type, operand, method, parent); }
public static IExclusiveOrFormulaRef ExclusiveOr(IFormulaRef left, IFormulaRef right) { Required.NotDefault(left, () => left); return new ExclusiveOrFormulaRef(left, right, left.Type, null, null); }
public static IConvertFormulaRef Convert(IFormulaRef operand, Type type) { Required.NotDefault(type, () => type); return Convert(type.ToTypeDecl(), operand, null, null); }
protected internal FormulaRef(IConstantNodeRef<NodeType> nodeType, string name, IConstantNodeRef<ITypeDeclaration> type, IFormulaRef parent, params INodeRef[] properties) : this(parent, name, new INodeRef[] { type, parent }.Concat(properties).ToArray()) { }
protected internal ConstantFormulaRef(object value, ITypeDeclaration type, IFormulaRef parent) : base(value, type, parent) { this.Value = value; this.parent = parent; }
public static IAndAlsoFormulaRef AndAlso(IFormulaRef left, IFormulaRef right, Type type) { Required.NotDefault(type, () => type); return new AndAlsoFormulaRef(left, right, type.ToTypeDecl(), null, null); }
public static INotEqualFormulaRef NotEqual(IFormulaRef left, IFormulaRef right, Type type) { Required.NotDefault(type, () => type); return new NotEqualFormulaRef(left, right, type.ToTypeDecl(), null, null); }
public static IAssignFormulaRef Assign(IFormulaRef left, IFormulaRef right) { return new AssignFormulaRef(left, right, null, null, null); }
void EvalInstanceMethodCall(MethodCallExpression exp, State state) { EvalExpression(exp.Object, state); var instance = state.CurrentBlock.Formulas.Pop(); EvalArguments(exp.Arguments, state); var arguments = new IFormulaRef[state.Arguments.Count]; state.Arguments.MoveTo(arguments); state.CurrentBlock.Formulas.Push(FormulaRef.Call(instance, exp.Method, arguments)); }
public static IMethodCallFormulaRef Call(IFormulaRef instance, IMethodDeclaration method, Collection<IFormulaRef> arguments, ITypeDeclaration type, IFormulaRef parent) { return new MethodCallFormulaRef(instance, method, arguments, type, parent); }
protected internal ReturnFormulaRef(IFormulaRef @object, ITypeDeclaration type, IFormulaRef parent) : base(@object, type, parent) { this.parent = parent; this.@object = @object; }
public static IConditionalFormulaRef Condition(IFormulaRef test, IFormulaRef ifTrue, IFormulaRef ifFalse) { return new ConditionalFormulaRef(test, ifTrue, ifFalse, null, null); }
public static ITypeAsFormulaRef TypeAs(ITypeDeclaration type, IFormulaRef operand, IMethodDeclaration method, IFormulaRef parent) { return new TypeAsFormulaRef(type, operand, method, parent); }
public static IReturnFormulaRef Return(IFormulaRef @object) { Required.NotDefault(@object, () => @object); return new ReturnFormulaRef(@object, @object.Type, null); }
FormulaRef(IFormulaRef parent, string name, IList<INodeRef> properties) : base(parent, name, new NodeRefCollection<INode, INodeRef>(properties, parent)) { nodeType = (IConstantNodeRef<NodeType>)properties[0]; type = (IConstantNodeRef<ITypeDeclaration>)properties[1]; }
void EvalStaticMethodCall(MethodCallExpression exp, State state) { EvalArguments(exp.Arguments, state); var arguments = new IFormulaRef[state.Arguments.Count]; state.Arguments.MoveTo(arguments); state.CurrentBlock.Formulas.Push(FormulaRef.Call(exp.Method, arguments)); }
public static ITypeAsFormulaRef TypeAs(IFormulaRef operand, Type type) { Required.NotDefault(type, () => type); return TypeAs(type.ToTypeDecl(), operand, null, null); }