Previous: , Up: Bovine Grammar Rules   [Contents]

2.3 Order of components in rules

If a rule has multiple components, order is important, for example

headerfile : symbol PERIOD symbol
           | symbol
           ;

would match ‘foo.h’ or the C++ header ‘foo’. The bovine parser will first attempt to match the long form, and then the short form. If they were in reverse order, then the long form would never be tested.