following is the ebnf grammar that i wish to get their first/follow and director set and convert it into LL(1). please help if can..
Program = { ClassDecl } EOF.
ClassDecl = “class” ident “{“ DeclSeq “}”.
DeclSeq = Declaration { Declaration }.
Declaration = ConstDecl | FieldDecl | MethodDecl.
ConstDecl = Attribute “const” BasicType ident “=” Expression “;”.
FieldDecl = Attribute Type ident IdDecl “;”
MethodDecl = Attribute Type ident “(“ [ Params ] “)”“{“ { Statement } “}”.
BasicType = “int” | “bool” | “char” | “string” | “void”.
TypeName = BasicType | ClassIdent.
Type = TypeName [ “[]” ].
Params = Type ident { “,” Type ident }.
Attribute = (“public” | “private”) [ “static” ].
Statement = “;” | “{“ { Statement } “}” | Assignment “;”| MethodCall “;”
| LocalDecl “;” | “if” “(“ Expression “)” Statement [ else Statement ]
| “while” “(“ Expression “)” Statement
|“do” Statement “while” “(“ Expression “)” | “return” [ Expression ] “;”.
Assignment=Designator “=” Expression.
MethodCall =Designator “(“ [ Expression { “,” Expression } ] “)”.
LocalDecl=Type ident IdDecl.
Expression=AndExpression { “||” AndExpression }.
AndExpression=RelExpression { “&&” RelExpression }.
RelExpression =SimpleExpression [ Relop SimpleExpression].
SimpleExpression=Term { Addop Term}.
Term =Factor { Mulop Factor }.
Factor=Primary | (“+” | “-“ | “!” ) Factor.
Primary=Designator [“(“ [ Expression { “,” Expression } ] “)” ] | “(“ Expression )”
| Constructor | “true” | “false” | “null” | number | litString | charLit.
Designator =(“this” | ident) { “.” ident | “[“ SimpleExpression “]” }.
Constructor =“new” ( TypeName “[“ SimpleExpression “]” | ClassIdent “(“ ”)” ).
ClassIdent =ident.
IdDecl=[“=” Expression] {“,” ident [ “=” Expression] }
Relop=“<=” | “<” | “>” | “>=” | “==” | “!=”.
Addop=“+” | “-“.
Mulop=“*” | “/”.
|