Start symbol

The first nonterminal symbol defined in the rules section is called the start symbol. This symbol is taken to be the largest, most general structure described by the grammar rules. For example, if you are generating the parser for a compiler, the start symbol should describe what a complete program looks like in the language to be parsed.

If you do not want the first grammar rule to be taken as the start symbol, you can use the directive:
%start name
in your rules section. This indicates that the nonterminal symbol name is the start symbol. name must be defined somewhere in the rules section.

The start symbol must be all-encompassing: Every other rule in the grammar must be related to it. In a sense, the grammar rules form a tree: The root is the start symbol, the first set of branches are the symbols that make up the start symbol, the next set of branches are the symbols that make up the first set, and so on. Any symbol that is outside this tree is reported as a useless variable in yacc output. The parser ignores useless variables; it is looking for a complete start symbol, and nothing else.