The definition may be recursive but it doesn't work like that. Basically, it says that a HexIntegerLiteral is one of:
- the case-insensitive prefix
0x
followed by one hex digit, or - a HexIntegerLiteral followed by one hex digit
0x00x00
does not follow this definition. Here is why:
0x0
This is obviously a HIL by the first production.
0x00
This is also a HIL by the second production: the HIL 0x0
(established above) is followed by the hex digit 0
.
0x00x
This is not a HIL, because:
- It is obviously not a result of the first production
- It is also not a result of the second production: the established HIL
0x00
from above is followed by something other than a hex digit.
In other words, the grammar above does not allow this:
(HIL (HIL (HIL (HIL (HIL (HIL HD))))))
What it allows is this:
(HIL (HD (HD (HD (HD (HD))))))