How to understand this EBNF Pascal Definition

Lea*_*lia 5 pascal ebnf

I'm implementing a Pascal parser from this EBNF defintion. There is something I don't understand in the following specifications:

variable
   entire-variable | component-variable | referenced-variable 

entire-variable
   variable-identifier | field-identifier

component-variable
   indexed-variable | field-designator | file-buffer

field-designator
   record-variable "." field-identifier 
Run Code Online (Sandbox Code Playgroud)

Assume we want to apply the variable production on a.b[0]. Since a conforms to the entire-variable production, this will prevent component-variable from detecting the field-designator a.b and therefore the . following a will stop the parser.

小智 3

由于 EBNF 没有有序选择,因此通常使用最长匹配来确定应用哪些规则。