发明名称 Configuration-preserving preprocessor
摘要 Methods, systems, and apparatuses, including computer programs encoded on computer readable media, for generating a plurality of tokens from one or more source files. The one or more source files include source code in a first programming language. The source code includes one or more static conditionals that include a conditional expression and branch code that is operative when the conditional expression is true. Various configurations are possible based upon the conditionals. A first static conditional that includes one or more nested static conditionals within the branch code associated with the first static conditional is determined. Each of the one or more nested static conditionals is hoisted to a beginning of the branch code associated with the first static conditional. Each innermost branch code does not contain a static conditional, and each possible configuration is preserved.
申请公布号 US9389842(B2) 申请公布日期 2016.07.12
申请号 US201414316159 申请日期 2014.06.26
申请人 New York University 发明人 Gazzillo Paul;Grimm Robert
分类号 G06F9/45;G06F9/44 主分类号 G06F9/45
代理机构 Foley & Lardner LLP 代理人 Foley & Lardner LLP
主权项 1. A system comprising: one or more processors; and one or more computer storage media storing one or more modules of computer program instructions executed by the one or more processors, the one or more modules of computer program instructions comprising: a lexer module to: generate a plurality of tokens from one or more source files, the one ormore source files including source code in a first programming language, the source code comprising a macro invocation containing one or more static conditionals that include a conditional expression and branch code that is operative when the conditional expression is true, and wherein various configurations are possible based upon the conditionals and the conditionals can alter the macro invocation by changing a name or argument of the macro invocation; and a configuration-preserving preprocessor module to: determine that a first static conditional in the macro invocation includes one or more nested static conditionals within the branch code associated with the first static conditional; andhoist each of the one or more nested static conditionals around the macro invocation to a beginning of the branch code associated with the first static conditional, wherein each innermost branch code does not contain a static conditional, and wherein each possible configuration is preserved.
地址 New York NY US