The grammar rules for an identifier is as follows:
id:: atom | id . atom | id . [ expr ]
| id . atom
| id . [ expr ]