示例#1
0
        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));
        }
示例#2
0
 public virtual IEnumerable <CodeAttributeDeclaration> NewCodeAttributeDecls(CRflProperty aProperty, CGenModelInterpreter aModelInterpreter) =>
 this.NewCodeAttributeDeclsExist(aProperty, aModelInterpreter)
 .Concat(this.NewCodeAttributeDeclsExplicit(aProperty));
示例#3
0
 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()
     );
示例#4
0
 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
 ;
示例#5
0
 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)));
示例#6
0
 public CCodeDomBuilder(CGenModelInterpreter aIdl, CGenTokens aTok)
 {
     this.Idl = aIdl;
     this.Tok = aTok;
 }