本文整理汇总了C#中Specification.SetInlineNone方法的典型用法代码示例。如果您正苦于以下问题:C# Specification.SetInlineNone方法的具体用法?C# Specification.SetInlineNone怎么用?C# Specification.SetInlineNone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Specification
的用法示例。
在下文中一共展示了Specification.SetInlineNone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateCode
/// <summary>
/// Should generate the code according to the specification of the algebra.
/// </summary>
/// <param name="S">The specification of the algebra. The specification also lists the names of the files
/// to be generated, or at least the base path.</param>
/// <param name="plugins">The plugins which Gaigen found that support the same language as this code generator.</param>
/// <returns>a list of filenames; the names of the files that were generated. This may be used
/// for post processing.</returns>
public List<string> GenerateCode(Specification S, List<CodeGeneratorPlugin> plugins)
{
// disable all inlining since the Java language does not support this:
S.SetInlineNone();
CreatePackageDirectory(S);
CoGsharp.CoG cog = InitCog(S);
CG.Shared.CGdata cgd = new G25.CG.Shared.CGdata(plugins, cog);
cgd.SetDependencyPrefix("missing_function_"); // this makes sure that the user sees the function call is a missing dependency
G25.CG.Shared.FunctionGeneratorInfo FGI = (S.m_generateTestSuite) ? new G25.CG.Shared.FunctionGeneratorInfo() : null; // the fields in this variable are set by Functions.WriteFunctions() and reused by TestSuite.GenerateCode()
{ // pregenerated code that will go into main source
// generate code for parts of the geometric product, dual, etc (works in parallel internally)
try
{
bool declOnly = false;
G25.CG.Shared.PartsCode.GeneratePartsCode(S, cgd, declOnly);
}
catch (G25.UserException E) { cgd.AddError(E); }
// write function (works in parallel internally)
G25.CG.Shared.Functions.WriteFunctions(S, cgd, FGI, Functions.GetFunctionGeneratorPlugins(cgd));
}
List<string> generatedFiles = new List<string>();
// generate Doxyfile
generatedFiles.Add(G25.CG.Shared.Util.GenerateDoxyfile(S, cgd));
// generate source files / classes for all GMV, SMV, GOM, SOM types
generatedFiles.AddRange(GenerateClasses(S, cgd));
// generate source
generatedFiles.AddRange(Source.GenerateCode(S, cgd));
// generate smv type enum
generatedFiles.AddRange(SmvType.GenerateCode(S, cgd));
// generate GroupBitmap class
generatedFiles.AddRange(GroupBitmap.GenerateCode(S, cgd));
// generate multivector interfaces
generatedFiles.AddRange(MvInterface.GenerateCode(S, cgd));
// generate parser
generatedFiles.AddRange(Parser.GenerateCode(S, cgd));
// generate report usage code
generatedFiles.AddRange(ReportUsage.GenerateCode(S, cgd));
// report errors and missing deps to user
cgd.PrintErrors(S);
cgd.PrintMissingDependencies(S);
if ((cgd.GetNbErrors() == 0) && (cgd.GetNbMissingDependencies() == 0) && S.m_generateTestSuite)
{
// generate test suite
generatedFiles.AddRange(TestSuite.GenerateCode(S, cgd, FGI));
}
return generatedFiles;
}
示例2: GenerateCode
/// <summary>
/// Generate all code according to the specification of the algebra.
/// </summary>
/// <param name="S">The specification of the algebra. The specification also lists the names of the files
/// to be generated, or at least the base path.</param>
/// <param name="plugins">The plugins which Gaigen found that support the same language as this code generator.</param>
/// <returns>a list of filenames; the names of the files that were generated. This may be used
/// for post processing.</returns>
public List<string> GenerateCode(Specification S, List<CodeGeneratorPlugin> plugins)
{
// disable all inlining since the C language does not support this:
S.SetInlineNone();
CoGsharp.CoG cog = InitCog(S);
CG.Shared.CGdata cgd = new G25.CG.Shared.CGdata(plugins, cog);
cgd.SetDependencyPrefix("missing_function_"); // this makes sure that the user sees the function call is a missing dependency
G25.CG.Shared.FunctionGeneratorInfo FGI = (S.m_generateTestSuite) ? new G25.CG.Shared.FunctionGeneratorInfo() : null; // the fields in this variable are set by Functions.WriteFunctions() and reused by TestSuite.GenerateCode()
{ // pregenerated code that will go into header, source
// generate code for parts of the geometric product, dual, etc (works in parallel internally)
try {
bool declOnly = false;
G25.CG.Shared.PartsCode.GeneratePartsCode(S, cgd, declOnly);
} catch (G25.UserException E) {cgd.AddError(E);}
// write set zero, set, copy, copy between float types, extract coordinate, largest coordinate, etc (works in parallel internally)
try {
GenerateSetFunctions(S, plugins, cgd);
} catch (G25.UserException E) { cgd.AddError(E); }
// write function (works in parallel internally)
G25.CG.Shared.Functions.WriteFunctions(S, cgd, FGI, Functions.GetFunctionGeneratorPlugins(cgd));
}
List<string> generatedFiles = new List<string>();
// generate Doxyfile
generatedFiles.Add(G25.CG.Shared.Util.GenerateDoxyfile(S, cgd));
// generate header
generatedFiles.AddRange(Header.GenerateCode(S, cgd));
// generate source
generatedFiles.AddRange(Source.GenerateCode(S, cgd));
// generate parser
generatedFiles.AddRange(Parser.GenerateCode(S, cgd));
// report errors and missing deps to user
cgd.PrintErrors(S);
cgd.PrintMissingDependencies(S);
if ((cgd.GetNbErrors() == 0) && (cgd.GetNbMissingDependencies() == 0) && S.m_generateTestSuite)
{
// if no errors, then generate testing code
TestSuite.GenerateCode(S, cgd, FGI);
}
// Generate random number generator source code (Mersenne Twister).
// This must be done last since the testing code may require it!
if (cgd.GetFeedback(G25.CG.C.MainGenerator.MERSENNE_TWISTER) == "true")
generatedFiles.AddRange(RandomMT.GenerateCode(S, cgd));
return generatedFiles;
}