void ConvertPasRecordTypeDecl(PasRecordTypeDecl pasRecord, CsNamespace csNamespace) { var csStruct = new CsStructTypeDecl(); csStruct.Name = pasRecord.Name; foreach (var pasVar in pasRecord.Vars) ConvertPasDecl(pasVar, csStruct); csNamespace.Decls.Add(csStruct); _associations.Assign(pasRecord, csStruct); }
void ConvertPasVarDecl(PasVarDecl pasVar, CsStructTypeDecl csStruct) { var csVar = new CsField(); csVar.Name = pasVar.Name; csVar.TypeRef = ConvertPasTypeRef(pasVar.TypeRef); csStruct.Decls.Add(csVar); _associations.Assign(pasVar, csVar); }
void ConvertPasDecl(PasDecl pasDecl, CsStructTypeDecl csStruct) { if (pasDecl is PasVarDecl) ConvertPasVarDecl(pasDecl as PasVarDecl, csStruct); else throw new Exception(string.Format("Tipo desconhecido: {0}", pasDecl.GetType().Name)); }