LibreOffice Module connectivity (master) 1
Macros | Functions | Variables
sqlflex.l File Reference
#include "sal/config.h"
#include <cstdarg>
#include <string.h>
#include <connectivity/internalnode.hxx>
#include "sqlbison.hxx"
#include <osl/diagnose.h>
#include <rtl/strbuf.hxx>
#include <connectivity/sqlparse.hxx>
#include <connectivity/sqlscan.hxx>
Include dependency graph for sqlflex.l:

Go to the source code of this file.

Macros

#define YY_EXIT   1
 
#define INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L
 
#define SQLYYDEBUG   1
 
#define YY_NO_UNISTD_H
 
#define SQL_NEW_NODE(text, token)    SQLyylval.pParseNode = new OSQLInternalNode(text, token);
 
#define SQL_NEW_KEYWORD(token)    SQLyylval.pParseNode = new OSQLInternalNode("", SQLNodeType::Keyword, (token)); return token;
 
#define SQL_NEW_INTNUM   SQL_NEW_NODE(OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQLNodeType::IntNum); return SQL_TOKEN_INTNUM;
 
#define SQL_NEW_APPROXNUM   SQL_NEW_NODE(OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQLNodeType::ApproxNum); return SQL_TOKEN_APPROXNUM;
 
#define SQL_NEW_DATE   SQL_NEW_NODE(OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQLNodeType::AccessDate); return SQL_TOKEN_ACCESS_DATE;
 
#define YY_INPUT(buf, result, max_size)
 
#define YY_FATAL_ERROR(msg)
 

Functions

static sal_Int32 gatherString (int delim, sal_Int32 nTyp)
 
static sal_Int32 gatherName (const char *)
 
static sal_Int32 gatherNamePre (const char *text)
 Read SQL Name literal for predicate check Valid Names or international keywords: As we have international keywords, we test first on them. More...
 
static void do_fatal_error (const char *msg)
 
int yylex (void)
 
bool checkeof (int c)
 
sal_Int32 mapEnumToToken (IParseContext::InternationalKeyCode _eKeyCode)
 

Variables

OSQLScannerxxx_pGLOBAL_SQLSCAN = nullptr
 
static bool IN_SQLyyerror
 

Macro Definition Documentation

◆ INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L

#define INCLUDED_CONNECTIVITY_SOURCE_PARSE_SQLFLEX_L

Definition at line 44 of file sqlflex.l.

◆ SQL_NEW_APPROXNUM

#define SQL_NEW_APPROXNUM   SQL_NEW_NODE(OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQLNodeType::ApproxNum); return SQL_TOKEN_APPROXNUM;

Definition at line 87 of file sqlflex.l.

◆ SQL_NEW_DATE

#define SQL_NEW_DATE   SQL_NEW_NODE(OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQLNodeType::AccessDate); return SQL_TOKEN_ACCESS_DATE;

Definition at line 88 of file sqlflex.l.

◆ SQL_NEW_INTNUM

#define SQL_NEW_INTNUM   SQL_NEW_NODE(OUString(SQLyytext,strlen(SQLyytext),RTL_TEXTENCODING_UTF8), SQLNodeType::IntNum); return SQL_TOKEN_INTNUM;

Definition at line 86 of file sqlflex.l.

◆ SQL_NEW_KEYWORD

#define SQL_NEW_KEYWORD (   token)     SQLyylval.pParseNode = new OSQLInternalNode("", SQLNodeType::Keyword, (token)); return token;

Definition at line 83 of file sqlflex.l.

◆ SQL_NEW_NODE

#define SQL_NEW_NODE (   text,
  token 
)     SQLyylval.pParseNode = new OSQLInternalNode(text, token);

Definition at line 80 of file sqlflex.l.

◆ SQLYYDEBUG

#define SQLYYDEBUG   1

Definition at line 47 of file sqlflex.l.

◆ YY_EXIT

#define YY_EXIT   1

Definition at line 24 of file sqlflex.l.

◆ YY_FATAL_ERROR

#define YY_FATAL_ERROR (   msg)
Value:
{ \
do_fatal_error(msg); \
}

Definition at line 104 of file sqlflex.l.

◆ YY_INPUT

#define YY_INPUT (   buf,
  result,
  max_size 
)
Value:
{ \
result = (c == EOF) ? YY_NULL : (buf[0] = c, 1);\
}
sal_Int32 SQLyygetc()
Definition: sqlflex.l:781
OSQLScanner * xxx_pGLOBAL_SQLSCAN
Definition: sqlflex.l:78

Definition at line 90 of file sqlflex.l.

◆ YY_NO_UNISTD_H

#define YY_NO_UNISTD_H

Definition at line 67 of file sqlflex.l.

Function Documentation

◆ checkeof()

bool checkeof ( int  c)
inline

Definition at line 513 of file sqlflex.l.

Referenced by gatherString(), and connectivity::OSQLScanner::SQLyyerror().

◆ do_fatal_error()

static void do_fatal_error ( const char *  msg)
static

Definition at line 97 of file sqlflex.l.

References connectivity::OSQLScanner::SQLyyerror(), and xxx_pGLOBAL_SQLSCAN.

◆ gatherName()

sal_Int32 gatherName ( const char *  text)
static

◆ gatherNamePre()

sal_Int32 gatherNamePre ( const char *  text)
static

Read SQL Name literal for predicate check Valid Names or international keywords: As we have international keywords, we test first on them.

Definition at line 653 of file sqlflex.l.

References connectivity::OSQLScanner::GetCurrentPos(), connectivity::OSQLScanner::getInternationalTokenID(), connectivity::OSQLScanner::getStatement(), mapEnumToToken(), nLength, nPos, nToken, SQL_NEW_KEYWORD, SQL_NEW_NODE, text(), and xxx_pGLOBAL_SQLSCAN.

◆ gatherString()

sal_Int32 gatherString ( int  delim,
sal_Int32  nTyp 
)
static

Definition at line 524 of file sqlflex.l.

References ch, checkeof(), SQL_NEW_NODE, and YY_FATAL_ERROR.

◆ mapEnumToToken()

sal_Int32 mapEnumToToken ( IParseContext::InternationalKeyCode  _eKeyCode)

Definition at line 570 of file sqlflex.l.

Referenced by gatherName(), and gatherNamePre().

◆ yylex()

int yylex ( void  )

Definition at line 119 of file sqlflex.l.

Variable Documentation

◆ IN_SQLyyerror

bool IN_SQLyyerror
static

◆ xxx_pGLOBAL_SQLSCAN

OSQLScanner* xxx_pGLOBAL_SQLSCAN = nullptr