Implementation of Fork-Merge Parsing in OpenRefactory/C
View/ Open
Date
2015-05-04Type of Degree
Master's ThesisDepartment
Computer Science
Metadata
Show full item recordAbstract
C preprocessor directives are extensively used in C programs. Due to this, performing advanced program transformations on C programs is difficult. To obtain correct transformations, all possible configurations have to be considered. Modern IDEs ignore multiple configurations of the C preprocessor due to its complexity. OpenRefactory/C is an infrastructure that builds correct and complex transformations for C programs.The preprocessor and the program representation were modified to support multiple configurations in OpenRefactory/C. The C grammar was extended to include conditional directives in the program representation. The extended grammar allows conditional directives to appear in between certain complete C constructs. However, the conditional directives can appear in any part of the program. We modified the OpenRefactory/C parser to handle conditional directives that appear at an unexpected location in C programs and hence support multiple configurations.