001package gudusoft.gsqlparser;
002
003/**
004 * Power Query M-Language lexer (hand-written).
005 *
006 * <p>Unlike every other {@code TLexer<Vendor>} in this repository this
007 * class is NOT generated from a {@code .l} file and does NOT consume a
008 * {@code *_lex_table.txt} DFA table.  It exists only to satisfy the
009 * {@link TCustomLexer} API contract; the actual M-language tokenization
010 * runs in
011 * {@link gudusoft.gsqlparser.parser.powerquery.PowerQueryTokenizer}.
012 *
013 * <p>Naming: this file deliberately avoids the {@code TLexer} prefix so
014 * the project's generated-file hook leaves it alone — see
015 * {@code .claude/hooks/protect-generated-files.sh}.  When (if) the full
016 * YACC grammar is ever regenerated, the generated
017 * {@code TLexerPowerQuery.java} can coexist and {@code PowerQuerySqlParser}
018 * would flip over.
019 */
020public class PowerQueryLexer extends TCustomLexer {
021
022    static {
023        if (TBaseType.enterprise_edition || TBaseType.powerquery_edition) {
024            // No table to init; keyword/operator recognition lives in
025            // PowerQueryTokenizer.
026        }
027    }
028
029    public PowerQueryLexer() {
030        super();
031        dbvendor = EDbVendor.dbvpowerquery;
032        sourcetokens = new TSourceTokenList();
033    }
034
035    public TSourceTokenList sourcetokens;
036
037    public boolean canBeColumnName(int tokencode) {
038        return false;
039    }
040
041    public int iskeyword(String str) {
042        return -1;
043    }
044
045    public int getkeywordvalue(String keyword) {
046        return 0;
047    }
048}