članak: 1 od 1  
Computer Science and Information Systems / ComSIS
2011, vol. 8, br. 2, str. 517-531
jezik rada: engleski
članak
doi:10.2298/CSIS101116008R

Solving difficult LR parsing conflicts by postponing them
(naslov ne postoji na srpskom)
Departamento de EIO y Computación, Universidad de La Laguna, Spain

e-adresa: casiano@ull.es, lgforte@ull.es

Sažetak

(ne postoji na srpskom)
Though yacc-like LR parser generators provide ways to solve shift-reduce conflicts using token precedences, no mechanisms are provided for the resolution of difficult shift-reduce or reduce-reduce conflicts. To solve this kind of conflicts the language designer has to modify the grammar. All the solutions for dealing with these difficult conflicts branch at each alternative, leading to the exploration of the whole search tree. These strategies differ in the way the tree is explored: GLR, Backtracking LR, Backtracking LR with priorities, etc. This paper explores an entirely different path: to extend the yacc conflict resolution sublanguage with new constructs allowing the programmers to explicit the way the conflict must be solved. These extensions supply ways to resolve any kind of conflicts, including those that can not be solved using static precedences. The method makes also feasible the parsing of grammars whose ambiguity must be solved in terms of the semantic context. Besides, it brings to LR-parsing a common LL-parsing feature: the advantage of providing full control over the specific trees the user wants to build.

Ključne reči

parsing; lexical analysis; syntactic analysis

Reference

Donnelly, C., Stallman, R. (2010) Bison: The yacc-compatible parser generator: Technical report. Cambridge, MA: Free Software Foundation
Ford, B. (2002) Functional pearl: Packrat parsing: Simple, powerful, lazy, linear time. Cambridge: Massachusetts Institute of Technology
Johnson, S.C. (1979) Yacc: Yet another compiler compiler. AT&T Bell Laboratories, Technical Report July 31, 1978
Mcpeak, S. (2004) Elkhound: A fast practical GLR parser generator. http://scottmcpeak.com/elkhound
Merrill, G.H. (1993) Parsing Non-LR(k) grammars with yacc. Software: Practice and Experience, 23(8): 829-850
Randal, A., Sugalski, D., Totsch, L. (2004) Perl 6 and parrot essentials. OReilly Media
Rodríguez-León, C. (2007) Parse: Eyapp manuals. CPAN, http://search.cpan.org/dist/Parse-Eyapp
Rodríguez-León, C., García-Forte, L. (2010) Grammar repository. http://code.google.com/p/grammar-repository
Teixeira, P.L., Bigonha, M.A., Bigonha, R. (2007) A methodology for removing LALR(k) conflicts. Journal of Universal Computer Science, str. 735-752
Thurston, A.D., Cordy, J.R. (2006) A backtracking LR algorithm for parsing ambiguous context-dependent languages. u: Conference of the Centre for advanced studies on collaborative research, CASCON 2006, Toronto, str. 39-53
Tomita, M. (1990) The generalized LR parser/compiler - version 8.4. u: International conference on computational linguistics, COLING90, Proceedings, Helsinki, Finland, str. 59-63
van der Veen, V. (1990) Extended pascal ISO 10206. www.standardpascal.org/iso10206.txt
Wall, L., Christiansen, T., Orward, J. (1996) Programming Perl. Beijing: O'Reilly