private FieldInfo CreateField( MidPipelineDecl pipeline, MidElementDecl element, MidAttributeDecl attribute, MidFieldDecl field) { var midExp = _exps.FieldRef( attribute.Range, _exps.AttributeRef(attribute.Range, attribute), field); var name = _identifiers.unique( string.Format("{0}_{1}", attribute.Name, field.Name)); var newAttr = element.CacheAttr( midExp, field.Type); newAttr.TrySetName(name, attribute.Range); return(new FieldInfo { AttrDecl = newAttr, FieldDecl = field }); }
public MidFieldMemberRef( MidVal obj, MidFieldDecl decl) { _obj = obj; _decl = decl; }
public MidFieldRef FieldRef( SourceRange range, MidPath obj, MidFieldDecl decl) { return((MidFieldRef)_fieldRefs.Get(obj).Get(decl).Cache( () => new MidFieldRef(range, obj, decl))); }
public MidFieldRef( SourceRange range, MidPath obj, MidFieldDecl decl) : base(range, decl.Type) { _obj = obj; _decl = decl; }
private MidMemberDecl EmitMemberDeclImpl( MidStructDecl midStruct, IResFieldDecl resField, MidEmitEnv env) { var midField = new MidFieldDecl(midStruct, resField.Name); midField.AddBuildAction(() => { midField.Type = EmitTypeExp(resField.Type, env); }); midField.DoneBuilding(); midStruct.AddField(midField); return(midField); }
public void AddField(MidFieldDecl field) { _fields.Add(field); }
private FieldInfo CreateField( MidPipelineDecl pipeline, MidElementDecl element, MidAttributeDecl attribute, MidFieldDecl field) { var midExp = _exps.FieldRef( attribute.Range, _exps.AttributeRef( attribute.Range, attribute ), field ); var name = _identifiers.unique( string.Format( "{0}_{1}", attribute.Name, field.Name ) ); var newAttr = element.CacheAttr( midExp, field.Type); newAttr.TrySetName(name, attribute.Range); return new FieldInfo{ AttrDecl = newAttr, FieldDecl = field}; }