tok = lexer.getNext(); if (tok.getType() != RoseToken.STRING)
tok = lexer.peekNext(); if (tok.getType() != RoseToken.STRING && tok.getType() != RoseToken.VERTICAL_BAR)
  private RoseNode parseList(String key)  {        boolean wasAllowed = isAllowed;        if (noLogicalPresentation)     {      if (key.equals("logical_presentations"))       {        isAllowed = false;      }       else       {        isAllowed = true;      }    }     else     {      isAllowed = true;    }        if (!isListMapping)     {      isAllowed = false;    }    RoseNode root = null;    RoseToken tok;    tok = lexer.getNext();    if (tok.getType() != RoseToken.LIST)     {      System.out.println("  Parsing error in parseList - expecting list token");      return null;    }    tok = lexer.getNext();    if (tok.getType() != RoseToken.STRING)     {      System.out.println("  Parsing error in parseList - expecting string");      return null;    }    String label = tok.getValue();    tok = lexer.peekNext();    if (tok.getType() == RoseToken.LEFT_PAREN)     {      root = null;      if (!isTreeOnly || isAllowed)       {        root = new RoseNode(key, label, RoseNode.LIST);      }      while (true)       {        tok = lexer.getNext();        if (tok.getType() != RoseToken.LEFT_PAREN)         {          System.out.println("  Parsing error in parseList - expecting left parenthesis");          return null;        }        RoseNode node = parseObject("");        if (isTreeOnly)         {          if (root != null && node != null)          {            root.addNode(node);          }        }         else         {          if (node == null)           {             return null;          }          root.addNode(node);        }        tok = lexer.getNext();        if (tok.getType() != RoseToken.RIGHT_PAREN)         {          System.out.println("  Parsing error in parseList - expecting right parenthesis");          return null;        }        tok = lexer.peekNext();        if (tok.getType() == RoseToken.RIGHT_PAREN)        {          break;        }      }    }     else if (tok.getType() == RoseToken.RIGHT_PAREN)     {      root = null;      if (!isTreeOnly || isAllowed)       {        root = new RoseNode(key, label, RoseNode.LIST);      }    }     else if (tok.getType() == RoseToken.STRING)     {      root = null;      if (!isTreeOnly || isAllowed)       {        root = new RoseNode(key, label, RoseNode.LIST);      }      while (true)       {        tok = lexer.getNext();        if (tok.getType() != RoseToken.STRING)         {          System.out.println("  Parsing error in parseList - expecting string");          return null;        }        RoseNode node = null;        node = new RoseNode("", tok.getValue(), RoseNode.STRING);        if (root != null)        {          root.addNode(node);        }        tok = lexer.peekNext();        if (tok.getType() == RoseToken.RIGHT_PAREN)         {          break;        }      }          }     else     {      lexer.getNext();      System.out.println("  Parsing error in parseList - expecting left/right parenthesis or string "+tok.lineNum);      root = null;    }    isAllowed = wasAllowed;    return root;  }