public void EmitNames() { for (int i = 0; i < PropertyASTList.Count; i++) { PropertyAST propertyAST = PropertyASTList[i]; propertyAST.EmitName(); } }
public void AnalyTypes() { dict.Clear(); for (int i = 0; i < PropertyASTList.Count; i++) { PropertyAST propertyAST = PropertyASTList[i]; propertyAST.AnalyType(); } }
public SectionPropertiesDim(DimAST dimAST, SectionPropertiesRaw raw) { this.dimAST = dimAST; Raw = raw; for (int i = 0; i < Raw.Properties.Count; i++) { PropertyASTRaw propertyRaw = Raw.Properties[i]; PropertyAST propertyAST = new PropertyAST(propertyRaw, this); PropertyASTList.Add(propertyAST); } }
public void EmitBodys() { TypeBuilder dimBuilder = this.dimAST.DimBuilder; constructorBuilder = dimBuilder.DefineConstructor( MethodAttributes.Private | MethodAttributes.Static, CallingConventions.Standard, new Type[] { }); ILGenerator IL = constructorBuilder.GetILGenerator(); //foreach (var item in DimItems) //{ // //item.Emit(Builder, IL); // FieldAttributes fieldAttr = FieldAttributes.Private | FieldAttributes.Static | FieldAttributes.InitOnly; // var fieldBuilder = dimBuilder.DefineField(item.DimName, typeof(string), fieldAttr); // EmitHelper.LoadString(IL, item.DimType); // EmitHelper.StormField(IL, fieldBuilder); //} for (int i = 0; i < PropertyASTList.Count; i++) { PropertyAST propertyAST = PropertyASTList[i]; propertyAST.EmitBody(); } IL.Emit(OpCodes.Ret); }
public void AddProperty(PropertyAST property) { Properties.Add(property); }