Abstract. Most language translation problems can be solved with existing LALR(1) or LL(k) language tools; e.g., YACC Joh78] or ANTLR PDC92]. However, there are language constructs that defy almost all parsing strategy commonly in use. Some of these constructs cannot be parsed without semantics, such as symbol table information, and some cannot be properly recognized without rst examining the entire construct, that is we need \in nite lookahead." In this paper, we introduce a new LL(k) parser strategy, pred-LL(k), that uses semantic or syntactic predicates to recognize language constructs when normal deterministic LL(k) parsing breaks down. Semantic predicates indicate the semantic validity of applying a production; syntactic predicates are grammar fragments that describe a syntactic context that must be satis ed before application of an associated production is authorized. Throughout, we discuss the implementation of predicates in ANTLR|the parser generator of The Purdue Compiler-Construction Tool Set.
Parr and Quong REF add semantic and syntactic predicates to LL(k) grammars to get the pred-LL(k) parsing strategy.
Adding Semantic and Syntactic Predicates to LL(k): pred-LL(k)
In Computational Complexity
Computer Science