tags:

views:

111

answers:

2

Lets say the same grammar is not LR(1), can we safely say that the grammar is not LALR too?

if not, what are the conditions for a grammar to be LALR? (or what are the conditions that make a grammar not LALR)

Thanks for the help!

A: 

This document compares both.

stacker
+1  A: 

LALR(1) ⊂ LR(1), so yes, we can assume that. The two grammars express languages in a similar manner, but LR(1) keeps track of more left state than LALR(1). Cf. These lecture notes, which discuss the differences in state between the two representations.

In general, parser generators will handle all the details of creating the shift-reduce steps for you; the difference is that generators based on the larger grammars are more likely to find conflict-free parsing strategies.

Charles Stewart