Construction of an AWK-to-C translator

Chalermsak Chatdokmaiprai, Somchai Thayarnyong · 1994

This thesis presents the design and development of a software system that translates any AWK program into a functionally equivalent C program. The AWK-to-C translation system, which comprises an AWK-to-C translator and a library of subroutines that support the execution of the generated programs, has been constructed successfully on the Unix System V Release 4.0, using the Unix language development tools lex and yacc. The purpose of the AWK-to-C translator is twofold. First, it serves as a faster alternative to the traditional AWK interpreters for processing AWK programs. Secondly, on the system with a C compiler but without and AWK language processor available, the AWK-to-C translator ported to the system, together with the C compiler, practically serves as a sole, complete implementation of the AWK language on that system. A performance measurement suite was constructed to evaluate the performance of the translator-generated programs. The results indicate that in most cases, the generated programs run faster than their interpreted counterparts. The average speed improvement over the ten representative cases is 32%

Read the paper · More papers on PaperTik