public static GenericHiveLexer of(String statement, Configuration configuration) {
    GenericHiveLexer lexer;
    if (Quotation.from(configuration) == Quotation.STANDARD) {
      lexer = new HiveLexerStandard(new ANTLRNoCaseStringStream(statement));
    } else {
      lexer = new HiveLexer(new ANTLRNoCaseStringStream(statement));
    }

    lexer.setHiveConf(configuration);
    for (GenericHiveLexer wrappedLexers : lexer.getDelegates()) {
      wrappedLexers.setHiveConf(configuration);
    }

    return lexer;
  }
Common class of Legacy and SQL Standard Hive Lexer.
parser/src/java/org/apache/hadoop/hive/ql/parse/GenericHiveLexer.java