Method and apparatus for generating inline code using template metaprograms
US5835771A · kind A · utility
Assignee
Inventor
Key dates
| Filing date | Jun 7, 1995 |
| Grant date | Nov 10, 1998 |
| Priority date | — |
| Expiry date | Jun 7, 2015 |
Classification
- Technology area (CPC G)Physics
- CPC primaryG06F8/4443
- WIPO fieldComputer technology
- WIPO sectorElectrical engineering
Abstract
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 metaprogr…
Source: USPTO / EPO open patent data. Objective bibliographic and citation counts.