|Backtracking yacc jarmo@ksvltd.FI (Jarmo Raiha) (1992-09-10)|
|Re: Backtracking yacc firstname.lastname@example.org (1992-09-11)|
|Re: Backtracking yacc email@example.com (Gary Merrill) (1992-09-11)|
|Re: Backtracking yacc firstname.lastname@example.org (Gary Merrill) (1992-09-14)|
|Re: Backtracking yacc email@example.com (1992-09-16)|
|Re: Backtracking yacc firstname.lastname@example.org.OZ.AU (1992-09-17)|
|Re: Backtracking yacc Jasper.Kamperman@cwi.nl (1992-09-17)|
|Re: Backtracking yacc email@example.com (1992-09-17)|
|Re: Backtracking yacc firstname.lastname@example.org (18-Sep-1992 1420) (1992-09-18)|
|Re: Backtracking yacc email@example.com (Tom Harwood) (1992-09-18)|
|Re: Backtracking yacc firstname.lastname@example.org (1992-09-19)|
|[7 later articles]|
|From:||email@example.com (Ed Ipser)|
|Date:||Wed, 16 Sep 1992 02:55:30 GMT|
Gary Merrill <firstname.lastname@example.org> writes:
>Such tests can, of course, be performed in the lexical analyzer and you
>can use the results of these tests to drive the invocations of your
With all due respect, this is not correct. Throwing the problem to the
lexical analyzer presupposes that the conlfict involves a lexeme; this, of
course, is not the general case.
Attaching conditional tests to productions instead of lexemes allows a
greater degree of freedom with respect to the definition of the language.
In particular, with tests on productions, you can introduce a
differentiation at any point in the language. For example, a production
which contains only nonterminals on the right hand side might be
conditioned on synthesized attributes of the right-hand-side elements,
inherited attributes, or arbitrary global variables or computations on any
of the above.
Note that this has nothing to do with LR vs. LL; any parser scheme can add
Another source of disambiguation that has not been discussed is the use of
regular expression grammars. Because a regular expression collects more
syntax into a single production, it can, by virtue of the LR parsing
method, defer certain choices until a larger part of the input has been
processed. The result is a more natural, and less ambiguous grammar.
The LADE C++/AT utilizes all of these methods to parse C++.
Return to the
Search the comp.compilers archives again.