Embedding semantics in LR parser tables
暂无分享,去创建一个
This paper addresses two of the problems commonly associated with LR parsing and syntax directed translation schemes, namely grammar stratification and excessively large table size, A solution is discussed which can eliminate stratification of the grammar by allowing the designer to embed semantics directly within the LR table (i.e., at shift and error entries instead of just at reduce entries) and to use global context to determine what semantics should be performed. The non‐stratified grammar can produce a significantly smaller LR table than the corresponding stratified grammar. The compatibility of this scheme with commonly used table compaction techniques is also discussed.
[1] Donald Ervin Knuth,et al. The Art of Computer Programming , 1968 .
[2] Alfred V. Aho,et al. The Theory of Parsing, Translation, and Compiling , 1972 .