public ValuePort(FlowNode node, string name, Type type, IDefaultValue defaultValue) { this.node = node; this.name = name; this.valueType = type; this.defaultValue = defaultValue; }
public SqlSvr2012SchemaBuilder() { _c = new SqlSvr2012ColumnType(); _n = new SqlSvr2012NullabilityType(); _d = new SqlSvr2012DefaultValue(); }
public override void Visit(IDefaultValue defaultValue) { if (Process(defaultValue)) { visitor.Visit(defaultValue); } base.Visit(defaultValue); }
protected ValuePort <T> AddValueInput <T>(string name, IDefaultValue defaultValue = null) { ValuePort <T> port = new ValuePort <T>(this, name, defaultValue); if (valueInputs == null) { valueInputs = new List <ValuePort>(); } valueInputs.Add(port); return(port); }
/// <summary> /// Initializes a new instance of the <see cref="Property{T}"/> class. /// Constructor for copying. /// </summary> /// <param name="name">Property name.</param> /// <param name="description">Property description.</param> /// <param name="alias">Property alias.</param> /// <param name="defaultValue">Default value function.</param> /// <param name="examples">Examples.</param> /// <param name="calculator">Calculate property value function.</param> internal Property( string name, string?description, string?alias, IDefaultValue <T> defaultValue, IReadOnlyList <T> examples, IPropertyCalculator <T>?calculator) { Name = name; Description = description; Alias = alias; DefaultValue = defaultValue.AssertArgumentNotNull(nameof(defaultValue)); Examples = examples.AssertArgumentNotNull(nameof(examples)); Calculator = calculator; }
protected ValuePort AddValueInput(string name, Type type, IDefaultValue defaultValue = null) { if (cachedAddValueInputGenericMethod == null) { foreach (var mInfo in typeof(FlowNode).GetMethods(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance)) { if (mInfo.Name == "AddValueInput" && mInfo.IsGenericMethod && mInfo.GetParameters().Length == 2) { cachedAddValueInputGenericMethod = mInfo; break; } } } var m = cachedAddValueInputGenericMethod.MakeGenericMethod(type); return((ValuePort)m.Invoke(this, new object[] { name, defaultValue })); }
public void Visit(IDefaultValue defaultValue) { this.result = this.rewriter.Rewrite(defaultValue); }
public virtual void onASTElement(IDefaultValue defaultValue) { }
public IFixedLengthComplexPropertyMapping DefaultValue(IDefaultValue defaultValue) { this.defaultValue = defaultValue; return(this); }
public void Visit(IDefaultValue defaultValue) { this.result = this.copier.Copy(defaultValue); }
private void translateStructDefaultValue(IDefaultValue defaultValue, ITypeReference typ) { // then it is a struct and gets special treatment // translate it as if it were a call to the nullary ctor for the struct type // (which doesn't actually exist, but gets generated for each struct type // encountered during translation) var tok = defaultValue.Token(); var loc = this.sink.CreateFreshLocal(typ); var locExpr = Bpl.Expr.Ident(loc); // First generate an Alloc() call this.StmtTraverser.StmtBuilder.Add(new Bpl.CallCmd(tok, this.sink.AllocationMethodName, new List<Bpl.Expr>(), new List<Bpl.IdentifierExpr>(new Bpl.IdentifierExpr[] {locExpr}))); // Second, generate the call to the appropriate ctor var proc = this.sink.FindOrCreateProcedureForDefaultStructCtor(typ); var invars = new List<Bpl.Expr>(); invars.Add(locExpr); this.StmtTraverser.StmtBuilder.Add(new Bpl.CallCmd(tok, proc.Name, invars, new List<Bpl.IdentifierExpr>())); // Generate an assumption about the dynamic type of the just allocated object this.sink.GenerateDynamicTypeAssume(this.StmtTraverser.StmtBuilder, tok, locExpr, typ); this.TranslatedExpressions.Push(locExpr); }
public ICharPropertyMapping DefaultValue(IDefaultValue defaultValue) { column.DefaultValue = defaultValue; return(this); }
/// <summary> /// Rewrites the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public virtual IExpression Rewrite(IDefaultValue defaultValue) { var mutableDefaultValue = defaultValue as DefaultValue; if (mutableDefaultValue == null) return defaultValue; this.RewriteChildren(mutableDefaultValue); return mutableDefaultValue; }
private HLLocation ProcessDefaultValueExpression(IDefaultValue pExpression) { return HLDefaultLocation.Create(HLDomain.GetOrCreateType(pExpression.DefaultValueType)); }
public override void TraverseChildren(IDefaultValue defaultValue) { base.TraverseChildren(defaultValue); ((DefaultValue)defaultValue).Type = defaultValue.DefaultValueType; }
/// <summary> /// Sets default value and returns this. /// </summary> /// <param name="defaultValue">Default value.</param> /// <returns>The same instance.</returns> public PropertyParser <T> SetDefaultValue(T defaultValue) { DefaultValue = new DefaultValue <T>(defaultValue); return(this); }
/// <summary> /// Generates IL for the specified default value. /// </summary> /// <param name="defaultValue">The default value.</param> public override void TraverseChildren(IDefaultValue defaultValue) { ILocalDefinition temp = new TemporaryVariable(defaultValue.Type, this.method); this.LoadAddressOf(temp, null); this.generator.Emit(OperationCode.Initobj, defaultValue.Type); this.StackSize--; this.LoadLocal(temp); }
public override void TraverseChildren(IDefaultValue defaultValue) { this.PrintToken(VBToken.Null); }
public RealizedParameter(IBlockContext context, FunctionParameter parameter) { name = parameter.name; type = parameter.type.UnderlyingType(context.ModuleContext); defaultValue = DefaultValue.ForParameter(context, parameter); }
public RealizedParameter(string name, RealizedType type, IDefaultValue defaultValue = null) { this.name = name; this.type = type; this.defaultValue = defaultValue; }
private HLLocation ProcessDefaultValueExpression(IDefaultValue pExpression) { return(HLDefaultLocation.Create(HLDomain.GetOrCreateType(pExpression.DefaultValueType))); }
public override void Visit(IDefaultValue defaultValue) { allElements.Add(new InvokInfo(Traverser, "IDefaultValue", defaultValue)); }
/// <summary> /// /// </summary> /// <param name="defaultValue"></param> public DefaultValue(IDefaultValue defaultValue) : base(defaultValue) { this.defaultValueType = defaultValue.DefaultValueType; }
public IDateTimeOffsetPropertyMapping DefaultValue(IDefaultValue defaultValue) { column.DefaultValue = defaultValue; return(this); }
/// <summary> /// Rewrites the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public virtual IExpression Rewrite(IDefaultValue defaultValue) { return defaultValue; }
/// <summary> /// Returns a shallow copy of the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public DefaultValue Copy(IDefaultValue defaultValue) { return new DefaultValue(defaultValue); }
public override void TraverseChildren(IDefaultValue defaultValue) { var typ = defaultValue.Type; if (TranslationHelper.IsStruct(typ)) { translateStructDefaultValue(defaultValue, typ); return; } Bpl.Expr e; var bplType = this.sink.CciTypeToBoogie(typ); if (bplType == Bpl.Type.Int) { var lit = Bpl.Expr.Literal(0); lit.Type = Bpl.Type.Int; e = lit; } else if (bplType == Bpl.Type.Bool) { var lit = Bpl.Expr.False; lit.Type = Bpl.Type.Bool; e = lit; } else if (bplType == this.sink.Heap.RefType) { e = Bpl.Expr.Ident(this.sink.Heap.NullRef); } else if (bplType == this.sink.Heap.UnionType) { e = Bpl.Expr.Ident(this.sink.Heap.DefaultHeapValue); } else if (bplType == this.sink.Heap.RealType) { e = Bpl.Expr.Ident(this.sink.Heap.DefaultReal); } else { throw new NotImplementedException(String.Format("Don't know how to translate type: '{0}'", TypeHelper.GetTypeName(typ))); } TranslatedExpressions.Push(e); return; }
//^ ensures this.path.Count == old(this.path.Count); /// <summary> /// Traverses the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public virtual void Visit(IDefaultValue defaultValue) { if (this.stopTraversal) return; //^ int oldCount = this.path.Count; this.path.Push(defaultValue); this.Visit(defaultValue.DefaultValueType); //^ assume this.path.Count == oldCount+1; //True because all of the virtual methods of this class promise not to decrease this.path.Count. this.path.Pop(); }
public ISeparatedValueComplexPropertyMapping DefaultValue(IDefaultValue defaultValue) { this.defaultValue = defaultValue; return(this); }
/// <summary> /// Traverses the defalut value expression. /// </summary> public void Traverse(IDefaultValue defaultValue) { Contract.Requires(defaultValue != null); if (this.preorderVisitor != null) this.preorderVisitor.Visit(defaultValue); if (this.StopTraversal) return; this.TraverseChildren(defaultValue); if (this.StopTraversal) return; if (this.postorderVisitor != null) this.postorderVisitor.Visit(defaultValue); }
public override void TraverseChildren(IDefaultValue defaultValue) { MethodEnter(defaultValue); base.TraverseChildren(defaultValue); MethodExit(); }
public void Visit(IDefaultValue defaultValue) { this.traverser.Traverse(defaultValue); }
public IEnumPropertyMapping <TEnum> DefaultValue(IDefaultValue defaultValue) { column.DefaultValue = defaultValue; return(this); }
public void Visit(IDefaultValue defaultValue) { Contract.Requires(defaultValue != null); throw new NotImplementedException(); }
/// <summary> /// Returns a deep copy of the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public DefaultValue Copy(IDefaultValue defaultValue) { Contract.Requires(defaultValue != null); Contract.Ensures(Contract.Result<DefaultValue>() != null); var mutableCopy = this.shallowCopier.Copy(defaultValue); this.CopyChildren((Expression)mutableCopy); mutableCopy.DefaultValueType = this.Copy(mutableCopy.DefaultValueType); return mutableCopy; }
public override void Visit(IDefaultValue defaultValue) { if(Process(defaultValue)){visitor.Visit(defaultValue);} base.Visit(defaultValue); }
/// <summary> /// Performs some computation with the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public virtual void Visit(IDefaultValue defaultValue) { }
/// <summary> /// Returns a shallow copy of the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public DefaultValue Copy(IDefaultValue defaultValue) { Contract.Requires(defaultValue != null); Contract.Ensures(Contract.Result<DefaultValue>() != null); return new DefaultValue(defaultValue); }
/// <summary> /// Traverses the children of the defalut value expression. /// </summary> public virtual void TraverseChildren(IDefaultValue defaultValue) { Contract.Requires(defaultValue != null); this.TraverseChildren((IExpression)defaultValue); if (this.StopTraversal) return; this.Traverse(defaultValue.DefaultValueType); }
public void SetDefaultValue <T>(IDefaultValue <T> defaultValue) { }
/// <summary> /// Performs some computation with the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public virtual void Visit(IDefaultValue defaultValue) { this.Visit((IExpression)defaultValue); }
public void Visit(IDefaultValue defaultValue) { throw new NotImplementedException(); }
public IByteArrayPropertyMapping DefaultValue(IDefaultValue defaultValue) { column.DefaultValue = defaultValue; return(this); }
public ISBytePropertyMapping DefaultValue(IDefaultValue defaultValue) { column.DefaultValue = defaultValue; return this; }
/// <summary> /// Visits the specified default value. /// </summary> /// <param name="defaultValue">The default value.</param> public override void Visit(IDefaultValue defaultValue) { DefaultValue mutableDefaultValue = new DefaultValue(defaultValue); this.resultExpression = this.myCodeCopier.DeepCopy(mutableDefaultValue); }
public override void TraverseChildren(IDefaultValue defaultValue) { this.sourceEmitterOutput.Write("default("); this.PrintTypeReference(defaultValue.DefaultValueType); this.sourceEmitterOutput.Write(")"); }
/// <summary> /// Returns a deep copy of the given defalut value expression. /// </summary> /// <param name="defaultValue"></param> public DefaultValue Copy(IDefaultValue defaultValue) { var mutableCopy = this.shallowCopier.Copy(defaultValue); this.CopyChildren((Expression)mutableCopy); mutableCopy.DefaultValueType = this.Copy(mutableCopy.DefaultValueType); return mutableCopy; }
/// <summary> /// Visits the specified default value. /// </summary> /// <param name="defaultValue">The default value.</param> public override void Visit(IDefaultValue defaultValue) { DefaultValue mutableDefaultValue = defaultValue as DefaultValue; if (alwaysMakeACopy || mutableDefaultValue == null) mutableDefaultValue = new DefaultValue(defaultValue); this.resultExpression = this.myCodeMutator.Visit(mutableDefaultValue); }