CUBRID Engine  latest
cnvlex.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 Search Solution Corporation
3  * Copyright 2016 CUBRID Corporation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 
20 /*
21  * cnvlex.h - Lexical scanning interface for string conversion API.
22  */
23 
24 #ifndef _CNVLEX_H_
25 #define _CNVLEX_H_
26 
27 #ident "$Id$"
28 
29 #include "intl_support.h"
30 
31 /*
32  * Lexical scan modes. These correspond directly to start conditions defined
33  * in the scanner definition file. Be sure to update db_fmt_lex_start() to
34  * maintain the correspondence.
35  */
36 
37 typedef enum
38 {
56 } FMT_LEX_MODE;
57 
58 
59 typedef enum
60 {
61  FT_NONE = 0,
62  FT_AM_PM = 1,
63  FT_BLANKS = 2,
67  FT_DATE = 6,
71  FT_DECIMAL = 10,
73  FT_HOUR = 12,
76  FT_MINUS = 15,
77  FT_MINUTE = 16,
79  FT_MONTH = 18,
82  FT_NUMBER = 21,
83  FT_PATTERN = 22,
84  FT_PLUS = 23,
85  FT_SECOND = 24,
86  FT_SPACES = 25,
87  FT_STARS = 26,
89  FT_TIME = 28,
97  FT_UNKNOWN = 36,
102  FT_YEAR = 41,
103  FT_ZEROES = 42,
104  FT_ZONE = 43,
107 
108 typedef struct fmt_token FMT_TOKEN;
109 struct fmt_token
110 {
112  const char *text;
113  int length;
114  const char *raw_text;
115  int value;
116 };
117 
118 extern void cnv_fmt_analyze (const char *instring, FMT_LEX_MODE mode);
119 extern FMT_TOKEN_TYPE cnv_fmt_lex (FMT_TOKEN * token);
120 extern void cnv_fmt_unlex (void);
121 extern const char *cnv_fmt_next_token (void);
124 extern void cnv_fmt_exit (void);
125 #endif /* _CNVLEX_H_ */
Definition: cnvlex.h:67
FMT_TOKEN_TYPE type
Definition: cnvlex.h:111
FMT_TOKEN_TYPE cnv_fmt_lex(FMT_TOKEN *token)
FMT_LEX_MODE
Definition: cnvlex.h:37
int value
Definition: cnvlex.h:115
Definition: cnvlex.h:89
void cnv_fmt_analyze(const char *instring, FMT_LEX_MODE mode)
Definition: cnvlex.c:1869
const char * cnv_fmt_next_token(void)
Definition: cnvlex.c:1893
const char * text
Definition: cnvlex.h:112
static enum scanner_mode mode
Definition: cnvlex.h:61
FMT_LEX_MODE cnv_fmt_time_mode(INTL_ZONE zone)
Definition: cnvlex.c:1962
void cnv_fmt_exit(void)
Definition: cnvlex.c:1995
enum intl_zone INTL_ZONE
Definition: intl_support.h:150
const char * raw_text
Definition: cnvlex.h:114
int length
Definition: cnvlex.h:113
void cnv_fmt_unlex(void)
Definition: cnvlex.c:1883
FMT_TOKEN_TYPE
Definition: cnvlex.h:59
Definition: cnvlex.h:73
Definition: cnvlex.h:84
FMT_LEX_MODE cnv_fmt_number_mode(INTL_ZONE zone)
Definition: cnvlex.c:1928