These are the static context conditions that you have to enforce in the assignment where you build the symbol table for declarations. There are many more context conditions that will be added later when we build the abstract syntax tree for expressions and instructions.
PROGRAMand the identifier after the corresponding
ENDmust be identical; that identifier is not added to the symbol table however.
Typeproduction (i.e. the first alternative) must denote a type; it is an error if that identifier denotes anything else (a constant or a variable).
Remember that as long as we don’t have the abstract syntax tree we don’t know the values of constant integers yet; for now just assume that every integer you need in order to process declarations has a value of 5 (five).