code: @Override
      public Object symbol(int symbol) throws ActionException {
          List<RegExpr> lst;
          int i;
          int max;
          RegExpr re;
          RegExpr[] args;
  
          if (expanding.contains(symbol)) {
              throw new ActionException("illegal recursion in scanner section for symbol " + symbolTable.getOrIndex(symbol));
          }
          used.add(symbol);
  
          lst = new ArrayList<RegExpr>();
          for (i = 0; i < rules.length; i++) {
              if (rules[i].getLeft() == symbol) {
                  lst.add(rules[i].getRight());
              }
          }
          max = lst.size();
          if (max == 0) {
              throw new ActionException("illegal reference to parser symbol '" + symbolTable.getOrIndex(symbol)
                      + "' from scanner section");
          } else if (max == 1) {
              re = lst.get(0);
          } else {
              args = new RegExpr[max];
              lst.toArray(args);
              re = new Choice(args);
          }
          expanding.add(symbol);
          re = (RegExpr) re.visit(this);
          expanding.remove(symbol);
          return re;
      }
docs: --