LR - parsing
نویسندگان
چکیده
LR-parsing Kyung-Goo Doh, Hyunha Kim, David A. Schmidt 1 Hanyang University, Ansan, South Korea 2 Kansas State University, Manhattan, Kansas, USA Abstract. We combine LR(k)-parsing technology and data-flow analysis to analyze, in advance of execution, the documents generated dynamically by a program. Based on the document language’s context-free reference grammar and the program’s control structure, formatted as a set of flow equations, the analysis predicts how the documents will be generated and simultaneously parses the predicted documents. Recursions in the flow equations cause the analysis to emit a set of residual equations that are solved by least-fixed point calculation in the domain of abstract (folded) LR-parse stacks. Since the technique accommodates LR(k) grammars, it can also handle string-update operations in the programs by translating the updates into finite-state transducers, whose controllers are composed with the LR(k)-parser controller. We combine LR(k)-parsing technology and data-flow analysis to analyze, in advance of execution, the documents generated dynamically by a program. Based on the document language’s context-free reference grammar and the program’s control structure, formatted as a set of flow equations, the analysis predicts how the documents will be generated and simultaneously parses the predicted documents. Recursions in the flow equations cause the analysis to emit a set of residual equations that are solved by least-fixed point calculation in the domain of abstract (folded) LR-parse stacks. Since the technique accommodates LR(k) grammars, it can also handle string-update operations in the programs by translating the updates into finite-state transducers, whose controllers are composed with the LR(k)-parser controller.
منابع مشابه
Unifying LL and LR parsing
In parsing theory, LL parsing and LR parsing are regarded to be two distinct methods. In this paper the relation between these methods is cla-riied. As shown in literature on parsing theory, for every context-free grammar, a so-called non-deterministic LR(0) automaton can be constructed. Here, we show, that traversing this automaton in a special way is equivalent to LL(1) parsing. This automato...
متن کاملLr Parsing = Grammar Transformation + Ll Parsing Making Lr Parsing More Understandable and More Eecient
The paper has three aims. Its primary focus is a derivation method which is | in contrast to many of the classical presentations in the literature | easy to comprehend and thus easy to adapt to di erent needs. Secondly, it presents an improved LR parser which has the power of LR parsing, but (almost) the e ciency of LALR parsing. Finally, it elucidates the strong conceptual relationships that a...
متن کاملFaster Generalized LR Parsing
Tomita devised a method of generalized LR (GLR) parsing to parse ambiguous grammars e ciently. A GLR parser uses linear-time LR parsing techniques as long as possible, falling back on more expensive general techniques when necessary. Much research has addressed speeding up LR parsers. However, we argue that this previous work is not transferable to GLR parsers. Instead, we speed up LR parsers b...
متن کاملGLR Parser with Conditional Action Model(CAM)
There are two different approaches in the LR parsing. The first one is the deterministic approach that performs the only one action using the control rules learned without any LR parsing resource. It shows good performance in speed. But it has a disadvantage that it cannot correct the previous mistakes, thus directly affects the parsing result. The second one is the probabilistic LR parsing app...
متن کاملAn Efficient Augmented-Context-Free Parsing Algorithm
An efficient parsing algorithm for augmented context-free grammars is introduced, and its application to on-line natural language interfaces discussed. The algorithm is a generalized LR parsing algorithm, which precomputes an LR shift-reduce parsing table (possibly with multiple entries) from a given augmented context-free grammar. Unlike the standard LR parsing algorithm, it can handle arbitra...
متن کاملA New Probabilistic LR Language Model for Statistical Parsing
This paper presents a newly formalized probabilistic LR language model. Our model inherits its essential features from Briscoe and Carroll's generalized probabilistic LR (PLR) model [3], which obtains context-sensitivity by assigning a probability to each LR parsing action according to its left and right context. However, our model is simpler while maintaining a higher degree of context-sensiti...
متن کامل