Premium
The cost of a generated parser
Author(s) -
Waite W. M.,
Carter L. R.
Publication year - 1985
Publication title -
software: practice and experience
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.437
H-Index - 70
eISSN - 1097-024X
pISSN - 0038-0644
DOI - 10.1002/spe.4380150302
Subject(s) - computer science , compiler , parsing , pascal (unit) , programming language , top down parsing , interpreter , parser combinator
Abstract The ‘fact’ that compilers employing generated parsers suffer significant performance degradation dis‐a‐vis recursive descent compilers is entrenched in the folklore of computing. We give detailed measurements that support this belief when the entire compiler is written in Pascal. We then define a general interface for a parsing module that hides significantly more information than usual, simplifying the process of generation and integration. This interface makes an assembly‐coded parse table interpreter feasible without changing the language used for the remainder of the compiler. When the parse table interpreter is written in assembly language, the costs of the generated parser are essentially the same as those for recursive descent. (A minor space/time trade‐off is possible, with the recursive descent implementation being slightly bigger and slightly faster.)