I got one grammar:
re2: re1 $
re1: expr == expr | expr != expr | expr < expr | expr <= expr | expr >= expr | expr > expr | expr
expr: expr + term | expr - term | term
term: term * factor | term / factor | factor
factor: (expr) | num | id
num: (0|1|2|3|4|5|6|7|8|9)num | ε
id: (a|b|....|z|A|B|....|Z|)id | ε
Here are the FOLLOW sets:
FOLLOW(r2) = {}
FOLLOW(r1) = {$}
FOLLOW(expr) = {=,!,<,>,+,-,)}
FOLLOW(term) = FOLLOW(factor) = FOLLOW (id) = FOLLOW (num) = {=,!,<,>,+,-,),*,/}
Now this grammar clearly got reduce-reduce conflict from num: ε and id: ε because FOLLOW(num) ∩ FOLLOW(id) != empty set
Now let's say I fix the grammar by doing the following (I assume it is mistake in the grammar because (ε == ε) makes no sense):
num: (0|1|2|3|4|5|6|7|8|9)num | (0|1|2|3|4|5|6|7|8|9)
id: (a|b|....|z|A|B|....|Z|)id | (a|b|....|z|A|B|....|Z|)
Now my question is, is this grammar SLR i.e can it be parsed by SLR parser? I know by building the parser I can find out but on exam I can not make the whole parser and then determine (I would lose lot of time).