YAZ 5.38.1
cql.c File Reference

Implements CQL parser. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <yaz/yaz-iconv.h>
#include <yaz/xmalloc.h>
#include <yaz/nmem.h>
#include <yaz/cql.h>
#include <limits.h>

Go to the source code of this file.

Data Structures

struct  token
struct  cql_parser
union  yyalloc

Macros

#define YYBISON   30802
#define YYBISON_VERSION   "3.8.2"
#define YYSKELETON_NAME   "yacc.c"
#define YYPURE   1
#define YYPUSH   0
#define YYPULL   1
#define yyparse   cql_parse
#define yylex   cql_lex
#define yyerror   cql_error
#define yydebug   cql_debug
#define yynerrs   cql_nerrs
#define YYSTYPE   token
#define YY_CAST(Type, Val)
#define YY_REINTERPRET_CAST(Type, Val)
#define YY_NULLPTR   ((void*)0)
#define YYDEBUG   0
#define YYTOKENTYPE
#define YYPTRDIFF_T   long
#define YYPTRDIFF_MAXIMUM   LONG_MAX
#define YYSIZE_T   unsigned
#define YYSIZE_MAXIMUM
#define YYSIZEOF(X)
#define YY_(Msgid)
#define YY_ATTRIBUTE_PURE
#define YY_ATTRIBUTE_UNUSED
#define YY_USE(E)
#define YY_INITIAL_VALUE(Value)
#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
#define YY_IGNORE_MAYBE_UNINITIALIZED_END
#define YY_IGNORE_USELESS_CAST_BEGIN
#define YY_IGNORE_USELESS_CAST_END
#define YY_ASSERT(E)
#define YYSTACK_ALLOC   YYMALLOC
#define YYSTACK_FREE   YYFREE
#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM
#define YYMALLOC   malloc
#define YYFREE   free
#define YYSTACK_GAP_MAXIMUM   (YYSIZEOF (union yyalloc) - 1)
#define YYSTACK_BYTES(N)
#define YYCOPY_NEEDED   1
#define YYSTACK_RELOCATE(Stack_alloc, Stack)
#define YYFINAL   3
#define YYLAST   103
#define YYNTOKENS   20
#define YYNNTS   22
#define YYNRULES   49
#define YYNSTATES   66
#define YYMAXUTOK   268
#define YYTRANSLATE(YYX)
#define YY_ACCESSING_SYMBOL(State)
#define YYPACT_NINF   (-34)
#define yypact_value_is_default(Yyn)
#define YYTABLE_NINF   (-43)
#define yytable_value_is_error(Yyn)
#define yyerrok   (yyerrstatus = 0)
#define yyclearin   (yychar = YYEMPTY)
#define YYACCEPT   goto yyacceptlab
#define YYABORT   goto yyabortlab
#define YYERROR   goto yyerrorlab
#define YYNOMEM   goto yyexhaustedlab
#define YYRECOVERING()
#define YYBACKUP(Token, Value)
#define YYERRCODE   YYUNDEF
#define YYDPRINTF(Args)
#define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
#define YY_STACK_PRINT(Bottom, Top)
#define YY_REDUCE_PRINT(Rule)
#define YYINITDEPTH   200
#define YYMAXDEPTH   10000
#define YYPOPSTACK(N)

Typedefs

typedef enum yytokentype yytoken_kind_t
typedef enum yysymbol_kind_t yysymbol_kind_t
typedef signed char yytype_int8
typedef short yytype_int16
typedef unsigned char yytype_uint8
typedef unsigned short yytype_uint16
typedef yytype_int8 yy_state_t
typedef int yy_state_fast_t

Enumerations

