CUBRID Engine  latest
double_byte_support.c File Reference
#include "config.h"
#include <stdio.h>
#include "parser.h"
#include "language_support.h"
Include dependency graph for double_byte_support.c:

Go to the source code of this file.

Macros

#define MAX_UNGET_SIZE   16
 
#define WSPACE_CHAR   0xa1a1
 
#define DBCS_UNGET_RETURN(X, Y)   do { *dbcs_Unget_buf++ = (X); return(Y); } while(0)
 
#define DBCS_STATUS_RETURN(X, Y)   do { dbcs_Input_status = X; return(Y); } while(0)
 
#define DBCS_STATUS_UNGET_RETURN(X, Y, Z)
 
#define DBCS_NEXT_CHAR(p)   ((p->next_byte)(p))
 

Enumerations

enum  DBCS_INPUT_STATUS {
  CSQL_, CSQL_BEGIN_, C_COMMENT_, C_COMMENT_BEGIN_,
  SQL_COMMENT_, SQL_COMMENT_BEGIN_, CPP_COMMENT_, CPP_COMMENT_BEGIN_,
  DQS_, DQS_OCTAL_, DQS_HEXA_, DQS_HEXA_BEGIN_,
  DQS_HEXA_BEGIN_2, DQS_DECIMAL_, DQS_TRANSPARENT_, DQS_TRANSPARENT_2,
  SQS_, SQS_TRANSPARENT_
}
 

Functions

static int dbcs_get_next_w_char (PARSER_CONTEXT *parser)
 
static int dbcs_convert_w_char (int input_char)
 
static int dbcs_get_next_token_wchar (PARSER_CONTEXT *parser)
 
static int dbcs_process_csql (PARSER_CONTEXT *parser, int converted_char)
 
static int dbcs_process_double_quote_string (PARSER_CONTEXT *parser, int input_char, int converted_char)
 
static int dbcs_process_double_quote_string_octal (PARSER_CONTEXT *parser, int input_char, int converted_char)
 
static int dbcs_process_double_quote_string_hexa (PARSER_CONTEXT *parser, int input_char, int converted_char)
 
static int dbcs_process_double_quote_string_decimal (PARSER_CONTEXT *parser, int input_char, int converted_char)
 
static int dbcs_process_single_quote_string (PARSER_CONTEXT *parser, int input_char, int converted_char)
 
static int dbcs_process_c_comment (PARSER_CONTEXT *parser, int input_char, int converted_char)
 
void dbcs_start_input (void)
 
int dbcs_get_next (PARSER_CONTEXT *parser)
 

Variables

static int DBCS_UNGET_BUF [MAX_UNGET_SIZE]
 
static int * dbcs_Unget_buf
 
static unsigned int dbcs_Latter_byte
 
static int dbcs_Latter_flag
 
static DBCS_INPUT_STATUS dbcs_Input_status
 

Macro Definition Documentation

#define DBCS_NEXT_CHAR (   p)    ((p->next_byte)(p))

Definition at line 44 of file double_byte_support.c.

Referenced by dbcs_get_next_w_char().

#define DBCS_STATUS_RETURN (   X,
 
)    do { dbcs_Input_status = X; return(Y); } while(0)

Definition at line 37 of file double_byte_support.c.

Referenced by dbcs_get_next_token_wchar(), and dbcs_process_c_comment().

#define DBCS_STATUS_UNGET_RETURN (   X,
  Y,
 
)
Value:
*dbcs_Unget_buf++ = (Y); return(Z); } while(0)
static DBCS_INPUT_STATUS dbcs_Input_status
static int * dbcs_Unget_buf

Definition at line 40 of file double_byte_support.c.

Referenced by dbcs_process_double_quote_string(), and dbcs_process_single_quote_string().

#define DBCS_UNGET_RETURN (   X,
 
)    do { *dbcs_Unget_buf++ = (X); return(Y); } while(0)
#define MAX_UNGET_SIZE   16

Definition at line 31 of file double_byte_support.c.

#define WSPACE_CHAR   0xa1a1

Definition at line 32 of file double_byte_support.c.

Referenced by dbcs_convert_w_char().

Enumeration Type Documentation

