Handling Operator Precedence in Arithmetic Expressions with Tree Transformations
Abstract
A simple linear time and space algorithm that transforms a standardized tree representation of an arithmetic expression lacking operator precedence information into a tree containing it is presented.The approach has applications in modularizing compilers, since the transformations can be applied after the parsing phase.Moreover, it facilitates the compiling of languages that allow dynamic operator definition.