enum  yytokentype {
  YYEMPTY = -2 , YYEOF = 0 , YYerror = 256 , YYUNDEF = 257 ,
  PREFIX_NAME = 258 , SIMPLE_STRING = 259 , AND = 260 , OR = 261 ,
  NOT = 262 , PROX = 263 , GE = 264 , LE = 265 ,
  NE = 266 , EXACT = 267 , SORTBY = 268
}
enum  yysymbol_kind_t {
  YYSYMBOL_YYEMPTY = -2 , YYSYMBOL_YYEOF = 0 , YYSYMBOL_YYerror = 1 , YYSYMBOL_YYUNDEF = 2 ,
  YYSYMBOL_PREFIX_NAME = 3 , YYSYMBOL_SIMPLE_STRING = 4 , YYSYMBOL_AND = 5 , YYSYMBOL_OR = 6 ,
  YYSYMBOL_NOT = 7 , YYSYMBOL_PROX = 8 , YYSYMBOL_GE = 9 , YYSYMBOL_LE = 10 ,
  YYSYMBOL_NE = 11 , YYSYMBOL_EXACT = 12 , YYSYMBOL_SORTBY = 13 , YYSYMBOL_14_ = 14 ,
  YYSYMBOL_15_ = 15 , YYSYMBOL_16_ = 16 , YYSYMBOL_17_ = 17 , YYSYMBOL_18_ = 18 ,
  YYSYMBOL_19_ = 19 , YYSYMBOL_YYACCEPT = 20 , YYSYMBOL_top = 21 , YYSYMBOL_22_1 = 22 ,
  YYSYMBOL_sortby = 23 , YYSYMBOL_sortSpec = 24 , YYSYMBOL_singleSpec = 25 , YYSYMBOL_cqlQuery1 = 26 ,
  YYSYMBOL_cqlQuery = 27 , YYSYMBOL_28_2 = 28 , YYSYMBOL_29_3 = 29 , YYSYMBOL_scopedClause = 30 ,
  YYSYMBOL_31_4 = 31 , YYSYMBOL_searchClause = 32 , YYSYMBOL_33_5 = 33 , YYSYMBOL_34_6 = 34 ,
  YYSYMBOL_extraTerms = 35 , YYSYMBOL_boolean = 36 , YYSYMBOL_modifiers = 37 , YYSYMBOL_relation = 38 ,
  YYSYMBOL_relation_symbol = 39 , YYSYMBOL_index = 40 , YYSYMBOL_searchTerm = 41
}
enum  { YYENOMEM = -2 }

Functions

int yylex (YYSTYPE *lval, void *vp)
int yyerror (void *lval, char *msg)
int cql_parse (void *parm)
void * malloc (YYSIZE_T)
void free (void *)
static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, void *parm)
int yyparse (void *parm)
static void putb (YYSTYPE *lval, CQL_parser cp, int c)
int cql_parser_stream (CQL_parser cp, int(*getbyte)(void *client_data), void(*ungetbyte)(int b, void *client_data), void *client_data)
 parses CQL query (query stream)
CQL_parser cql_parser_create (void)
 creates a CQL parser.
void cql_parser_destroy (CQL_parser cp)
 destroys a CQL parser.
struct cql_node * cql_parser_result (CQL_parser cp)
 returns the parse tree of the most recently parsed CQL query.
void cql_parser_strict (CQL_parser cp, int mode)
 configures strict mode

Variables

static const yytype_int8 yytranslate []
static const yytype_int8 yypact []
static const yytype_int8 yydefact []
static const yytype_int8 yypgoto []
static const yytype_int8 yydefgoto []
static const yytype_int8 yytable []
static const yytype_int8 yycheck []
static const yytype_int8 yystos []
static const yytype_int8 yyr1 []
static const yytype_int8 yyr2 []

Detailed Description

Implements CQL parser.

This is a reentrant Bison parser. The original source file is cql.y.

Definition in file cql.c.

Macro Definition Documentation

◆ YY_

#define YY_ ( Msgid)
Value:
Msgid

Definition at line 375 of file cql.c.

Referenced by yyparse().

◆ YY_ACCESSING_SYMBOL

#define YY_ACCESSING_SYMBOL ( State)
Value:
yysymbol_kind_t
Definition cql.c:202
#define YY_CAST(Type, Val)
Definition cql.c:137
static const yytype_int8 yystos[]
Definition cql.c:756

