Premium
Compiling short‐circuit boolean expressions in one pass
Author(s) -
Logothetis George,
Mishra Prateek
Publication year - 1981
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.4380111104
Subject(s) - computer science , compiler , pascal (unit) , boolean circuit , programming language , parsing , boolean expression , scheme (mathematics) , code (set theory) , simple (philosophy) , theoretical computer science , algorithm , boolean function , mathematics , mathematical analysis , philosophy , set (abstract data type) , epistemology
We present a very simple scheme for compiling boolean expressions in the short‐circuit manner in one pass. The generated code is of very high quality and avoids most inefficiencies commonly associated with one‐pass code generation. In particular, redundant conditional and unconditional branches are kept to a minimum. The scheme is general enough to compile the boolean expressions of a typical high‐level language such as Pascal. It is presented in a format suited for syntax‐directed translation and can be used with both top‐down and bottom‐up parsing.