Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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);
     }
 }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
 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;
 }
Exemplo n.º 6
0
 public static IAndAlsoFormulaRef AndAlso(IFormulaRef left, IFormulaRef right)
 {
     return AndAlso(left, right, typeof(bool));
 }
Exemplo n.º 7
0
 public static IAddFormulaRef Add(IFormulaRef left, IFormulaRef right)
 {
     Required.NotDefault(left, () => left);
     return new AddFormulaRef(left, right, left.Type, null, null);
 }
Exemplo n.º 8
0
 public static IFormula Accept(IFormulaRef formula, IFormulaVisitor visitor)
 {
     throw new InvalidOperationException("Must convert this to an object implemented IFormula by calling Establish().");
 }
Exemplo n.º 9
0
 public static IConstantFormulaRef Constant(object value, ITypeDeclaration type, IFormulaRef parent)
 {
     return new ConstantFormulaRef(value, type, parent);
 }
Exemplo n.º 10
0
 protected internal TypeAsFormulaRef(ITypeDeclaration type, IFormulaRef operand, IMethodDeclaration method, IFormulaRef parent)
     : base(type, operand, method, parent)
 {
     this.parent = parent;
     this.operand = operand;
 }
Exemplo n.º 11
0
 public static IConditionalFormulaRef Condition(IFormulaRef test)
 {
     return Condition(test, null, null);
 }
Exemplo n.º 12
0
 public static IMultiplyFormulaRef Multiply(IFormulaRef left, IFormulaRef right)
 {
     Required.NotDefault(left, () => left);
     return new MultiplyFormulaRef(left, right, left.Type, null, null);
 }
Exemplo n.º 13
0
 public static INotEqualFormulaRef NotEqual(IFormulaRef left, IFormulaRef right)
 {
     return NotEqual(left, right, typeof(bool));
 }
Exemplo n.º 14
0
 public static IConvertFormulaRef Convert(ITypeDeclaration type, IFormulaRef operand, IMethodDeclaration method, IFormulaRef parent)
 {
     return new ConvertFormulaRef(type, operand, method, parent);
 }
Exemplo n.º 15
0
 public static IExclusiveOrFormulaRef ExclusiveOr(IFormulaRef left, IFormulaRef right)
 {
     Required.NotDefault(left, () => left);
     return new ExclusiveOrFormulaRef(left, right, left.Type, null, null);
 }
Exemplo n.º 16
0
 public static IConvertFormulaRef Convert(IFormulaRef operand, Type type)
 {
     Required.NotDefault(type, () => type);
     return Convert(type.ToTypeDecl(), operand, null, null);
 }
Exemplo n.º 17
0
 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())
 {
 }
Exemplo n.º 18
0
 protected internal ConstantFormulaRef(object value, ITypeDeclaration type, IFormulaRef parent)
     : base(value, type, parent)
 {
     this.Value = value;
     this.parent = parent;
 }
Exemplo n.º 19
0
 public static IAndAlsoFormulaRef AndAlso(IFormulaRef left, IFormulaRef right, Type type)
 {
     Required.NotDefault(type, () => type);
     return new AndAlsoFormulaRef(left, right, type.ToTypeDecl(), null, null);
 }
Exemplo n.º 20
0
 public static INotEqualFormulaRef NotEqual(IFormulaRef left, IFormulaRef right, Type type)
 {
     Required.NotDefault(type, () => type);
     return new NotEqualFormulaRef(left, right, type.ToTypeDecl(), null, null);
 }
Exemplo n.º 21
0
 public static IAssignFormulaRef Assign(IFormulaRef left, IFormulaRef right)
 {
     return new AssignFormulaRef(left, right, null, null, null);
 }
Exemplo n.º 22
0
 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));
 }
Exemplo n.º 23
0
 public static IMethodCallFormulaRef Call(IFormulaRef instance, IMethodDeclaration method, Collection<IFormulaRef> arguments, ITypeDeclaration type, IFormulaRef parent)
 {
     return new MethodCallFormulaRef(instance, method, arguments, type, parent);
 }
Exemplo n.º 24
0
 protected internal ReturnFormulaRef(IFormulaRef @object, ITypeDeclaration type, IFormulaRef parent)
     : base(@object, type, parent)
 {
     this.parent = parent;
     this.@object = @object;
 }
Exemplo n.º 25
0
 public static IConditionalFormulaRef Condition(IFormulaRef test, IFormulaRef ifTrue, IFormulaRef ifFalse)
 {
     return new ConditionalFormulaRef(test, ifTrue, ifFalse, null, null);
 }
Exemplo n.º 26
0
 public static ITypeAsFormulaRef TypeAs(ITypeDeclaration type, IFormulaRef operand, IMethodDeclaration method, IFormulaRef parent)
 {
     return new TypeAsFormulaRef(type, operand, method, parent);
 }
Exemplo n.º 27
0
 public static IReturnFormulaRef Return(IFormulaRef @object)
 {
     Required.NotDefault(@object, () => @object);
     return new ReturnFormulaRef(@object, @object.Type, null);
 }
Exemplo n.º 28
0
 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];
 }
Exemplo n.º 29
0
 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));
 }
Exemplo n.º 30
0
 public static ITypeAsFormulaRef TypeAs(IFormulaRef operand, Type type)
 {
     Required.NotDefault(type, () => type);
     return TypeAs(type.ToTypeDecl(), operand, null, null);
 }