docs: void readRegExp(int startToken)
          throws IOException
      {
          int start = tokenBeg;
          stringBufferTop = 0;
          if (startToken == Token.ASSIGN_DIV) {
              // Miss-scanned /=
              addToString('=');
          } else {
              if (startToken != Token.DIV) Kit.codeBug();
          }
  
          boolean inCharSet = false; // true if inside a '['..']' pair
          int c;
          while ((c = getChar()) != '/' || inCharSet) {
              if (c == '\n' || c == EOF_CHAR) {
                  ungetChar(c);
                  tokenEnd = cursor - 1;
                  this.string = new String(stringBuffer, 0, stringBufferTop);
                  parser.reportError("msg.unterminated.re.lit");
                  return;
              }
              if (c == '\\') {
                  addToString(c);
                  c = getChar();
              } else if (c == '[') {
                  inCharSet = true;
              } else if (c == ']') {
                  inCharSet = false;
              }
              addToString(c);
          }
          int reEnd = stringBufferTop;
  
          while (true) {
              if (matchChar('g'))
                  addToString('g');
              else if (matchChar('i'))
                  addToString('i');
              else if (matchChar('m'))
                  addToString('m');
              else if (matchChar('y'))  // FireFox 3
                  addToString('y');
              else
                  break;
          }
          tokenEnd = start + stringBufferTop + 2;  // include slashes
  
          if (isAlpha(peekChar())) {
              parser.reportError("msg.invalid.re.flag");
          }
  
          this.string = new String(stringBuffer, 0, reEnd);
          this.regExpFlags = new String(stringBuffer, reEnd,
                                        stringBufferTop - reEnd);
      }