public CCodeGenerator(CGenModelInterpreter aMdlInterpreter, CGenTokens aTok, CCodeDomBuilder aDom, FileInfo aModelInputFileInfo, FileInfo aIdsInputFileInfo, FileInfo aModelOutputFileInfo, FileInfo aIdsOutputFileInfo) { this.ModelInterpreter = aMdlInterpreter; this.Tok = aTok; this.CodeDomBuilder = aDom; this.ModelInputFileInfo = aModelInputFileInfo; this.IdsInputFileInfoNullable = aIdsInputFileInfo; this.ModelOutputFileInfo = aModelOutputFileInfo; this.IdsOutputFileInfo = aIdsOutputFileInfo; this.Exp.ChainedExpanders.Add(new CIncludeModelExpander(this.ModelInterpreter)); this.Exp.ChainedExpanders.Add(new CCrossReferenceExpander(this.ModelInterpreter)); }
public virtual IEnumerable <CodeAttributeDeclaration> NewCodeAttributeDecls(CRflProperty aProperty, CGenModelInterpreter aModelInterpreter) => this.NewCodeAttributeDeclsExist(aProperty, aModelInterpreter) .Concat(this.NewCodeAttributeDeclsExplicit(aProperty));
public virtual IEnumerable <CodeAttributeDeclaration> NewCodeAttributeDeclsExist(CRflProperty aProperty, CGenModelInterpreter aModelInterpreter) => from aAttribute in aProperty.GetAttributesWithPrefix(this.Tok.Mdl_P_A_Nme_DomA) select new CodeAttributeDeclaration( new CodeTypeReference(this.GetAttributeTypeName(aProperty, aAttribute.Name.TrimStart(this.Tok.Mdl_P_A_Nme_DomA), aModelInterpreter)), System.Type.GetType(this.GetAttributeTypeName(aProperty, aAttribute.Name.TrimStart(this.Tok.Mdl_P_A_Nme_DomA), aModelInterpreter)).GetCustomAttribute <CAttributeValueTypeAttribute>().NewCodeAttributeArguments(aAttribute.Value).ToArray() );
public virtual string GetAttributeTypeName(CRflProperty aProperty, string aModelAttributeTypeName, CGenModelInterpreter aModelInterpreter) => aModelAttributeTypeName.Contains(aModelInterpreter.Tok.Dom_Nsp_Seperator) ? aModelAttributeTypeName : aModelInterpreter.GetClrNamespace(aProperty.Model.GetTypByName(aModelAttributeTypeName)).Length == 0 ? aModelAttributeTypeName : aModelInterpreter.GetClrNamespace(aProperty.Model.GetTypByName(aModelAttributeTypeName)) + aModelInterpreter.Tok.Dom_Nsp_Seperator + aModelAttributeTypeName ;
public virtual IEnumerable <CodeAttributeDeclaration> NewCodeAttributeDeclsGen(CRflProperty aProperty, CGenModelInterpreter aModelInterpreter) => from aAttribute in aProperty.GetAttributesWithPrefix(this.Tok.Mdl_P_A_Nme_DomA) where aModelInterpreter.GetGenerate(aProperty.Model.GetTypByName(aAttribute.Name.TrimStart(this.Tok.Mdl_P_A_Nme_DomA))) select new CodeAttributeDeclaration( new CodeTypeReference(this.Tok.GetClrAttributeClassNameFromModel(aAttribute.Name.TrimStart(this.Tok.Mdl_P_A_Nme_DomA))), new CodeAttributeArgument(new CodePrimitiveExpression(aAttribute.Value)));
public CCodeDomBuilder(CGenModelInterpreter aIdl, CGenTokens aTok) { this.Idl = aIdl; this.Tok = aTok; }