@IvenBach I would like to add two pieces of information regarding the lexer and parser rules:
First, the only difference between fragment rules and token rules is that fragments will never be returned as tokens. In our grammer this prevents sinlge letters to be returned as tokens, which the parser would not understand. You actually do not need to use fragments in the token rules; you could use string literals instead. We just use fragments because VBA is case-insensitive.
Second, whenever you have ambiguous lexer or parser rules, i.e. multiple rules can match the input, the topmost rule in …