visitTerminal<E> method

  1. @override
Expression visitTerminal<E>(
  1. Terminal<E> node
)
override

Implementation

@override
Expression visitTerminal<E>(Terminal<E> node) {
  var rule = _rules[node] as TerminalRule<E>?;
  if (rule == null) {
    rule = TerminalRule<E>(node.name);
    _rules[node] = rule;
    final expression =
        visitOrderedChoice<E>(node) as OrderedChoiceExpression<E>;
    rule.expression = expression;
    expression.rule = rule;
  }

  final symbol = TerminalSymbol<E>();
  _addCaller(rule, symbol);
  return symbol;
}