private IToken tryResolveExtraToken() {
        SQLDocumentSyntaxContext syntaxContext = this.editor == null ? null : this.editor.getSyntaxContext();
        if (syntaxContext == null) {
            return Token.UNDEFINED;
        }
        
        int offset = this.getOffset();
        SQLQuerySymbolEntry entry = syntaxContext.findToken(offset);
        if (entry != null) {
            int end = syntaxContext.getLastAccessedTokenOffset() + entry.getInterval().length();
            if (end > offset) {
                if (DEBUG) {
                    StringBuilder sb = new StringBuilder();
                    while (this.getOffset() < end) {
                        int c = super.read();
                        if (c == RuleBasedScanner.EOF) {
                            return Token.UNDEFINED;
                        }
                        sb.append((char) c);
                    }
                    System.out.println("found @" + offset + "-" + end + " " + entry + " = " + sb);
                } else {
                    while (this.getOffset() < end) {
                        if (super.read() == RuleBasedScanner.EOF) {
                            return Token.UNDEFINED;
                        }
                    }
                }
                return this.extraSyntaxTokens.computeIfAbsent(
                    entry.getSymbolClass().getTokenType(),
                    tt -> new SQLTokenAdapter(new LazyToken(tt), this)
                );
            } else {
                return Token.UNDEFINED;
            }
        } else {
            return Token.UNDEFINED;
        }
    }
SQLRuleScanner.

Contains information about some concrete datasource underlying database syntax.
Support runtime change of datasource (reloads syntax information)
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/syntax/SQLRuleScanner.java