public MidVar( Identifier name, MidType type) { _name = name; _type = type; }
public MidAttributeDecl CacheAttr( MidExp exp, MidType type) { MidAttributeDecl attrDecl = null; if (_attrCache.TryGetValue(exp, out attrDecl)) { return(attrDecl); } if (exp is MidAttributeRef) { var attrRef = (MidAttributeRef)exp; attrDecl = attrRef.Decl; if (attrDecl.Element == this && attrDecl.Exp != null) { _attrCache[exp] = attrDecl; return(attrDecl); } } attrDecl = new MidAttributeDecl( _name.Factory.unique("attr"), this, type, exp); _attrCache[exp] = attrDecl; AddAttribute(attrDecl); return(attrDecl); }
public MidStructVal( SourceRange range, MidType type, IEnumerable <MidExp> fieldVals) : base(range, type) { _fieldVals = fieldVals.ToArray(); }
public MidLit Lit <T>(SourceRange range, T value, MidType type) { var lits = (MidLitFactory <T>)_litFactories.Cache( typeof(T), () => (MidLitFactory) new MidLitFactory <T>()); return(lits.Lit(range, value, type)); }
public static ISpan Dump( this MidType type) { var span = new Span(); type.Dump(span); return(span); }
public MidLabelExp( SourceRange range, MidLabel label, MidExp body, MidType type) : base(range, type) { _label = label; _body = body; }
public T MaybeMoveTemp <T>(MidExp exp, MidType type) where T : MidExp { if (exp is T) { return((T)exp); } return((T)(MidExp)CreateTemp(exp, type)); }
public MidAttributeRef( SourceRange range, MidType type, ILazy <MidAttributeDecl> decl) : base(range, new MidDummyType()) { _type = Lazy.Value(type); _decl = decl; _isLazy = true; }
private AttributeInfo GenerateInputElementsImpl( SourceRange range, string name, MidType type, int vertexStream, AttributeInfo index, UInt32 baseOffset) { throw OperationTooComplex(range); }
public MidExp( SourceRange range, MidType type) { if (type == null) { throw new ArgumentNullException("type"); } _range = range; _type = type; }
public MidAttributeFetch( SourceRange range, MidPath obj, MidType type, ILazy <MidAttributeDecl> attribute) : base(range, new MidDummyType()) { _obj = obj; _type = Lazy.Value(type); _attribute = attribute; }
public MidAttributeDecl( Identifier name, MidElementDecl element, MidType type, MidExp exp) { _name = name; _element = element; _type = type; _exp = exp; }
public MidAttributeFetch( SourceRange range, MidPath obj, MidType type, ILazy<MidAttributeDecl> attribute) : base(range, new MidDummyType()) { _obj = obj; _type = Lazy.Value(type); _attribute = attribute; }
public MidAttributeDecl( Identifier name, MidElementDecl element, MidType type, MidExp exp ) { _name = name; _element = element; _type = type; _exp = exp; }
private MidExp EmitAttrExp( MidElementDecl midElement, MidType midType, IResExp resExp, MidEmitEnv env) { var savedElement = _currentElement; _currentElement = midElement; var result = EmitLocalExp(resExp, env, midElement); _currentElement = savedElement; return(result); }
private AttributeInfo GenerateInputElements( SourceRange range, string name, MidType type, int vertexStream, AttributeInfo index, UInt32 baseOffset) { return(GenerateInputElementsImpl( range, name, (dynamic)type, vertexStream, (IndexSourceInfo)index, baseOffset, vertexStream)); }
public override MidVal CreateTemp(MidExp exp, MidType type) { if (_element != null) { var attrDecl = _element.CacheAttr(exp, type); return(_exps.AttributeRef(exp.Range, attrDecl)); } else { MidVar var = new MidVar(_identifiers.unique("temp"), type); Func <MidExp, MidExp> wrapper = (body) => new MidLetExp(exp.Range, var, exp, body); _wrappers.Insert(0, wrapper); return(new MidVarRef(exp.Range, var)); } }
public override int GetHashCode() { int hashcode = 157; unchecked { if (__isset.id) { hashcode = (hashcode * 397) + Id.GetHashCode(); } if (__isset.channelId) { hashcode = (hashcode * 397) + ChannelId.GetHashCode(); } if (__isset.lastSeq) { hashcode = (hashcode * 397) + LastSeq.GetHashCode(); } if (__isset.unreadCount) { hashcode = (hashcode * 397) + UnreadCount.GetHashCode(); } if (__isset.lastModifiedTime) { hashcode = (hashcode * 397) + LastModifiedTime.GetHashCode(); } if (__isset.status) { hashcode = (hashcode * 397) + Status.GetHashCode(); } if (__isset.midType) { hashcode = (hashcode * 397) + MidType.GetHashCode(); } if (__isset.lastMessages) { hashcode = (hashcode * 397) + TCollections.GetHashCode(LastMessages); } } return(hashcode); }
private string DeterminedMid(string content, MidType type) { var matches = Regex.Matches(content, RegexContent, RegexOptions.Multiline | RegexOptions.IgnoreCase).Cast <Match>(); switch (type) { case MidType.MaxId: default: { var result = matches.LastOrDefault(); return(result == null ? "" : result.Groups["Mid"].Value); break; } case MidType.EndId: { var result = matches.FirstOrDefault(); return(result == null ? "" : result.Groups["Mid"].Value); break; } } }
public override MidVal CreateTemp(MidExp exp, MidType type) { throw new NotImplementedException(); }
public override MidVal CreateTemp(MidExp exp, MidType type) { return(_parent.CreateTemp(exp, type)); }
public MidLit( SourceRange range, MidType type) : base(range, type) { }
public MidPath( SourceRange range, MidType type) : base(range, type) { }
public abstract MidVal CreateTemp(MidExp exp, MidType type);
public SizeInfo GetSizeInfo(MidType type) { return(GetSizeInfoImpl((dynamic)type)); }
public static void Dump( this MidType type, Span span) { DumpTypeImpl((dynamic)type, span); }
public void Insert(IResTypeParamDecl key, MidType value) { _types[key] = value; }
public MidAttributeDecl CacheAttr( MidExp exp, MidType type ) { MidAttributeDecl attrDecl = null; if( _attrCache.TryGetValue( exp, out attrDecl ) ) return attrDecl; if( exp is MidAttributeRef ) { var attrRef = (MidAttributeRef) exp; attrDecl = attrRef.Decl; if( attrDecl.Element == this && attrDecl.Exp != null ) { _attrCache[ exp ] = attrDecl; return attrDecl; } } attrDecl = new MidAttributeDecl( _name.Factory.unique( "attr" ), this, type, exp ); _attrCache[ exp ] = attrDecl; AddAttribute( attrDecl ); return attrDecl; }
public MidLabelExp( SourceRange range, MidLabel label, MidExp body, MidType type) : base(range, type) { _label = label; _body = body; }
protected UInt32 GetSizeOf(MidType type) { return(GetSizeInfo(type).Size); }
private AttributeInfo GenerateInputElements( SourceRange range, string name, MidType type, int vertexStream, AttributeInfo index, UInt32 baseOffset) { return GenerateInputElementsImpl( range, name, (dynamic)type, vertexStream, (IndexSourceInfo)index, baseOffset, vertexStream); }
public override string ToString() { var sb = new StringBuilder("TMessageBox("); bool __first = true; if (Id != null && __isset.id) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Id: "); Id.ToString(sb); } if (ChannelId != null && __isset.channelId) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("ChannelId: "); ChannelId.ToString(sb); } if (__isset.lastSeq) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("LastSeq: "); LastSeq.ToString(sb); } if (__isset.unreadCount) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("UnreadCount: "); UnreadCount.ToString(sb); } if (__isset.lastModifiedTime) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("LastModifiedTime: "); LastModifiedTime.ToString(sb); } if (__isset.status) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("Status: "); Status.ToString(sb); } if (__isset.midType) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("MidType: "); MidType.ToString(sb); } if (LastMessages != null && __isset.lastMessages) { if (!__first) { sb.Append(", "); } __first = false; sb.Append("LastMessages: "); LastMessages.ToString(sb); } sb.Append(")"); return(sb.ToString()); }
private int CountSlots(MidType type) { return CountSlotsImpl((dynamic)type); }
private AttributeInfo GenerateInputElementsImpl( SourceRange range, string name, MidType type, int vertexStream, AttributeInfo index, UInt32 baseOffset) { throw OperationTooComplex(range); }
// Emit types public ITypeHLSL EmitType(MidType type) { return EmitTypeImpl((dynamic)type); }
public SizeInfo GetSizeInfo(MidType type) { return GetSizeInfoImpl((dynamic)type); }
protected UInt32 GetSizeOfImpl(MidType type) { return(EmitContext.EmitType(type, null).Size); }
public MidVar( Identifier name, MidType type) { _name = name; _type = type; }
protected UInt32 GetSizeOf(MidType type) { return GetSizeInfo(type).Size; }
protected UInt32 GetSizeOfImpl(MidType type) { return EmitContext.EmitType(type, null).Size; }
public IEmitType EmitType( MidType midType, EmitEnv env) { return(EmitTypeImpl((dynamic)midType, env)); }