File: //usr/local/CyberCP/lib/python3.10/site-packages/sqlparse/__pycache__/lexer.cpython-310.pyc
o
�hg � @ s\ d Z ddlZddlmZ ddlmZ ddlmZmZ ddl m
Z
G dd� d�Zdd d
�ZdS )z SQL Lexer� N)�Lock)�
TextIOBase)�tokens�keywords)�consumec @ sX e Zd ZdZdZe� Zedd� �Zdd� Z dd� Z
d d
� Zdd� Zd
d� Z
ddd�ZdS )�LexerzrThe Lexer supports configurable syntax.
To add support for additional keywords, use the `add_keywords` method.Nc C s^ | j �! | jdu r| � | _| j�� W d � | jS W d � | jS 1 s'w Y | jS )zRReturns the lexer instance used internally
by the sqlparse core functions.N)�_lock�_default_instance�default_initialization)�cls� r �A/usr/local/CyberCP/lib/python3.10/site-packages/sqlparse/lexer.py�get_default_instance0 s
��
��zLexer.get_default_instancec C s� | � � | �tj� | �tj� | �tj� | �tj� | �tj� | �tj � | �tj
� | �tj� | �tj� | �tj
� dS )zlInitialize the lexer with default dictionaries.
Useful if you need to revert custom syntax settings.N)�clear�
set_SQL_REGEXr � SQL_REGEX�add_keywords�KEYWORDS_COMMON�KEYWORDS_ORACLE�KEYWORDS_MYSQL�KEYWORDS_PLPGSQL�KEYWORDS_HQL�KEYWORDS_MSACCESS�KEYWORDS_SNOWFLAKE�KEYWORDS_BIGQUERY�KEYWORDS��selfr r r
r
: s zLexer.default_initializationc C s g | _ g | _dS )z�Clear all syntax configurations.
Useful if you want to load a reduced set of syntax configurations.
After this call, regexps and keyword dictionaries need to be loaded
to make the lexer functional again.N)�
_SQL_REGEX� _keywordsr r r r
r I s
zLexer.clearc s$ t jt jB � � fdd�|D �| _dS )z.Set the list of regex that will parse the SQL.c s"