Enumerator
CSQL_ 
CSQL_BEGIN_ 
C_COMMENT_ 
C_COMMENT_BEGIN_ 
SQL_COMMENT_ 
SQL_COMMENT_BEGIN_ 
CPP_COMMENT_ 
CPP_COMMENT_BEGIN_ 
DQS_ 
DQS_OCTAL_ 
DQS_HEXA_ 
DQS_HEXA_BEGIN_ 
DQS_HEXA_BEGIN_2 
DQS_DECIMAL_ 
DQS_TRANSPARENT_ 
DQS_TRANSPARENT_2 
SQS_ 
SQS_TRANSPARENT_ 

Definition at line 46 of file double_byte_support.c.

Function Documentation

static int dbcs_convert_w_char ( int  input_char)
static
int dbcs_get_next ( PARSER_CONTEXT parser)

Definition at line 102 of file double_byte_support.c.

References dbcs_get_next_token_wchar(), dbcs_Latter_byte, and dbcs_Latter_flag.

Referenced by parser_parse_file(), parser_parse_string_with_escapes(), and pt_init_one_statement_parser().

Here is the caller graph for this function:

static int dbcs_get_next_w_char ( PARSER_CONTEXT parser)
static
static int dbcs_process_c_comment ( PARSER_CONTEXT parser,
int  input_char,
int  converted_char 
)
static

Definition at line 555 of file double_byte_support.c.

References CSQL_BEGIN_, dbcs_convert_w_char(), dbcs_get_next_w_char(), DBCS_STATUS_RETURN, dbcs_Unget_buf, and DBCS_UNGET_RETURN.

Referenced by dbcs_get_next_token_wchar().

Here is the caller graph for this function:

static int dbcs_process_csql ( PARSER_CONTEXT parser,
int  converted_char 
)
static
static int dbcs_process_double_quote_string ( PARSER_CONTEXT parser,
int  input_char,
int  converted_char 
)
static
static int dbcs_process_double_quote_string_decimal ( PARSER_CONTEXT parser,
int  input_char,
int  converted_char 
)
static

Definition at line 266 of file double_byte_support.c.

References dbcs_Input_status, dbcs_process_double_quote_string(), and DQS_.

Referenced by dbcs_get_next_token_wchar().

Here is the caller graph for this function:

static int dbcs_process_double_quote_string_hexa ( PARSER_CONTEXT parser,
int  input_char,
int  converted_char 
)
static

Definition at line 241 of file double_byte_support.c.

References dbcs_Input_status, dbcs_process_double_quote_string(), and DQS_.

Referenced by dbcs_get_next_token_wchar().

Here is the caller graph for this function:

static int dbcs_process_double_quote_string_octal ( PARSER_CONTEXT parser,
int  input_char,
int  converted_char 
)
static

Definition at line 290 of file double_byte_support.c.

References dbcs_Input_status, dbcs_process_double_quote_string(), and DQS_.

Referenced by dbcs_get_next_token_wchar().

Here is the caller graph for this function:

static int dbcs_process_single_quote_string ( PARSER_CONTEXT parser,
int  input_char,
int  converted_char 
)
static

Definition at line 481 of file double_byte_support.c.

References CSQL_, dbcs_convert_w_char(), dbcs_get_next_w_char(), DBCS_STATUS_UNGET_RETURN, DBCS_UNGET_RETURN, and SQS_TRANSPARENT_.

Referenced by dbcs_get_next_token_wchar().

Here is the caller graph for this function:

void dbcs_start_input ( void  )

Definition at line 89 of file double_byte_support.c.

References CSQL_, dbcs_Input_status, dbcs_Latter_flag, DBCS_UNGET_BUF, and dbcs_Unget_buf.

Referenced by pt_init_one_statement_parser().

Here is the caller graph for this function:

Variable Documentation

unsigned int dbcs_Latter_byte
static

Definition at line 69 of file double_byte_support.c.

Referenced by dbcs_get_next().

int dbcs_Latter_flag
static

Definition at line 70 of file double_byte_support.c.

Referenced by dbcs_get_next(), and dbcs_start_input().

int DBCS_UNGET_BUF[MAX_UNGET_SIZE]
static

Definition at line 67 of file double_byte_support.c.

Referenced by dbcs_get_next_w_char(), and dbcs_start_input().