public static void expandQuoteMacroToken(StellaToken quotedlist) {
    { String quotestring = quotedlist.content;

      { StellaToken self000 = StellaToken.newStellaToken();

        self000.type = Stella.KWD_SYMBOL;
        self000.logicalTokenType = Stella.KWD_SYMBOL;
        self000.content = (Stella.stringEqlP(quotestring, "'") ? "QUOTE" : "BQUOTE");
        self000.module = "/STELLA";
        self000.next = ((StellaToken)(quotedlist.next));
        { StellaToken token = self000;
          Keyword tokentype = null;
          int balance = 0;

          quotedlist.type = Stella.KWD_OPEN_PAREN;
          quotedlist.logicalTokenType = Stella.KWD_OPEN_PAREN;
          quotedlist.content = "(";
          quotedlist.next = token;
          quotedlist = ((StellaToken)(token.next));
          loop000 : for (;;) {
            tokentype = quotedlist.logicalTokenType;
            if (tokentype == null) {
              break loop000;
            }
            if (tokentype == Stella.KWD_OPEN_PAREN) {
              balance = balance + 1;
            }
            else if (tokentype == Stella.KWD_CLOSE_PAREN) {
              balance = balance - 1;
              if (balance == 0) {
                break loop000;
              }
              else if (balance < 0) {
                { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

                  stream000.nativeStream.print("Illegal `" + quotestring + "' syntax");
                  throw ((ReadException)(ReadException.newReadException(stream000.theStringReader()).fillInStackTrace()));
                }
              }
            }
            else {
              if (balance == 0) {
                break loop000;
              }
            }
            quotedlist = ((StellaToken)(quotedlist.next));
          }
          if (tokentype == null) {
            { OutputStringStream stream001 = OutputStringStream.newOutputStringStream();

              stream001.nativeStream.print("EOF encountered while parsing `" + quotestring + "' syntax");
              throw ((ReadException)(ReadException.newReadException(stream001.theStringReader()).fillInStackTrace()));
            }
          }
          { StellaToken self005 = StellaToken.newStellaToken();

            self005.type = Stella.KWD_CLOSE_PAREN;
            self005.logicalTokenType = Stella.KWD_CLOSE_PAREN;
            self005.content = ")";
            self005.next = ((StellaToken)(quotedlist.next));
            token = self005;
          }
          quotedlist.next = token;
        }
      }
    }
  }