发明名称 Method and apparatus for generating inline code using template metaprograms
摘要 The present invention provides the capability to generate customized, inlined code or expression objects using template metaprograms. The code or expression object is created at compile time using template parameters, if specified. At compile time, these parameters are used to determine the customized, inline code that is generated by the compiler. A general algorithm is used to convert algorithms into inline pieces of code. An algorithm, or program code segment, is selected for customization. A grammar is written to define the algorithm. A grammar is comprised of a set of production rules. Production rules contain symbols of the grammar. A symbol can be a terminal or non-terminal symbol. A production rule further includes parameters that can be used to further customize an instantiation of a template metaprogram. The algorithm is expressed using the production rules that comprise the grammar. Each production rule is translated into a template class or a specialization. A template metaprogram can further comprise template parameters. At compile time, the compiler uses the template metaprogram reference including template parameters specified to generate code. The template metaprogram that is referenced by the program code is used as a blueprint for the code that is generated by the compiler. The code generated by the compiler is customized, inlined code. Further, the process for creating and generating customized, inlined code provides for the creation and manipulation of objects that encapsulate expressions. Customized, inlined code can replace less efficient code thereby achieving increased run time efficiency. Code generation is done using the end user's compiler.
申请公布号 US5835771(A) 申请公布日期 1998.11.10
申请号 US19950487593 申请日期 1995.06.07
申请人 ROGUE WAVE SOFTWARE, INC. 发明人 VELDHUIZEN, TODD
分类号 G06F9/44;G06F9/45;(IPC1-7):G06F9/45 主分类号 G06F9/44
代理机构 代理人
主权项
地址