code: public Expression primaryExpression() {
          TokenType t = la();
  
          Token token = null;
  
          switch (t) {
              case THIS:
                  return factory.thisExpression(consume());
              case IDENTIFIER:
                  token = consume(IDENTIFIER);
                  if (!isValidIdentifier(token)) {
                      throw new SyntaxError(token, "invalid identifier: " + token.getText());
                  }
                  return factory.identifier(token, token.getText());
              case STRING_LITERAL:
                  token = consume(STRING_LITERAL);
                  if (currentContext().isStrict() && token.isEscapedOctalString()) {
                      throw new SyntaxError(token, "octal escapes not allowed in strict mode");
                  }
                  return factory.stringLiteral(token, token.getText(), token.isEscapedString(), token.isContinuedLine());
              case DECIMAL_LITERAL:
                  token = consume(DECIMAL_LITERAL);
                  return factory.decimalLiteral(token, token.getText());
              case HEX_LITERAL:
                  token = consume(HEX_LITERAL);
                  return factory.hexLiteral(token, token.getText());
              case OCTAL_LITERAL:
                  token = consume(OCTAL_LITERAL);
                  if (currentContext().isStrict()) {
                      throw new SyntaxError(token, "octal literals not allowed in strict mode");
                  }
                  return factory.octalLiteral(token, token.getText());
              case REGEXP_LITERAL:
                  token = consume(REGEXP_LITERAL);
                  return factory.regexpLiteral(token, token.getText());
              case TRUE:
                  return factory.trueLiteral(consume());
              case FALSE:
                  return factory.falseLiteral(consume());
              case NULL:
                  return factory.nullLiteral(consume());
              case LEFT_BRACE:
                  return objectLiteral();
              case LEFT_BRACKET:
                  return arrayLiteral();
              case LEFT_PAREN:
                  consume(LEFT_PAREN);
                  try {
                      ++this.parens;
                      Expression expr = expression();
                      consume(RIGHT_PAREN);
                      return expr;
                  } finally {
                      --this.parens;
                  }
          }
  
          throw new SyntaxError(laToken(), "unexpected token: " + laToken().getText());
      }
docs: ----------------------------------------------------------------------