Accessing symbol of state STATE.

Definition at line 641 of file cql.c.

Referenced by yyparse().

◆ YY_ASSERT

#define YY_ASSERT ( E)
Value:
((void) (0 && (E)))

Definition at line 441 of file cql.c.

Referenced by yyparse().

◆ YY_ATTRIBUTE_PURE

#define YY_ATTRIBUTE_PURE

Definition at line 384 of file cql.c.

◆ YY_ATTRIBUTE_UNUSED

#define YY_ATTRIBUTE_UNUSED

Definition at line 392 of file cql.c.

◆ YY_CAST

#define YY_CAST ( Type,
Val )
Value:
((Type) (Val))

Definition at line 137 of file cql.c.

Referenced by yyparse().

◆ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

#define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN

Definition at line 421 of file cql.c.

Referenced by yydestruct(), and yyparse().

◆ YY_IGNORE_MAYBE_UNINITIALIZED_END

#define YY_IGNORE_MAYBE_UNINITIALIZED_END

Definition at line 422 of file cql.c.

Referenced by yydestruct(), and yyparse().

◆ YY_IGNORE_USELESS_CAST_BEGIN

#define YY_IGNORE_USELESS_CAST_BEGIN

Definition at line 436 of file cql.c.

Referenced by yyparse().

◆ YY_IGNORE_USELESS_CAST_END

#define YY_IGNORE_USELESS_CAST_END

Definition at line 437 of file cql.c.

Referenced by yyparse().

◆ YY_INITIAL_VALUE

#define YY_INITIAL_VALUE ( Value)
Value:
Value

Definition at line 418 of file cql.c.

Referenced by yyparse().

◆ YY_NULLPTR

#define YY_NULLPTR   ((void*)0)

Definition at line 149 of file cql.c.

◆ YY_REDUCE_PRINT

#define YY_REDUCE_PRINT ( Rule)

Definition at line 947 of file cql.c.

Referenced by yyparse().

◆ YY_REINTERPRET_CAST

#define YY_REINTERPRET_CAST ( Type,
Val )
Value:
((Type) (Val))

Definition at line 138 of file cql.c.

◆ YY_STACK_PRINT

#define YY_STACK_PRINT ( Bottom,
Top )

Definition at line 946 of file cql.c.

Referenced by yyparse().

◆ YY_SYMBOL_PRINT

#define YY_SYMBOL_PRINT ( Title,
Kind,
Value,
Location )

Definition at line 945 of file cql.c.

Referenced by yydestruct(), and yyparse().

◆ YY_USE

#define YY_USE ( E)
Value:
((void) (E))

Definition at line 398 of file cql.c.

Referenced by yydestruct().

◆ YYABORT

#define YYABORT   goto yyabortlab

Definition at line 794 of file cql.c.

Referenced by yyparse().

◆ YYACCEPT

#define YYACCEPT   goto yyacceptlab

Definition at line 793 of file cql.c.

Referenced by yyparse().

◆ YYBACKUP

#define YYBACKUP ( Token,
Value )
Value:
do \
if (yychar == YYEMPTY) \
{ \
yychar = (Token); \
yylval = (Value); \
YYPOPSTACK (yylen); \
yystate = *yyssp; \
goto yybackup; \
} \
else \
{ \
yyerror (parm, YY_("syntax error: cannot back up")); \
} \
while (0)
@ YYEMPTY
Definition cql.c:167
#define YY_(Msgid)
Definition cql.c:375
#define YYERROR
Definition cql.c:795

Definition at line 801 of file cql.c.

◆ YYBISON

#define YYBISON   30802

Definition at line 49 of file cql.c.

◆ YYBISON_VERSION

#define YYBISON_VERSION   "3.8.2"

Definition at line 52 of file cql.c.

◆ yyclearin

#define yyclearin   (yychar = YYEMPTY)

Definition at line 791 of file cql.c.

◆ YYCOPY_NEEDED

#define YYCOPY_NEEDED   1

Definition at line 530 of file cql.c.

