compiler construction - LL1 grammar in compiling -
compiler construction - LL1 grammar in compiling -
i have question ll1 grammar. if have grammar this:
<s>::=<a> <a>::=<a> auto cat | epsilon
what first <a>
can be? epsilon? , if epsilon, language not ll1! confused...
first(a) = {epsilon, car}
if non-terminal , : α production, add together first( ). if : epsilon production, add together epsilon first( ).
if : α1 α2 α3 ... αm production, add together first( α1 ) first( ). if α1 derives epsilon, add together first( α2 ) first( ). if both α1 , α2 derive epsilon, add together first( α3 ) first( ), , on.
compiler-construction programming-languages
Comments
Post a Comment