Exemplo n.º 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));
        }
Exemplo n.º 2
0
 public virtual IEnumerable <CodeAttributeDeclaration> NewCodeAttributeDecls(CRflProperty aProperty, CGenModelInterpreter aModelInterpreter) =>
 this.NewCodeAttributeDeclsExist(aProperty, aModelInterpreter)
 .Concat(this.NewCodeAttributeDeclsExplicit(aProperty));
Exemplo n.º 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()
     );
Exemplo n.º 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
 ;
Exemplo n.º 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)));
Exemplo n.º 6
0
 public CCodeDomBuilder(CGenModelInterpreter aIdl, CGenTokens aTok)
 {
     this.Idl = aIdl;
     this.Tok = aTok;
 }