Method for handling preprocessing in source code transformation
AssigneeLucent Technologies Inc.
InventorsDaniel Waddington, Bin Yao
Life of this patent
Estimating the term…
Abstract
A method for handling preprocessing in source code transformation creates a semantically correct view of a program being transformed. This semantically correct view is called a transformed form and it is capable of being parsed with a regular grammar. The original use of preprocessing macros is determined, including their relationship to the transformed form and the preprocessing is reconstructed in the modified source code.
Claims13
A method for handling preprocessing in source code transformation, comprising:
- deconditioning an original source code to produce a parsable source code, the original source code including original preprocessing;
- parsing the parsable source code to produce an abstract syntax tree (AST) form;
- performing an AST-based transformation on the AST form to produce modified source code;
- and
- reconditioning by reconstructing that portion of the original preprocessing that was unaffected by the AST-based transformation in the modified source code.
A system for handling preprocessing in source code transformation, comprising:
- a deconditioning component for deconditioning an original source code to produce a parsable source code, the original source code including original preprocessing;
- a parser for parsing the parsable source code to produce an abstract syntax tree (AST) form;
- a transformation engine for performing an abstract syntax tree (AST)-based transformation on the AST form to produce modified source code;
- and
- a reconditioning component for reconstructing portions of the original preprocessing that were unaffected by the AST-based transformation.
A computer-readable medium having instructions stored thereon for performing a method for handling preprocessing in source code transformation, the method comprising:
- deconditioning an original source code to produce a parsable source code, the original source code including original preprocessing;
- parsing the parsable source code to produce an abstract syntax tree (AST) form;
- performing an AST-based transformation on the AST form to produce modified source code;
- and
- reconditioning by reconstructing that portion of the original preprocessing that was unaffected by the AST-based transformation in the modified source code.
Dependencies are inferred from the claim text.