◆ YYDEBUG

#define YYDEBUG   0

Definition at line 156 of file cql.c.

◆ yydebug

#define yydebug   cql_debug

Definition at line 71 of file cql.c.

◆ YYDPRINTF

#define YYDPRINTF ( Args)
Value:
((void) 0)

Definition at line 944 of file cql.c.

Referenced by yyparse().

◆ YYERRCODE

#define YYERRCODE   YYUNDEF

Definition at line 820 of file cql.c.

◆ yyerrok

#define yyerrok   (yyerrstatus = 0)

Definition at line 790 of file cql.c.

◆ YYERROR

#define YYERROR   goto yyerrorlab

Definition at line 795 of file cql.c.

Referenced by yyparse().

◆ yyerror

#define yyerror   cql_error

Definition at line 70 of file cql.c.

Referenced by yyerror(), and yyparse().

◆ YYFINAL

#define YYFINAL   3

Definition at line 571 of file cql.c.

Referenced by yyparse().

◆ YYFREE

#define YYFREE   free

Definition at line 502 of file cql.c.

◆ YYINITDEPTH

#define YYINITDEPTH   200

Definition at line 953 of file cql.c.

Referenced by yyparse().

◆ YYLAST

#define YYLAST   103

Definition at line 573 of file cql.c.

Referenced by yyparse().

◆ yylex

#define yylex   cql_lex

Definition at line 69 of file cql.c.

Referenced by yylex(), and yyparse().

◆ YYMALLOC

#define YYMALLOC   malloc

Definition at line 496 of file cql.c.

◆ YYMAXDEPTH

#define YYMAXDEPTH   10000

Definition at line 964 of file cql.c.

Referenced by yyparse().

◆ YYMAXUTOK

#define YYMAXUTOK   268

Definition at line 585 of file cql.c.

◆ yynerrs

#define yynerrs   cql_nerrs

Definition at line 72 of file cql.c.

Referenced by yyparse().

◆ YYNNTS

#define YYNNTS   22

Definition at line 578 of file cql.c.

◆ YYNOMEM

#define YYNOMEM   goto yyexhaustedlab

Definition at line 796 of file cql.c.

Referenced by yyparse().

◆ YYNRULES

#define YYNRULES   49

Definition at line 580 of file cql.c.

◆ YYNSTATES

#define YYNSTATES   66

Definition at line 582 of file cql.c.

Referenced by yyparse().

◆ YYNTOKENS

#define YYNTOKENS   20

Definition at line 576 of file cql.c.

Referenced by yyparse().

◆ YYPACT_NINF

#define YYPACT_NINF   (-34)

Definition at line 668 of file cql.c.

◆ yypact_value_is_default

#define yypact_value_is_default ( Yyn)
Value:
((Yyn) == YYPACT_NINF)
#define YYPACT_NINF
Definition cql.c:668

Definition at line 670 of file cql.c.

Referenced by yyparse().

◆ yyparse

#define yyparse   cql_parse

Definition at line 68 of file cql.c.

Referenced by yyparse().

◆ YYPOPSTACK

#define YYPOPSTACK ( N)
Value:
(yyvsp -= (N), yyssp -= (N))

Referenced by yyparse().

◆ YYPTRDIFF_MAXIMUM

#define YYPTRDIFF_MAXIMUM   LONG_MAX

Definition at line 335 of file cql.c.

◆ YYPTRDIFF_T

#define YYPTRDIFF_T   long

Definition at line 334 of file cql.c.

Referenced by yyparse().

◆ YYPULL

#define YYPULL   1

Definition at line 64 of file cql.c.

◆ YYPURE

#define YYPURE   1

Definition at line 58 of file cql.c.

◆ YYPUSH

#define YYPUSH   0

Definition at line 61 of file cql.c.

◆ YYRECOVERING

#define YYRECOVERING ( )
Value:
(!!yyerrstatus)

Definition at line 799 of file cql.c.

◆ YYSIZE_MAXIMUM

