match method

int match(
  1. CharStream input,
  2. int mode
)

Implementation

int match(CharStream input, int mode) {
  this.mode = mode;
  final mark = input.mark();
  try {
    startIndex = input.index;
    prevAccept.reset();
    final dfa = decisionToDFA[mode];
    if (dfa.s0 == null) {
      return matchATN(input);
    } else {
      return execATN(input, dfa.s0!);
    }
  } finally {
    input.release(mark);
  }
}