Incremental LR Parsing
نویسنده
چکیده
Given a parse tree for a sentence xyz and a string w , an incremental parser builds the parse tree for the modified sentence xwz by re-using as much of the parse tree for xyz as possible. A key observation of the LR parser is that, if a string of tokens α can be reduced to a nonterminal A in some state, then α must be reduced to A in all "similar" states as long as the look-ahead condition of the states is satisfied. There is no other way to parse α. Therefore, the subtree that derives α can be re-used directly. We present an incremental LR parsing algorithm based on the observation. The incremental parser is able to divide its work among parallel processes. The question whether two states are "similar" can be answered by checking the goto table in the conventional LR parsers.
منابع مشابه
Visual Language Editors Based on Lr Parsing Techniques
Visual language editors should provide a user-friendly environment where users are supported in an effective way in the construction of visual sentences. In this paper, we propose an approach for the construction of syntax-directed visual language editors by integrating incremental parsers into freehand editors. The approach combines the LR-based techniques for parsing visual languages with the...
متن کاملAn Incremental LR Parse Strategy for Language - Based EditorsPhil
We present an incremental parser for a modeless syntax recognising language-based editor. The strategy we describe has been implemented as part of the UQ? generic language-based environment. Incremental parsing in the UQ? editor has previously been based on LL techniques. The incremen-tal LR parser described in this report has been developed to allow manipulation of a larger class of languages ...
متن کاملBlock-Level Parallelism in Parsing Block Structured Languages
Softwares source code is becoming large and complex. Compilation of large base code is a time consuming process. Parallel compilation of code will help in reducing the time complexity. Parsing is one of the phases in compiler in which significant amount of time of compilation is spent. Techniques have already been developed to extract the parallelism available in parser. Current LR(k) parallel ...
متن کاملAn Efficient Algorithm To Induce Minimum Average Lookahead Grammars For Incremental LR Parsing
We define a new learning task, minimum average lookahead grammar induction, with strong potential implications for incremental parsing in NLP and cognitive models. Our thesis is that a suitable learning bias for grammar induction is to minimize the degree of lookahead required, on the underlying tenet that language evolution drove grammars to be efficiently parsable in incremental fashion. The ...
متن کاملIncremental Generation of LR Parsers
Implementation of a new compiler usually requires making frequent adjustments to grammar de nitions. An incremental technique for updating the parser tables after a minor change to the grammar could potentially save much computational e ort. More importantly, debugging a grammar is made easier if the grammar is re-checked for correctness after each small change to the grammar. The basic design ...
متن کامل