How to understand ATN graph generated for ANTLR grammar?

Viewed 1477

I have 2 simple lexer rules in my ANTLR4 grammar:

fragment Attrs : '.' ARCH; 
fragment ARCH : 'IA32' | 'X64' | 'IPF' | 'EBC' | 'common';

The generated ATN with ANTLR4.7 is like this (Visual Studio Code):

enter image description here

I searched some references about "ATN", such as this one.

It's beautiful but I don't understand it:

  • What does the number and label in the node mean?
  • What does the epsilon symbol on the arrow line mean?
  • What do the grey and red nodes mean?
1 Answers
Related