Re: predicate parsing

isckbk@nuscc.nus.sg (Kiong Beng Kee)
Fri, 23 Apr 1993 13:36:32 GMT

          From comp.compilers

Related articles
predicate parsing tamches@wam.umd.edu (Ariel Meir Tamches) (1993-04-21)
Re: predicate parsing dave@cs.arizona.edu (1993-04-22)
predicate parsing bevan@computer-science.manchester.ac.uk (Stephen J Bevan) (1993-04-22)
Re: predicate parsing isckbk@nuscc.nus.sg (1993-04-23)
Re: predicate parsing simonh@swidev.demon.co.uk (1993-04-23)
Re: predicate parsing mauney@csljon.csl.ncsu.edu (1993-04-27)
Re: predicate parsing isckbk@nuscc.nus.sg (1993-04-28)
predicate parsing tfj@apusapus.demon.co.uk (Trevor Jenkins) (1993-04-28)
Re: predicate parsing mauney@csljon.csl.ncsu.edu (1993-04-29)
Re: predicate parsing andrewd@winnie.cs.adelaide.edu.au (1993-04-29)
[1 later articles]
| List of all articles for this month |

Newsgroups: comp.compilers
From: isckbk@nuscc.nus.sg (Kiong Beng Kee)
Keywords: LALR, parse
Organization: National University of Singapore
References: 93-04-077
Date: Fri, 23 Apr 1993 13:36:32 GMT

tamches@wam.umd.edu (Ariel Meir Tamches) writes:
: It's hard to imagine how one can insert arbitrary predicates in a
: bottom-up parser; for the same reason it's hard for bottom-up parsers to
: have inherited attributes - their control flow is "screwy" - top-down is


The predicates used in LADE are called 'conditionals'. Since bottom-up
parsing is happy to accomodate more than one possibility, it does not need
predicates to tell it which nonterminal to predict. However, it uses
conditionals to dynamically resolve shift-reduce and reduce-reduce
conflicts (rather than rules at table generation time as in YACC).


Inherited attributes in LADE is somewhat implicit, and quite equivalent to
global variables with (invisible) mechanisms for saving and restoring such
values. It gets the job done efficiently, and is better than in YACC, but
maybe not as nicely as in a top-down parser.


Compared with a top-down approach, I suspect that the LADE approach
requires fewer predicates.
--
Kiong Beng Kee
Dept of Information Systems and Computer Science
National University of Singapore
Lower Kent Ridge Road, SINGAPORE 0511
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.