#define YYSIZE_MAXIMUM
Value:
: YY_CAST (YYSIZE_T, -1)))
#define YYPTRDIFF_MAXIMUM
Definition cql.c:335
#define YYSIZE_T
Definition cql.c:348
#define YYPTRDIFF_T
Definition cql.c:334

Definition at line 352 of file cql.c.

◆ YYSIZE_T

#define YYSIZE_T   unsigned

Definition at line 348 of file cql.c.

Referenced by malloc(), and yyparse().

◆ YYSIZEOF

#define YYSIZEOF ( X)
Value:
YY_CAST (YYPTRDIFF_T, sizeof (X))

Definition at line 358 of file cql.c.

Referenced by yyparse().

◆ YYSKELETON_NAME

#define YYSKELETON_NAME   "yacc.c"

Definition at line 55 of file cql.c.

◆ YYSTACK_ALLOC

#define YYSTACK_ALLOC   YYMALLOC

Definition at line 482 of file cql.c.

Referenced by yyparse().

◆ YYSTACK_ALLOC_MAXIMUM

#define YYSTACK_ALLOC_MAXIMUM   YYSIZE_MAXIMUM

Definition at line 485 of file cql.c.

◆ YYSTACK_BYTES

#define YYSTACK_BYTES ( N)
Value:
#define YYSTYPE
Definition cql.c:124
#define YYSIZEOF(X)
Definition cql.c:358
yytype_int8 yy_state_t
Definition cql.c:362
#define YYSTACK_GAP_MAXIMUM
Definition cql.c:522

Definition at line 526 of file cql.c.

Referenced by yyparse().

◆ YYSTACK_FREE

#define YYSTACK_FREE   YYFREE

Definition at line 483 of file cql.c.

Referenced by yyparse().

◆ YYSTACK_GAP_MAXIMUM

#define YYSTACK_GAP_MAXIMUM   (YYSIZEOF (union yyalloc) - 1)

Definition at line 522 of file cql.c.

◆ YYSTACK_RELOCATE

#define YYSTACK_RELOCATE ( Stack_alloc,
Stack )
Value:
do \
{ \
YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)

Definition at line 537 of file cql.c.

Referenced by yyparse().

◆ YYSTYPE

#define YYSTYPE   token

Definition at line 124 of file cql.c.

Referenced by putb(), yydestruct(), yylex(), and yyparse().

◆ YYTABLE_NINF

#define YYTABLE_NINF   (-43)

Definition at line 673 of file cql.c.

◆ yytable_value_is_error

#define yytable_value_is_error ( Yyn)
Value:
0

Definition at line 675 of file cql.c.

Referenced by yyparse().

◆ YYTOKENTYPE

#define YYTOKENTYPE

Definition at line 164 of file cql.c.

◆ YYTRANSLATE

