code: public void printAnnotations(Appendable out) throws IOException
      {
          boolean f = true;
          out.append("@Terminals({\n");
          for (T terminal : terminalMap.values())
          {
              if (!isAnonymousTerminal(terminal.name))
              {
                  if (f)
                  {
                      f = false;
                  }
                  else
                  {
                      out.append(",");
                  }
                  terminal.printAnnotation(out);
                  out.append('\n');
              }
          }
          out.append("})\n");
          out.append("@Rules({\n");
          f = true;
          for (R rule : ruleSet)
          {
              if (!rule.synthetic)
              {
                  if (f)
                  {
                      f = false;
                  }
                  else
                  {
                      out.append(",");
                  }
                  rule.printAnnotation(out);
                  out.append('\n');
              }
          }
          out.append("})\n");
      }
docs: Prints @Terminals and @Rules annotations
  @param out
  @throws IOException