visitNonterminal<E> method

  1. @override
Expression visitNonterminal<E>(
  1. Nonterminal<E> node
)
override

Implementation

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

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