#define YYTRANSLATE ( YYX)
Value:
(0 <= (YYX) && (YYX) <= YYMAXUTOK \
static const yytype_int8 yytranslate[]
Definition cql.c:597
@ YYSYMBOL_YYUNDEF
Definition cql.c:206
#define YYMAXUTOK
Definition cql.c:585

Definition at line 590 of file cql.c.

Referenced by yyparse().

Typedef Documentation

◆ yy_state_fast_t

typedef int yy_state_fast_t

Definition at line 365 of file cql.c.

◆ yy_state_t

Definition at line 362 of file cql.c.

◆ yysymbol_kind_t

Definition at line 247 of file cql.c.

◆ yytoken_kind_t

Definition at line 183 of file cql.c.

◆ yytype_int16

typedef short yytype_int16

Definition at line 286 of file cql.c.

◆ yytype_int8

typedef signed char yytype_int8

Definition at line 278 of file cql.c.

◆ yytype_uint16

typedef unsigned short yytype_uint16

Definition at line 318 of file cql.c.

◆ yytype_uint8

typedef unsigned char yytype_uint8

Definition at line 307 of file cql.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
YYENOMEM 

Definition at line 788 of file cql.c.

◆ yysymbol_kind_t

Enumerator
YYSYMBOL_YYEMPTY 
YYSYMBOL_YYEOF 
YYSYMBOL_YYerror 
YYSYMBOL_YYUNDEF 
YYSYMBOL_PREFIX_NAME 
YYSYMBOL_SIMPLE_STRING 
YYSYMBOL_AND 
YYSYMBOL_OR 
YYSYMBOL_NOT 
YYSYMBOL_PROX 
YYSYMBOL_GE 
YYSYMBOL_LE 
YYSYMBOL_NE 
YYSYMBOL_EXACT 
YYSYMBOL_SORTBY 
YYSYMBOL_14_ 
YYSYMBOL_15_ 
YYSYMBOL_16_ 
YYSYMBOL_17_ 
YYSYMBOL_18_ 
YYSYMBOL_19_ 
YYSYMBOL_YYACCEPT 
YYSYMBOL_top 
YYSYMBOL_22_1 
YYSYMBOL_sortby 
YYSYMBOL_sortSpec 
YYSYMBOL_singleSpec 
YYSYMBOL_cqlQuery1 
YYSYMBOL_cqlQuery 
YYSYMBOL_28_2 
YYSYMBOL_29_3 
YYSYMBOL_scopedClause 
YYSYMBOL_31_4 
YYSYMBOL_searchClause 
YYSYMBOL_33_5 
YYSYMBOL_34_6 
YYSYMBOL_extraTerms 
YYSYMBOL_boolean 
YYSYMBOL_modifiers 
YYSYMBOL_relation 
YYSYMBOL_relation_symbol 
YYSYMBOL_index 
YYSYMBOL_searchTerm 

Definition at line 201 of file cql.c.

◆ yytokentype

Enumerator
YYEMPTY 
YYEOF 
YYerror 
YYUNDEF 
PREFIX_NAME 
SIMPLE_STRING 
AND 
OR 
NOT 
PROX 
GE 
LE 
NE 
EXACT 
SORTBY 

Definition at line 165 of file cql.c.

Function Documentation

◆ cql_parse()

int cql_parse ( void * parm)

References cql_parse().

Referenced by cql_parse(), and cql_parser_stream().

◆ cql_parser_create()

CQL_parser cql_parser_create ( void )

creates a CQL parser.

Returns
CCL parser

Returns CQL parser or NULL if parser could not be created.

Definition at line 1874 of file cql.c.

References cql_parser::client_data, cql_parser_create(), cql_parser::getbyte, cql_parser::last_error, cql_parser::last_pos, cql_parser::nmem, nmem_create(), cql_parser::strict, cql_parser::top, cql_parser::ungetbyte, and xmalloc.

Referenced by cql2pqf(), cql2pqf(), and cql_parser_create().

◆ cql_parser_destroy()

void cql_parser_destroy ( CQL_parser cp)

destroys a CQL parser.

Parameters
cpCQL parser

This function does nothing if NULL if received.

Definition at line 1889 of file cql.c.

References cql_node_destroy(), cql_parser_destroy(), cql_parser::nmem, nmem_destroy(), cql_parser::top, and xfree.

Referenced by cql2pqf(), cql2pqf(), and cql_parser_destroy().

◆ cql_parser_result()

struct cql_node * cql_parser_result ( CQL_parser cp)

returns the parse tree of the most recently parsed CQL query.

Parameters
cpCQL parser
Returns
CQL node or NULL for failure

Definition at line 1896 of file cql.c.

References cql_parser_result(), and cql_parser::top.

Referenced by cql2pqf(), cql2pqf(), cql_node_print(), and cql_parser_result().

◆ cql_parser_stream()

int cql_parser_stream ( CQL_parser cp,
int(* getbyte )(void *client_data),
void(* ungetbyte )(int b, void *client_data),
void * client_data )

parses CQL query (query stream)

Parameters
cpCQL parser
getbytefunction which reads one character from stream
ungetbytefunction which unreads one character from stream
client_datadata to be passed to stream functions
Return values
0success
!=0failure

This function is similar to cql_parser_string but takes a functions to read each query character from a stream.

The functions pointers getbytes, ungetbyte are similar to that known from stdios getc, ungetc.

Definition at line 1858 of file cql.c.

References cql_parser::client_data, cql_node_destroy(), cql_parse(), cql_parser_stream(), cql_parser::getbyte, cql_parser::nmem, nmem_reset(), cql_parser::top, and cql_parser::ungetbyte.

Referenced by cql_parser_stdio(), cql_parser_stream(), and cql_parser_string().

◆ cql_parser_strict()

void cql_parser_strict ( CQL_parser cp,
int mode )

configures strict mode

Parameters
cpCQL parser
mode1=enable strict mode, 0=disable strict mode

This function is similar to cql_parser_string but reads from stdio FILE handle instead.

Definition at line 1901 of file cql.c.

References cql_parser_strict(), and cql_parser::strict.

Referenced by cql_parser_strict().

◆ free()

◆ malloc()

◆ putb()

void putb ( YYSTYPE * lval,
CQL_parser cp,
int c )
static

putb is a utility that puts one character to the string in current lexical token. This routine deallocates as necessary using NMEM.

Definition at line 1698 of file cql.c.

References cql_parser::nmem, nmem_malloc(), putb(), and YYSTYPE.

Referenced by putb(), and yylex().

◆ yydestruct()

void yydestruct ( const char * yymsg,
yysymbol_kind_t yykind,
YYSTYPE * yyvaluep,
void * parm )
static

◆ yyerror()

int yyerror ( void * lval,
char * msg )

Definition at line 1687 of file cql.c.

References yyerror.

◆ yylex()

int yylex ( YYSTYPE * lval,
void * vp )

yylex returns next token for Bison to be read. In this case one of the CQL terminals are returned.

Definition at line 1717 of file cql.c.

References AND, cql_parser::client_data, cql_strcmp(), EXACT, GE, cql_parser::getbyte, LE, NE, cql_parser::nmem, nmem_malloc(), NOT, OR, PREFIX_NAME, PROX, putb(), SIMPLE_STRING, SORTBY, cql_parser::strict, cql_parser::ungetbyte, yaz_isspace, yylex, and YYSTYPE.

◆ yyparse()

Variable Documentation

◆ yycheck

const yytype_int8 yycheck[]
static
Initial value:
=
{
11, 20, 15, 21, 0, 3, 4, 0, 1, 37,
21, 9, 10, 11, 12, 4, 14, 15, 46, 13,
13, 19, 17, 42, 57, 58, 44, 18, 44, 39,
41, 60, -1, 44, -1, 3, 5, 6, 7, 8,
59, 9, 10, 11, 12, 56, 14, 15, -1, -1,
-1, 19, -1, 64, 3, 4, 5, 6, 7, 8,
-1, -1, -1, -1, 13, 14, -1, 16, 3, 4,
5, 6, 7, 8, -1, -1, -1, -1, 13, -1,
-1, 16, 3, 4, 5, 6, 7, 8, -1, -1,
-1, -1, 13, 9, 10, 11, 12, -1, 14, 15,
-1, -1, -1, 19
}

Definition at line 739 of file cql.c.

Referenced by yyparse().

◆ yydefact

const yytype_int8 yydefact[]
static
Initial value:
=
{
2, 0, 0, 1, 44, 43, 45, 46, 47, 48,
49, 0, 19, 4, 0, 11, 16, 0, 25, 14,
0, 0, 3, 10, 26, 27, 28, 29, 32, 33,
38, 39, 40, 41, 36, 35, 37, 32, 34, 25,
21, 0, 0, 0, 5, 7, 32, 42, 17, 22,
24, 12, 15, 20, 6, 8, 0, 0, 0, 0,
30, 18, 23, 13, 0, 31
}

Definition at line 694 of file cql.c.

Referenced by yyparse().

◆ yydefgoto

const yytype_int8 yydefgoto[]
static
Initial value:
=
{
0, 1, 2, 22, 44, 45, 13, 14, 59, 42,
15, 57, 16, 20, 58, 40, 28, 48, 37, 38,
17, 18
}

Definition at line 714 of file cql.c.

Referenced by yyparse().

◆ yypact

const yytype_int8 yypact[]
static
Initial value:
=
{
-34, 4, 51, -34, -34, -34, -34, -34, -34, -34,
-34, 79, -34, 6, 7, 31, -34, 32, 2, -13,
51, 79, -34, -34, -34, -34, -34, -34, -34, -34,
-34, -34, -34, -34, -34, -34, -34, -34, -34, 11,
-34, 79, 51, 5, 79, -34, -34, -34, 9, 9,
-34, -34, -34, -34, -34, 9, 79, 65, 65, 51,
84, -34, -34, -34, 79, -34
}

Definition at line 680 of file cql.c.

Referenced by yyparse().

◆ yypgoto

const yytype_int8 yypgoto[]
static
Initial value:
=
{
-34, -34, -34, -34, -34, -16, -34, -19, -34, -34,
-34, -34, -33, -34, -34, -10, -34, -28, -34, -29,
-18, -11
}

Definition at line 706 of file cql.c.

Referenced by yyparse().

◆ yyr1

const yytype_int8 yyr1[]
static
Initial value:
=
{
0, 20, 22, 21, 23, 23, 24, 24, 25, 26,
26, 27, 28, 27, 29, 27, 30, 31, 30, 33,
32, 32, 34, 32, 35, 35, 36, 36, 36, 36,
37, 37, 37, 38, 38, 39, 39, 39, 39, 39,
39, 39, 40, 41, 41, 41, 41, 41, 41, 41
}

Definition at line 768 of file cql.c.

Referenced by yyparse().

◆ yyr2

const yytype_int8 yyr2[]
static
Initial value:
=
{
0, 2, 0, 3, 0, 2, 2, 1, 2, 1,
2, 1, 0, 6, 0, 4, 1, 0, 5, 0,
4, 2, 0, 5, 2, 0, 1, 1, 1, 1,
3, 5, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
}

Definition at line 778 of file cql.c.

Referenced by yyparse().

◆ yystos

const yytype_int8 yystos[]
static
Initial value:
=
{
0, 21, 22, 0, 3, 4, 5, 6, 7, 8,
13, 14, 16, 26, 27, 30, 32, 40, 41, 41,
33, 13, 23, 1, 5, 6, 7, 8, 36, 3,
9, 10, 11, 12, 14, 15, 19, 38, 39, 4,
35, 15, 29, 27, 24, 25, 40, 41, 37, 37,
35, 41, 27, 17, 25, 37, 18, 31, 34, 28,
41, 32, 32, 27, 39, 41
}

Definition at line 756 of file cql.c.

◆ yytable

const yytype_int8 yytable[]
static
Initial value:
=
{
19, 43, 41, 46, 3, -42, 39, -9, 23, 49,
47, -42, -42, -42, -42, 39, -42, -42, 55, 21,
-9, -42, 53, 52, 61, 62, 46, 56, 54, 50,
51, 64, 0, 47, 0, 29, 24, 25, 26, 27,
63, 30, 31, 32, 33, 60, 34, 35, 0, 0,
0, 36, 0, 65, 4, 5, 6, 7, 8, 9,
0, 0, 0, 0, 10, 11, 0, 12, 4, 5,
6, 7, 8, 9, 0, 0, 0, 0, 10, 0,
0, 12, 4, 5, 6, 7, 8, 9, 0, 0,
0, 0, 10, 30, 31, 32, 33, 0, 34, 35,
0, 0, 0, 36
}

Definition at line 724 of file cql.c.

Referenced by yyparse().

◆ yytranslate

const yytype_int8 yytranslate[]
static
Initial value:
=
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
16, 17, 2, 2, 2, 2, 2, 18, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
19, 15, 14, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
5, 6, 7, 8, 9, 10, 11, 12, 13
}

Definition at line 597 of file cql.c.