PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
wparser_def.c File Reference
#include "postgres.h"
#include <limits.h>
#include "catalog/pg_collation.h"
#include "commands/defrem.h"
#include "tsearch/ts_locale.h"
#include "tsearch/ts_public.h"
#include "tsearch/ts_type.h"
#include "tsearch/ts_utils.h"
#include "utils/builtins.h"
Include dependency graph for wparser_def.c:

Go to the source code of this file.

Data Structures

struct  TParserStateActionItem
 
struct  TParserPosition
 
struct  TParser
 
struct  TParserStateAction
 
struct  hlCheck
 
struct  CoverPos
 

Macros

#define ASCIIWORD   1
 
#define WORD_T   2
 
#define NUMWORD   3
 
#define EMAIL   4
 
#define URL_T   5
 
#define HOST   6
 
#define SCIENTIFIC   7
 
#define VERSIONNUMBER   8
 
#define NUMPARTHWORD   9
 
#define PARTHWORD   10
 
#define ASCIIPARTHWORD   11
 
#define SPACE   12
 
#define TAG_T   13
 
#define PROTOCOL   14
 
#define NUMHWORD   15
 
#define ASCIIHWORD   16
 
#define HWORD   17
 
#define URLPATH   18
 
#define FILEPATH   19
 
#define DECIMAL_T   20
 
#define SIGNEDINT   21
 
#define UNSIGNEDINT   22
 
#define XMLENTITY   23
 
#define LASTNUM   23
 
#define A_NEXT   0x0000
 
#define A_BINGO   0x0001
 
#define A_POP   0x0002
 
#define A_PUSH   0x0004
 
#define A_RERUN   0x0008
 
#define A_CLEAR   0x0010
 
#define A_MERGE   0x0020
 
#define A_CLRALL   0x0040
 
#define p_iswhat(type, nonascii)
 
#define TPARSERSTATEACTION(state)   { CppConcat(action,state), state }
 
#define LEAVETOKEN(x)   ( (x)==SPACE )
 
#define COMPLEXTOKEN(x)   ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
 
#define ENDPUNCTOKEN(x)   ( (x)==SPACE )
 
#define TS_IDIGNORE(x)   ( (x)==TAG_T || (x)==PROTOCOL || (x)==SPACE || (x)==XMLENTITY )
 
#define HLIDREPLACE(x)   ( (x)==TAG_T )
 
#define HLIDSKIP(x)   ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
 
#define XMLHLIDSKIP(x)   ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )
 
#define NONWORDTOKEN(x)   ( (x)==SPACE || HLIDREPLACE(x) || HLIDSKIP(x) )
 
#define NOENDTOKEN(x)   ( NONWORDTOKEN(x) || (x)==SCIENTIFIC || (x)==VERSIONNUMBER || (x)==DECIMAL_T || (x)==SIGNEDINT || (x)==UNSIGNEDINT || TS_IDIGNORE(x) )
 

Typedefs

typedef int(* TParserCharTest )(struct TParser *)
 
typedef void(* TParserSpecial )(struct TParser *)
 
typedef struct TParserPosition TParserPosition
 
typedef struct TParser TParser
 

Enumerations

enum  TParserState {
  TPS_Base = 0, TPS_InNumWord, TPS_InAsciiWord, TPS_InWord,
  TPS_InUnsignedInt, TPS_InSignedIntFirst, TPS_InSignedInt, TPS_InSpace,
  TPS_InUDecimalFirst, TPS_InUDecimal, TPS_InDecimalFirst, TPS_InDecimal,
  TPS_InVerVersion, TPS_InSVerVersion, TPS_InVersionFirst, TPS_InVersion,
  TPS_InMantissaFirst, TPS_InMantissaSign, TPS_InMantissa, TPS_InXMLEntityFirst,
  TPS_InXMLEntity, TPS_InXMLEntityNumFirst, TPS_InXMLEntityNum, TPS_InXMLEntityHexNumFirst,
  TPS_InXMLEntityHexNum, TPS_InXMLEntityEnd, TPS_InTagFirst, TPS_InXMLBegin,
  TPS_InTagCloseFirst, TPS_InTagName, TPS_InTagBeginEnd, TPS_InTag,
  TPS_InTagEscapeK, TPS_InTagEscapeKK, TPS_InTagBackSleshed, TPS_InTagEnd,
  TPS_InCommentFirst, TPS_InCommentLast, TPS_InComment, TPS_InCloseCommentFirst,
  TPS_InCloseCommentLast, TPS_InCommentEnd, TPS_InHostFirstDomain, TPS_InHostDomainSecond,
  TPS_InHostDomain, TPS_InPortFirst, TPS_InPort, TPS_InHostFirstAN,
  TPS_InHost, TPS_InEmail, TPS_InFileFirst, TPS_InFileTwiddle,
  TPS_InPathFirst, TPS_InPathFirstFirst, TPS_InPathSecond, TPS_InFile,
  TPS_InFileNext, TPS_InURLPathFirst, TPS_InURLPathStart, TPS_InURLPath,
  TPS_InFURL, TPS_InProtocolFirst, TPS_InProtocolSecond, TPS_InProtocolEnd,
  TPS_InHyphenAsciiWordFirst, TPS_InHyphenAsciiWord, TPS_InHyphenWordFirst, TPS_InHyphenWord,
  TPS_InHyphenNumWordFirst, TPS_InHyphenNumWord, TPS_InHyphenDigitLookahead, TPS_InParseHyphen,
  TPS_InParseHyphenHyphen, TPS_InHyphenWordPart, TPS_InHyphenAsciiWordPart, TPS_InHyphenNumWordPart,
  TPS_InHyphenUnsignedInt, TPS_Null
}
 

Functions

static bool TParserGet (TParser *prs)
 
static TParserPositionnewTParserPosition (TParserPosition *prev)
 
static TParserTParserInit (char *str, int len)
 
static TParserTParserCopyInit (const TParser *orig)
 
static void TParserClose (TParser *prs)
 
static void TParserCopyClose (TParser *prs)
 
 p_iswhat (alnum, 1)
 
static int p_isEOF (TParser *prs)
 
static int p_iseqC (TParser *prs)
 
static int p_isneC (TParser *prs)
 
static int p_isascii (TParser *prs)
 
static int p_isasclet (TParser *prs)
 
static int p_isurlchar (TParser *prs)
 
void _make_compiler_happy (void)
 
static void SpecialTags (TParser *prs)
 
static void SpecialFURL (TParser *prs)
 
static void SpecialHyphen (TParser *prs)
 
static void SpecialVerVersion (TParser *prs)
 
static int p_isstophost (TParser *prs)
 
static int p_isignore (TParser *prs)
 
static int p_ishost (TParser *prs)
 
static int p_isURLPath (TParser *prs)
 
static int p_isspecial (TParser *prs)
 
Datum prsd_lextype (PG_FUNCTION_ARGS)
 
Datum prsd_start (PG_FUNCTION_ARGS)
 
Datum prsd_nexttoken (PG_FUNCTION_ARGS)
 
Datum prsd_end (PG_FUNCTION_ARGS)
 
static bool checkcondition_HL (void *opaque, QueryOperand *val, ExecPhraseData *data)
 
static bool hlCover (HeadlineParsedText *prs, TSQuery query, int *p, int *q)
 
static void mark_fragment (HeadlineParsedText *prs, int highlight, int startpos, int endpos)
 
static void get_next_fragment (HeadlineParsedText *prs, int *startpos, int *endpos, int *curlen, int *poslen, int max_words)
 
static void mark_hl_fragments (HeadlineParsedText *prs, TSQuery query, int highlight, int shortword, int min_words, int max_words, int max_fragments)
 
static void mark_hl_words (HeadlineParsedText *prs, TSQuery query, int highlight, int shortword, int min_words, int max_words)
 
Datum prsd_headline (PG_FUNCTION_ARGS)
 

Variables

static const char *const tok_alias []
 
static const char *const lex_descr []
 
static const TParserStateActionItem actionTPS_Base []
 
static const TParserStateActionItem actionTPS_InNumWord []
 
static const TParserStateActionItem actionTPS_InAsciiWord []
 
static const TParserStateActionItem actionTPS_InWord []
 
static const TParserStateActionItem actionTPS_InUnsignedInt []
 
static const TParserStateActionItem actionTPS_InSignedIntFirst []
 
static const TParserStateActionItem actionTPS_InSignedInt []
 
static const TParserStateActionItem actionTPS_InSpace []
 
static const TParserStateActionItem actionTPS_InUDecimalFirst []
 
static const TParserStateActionItem actionTPS_InUDecimal []
 
static const TParserStateActionItem actionTPS_InDecimalFirst []
 
static const TParserStateActionItem actionTPS_InDecimal []
 
static const TParserStateActionItem actionTPS_InVerVersion []
 
static const TParserStateActionItem actionTPS_InSVerVersion []
 
static const TParserStateActionItem actionTPS_InVersionFirst []
 
static const TParserStateActionItem actionTPS_InVersion []
 
static const TParserStateActionItem actionTPS_InMantissaFirst []
 
static const TParserStateActionItem actionTPS_InMantissaSign []
 
static const TParserStateActionItem actionTPS_InMantissa []
 
static const TParserStateActionItem actionTPS_InXMLEntityFirst []
 
static const TParserStateActionItem actionTPS_InXMLEntity []
 
static const TParserStateActionItem actionTPS_InXMLEntityNumFirst []
 
static const TParserStateActionItem actionTPS_InXMLEntityHexNumFirst []
 
static const TParserStateActionItem actionTPS_InXMLEntityNum []
 
static const TParserStateActionItem actionTPS_InXMLEntityHexNum []
 
static const TParserStateActionItem actionTPS_InXMLEntityEnd []
 
static const TParserStateActionItem actionTPS_InTagFirst []
 
static const TParserStateActionItem actionTPS_InXMLBegin []
 
static const TParserStateActionItem actionTPS_InTagCloseFirst []
 
static const TParserStateActionItem actionTPS_InTagName []
 
static const TParserStateActionItem actionTPS_InTagBeginEnd []
 
static const TParserStateActionItem actionTPS_InTag []
 
static const TParserStateActionItem actionTPS_InTagEscapeK []
 
static const TParserStateActionItem actionTPS_InTagEscapeKK []
 
static const TParserStateActionItem actionTPS_InTagBackSleshed []
 
static const TParserStateActionItem actionTPS_InTagEnd []
 
static const TParserStateActionItem actionTPS_InCommentFirst []
 
static const TParserStateActionItem actionTPS_InCommentLast []
 
static const TParserStateActionItem actionTPS_InComment []
 
static const TParserStateActionItem actionTPS_InCloseCommentFirst []
 
static const TParserStateActionItem actionTPS_InCloseCommentLast []
 
static const TParserStateActionItem actionTPS_InCommentEnd []
 
static const TParserStateActionItem actionTPS_InHostFirstDomain []
 
static const TParserStateActionItem actionTPS_InHostDomainSecond []
 
static const TParserStateActionItem actionTPS_InHostDomain []
 
static const TParserStateActionItem actionTPS_InPortFirst []
 
static const TParserStateActionItem actionTPS_InPort []
 
static const TParserStateActionItem actionTPS_InHostFirstAN []
 
static const TParserStateActionItem actionTPS_InHost []
 
static const TParserStateActionItem actionTPS_InEmail []
 
static const TParserStateActionItem actionTPS_InFileFirst []
 
static const TParserStateActionItem actionTPS_InFileTwiddle []
 
static const TParserStateActionItem actionTPS_InPathFirst []
 
static const TParserStateActionItem actionTPS_InPathFirstFirst []
 
static const TParserStateActionItem actionTPS_InPathSecond []
 
static const TParserStateActionItem actionTPS_InFile []
 
static const TParserStateActionItem actionTPS_InFileNext []
 
static const TParserStateActionItem actionTPS_InURLPathFirst []
 
static const TParserStateActionItem actionTPS_InURLPathStart []
 
static const TParserStateActionItem actionTPS_InURLPath []
 
static const TParserStateActionItem actionTPS_InFURL []
 
static const TParserStateActionItem actionTPS_InProtocolFirst []
 
static const TParserStateActionItem actionTPS_InProtocolSecond []
 
static const TParserStateActionItem actionTPS_InProtocolEnd []
 
static const TParserStateActionItem actionTPS_InHyphenAsciiWordFirst []
 
static const TParserStateActionItem actionTPS_InHyphenAsciiWord []
 
static const TParserStateActionItem actionTPS_InHyphenWordFirst []
 
static const TParserStateActionItem actionTPS_InHyphenWord []
 
static const TParserStateActionItem actionTPS_InHyphenNumWordFirst []
 
static const TParserStateActionItem actionTPS_InHyphenNumWord []
 
static const TParserStateActionItem actionTPS_InHyphenDigitLookahead []
 
static const TParserStateActionItem actionTPS_InParseHyphen []
 
static const TParserStateActionItem actionTPS_InParseHyphenHyphen []
 
static const TParserStateActionItem actionTPS_InHyphenWordPart []
 
static const TParserStateActionItem actionTPS_InHyphenAsciiWordPart []
 
static const TParserStateActionItem actionTPS_InHyphenNumWordPart []
 
static const TParserStateActionItem actionTPS_InHyphenUnsignedInt []
 
static const TParserStateAction Actions []
 

Macro Definition Documentation

#define A_BINGO   0x0001

Definition at line 219 of file wparser_def.c.

Referenced by TParserGet().

#define A_CLEAR   0x0010

Definition at line 223 of file wparser_def.c.

Referenced by TParserGet().

#define A_CLRALL   0x0040

Definition at line 225 of file wparser_def.c.

Referenced by TParserGet().

#define A_MERGE   0x0020

Definition at line 224 of file wparser_def.c.

Referenced by TParserGet().

#define A_NEXT   0x0000

Definition at line 218 of file wparser_def.c.

#define A_POP   0x0002

Definition at line 220 of file wparser_def.c.

Referenced by TParserGet().

#define A_PUSH   0x0004

Definition at line 221 of file wparser_def.c.

Referenced by TParserGet().

#define A_RERUN   0x0008

Definition at line 222 of file wparser_def.c.

Referenced by TParserGet().

#define ASCIIHWORD   16

Definition at line 49 of file wparser_def.c.

#define ASCIIPARTHWORD   11

Definition at line 44 of file wparser_def.c.

#define ASCIIWORD   1

Definition at line 34 of file wparser_def.c.

#define COMPLEXTOKEN (   x)    ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )

Definition at line 1919 of file wparser_def.c.

#define DECIMAL_T   20

Definition at line 53 of file wparser_def.c.

#define EMAIL   4

Definition at line 37 of file wparser_def.c.

#define ENDPUNCTOKEN (   x)    ( (x)==SPACE )

Definition at line 1920 of file wparser_def.c.

#define FILEPATH   19

Definition at line 52 of file wparser_def.c.

#define HLIDREPLACE (   x)    ( (x)==TAG_T )

Definition at line 1923 of file wparser_def.c.

Referenced by mark_fragment(), and mark_hl_words().

#define HLIDSKIP (   x)    ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )

Definition at line 1924 of file wparser_def.c.

Referenced by mark_fragment(), and mark_hl_words().

#define HOST   6

Definition at line 39 of file wparser_def.c.

Referenced by p_ishost().

#define HWORD   17

Definition at line 50 of file wparser_def.c.

#define LASTNUM   23

Definition at line 58 of file wparser_def.c.

Referenced by prsd_lextype().

#define LEAVETOKEN (   x)    ( (x)==SPACE )

Definition at line 1918 of file wparser_def.c.

#define NOENDTOKEN (   x)    ( NONWORDTOKEN(x) || (x)==SCIENTIFIC || (x)==VERSIONNUMBER || (x)==DECIMAL_T || (x)==SIGNEDINT || (x)==UNSIGNEDINT || TS_IDIGNORE(x) )

Definition at line 1927 of file wparser_def.c.

Referenced by mark_hl_fragments(), and mark_hl_words().

#define NONWORDTOKEN (   x)    ( (x)==SPACE || HLIDREPLACE(x) || HLIDSKIP(x) )

Definition at line 1926 of file wparser_def.c.

Referenced by get_next_fragment(), mark_hl_fragments(), and mark_hl_words().

#define NUMHWORD   15

Definition at line 48 of file wparser_def.c.

#define NUMPARTHWORD   9

Definition at line 42 of file wparser_def.c.

#define NUMWORD   3

Definition at line 36 of file wparser_def.c.

#define p_iswhat (   type,
  nonascii 
)
Value:
\
static int \
p_is##type(TParser *prs) \
{ \
Assert(prs->state); \
if (prs->usewide) \
{ \
if (prs->pgwstr) \
{ \
unsigned int c = *(prs->pgwstr + prs->state->poschar); \
if (c > 0x7f) \
return nonascii; \
return is##type(c); \
} \
return isw##type(*(prs->wstr + prs->state->poschar)); \
} \
return is##type(*(unsigned char *) (prs->str + prs->state->posbyte)); \
} \
\
static int \
p_isnot##type(TParser *prs) \
{ \
return !p_is##type(prs); \
}
char * c
#define Assert(condition)
Definition: c.h:664

Definition at line 430 of file wparser_def.c.

#define PARTHWORD   10

Definition at line 43 of file wparser_def.c.

#define PROTOCOL   14

Definition at line 47 of file wparser_def.c.

#define SCIENTIFIC   7

Definition at line 40 of file wparser_def.c.

#define SIGNEDINT   21

Definition at line 54 of file wparser_def.c.

#define SPACE   12

Definition at line 45 of file wparser_def.c.

#define TAG_T   13

Definition at line 46 of file wparser_def.c.

#define TPARSERSTATEACTION (   state)    { CppConcat(action,state), state }

Definition at line 1614 of file wparser_def.c.

#define TS_IDIGNORE (   x)    ( (x)==TAG_T || (x)==PROTOCOL || (x)==SPACE || (x)==XMLENTITY )

Definition at line 1922 of file wparser_def.c.

#define UNSIGNEDINT   22

Definition at line 55 of file wparser_def.c.

#define URL_T   5

Definition at line 38 of file wparser_def.c.

#define URLPATH   18

Definition at line 51 of file wparser_def.c.

Referenced by p_isURLPath().

#define VERSIONNUMBER   8

Definition at line 41 of file wparser_def.c.

#define WORD_T   2

Definition at line 35 of file wparser_def.c.

#define XMLENTITY   23

Definition at line 56 of file wparser_def.c.

#define XMLHLIDSKIP (   x)    ( (x)==URL_T || (x)==NUMHWORD || (x)==ASCIIHWORD || (x)==HWORD )

Definition at line 1925 of file wparser_def.c.

Referenced by mark_fragment(), and mark_hl_words().

Typedef Documentation

typedef int(* TParserCharTest)(struct TParser *)

Definition at line 202 of file wparser_def.c.

typedef void(* TParserSpecial)(struct TParser *)

Definition at line 204 of file wparser_def.c.

Enumeration Type Documentation

Enumerator
TPS_Base 
TPS_InNumWord 
TPS_InAsciiWord 
TPS_InWord 
TPS_InUnsignedInt 
TPS_InSignedIntFirst 
TPS_InSignedInt 
TPS_InSpace 
TPS_InUDecimalFirst 
TPS_InUDecimal 
TPS_InDecimalFirst 
TPS_InDecimal 
TPS_InVerVersion 
TPS_InSVerVersion 
TPS_InVersionFirst 
TPS_InVersion 
TPS_InMantissaFirst 
TPS_InMantissaSign 
TPS_InMantissa 
TPS_InXMLEntityFirst 
TPS_InXMLEntity 
TPS_InXMLEntityNumFirst 
TPS_InXMLEntityNum 
TPS_InXMLEntityHexNumFirst 
TPS_InXMLEntityHexNum 
TPS_InXMLEntityEnd 
TPS_InTagFirst 
TPS_InXMLBegin 
TPS_InTagCloseFirst 
TPS_InTagName 
TPS_InTagBeginEnd 
TPS_InTag 
TPS_InTagEscapeK 
TPS_InTagEscapeKK 
TPS_InTagBackSleshed 
TPS_InTagEnd 
TPS_InCommentFirst 
TPS_InCommentLast 
TPS_InComment 
TPS_InCloseCommentFirst 
TPS_InCloseCommentLast 
TPS_InCommentEnd 
TPS_InHostFirstDomain 
TPS_InHostDomainSecond 
TPS_InHostDomain 
TPS_InPortFirst 
TPS_InPort 
TPS_InHostFirstAN 
TPS_InHost 
TPS_InEmail 
TPS_InFileFirst 
TPS_InFileTwiddle 
TPS_InPathFirst 
TPS_InPathFirstFirst 
TPS_InPathSecond 
TPS_InFile 
TPS_InFileNext 
TPS_InURLPathFirst 
TPS_InURLPathStart 
TPS_InURLPath 
TPS_InFURL 
TPS_InProtocolFirst 
TPS_InProtocolSecond 
TPS_InProtocolEnd 
TPS_InHyphenAsciiWordFirst 
TPS_InHyphenAsciiWord 
TPS_InHyphenWordFirst 
TPS_InHyphenWord 
TPS_InHyphenNumWordFirst 
TPS_InHyphenNumWord 
TPS_InHyphenDigitLookahead 
TPS_InParseHyphen 
TPS_InParseHyphenHyphen 
TPS_InHyphenWordPart 
TPS_InHyphenAsciiWordPart 
TPS_InHyphenNumWordPart 
TPS_InHyphenUnsignedInt 
TPS_Null 

Definition at line 117 of file wparser_def.c.

118 {
119  TPS_Base = 0,
122  TPS_InWord,
126  TPS_InSpace,
150  TPS_InTag,
154  TPS_InTagEnd,
165  TPS_InPort,
167  TPS_InHost,
168  TPS_InEmail,
174  TPS_InFile,
179  TPS_InFURL,
196  TPS_Null /* last state (fake value) */
197 } TParserState;
TParserState
Definition: wparser_def.c:117

Function Documentation

void _make_compiler_happy ( void  )

Definition at line 543 of file wparser_def.c.

References p_isEOF(), p_iseqC(), and p_isneC().

544 {
545  p_isalnum(NULL);
546  p_isnotalnum(NULL);
547  p_isalpha(NULL);
548  p_isnotalpha(NULL);
549  p_isdigit(NULL);
550  p_isnotdigit(NULL);
551  p_islower(NULL);
552  p_isnotlower(NULL);
553  p_isprint(NULL);
554  p_isnotprint(NULL);
555  p_ispunct(NULL);
556  p_isnotpunct(NULL);
557  p_isspace(NULL);
558  p_isnotspace(NULL);
559  p_isupper(NULL);
560  p_isnotupper(NULL);
561  p_isxdigit(NULL);
562  p_isnotxdigit(NULL);
563  p_isEOF(NULL);
564  p_iseqC(NULL);
565  p_isneC(NULL);
566 }
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
static int p_isneC(TParser *prs)
Definition: wparser_def.c:493
static bool checkcondition_HL ( void *  opaque,
QueryOperand val,
ExecPhraseData data 
)
static

Definition at line 1936 of file wparser_def.c.

References ExecPhraseData::allocated, i, HeadlineWordEntry::item, hlCheck::len, ExecPhraseData::npos, palloc(), HeadlineWordEntry::pos, ExecPhraseData::pos, and hlCheck::words.

Referenced by hlCover().

1937 {
1938  int i;
1939  hlCheck *checkval = (hlCheck *) opaque;
1940 
1941  for (i = 0; i < checkval->len; i++)
1942  {
1943  if (checkval->words[i].item == val)
1944  {
1945  /* don't need to find all positions */
1946  if (!data)
1947  return true;
1948 
1949  if (!data->pos)
1950  {
1951  data->pos = palloc(sizeof(WordEntryPos) * checkval->len);
1952  data->allocated = true;
1953  data->npos = 1;
1954  data->pos[0] = checkval->words[i].pos;
1955  }
1956  else if (data->pos[data->npos - 1] < checkval->words[i].pos)
1957  {
1958  data->pos[data->npos++] = checkval->words[i].pos;
1959  }
1960  }
1961  }
1962 
1963  if (data && data->npos > 0)
1964  return true;
1965 
1966  return false;
1967 }
uint16 WordEntryPos
Definition: ts_type.h:63
bool allocated
Definition: ts_utils.h:136
QueryOperand * item
Definition: ts_public.h:47
WordEntryPos pos
Definition: ts_public.h:45
WordEntryPos * pos
Definition: ts_utils.h:138
void * palloc(Size size)
Definition: mcxt.c:848
int i
HeadlineWordEntry * words
Definition: wparser_def.c:1931
static void get_next_fragment ( HeadlineParsedText prs,
int *  startpos,
int *  endpos,
int *  curlen,
int *  poslen,
int  max_words 
)
static

Definition at line 2078 of file wparser_def.c.

References endpos, i, HeadlineWordEntry::item, NONWORDTOKEN, HeadlineWordEntry::repeated, startpos, HeadlineWordEntry::type, and HeadlineParsedText::words.

Referenced by mark_hl_fragments().

2080 {
2081  int i;
2082 
2083  /*
2084  * Objective: Generate a fragment of words between startpos and endpos
2085  * such that it has at most max_words and both ends has query words. If
2086  * the startpos and endpos are the endpoints of the cover and the cover
2087  * has fewer words than max_words, then this function should just return
2088  * the cover
2089  */
2090  /* first move startpos to an item */
2091  for (i = *startpos; i <= *endpos; i++)
2092  {
2093  *startpos = i;
2094  if (prs->words[i].item && !prs->words[i].repeated)
2095  break;
2096  }
2097  /* cut endpos to have only max_words */
2098  *curlen = 0;
2099  *poslen = 0;
2100  for (i = *startpos; i <= *endpos && *curlen < max_words; i++)
2101  {
2102  if (!NONWORDTOKEN(prs->words[i].type))
2103  *curlen += 1;
2104  if (prs->words[i].item && !prs->words[i].repeated)
2105  *poslen += 1;
2106  }
2107  /* if the cover was cut then move back endpos to a query item */
2108  if (*endpos > i)
2109  {
2110  *endpos = i;
2111  for (i = *endpos; i >= *startpos; i--)
2112  {
2113  *endpos = i;
2114  if (prs->words[i].item && !prs->words[i].repeated)
2115  break;
2116  if (!NONWORDTOKEN(prs->words[i].type))
2117  *curlen -= 1;
2118  }
2119  }
2120 }
#define NONWORDTOKEN(x)
Definition: wparser_def.c:1926
QueryOperand * item
Definition: ts_public.h:47
static XLogRecPtr endpos
Definition: pg_receivewal.c:45
HeadlineWordEntry * words
Definition: ts_public.h:52
static XLogRecPtr startpos
int i
static bool hlCover ( HeadlineParsedText prs,
TSQuery  query,
int *  p,
int *  q 
)
static

Definition at line 1971 of file wparser_def.c.

References checkcondition_HL(), HeadlineParsedText::curwords, GETQUERY, i, HeadlineWordEntry::item, hlCheck::len, QI_VAL, QueryItem::qoperand, TSQueryData::size, TS_EXEC_EMPTY, TS_execute(), QueryItem::type, HeadlineParsedText::words, and hlCheck::words.

Referenced by mark_hl_fragments(), and mark_hl_words().

1972 {
1973  int i,
1974  j;
1975  QueryItem *item = GETQUERY(query);
1976  int pos = *p;
1977 
1978  *q = -1;
1979  *p = INT_MAX;
1980 
1981  for (j = 0; j < query->size; j++)
1982  {
1983  if (item->type != QI_VAL)
1984  {
1985  item++;
1986  continue;
1987  }
1988  for (i = pos; i < prs->curwords; i++)
1989  {
1990  if (prs->words[i].item == &item->qoperand)
1991  {
1992  if (i > *q)
1993  *q = i;
1994  break;
1995  }
1996  }
1997  item++;
1998  }
1999 
2000  if (*q < 0)
2001  return false;
2002 
2003  item = GETQUERY(query);
2004  for (j = 0; j < query->size; j++)
2005  {
2006  if (item->type != QI_VAL)
2007  {
2008  item++;
2009  continue;
2010  }
2011  for (i = *q; i >= pos; i--)
2012  {
2013  if (prs->words[i].item == &item->qoperand)
2014  {
2015  if (i < *p)
2016  *p = i;
2017  break;
2018  }
2019  }
2020  item++;
2021  }
2022 
2023  if (*p <= *q)
2024  {
2025  hlCheck ch;
2026 
2027  ch.words = &(prs->words[*p]);
2028  ch.len = *q - *p + 1;
2030  return true;
2031  else
2032  {
2033  (*p)++;
2034  return hlCover(prs, query, p, q);
2035  }
2036  }
2037 
2038  return false;
2039 }
bool TS_execute(QueryItem *curitem, void *arg, uint32 flags, TSExecuteCallback chkcond)
Definition: tsvector_op.c:1815
QueryOperand * item
Definition: ts_public.h:47
#define QI_VAL
Definition: ts_type.h:134
#define GETQUERY(x)
Definition: _int.h:142
HeadlineWordEntry * words
Definition: ts_public.h:52
QueryItemType type
Definition: ts_type.h:195
static bool hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
Definition: wparser_def.c:1971
int32 size
Definition: ts_type.h:208
int i
QueryOperand qoperand
Definition: ts_type.h:197
#define TS_EXEC_EMPTY
Definition: ts_utils.h:159
static bool checkcondition_HL(void *opaque, QueryOperand *val, ExecPhraseData *data)
Definition: wparser_def.c:1936
HeadlineWordEntry * words
Definition: wparser_def.c:1931
static void mark_fragment ( HeadlineParsedText prs,
int  highlight,
int  startpos,
int  endpos 
)
static

Definition at line 2042 of file wparser_def.c.

References endpos, HLIDREPLACE, HLIDSKIP, i, HeadlineWordEntry::in, HeadlineWordEntry::item, HeadlineWordEntry::repeated, HeadlineWordEntry::replace, HeadlineWordEntry::selected, HeadlineWordEntry::skip, HeadlineWordEntry::type, HeadlineParsedText::words, and XMLHLIDSKIP.

Referenced by mark_hl_fragments().

2043 {
2044  int i;
2045 
2046  for (i = startpos; i <= endpos; i++)
2047  {
2048  if (prs->words[i].item)
2049  prs->words[i].selected = 1;
2050  if (highlight == 0)
2051  {
2052  if (HLIDREPLACE(prs->words[i].type))
2053  prs->words[i].replace = 1;
2054  else if (HLIDSKIP(prs->words[i].type))
2055  prs->words[i].skip = 1;
2056  }
2057  else
2058  {
2059  if (XMLHLIDSKIP(prs->words[i].type))
2060  prs->words[i].skip = 1;
2061  }
2062 
2063  prs->words[i].in = (prs->words[i].repeated) ? 0 : 1;
2064  }
2065 }
#define HLIDSKIP(x)
Definition: wparser_def.c:1924
QueryOperand * item
Definition: ts_public.h:47
static XLogRecPtr endpos
Definition: pg_receivewal.c:45
#define HLIDREPLACE(x)
Definition: wparser_def.c:1923
HeadlineWordEntry * words
Definition: ts_public.h:52
#define XMLHLIDSKIP(x)
Definition: wparser_def.c:1925
static XLogRecPtr startpos
int i
static void mark_hl_fragments ( HeadlineParsedText prs,
TSQuery  query,
int  highlight,
int  shortword,
int  min_words,
int  max_words,
int  max_fragments 
)
static

Definition at line 2123 of file wparser_def.c.

References CoverPos::curlen, HeadlineParsedText::curwords, endpos, CoverPos::endpos, CoverPos::excluded, get_next_fragment(), hlCover(), i, HeadlineWordEntry::in, CoverPos::in, HeadlineWordEntry::len, mark_fragment(), NOENDTOKEN, NONWORDTOKEN, palloc(), pfree(), PG_INT32_MAX, CoverPos::poslen, repalloc(), startpos, CoverPos::startpos, HeadlineWordEntry::type, and HeadlineParsedText::words.

Referenced by prsd_headline().

2126 {
2127  int32 poslen,
2128  curlen,
2129  i,
2130  f,
2131  num_f = 0;
2132  int32 stretch,
2133  maxstretch,
2134  posmarker;
2135 
2136  int32 startpos = 0,
2137  endpos = 0,
2138  p = 0,
2139  q = 0;
2140 
2141  int32 numcovers = 0,
2142  maxcovers = 32;
2143 
2144  int32 minI,
2145  minwords,
2146  maxitems;
2147  CoverPos *covers;
2148 
2149  covers = palloc(maxcovers * sizeof(CoverPos));
2150 
2151  /* get all covers */
2152  while (hlCover(prs, query, &p, &q))
2153  {
2154  startpos = p;
2155  endpos = q;
2156 
2157  /*
2158  * Break the cover into smaller fragments such that each fragment has
2159  * at most max_words. Also ensure that each end of the fragment is a
2160  * query word. This will allow us to stretch the fragment in either
2161  * direction
2162  */
2163 
2164  while (startpos <= endpos)
2165  {
2166  get_next_fragment(prs, &startpos, &endpos, &curlen, &poslen, max_words);
2167  if (numcovers >= maxcovers)
2168  {
2169  maxcovers *= 2;
2170  covers = repalloc(covers, sizeof(CoverPos) * maxcovers);
2171  }
2172  covers[numcovers].startpos = startpos;
2173  covers[numcovers].endpos = endpos;
2174  covers[numcovers].curlen = curlen;
2175  covers[numcovers].poslen = poslen;
2176  covers[numcovers].in = 0;
2177  covers[numcovers].excluded = 0;
2178  numcovers++;
2179  startpos = endpos + 1;
2180  endpos = q;
2181  }
2182  /* move p to generate the next cover */
2183  p++;
2184  }
2185 
2186  /* choose best covers */
2187  for (f = 0; f < max_fragments; f++)
2188  {
2189  maxitems = 0;
2190  minwords = PG_INT32_MAX;
2191  minI = -1;
2192 
2193  /*
2194  * Choose the cover that contains max items. In case of tie choose the
2195  * one with smaller number of words.
2196  */
2197  for (i = 0; i < numcovers; i++)
2198  {
2199  if (!covers[i].in && !covers[i].excluded &&
2200  (maxitems < covers[i].poslen || (maxitems == covers[i].poslen
2201  && minwords > covers[i].curlen)))
2202  {
2203  maxitems = covers[i].poslen;
2204  minwords = covers[i].curlen;
2205  minI = i;
2206  }
2207  }
2208  /* if a cover was found mark it */
2209  if (minI >= 0)
2210  {
2211  covers[minI].in = 1;
2212  /* adjust the size of cover */
2213  startpos = covers[minI].startpos;
2214  endpos = covers[minI].endpos;
2215  curlen = covers[minI].curlen;
2216  /* stretch the cover if cover size is lower than max_words */
2217  if (curlen < max_words)
2218  {
2219  /* divide the stretch on both sides of cover */
2220  maxstretch = (max_words - curlen) / 2;
2221 
2222  /*
2223  * first stretch the startpos stop stretching if 1. we hit the
2224  * beginning of document 2. exceed maxstretch 3. we hit an
2225  * already marked fragment
2226  */
2227  stretch = 0;
2228  posmarker = startpos;
2229  for (i = startpos - 1; i >= 0 && stretch < maxstretch && !prs->words[i].in; i--)
2230  {
2231  if (!NONWORDTOKEN(prs->words[i].type))
2232  {
2233  curlen++;
2234  stretch++;
2235  }
2236  posmarker = i;
2237  }
2238  /* cut back startpos till we find a non short token */
2239  for (i = posmarker; i < startpos && (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword); i++)
2240  {
2241  if (!NONWORDTOKEN(prs->words[i].type))
2242  curlen--;
2243  }
2244  startpos = i;
2245  /* now stretch the endpos as much as possible */
2246  posmarker = endpos;
2247  for (i = endpos + 1; i < prs->curwords && curlen < max_words && !prs->words[i].in; i++)
2248  {
2249  if (!NONWORDTOKEN(prs->words[i].type))
2250  curlen++;
2251  posmarker = i;
2252  }
2253  /* cut back endpos till we find a non-short token */
2254  for (i = posmarker; i > endpos && (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword); i--)
2255  {
2256  if (!NONWORDTOKEN(prs->words[i].type))
2257  curlen--;
2258  }
2259  endpos = i;
2260  }
2261  covers[minI].startpos = startpos;
2262  covers[minI].endpos = endpos;
2263  covers[minI].curlen = curlen;
2264  /* Mark the chosen fragments (covers) */
2265  mark_fragment(prs, highlight, startpos, endpos);
2266  num_f++;
2267  /* exclude overlapping covers */
2268  for (i = 0; i < numcovers; i++)
2269  {
2270  if (i != minI && ((covers[i].startpos >= covers[minI].startpos && covers[i].startpos <= covers[minI].endpos) || (covers[i].endpos >= covers[minI].startpos && covers[i].endpos <= covers[minI].endpos)))
2271  covers[i].excluded = 1;
2272  }
2273  }
2274  else
2275  break;
2276  }
2277 
2278  /* show at least min_words we have not marked anything */
2279  if (num_f <= 0)
2280  {
2281  startpos = endpos = curlen = 0;
2282  for (i = 0; i < prs->curwords && curlen < min_words; i++)
2283  {
2284  if (!NONWORDTOKEN(prs->words[i].type))
2285  curlen++;
2286  endpos = i;
2287  }
2288  mark_fragment(prs, highlight, startpos, endpos);
2289  }
2290  pfree(covers);
2291 }
int32 curlen
Definition: wparser_def.c:2072
#define NONWORDTOKEN(x)
Definition: wparser_def.c:1926
static void get_next_fragment(HeadlineParsedText *prs, int *startpos, int *endpos, int *curlen, int *poslen, int max_words)
Definition: wparser_def.c:2078
#define NOENDTOKEN(x)
Definition: wparser_def.c:1927
int32 startpos
Definition: wparser_def.c:2069
signed int int32
Definition: c.h:246
void pfree(void *pointer)
Definition: mcxt.c:949
static void mark_fragment(HeadlineParsedText *prs, int highlight, int startpos, int endpos)
Definition: wparser_def.c:2042
int32 endpos
Definition: wparser_def.c:2070
static XLogRecPtr endpos
Definition: pg_receivewal.c:45
int16 in
Definition: wparser_def.c:2073
HeadlineWordEntry * words
Definition: ts_public.h:52
int16 excluded
Definition: wparser_def.c:2074
int32 poslen
Definition: wparser_def.c:2071
static bool hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
Definition: wparser_def.c:1971
static XLogRecPtr startpos
void * repalloc(void *pointer, Size size)
Definition: mcxt.c:962
void * palloc(Size size)
Definition: mcxt.c:848
#define PG_INT32_MAX
Definition: c.h:325
int i
static void mark_hl_words ( HeadlineParsedText prs,
TSQuery  query,
int  highlight,
int  shortword,
int  min_words,
int  max_words 
)
static

Definition at line 2294 of file wparser_def.c.

References HeadlineParsedText::curwords, hlCover(), HLIDREPLACE, HLIDSKIP, i, HeadlineWordEntry::in, HeadlineWordEntry::item, HeadlineWordEntry::len, NOENDTOKEN, NONWORDTOKEN, HeadlineWordEntry::repeated, HeadlineWordEntry::replace, HeadlineWordEntry::selected, HeadlineWordEntry::skip, HeadlineWordEntry::type, HeadlineParsedText::words, and XMLHLIDSKIP.

Referenced by prsd_headline().

2296 {
2297  int p = 0,
2298  q = 0;
2299  int bestb = -1,
2300  beste = -1;
2301  int bestlen = -1;
2302  int pose = 0,
2303  posb,
2304  poslen,
2305  curlen;
2306 
2307  int i;
2308 
2309  if (highlight == 0)
2310  {
2311  while (hlCover(prs, query, &p, &q))
2312  {
2313  /* find cover len in words */
2314  curlen = 0;
2315  poslen = 0;
2316  for (i = p; i <= q && curlen < max_words; i++)
2317  {
2318  if (!NONWORDTOKEN(prs->words[i].type))
2319  curlen++;
2320  if (prs->words[i].item && !prs->words[i].repeated)
2321  poslen++;
2322  pose = i;
2323  }
2324 
2325  if (poslen < bestlen && !(NOENDTOKEN(prs->words[beste].type) || prs->words[beste].len <= shortword))
2326  {
2327  /* best already found, so try one more cover */
2328  p++;
2329  continue;
2330  }
2331 
2332  posb = p;
2333  if (curlen < max_words)
2334  { /* find good end */
2335  for (i = i - 1; i < prs->curwords && curlen < max_words; i++)
2336  {
2337  if (i != q)
2338  {
2339  if (!NONWORDTOKEN(prs->words[i].type))
2340  curlen++;
2341  if (prs->words[i].item && !prs->words[i].repeated)
2342  poslen++;
2343  }
2344  pose = i;
2345  if (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword)
2346  continue;
2347  if (curlen >= min_words)
2348  break;
2349  }
2350  if (curlen < min_words && i >= prs->curwords)
2351  { /* got end of text and our cover is shorter
2352  * than min_words */
2353  for (i = p - 1; i >= 0; i--)
2354  {
2355  if (!NONWORDTOKEN(prs->words[i].type))
2356  curlen++;
2357  if (prs->words[i].item && !prs->words[i].repeated)
2358  poslen++;
2359  if (curlen >= max_words)
2360  break;
2361  if (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword)
2362  continue;
2363  if (curlen >= min_words)
2364  break;
2365  }
2366  posb = (i >= 0) ? i : 0;
2367  }
2368  }
2369  else
2370  { /* shorter cover :((( */
2371  if (i > q)
2372  i = q;
2373  for (; curlen > min_words; i--)
2374  {
2375  if (!NONWORDTOKEN(prs->words[i].type))
2376  curlen--;
2377  if (prs->words[i].item && !prs->words[i].repeated)
2378  poslen--;
2379  pose = i;
2380  if (NOENDTOKEN(prs->words[i].type) || prs->words[i].len <= shortword)
2381  continue;
2382  break;
2383  }
2384  }
2385 
2386  if (bestlen < 0 || (poslen > bestlen && !(NOENDTOKEN(prs->words[pose].type) || prs->words[pose].len <= shortword)) ||
2387  (bestlen >= 0 && !(NOENDTOKEN(prs->words[pose].type) || prs->words[pose].len <= shortword) &&
2388  (NOENDTOKEN(prs->words[beste].type) || prs->words[beste].len <= shortword)))
2389  {
2390  bestb = posb;
2391  beste = pose;
2392  bestlen = poslen;
2393  }
2394 
2395  p++;
2396  }
2397 
2398  if (bestlen < 0)
2399  {
2400  curlen = 0;
2401  for (i = 0; i < prs->curwords && curlen < min_words; i++)
2402  {
2403  if (!NONWORDTOKEN(prs->words[i].type))
2404  curlen++;
2405  pose = i;
2406  }
2407  bestb = 0;
2408  beste = pose;
2409  }
2410  }
2411  else
2412  {
2413  bestb = 0;
2414  beste = prs->curwords - 1;
2415  }
2416 
2417  for (i = bestb; i <= beste; i++)
2418  {
2419  if (prs->words[i].item)
2420  prs->words[i].selected = 1;
2421  if (highlight == 0)
2422  {
2423  if (HLIDREPLACE(prs->words[i].type))
2424  prs->words[i].replace = 1;
2425  else if (HLIDSKIP(prs->words[i].type))
2426  prs->words[i].skip = 1;
2427  }
2428  else
2429  {
2430  if (XMLHLIDSKIP(prs->words[i].type))
2431  prs->words[i].skip = 1;
2432  }
2433 
2434  prs->words[i].in = (prs->words[i].repeated) ? 0 : 1;
2435  }
2436 
2437 }
#define HLIDSKIP(x)
Definition: wparser_def.c:1924
#define NONWORDTOKEN(x)
Definition: wparser_def.c:1926
QueryOperand * item
Definition: ts_public.h:47
#define NOENDTOKEN(x)
Definition: wparser_def.c:1927
#define HLIDREPLACE(x)
Definition: wparser_def.c:1923
HeadlineWordEntry * words
Definition: ts_public.h:52
#define XMLHLIDSKIP(x)
Definition: wparser_def.c:1925
static bool hlCover(HeadlineParsedText *prs, TSQuery query, int *p, int *q)
Definition: wparser_def.c:1971
int i
static TParserPosition* newTParserPosition ( TParserPosition prev)
static

Definition at line 270 of file wparser_def.c.

References palloc(), TParserPosition::prev, and TParserPosition::pushedAtAction.

Referenced by p_isURLPath(), TParserCopyInit(), TParserGet(), and TParserInit().

271 {
273 
274  if (prev)
275  memcpy(res, prev, sizeof(TParserPosition));
276  else
277  memset(res, 0, sizeof(TParserPosition));
278 
279  res->prev = prev;
280 
281  res->pushedAtAction = NULL;
282 
283  return res;
284 }
struct TParserPosition * prev
Definition: wparser_def.c:235
const TParserStateActionItem * pushedAtAction
Definition: wparser_def.c:236
void * palloc(Size size)
Definition: mcxt.c:848
static int p_isascii ( TParser prs)
static

Definition at line 499 of file wparser_def.c.

References TParserPosition::charlen, TParserPosition::posbyte, TParser::state, and TParser::str.

Referenced by p_isasclet().

500 {
501  return (prs->state->charlen == 1 && isascii((unsigned char) *(prs->str + prs->state->posbyte))) ? 1 : 0;
502 }
char * str
Definition: wparser_def.c:242
TParserPosition * state
Definition: wparser_def.c:250
static int p_isasclet ( TParser prs)
static

Definition at line 505 of file wparser_def.c.

References p_isascii().

506 {
507  return (p_isascii(prs) && p_isalpha(prs)) ? 1 : 0;
508 }
static int p_isascii(TParser *prs)
Definition: wparser_def.c:499
static int p_isEOF ( TParser prs)
static

Definition at line 480 of file wparser_def.c.

References Assert, TParserPosition::charlen, TParser::lenstr, TParserPosition::posbyte, and TParser::state.

Referenced by _make_compiler_happy().

481 {
482  Assert(prs->state);
483  return (prs->state->posbyte == prs->lenstr || prs->state->charlen == 0) ? 1 : 0;
484 }
TParserPosition * state
Definition: wparser_def.c:250
#define Assert(condition)
Definition: c.h:664
int lenstr
Definition: wparser_def.c:243
static int p_iseqC ( TParser prs)
static

Definition at line 487 of file wparser_def.c.

References TParser::c.

Referenced by _make_compiler_happy().

488 {
489  return p_iseq(prs, prs->c);
490 }
char c
Definition: wparser_def.c:255
static int p_ishost ( TParser prs)
static

Definition at line 635 of file wparser_def.c.

References TParserPosition::charlen, HOST, TParserPosition::lenbytetoken, TParser::lenbytetoken, TParserPosition::lenchartoken, TParser::lenchartoken, TParserPosition::posbyte, TParserPosition::poschar, TParser::state, TParserCopyClose(), TParserCopyInit(), TParserGet(), TParser::type, and TParser::wanthost.

636 {
637  TParser *tmpprs = TParserCopyInit(prs);
638  int res = 0;
639 
640  tmpprs->wanthost = true;
641 
642  if (TParserGet(tmpprs) && tmpprs->type == HOST)
643  {
644  prs->state->posbyte += tmpprs->lenbytetoken;
645  prs->state->poschar += tmpprs->lenchartoken;
646  prs->state->lenbytetoken += tmpprs->lenbytetoken;
647  prs->state->lenchartoken += tmpprs->lenchartoken;
648  prs->state->charlen = tmpprs->state->charlen;
649  res = 1;
650  }
651  TParserCopyClose(tmpprs);
652 
653  return res;
654 }
static bool TParserGet(TParser *prs)
Definition: wparser_def.c:1704
bool wanthost
Definition: wparser_def.c:252
static void TParserCopyClose(TParser *prs)
Definition: wparser_def.c:403
TParserPosition * state
Definition: wparser_def.c:250
static TParser * TParserCopyInit(const TParser *orig)
Definition: wparser_def.c:351
int lenbytetoken
Definition: wparser_def.c:259
int type
Definition: wparser_def.c:261
int lenchartoken
Definition: wparser_def.c:260
#define HOST
Definition: wparser_def.c:39
static int p_isignore ( TParser prs)
static

Definition at line 629 of file wparser_def.c.

References TParser::ignore.

630 {
631  return (prs->ignore) ? 1 : 0;
632 }
bool ignore
Definition: wparser_def.c:251
static int p_isneC ( TParser prs)
static

Definition at line 493 of file wparser_def.c.

References TParser::c.

Referenced by _make_compiler_happy().

494 {
495  return !p_iseq(prs, prs->c);
496 }
char c
Definition: wparser_def.c:255
static int p_isspecial ( TParser prs)
static

Definition at line 686 of file wparser_def.c.

References GetDatabaseEncoding(), lengthof, pg_dsplen(), PG_UTF8, TParser::pgwstr, TParserPosition::posbyte, TParserPosition::poschar, TParser::state, TParser::str, TParser::usewide, and TParser::wstr.

687 {
688  /*
689  * pg_dsplen could return -1 which means error or control character
690  */
691  if (pg_dsplen(prs->str + prs->state->posbyte) == 0)
692  return 1;
693 
694  /*
695  * Unicode Characters in the 'Mark, Spacing Combining' Category That
696  * characters are not alpha although they are not breakers of word too.
697  * Check that only in utf encoding, because other encodings aren't
698  * supported by postgres or even exists.
699  */
700  if (GetDatabaseEncoding() == PG_UTF8 && prs->usewide)
701  {
702  static const pg_wchar strange_letter[] = {
703  /*
704  * use binary search, so elements should be ordered
705  */
706  0x0903, /* DEVANAGARI SIGN VISARGA */
707  0x093E, /* DEVANAGARI VOWEL SIGN AA */
708  0x093F, /* DEVANAGARI VOWEL SIGN I */
709  0x0940, /* DEVANAGARI VOWEL SIGN II */
710  0x0949, /* DEVANAGARI VOWEL SIGN CANDRA O */
711  0x094A, /* DEVANAGARI VOWEL SIGN SHORT O */
712  0x094B, /* DEVANAGARI VOWEL SIGN O */
713  0x094C, /* DEVANAGARI VOWEL SIGN AU */
714  0x0982, /* BENGALI SIGN ANUSVARA */
715  0x0983, /* BENGALI SIGN VISARGA */
716  0x09BE, /* BENGALI VOWEL SIGN AA */
717  0x09BF, /* BENGALI VOWEL SIGN I */
718  0x09C0, /* BENGALI VOWEL SIGN II */
719  0x09C7, /* BENGALI VOWEL SIGN E */
720  0x09C8, /* BENGALI VOWEL SIGN AI */
721  0x09CB, /* BENGALI VOWEL SIGN O */
722  0x09CC, /* BENGALI VOWEL SIGN AU */
723  0x09D7, /* BENGALI AU LENGTH MARK */
724  0x0A03, /* GURMUKHI SIGN VISARGA */
725  0x0A3E, /* GURMUKHI VOWEL SIGN AA */
726  0x0A3F, /* GURMUKHI VOWEL SIGN I */
727  0x0A40, /* GURMUKHI VOWEL SIGN II */
728  0x0A83, /* GUJARATI SIGN VISARGA */
729  0x0ABE, /* GUJARATI VOWEL SIGN AA */
730  0x0ABF, /* GUJARATI VOWEL SIGN I */
731  0x0AC0, /* GUJARATI VOWEL SIGN II */
732  0x0AC9, /* GUJARATI VOWEL SIGN CANDRA O */
733  0x0ACB, /* GUJARATI VOWEL SIGN O */
734  0x0ACC, /* GUJARATI VOWEL SIGN AU */
735  0x0B02, /* ORIYA SIGN ANUSVARA */
736  0x0B03, /* ORIYA SIGN VISARGA */
737  0x0B3E, /* ORIYA VOWEL SIGN AA */
738  0x0B40, /* ORIYA VOWEL SIGN II */
739  0x0B47, /* ORIYA VOWEL SIGN E */
740  0x0B48, /* ORIYA VOWEL SIGN AI */
741  0x0B4B, /* ORIYA VOWEL SIGN O */
742  0x0B4C, /* ORIYA VOWEL SIGN AU */
743  0x0B57, /* ORIYA AU LENGTH MARK */
744  0x0BBE, /* TAMIL VOWEL SIGN AA */
745  0x0BBF, /* TAMIL VOWEL SIGN I */
746  0x0BC1, /* TAMIL VOWEL SIGN U */
747  0x0BC2, /* TAMIL VOWEL SIGN UU */
748  0x0BC6, /* TAMIL VOWEL SIGN E */
749  0x0BC7, /* TAMIL VOWEL SIGN EE */
750  0x0BC8, /* TAMIL VOWEL SIGN AI */
751  0x0BCA, /* TAMIL VOWEL SIGN O */
752  0x0BCB, /* TAMIL VOWEL SIGN OO */
753  0x0BCC, /* TAMIL VOWEL SIGN AU */
754  0x0BD7, /* TAMIL AU LENGTH MARK */
755  0x0C01, /* TELUGU SIGN CANDRABINDU */
756  0x0C02, /* TELUGU SIGN ANUSVARA */
757  0x0C03, /* TELUGU SIGN VISARGA */
758  0x0C41, /* TELUGU VOWEL SIGN U */
759  0x0C42, /* TELUGU VOWEL SIGN UU */
760  0x0C43, /* TELUGU VOWEL SIGN VOCALIC R */
761  0x0C44, /* TELUGU VOWEL SIGN VOCALIC RR */
762  0x0C82, /* KANNADA SIGN ANUSVARA */
763  0x0C83, /* KANNADA SIGN VISARGA */
764  0x0CBE, /* KANNADA VOWEL SIGN AA */
765  0x0CC0, /* KANNADA VOWEL SIGN II */
766  0x0CC1, /* KANNADA VOWEL SIGN U */
767  0x0CC2, /* KANNADA VOWEL SIGN UU */
768  0x0CC3, /* KANNADA VOWEL SIGN VOCALIC R */
769  0x0CC4, /* KANNADA VOWEL SIGN VOCALIC RR */
770  0x0CC7, /* KANNADA VOWEL SIGN EE */
771  0x0CC8, /* KANNADA VOWEL SIGN AI */
772  0x0CCA, /* KANNADA VOWEL SIGN O */
773  0x0CCB, /* KANNADA VOWEL SIGN OO */
774  0x0CD5, /* KANNADA LENGTH MARK */
775  0x0CD6, /* KANNADA AI LENGTH MARK */
776  0x0D02, /* MALAYALAM SIGN ANUSVARA */
777  0x0D03, /* MALAYALAM SIGN VISARGA */
778  0x0D3E, /* MALAYALAM VOWEL SIGN AA */
779  0x0D3F, /* MALAYALAM VOWEL SIGN I */
780  0x0D40, /* MALAYALAM VOWEL SIGN II */
781  0x0D46, /* MALAYALAM VOWEL SIGN E */
782  0x0D47, /* MALAYALAM VOWEL SIGN EE */
783  0x0D48, /* MALAYALAM VOWEL SIGN AI */
784  0x0D4A, /* MALAYALAM VOWEL SIGN O */
785  0x0D4B, /* MALAYALAM VOWEL SIGN OO */
786  0x0D4C, /* MALAYALAM VOWEL SIGN AU */
787  0x0D57, /* MALAYALAM AU LENGTH MARK */
788  0x0D82, /* SINHALA SIGN ANUSVARAYA */
789  0x0D83, /* SINHALA SIGN VISARGAYA */
790  0x0DCF, /* SINHALA VOWEL SIGN AELA-PILLA */
791  0x0DD0, /* SINHALA VOWEL SIGN KETTI AEDA-PILLA */
792  0x0DD1, /* SINHALA VOWEL SIGN DIGA AEDA-PILLA */
793  0x0DD8, /* SINHALA VOWEL SIGN GAETTA-PILLA */
794  0x0DD9, /* SINHALA VOWEL SIGN KOMBUVA */
795  0x0DDA, /* SINHALA VOWEL SIGN DIGA KOMBUVA */
796  0x0DDB, /* SINHALA VOWEL SIGN KOMBU DEKA */
797  0x0DDC, /* SINHALA VOWEL SIGN KOMBUVA HAA AELA-PILLA */
798  0x0DDD, /* SINHALA VOWEL SIGN KOMBUVA HAA DIGA
799  * AELA-PILLA */
800  0x0DDE, /* SINHALA VOWEL SIGN KOMBUVA HAA GAYANUKITTA */
801  0x0DDF, /* SINHALA VOWEL SIGN GAYANUKITTA */
802  0x0DF2, /* SINHALA VOWEL SIGN DIGA GAETTA-PILLA */
803  0x0DF3, /* SINHALA VOWEL SIGN DIGA GAYANUKITTA */
804  0x0F3E, /* TIBETAN SIGN YAR TSHES */
805  0x0F3F, /* TIBETAN SIGN MAR TSHES */
806  0x0F7F, /* TIBETAN SIGN RNAM BCAD */
807  0x102B, /* MYANMAR VOWEL SIGN TALL AA */
808  0x102C, /* MYANMAR VOWEL SIGN AA */
809  0x1031, /* MYANMAR VOWEL SIGN E */
810  0x1038, /* MYANMAR SIGN VISARGA */
811  0x103B, /* MYANMAR CONSONANT SIGN MEDIAL YA */
812  0x103C, /* MYANMAR CONSONANT SIGN MEDIAL RA */
813  0x1056, /* MYANMAR VOWEL SIGN VOCALIC R */
814  0x1057, /* MYANMAR VOWEL SIGN VOCALIC RR */
815  0x1062, /* MYANMAR VOWEL SIGN SGAW KAREN EU */
816  0x1063, /* MYANMAR TONE MARK SGAW KAREN HATHI */
817  0x1064, /* MYANMAR TONE MARK SGAW KAREN KE PHO */
818  0x1067, /* MYANMAR VOWEL SIGN WESTERN PWO KAREN EU */
819  0x1068, /* MYANMAR VOWEL SIGN WESTERN PWO KAREN UE */
820  0x1069, /* MYANMAR SIGN WESTERN PWO KAREN TONE-1 */
821  0x106A, /* MYANMAR SIGN WESTERN PWO KAREN TONE-2 */
822  0x106B, /* MYANMAR SIGN WESTERN PWO KAREN TONE-3 */
823  0x106C, /* MYANMAR SIGN WESTERN PWO KAREN TONE-4 */
824  0x106D, /* MYANMAR SIGN WESTERN PWO KAREN TONE-5 */
825  0x1083, /* MYANMAR VOWEL SIGN SHAN AA */
826  0x1084, /* MYANMAR VOWEL SIGN SHAN E */
827  0x1087, /* MYANMAR SIGN SHAN TONE-2 */
828  0x1088, /* MYANMAR SIGN SHAN TONE-3 */
829  0x1089, /* MYANMAR SIGN SHAN TONE-5 */
830  0x108A, /* MYANMAR SIGN SHAN TONE-6 */
831  0x108B, /* MYANMAR SIGN SHAN COUNCIL TONE-2 */
832  0x108C, /* MYANMAR SIGN SHAN COUNCIL TONE-3 */
833  0x108F, /* MYANMAR SIGN RUMAI PALAUNG TONE-5 */
834  0x17B6, /* KHMER VOWEL SIGN AA */
835  0x17BE, /* KHMER VOWEL SIGN OE */
836  0x17BF, /* KHMER VOWEL SIGN YA */
837  0x17C0, /* KHMER VOWEL SIGN IE */
838  0x17C1, /* KHMER VOWEL SIGN E */
839  0x17C2, /* KHMER VOWEL SIGN AE */
840  0x17C3, /* KHMER VOWEL SIGN AI */
841  0x17C4, /* KHMER VOWEL SIGN OO */
842  0x17C5, /* KHMER VOWEL SIGN AU */
843  0x17C7, /* KHMER SIGN REAHMUK */
844  0x17C8, /* KHMER SIGN YUUKALEAPINTU */
845  0x1923, /* LIMBU VOWEL SIGN EE */
846  0x1924, /* LIMBU VOWEL SIGN AI */
847  0x1925, /* LIMBU VOWEL SIGN OO */
848  0x1926, /* LIMBU VOWEL SIGN AU */
849  0x1929, /* LIMBU SUBJOINED LETTER YA */
850  0x192A, /* LIMBU SUBJOINED LETTER RA */
851  0x192B, /* LIMBU SUBJOINED LETTER WA */
852  0x1930, /* LIMBU SMALL LETTER KA */
853  0x1931, /* LIMBU SMALL LETTER NGA */
854  0x1933, /* LIMBU SMALL LETTER TA */
855  0x1934, /* LIMBU SMALL LETTER NA */
856  0x1935, /* LIMBU SMALL LETTER PA */
857  0x1936, /* LIMBU SMALL LETTER MA */
858  0x1937, /* LIMBU SMALL LETTER RA */
859  0x1938, /* LIMBU SMALL LETTER LA */
860  0x19B0, /* NEW TAI LUE VOWEL SIGN VOWEL SHORTENER */
861  0x19B1, /* NEW TAI LUE VOWEL SIGN AA */
862  0x19B2, /* NEW TAI LUE VOWEL SIGN II */
863  0x19B3, /* NEW TAI LUE VOWEL SIGN U */
864  0x19B4, /* NEW TAI LUE VOWEL SIGN UU */
865  0x19B5, /* NEW TAI LUE VOWEL SIGN E */
866  0x19B6, /* NEW TAI LUE VOWEL SIGN AE */
867  0x19B7, /* NEW TAI LUE VOWEL SIGN O */
868  0x19B8, /* NEW TAI LUE VOWEL SIGN OA */
869  0x19B9, /* NEW TAI LUE VOWEL SIGN UE */
870  0x19BA, /* NEW TAI LUE VOWEL SIGN AY */
871  0x19BB, /* NEW TAI LUE VOWEL SIGN AAY */
872  0x19BC, /* NEW TAI LUE VOWEL SIGN UY */
873  0x19BD, /* NEW TAI LUE VOWEL SIGN OY */
874  0x19BE, /* NEW TAI LUE VOWEL SIGN OAY */
875  0x19BF, /* NEW TAI LUE VOWEL SIGN UEY */
876  0x19C0, /* NEW TAI LUE VOWEL SIGN IY */
877  0x19C8, /* NEW TAI LUE TONE MARK-1 */
878  0x19C9, /* NEW TAI LUE TONE MARK-2 */
879  0x1A19, /* BUGINESE VOWEL SIGN E */
880  0x1A1A, /* BUGINESE VOWEL SIGN O */
881  0x1A1B, /* BUGINESE VOWEL SIGN AE */
882  0x1B04, /* BALINESE SIGN BISAH */
883  0x1B35, /* BALINESE VOWEL SIGN TEDUNG */
884  0x1B3B, /* BALINESE VOWEL SIGN RA REPA TEDUNG */
885  0x1B3D, /* BALINESE VOWEL SIGN LA LENGA TEDUNG */
886  0x1B3E, /* BALINESE VOWEL SIGN TALING */
887  0x1B3F, /* BALINESE VOWEL SIGN TALING REPA */
888  0x1B40, /* BALINESE VOWEL SIGN TALING TEDUNG */
889  0x1B41, /* BALINESE VOWEL SIGN TALING REPA TEDUNG */
890  0x1B43, /* BALINESE VOWEL SIGN PEPET TEDUNG */
891  0x1B44, /* BALINESE ADEG ADEG */
892  0x1B82, /* SUNDANESE SIGN PANGWISAD */
893  0x1BA1, /* SUNDANESE CONSONANT SIGN PAMINGKAL */
894  0x1BA6, /* SUNDANESE VOWEL SIGN PANAELAENG */
895  0x1BA7, /* SUNDANESE VOWEL SIGN PANOLONG */
896  0x1BAA, /* SUNDANESE SIGN PAMAAEH */
897  0x1C24, /* LEPCHA SUBJOINED LETTER YA */
898  0x1C25, /* LEPCHA SUBJOINED LETTER RA */
899  0x1C26, /* LEPCHA VOWEL SIGN AA */
900  0x1C27, /* LEPCHA VOWEL SIGN I */
901  0x1C28, /* LEPCHA VOWEL SIGN O */
902  0x1C29, /* LEPCHA VOWEL SIGN OO */
903  0x1C2A, /* LEPCHA VOWEL SIGN U */
904  0x1C2B, /* LEPCHA VOWEL SIGN UU */
905  0x1C34, /* LEPCHA CONSONANT SIGN NYIN-DO */
906  0x1C35, /* LEPCHA CONSONANT SIGN KANG */
907  0xA823, /* SYLOTI NAGRI VOWEL SIGN A */
908  0xA824, /* SYLOTI NAGRI VOWEL SIGN I */
909  0xA827, /* SYLOTI NAGRI VOWEL SIGN OO */
910  0xA880, /* SAURASHTRA SIGN ANUSVARA */
911  0xA881, /* SAURASHTRA SIGN VISARGA */
912  0xA8B4, /* SAURASHTRA CONSONANT SIGN HAARU */
913  0xA8B5, /* SAURASHTRA VOWEL SIGN AA */
914  0xA8B6, /* SAURASHTRA VOWEL SIGN I */
915  0xA8B7, /* SAURASHTRA VOWEL SIGN II */
916  0xA8B8, /* SAURASHTRA VOWEL SIGN U */
917  0xA8B9, /* SAURASHTRA VOWEL SIGN UU */
918  0xA8BA, /* SAURASHTRA VOWEL SIGN VOCALIC R */
919  0xA8BB, /* SAURASHTRA VOWEL SIGN VOCALIC RR */
920  0xA8BC, /* SAURASHTRA VOWEL SIGN VOCALIC L */
921  0xA8BD, /* SAURASHTRA VOWEL SIGN VOCALIC LL */
922  0xA8BE, /* SAURASHTRA VOWEL SIGN E */
923  0xA8BF, /* SAURASHTRA VOWEL SIGN EE */
924  0xA8C0, /* SAURASHTRA VOWEL SIGN AI */
925  0xA8C1, /* SAURASHTRA VOWEL SIGN O */
926  0xA8C2, /* SAURASHTRA VOWEL SIGN OO */
927  0xA8C3, /* SAURASHTRA VOWEL SIGN AU */
928  0xA952, /* REJANG CONSONANT SIGN H */
929  0xA953, /* REJANG VIRAMA */
930  0xAA2F, /* CHAM VOWEL SIGN O */
931  0xAA30, /* CHAM VOWEL SIGN AI */
932  0xAA33, /* CHAM CONSONANT SIGN YA */
933  0xAA34, /* CHAM CONSONANT SIGN RA */
934  0xAA4D /* CHAM CONSONANT SIGN FINAL H */
935  };
936  const pg_wchar *StopLow = strange_letter,
937  *StopHigh = strange_letter + lengthof(strange_letter),
938  *StopMiddle;
939  pg_wchar c;
940 
941  if (prs->pgwstr)
942  c = *(prs->pgwstr + prs->state->poschar);
943  else
944  c = (pg_wchar) *(prs->wstr + prs->state->poschar);
945 
946  while (StopLow < StopHigh)
947  {
948  StopMiddle = StopLow + ((StopHigh - StopLow) >> 1);
949  if (*StopMiddle == c)
950  return 1;
951  else if (*StopMiddle < c)
952  StopLow = StopMiddle + 1;
953  else
954  StopHigh = StopMiddle;
955  }
956  }
957 
958  return 0;
959 }
bool usewide
Definition: wparser_def.c:246
char * str
Definition: wparser_def.c:242
#define lengthof(array)
Definition: c.h:556
TParserPosition * state
Definition: wparser_def.c:250
char * c
unsigned int pg_wchar
Definition: mbprint.c:31
int GetDatabaseEncoding(void)
Definition: mbutils.c:1015
int pg_dsplen(const char *mbstr)
Definition: mbutils.c:778
pg_wchar * pgwstr
Definition: wparser_def.c:245
wchar_t * wstr
Definition: wparser_def.c:244
static int p_isstophost ( TParser prs)
static

Definition at line 618 of file wparser_def.c.

References TParser::wanthost.

619 {
620  if (prs->wanthost)
621  {
622  prs->wanthost = false;
623  return 1;
624  }
625  return 0;
626 }
bool wanthost
Definition: wparser_def.c:252
static int p_isurlchar ( TParser prs)
static

Definition at line 511 of file wparser_def.c.

References TParserPosition::charlen, TParserPosition::posbyte, TParser::state, and TParser::str.

512 {
513  char ch;
514 
515  /* no non-ASCII need apply */
516  if (prs->state->charlen != 1)
517  return 0;
518  ch = *(prs->str + prs->state->posbyte);
519  /* no spaces or control characters */
520  if (ch <= 0x20 || ch >= 0x7F)
521  return 0;
522  /* reject characters disallowed by RFC 3986 */
523  switch (ch)
524  {
525  case '"':
526  case '<':
527  case '>':
528  case '\\':
529  case '^':
530  case '`':
531  case '{':
532  case '|':
533  case '}':
534  return 0;
535  }
536  return 1;
537 }
char * str
Definition: wparser_def.c:242
TParserPosition * state
Definition: wparser_def.c:250
static int p_isURLPath ( TParser prs)
static

Definition at line 657 of file wparser_def.c.

References TParserPosition::charlen, TParserPosition::lenbytetoken, TParser::lenbytetoken, TParserPosition::lenchartoken, TParser::lenchartoken, newTParserPosition(), TParserPosition::posbyte, TParserPosition::poschar, TParserPosition::state, TParser::state, TParserCopyClose(), TParserCopyInit(), TParserGet(), TPS_InURLPathFirst, TParser::type, and URLPATH.

658 {
659  TParser *tmpprs = TParserCopyInit(prs);
660  int res = 0;
661 
662  tmpprs->state = newTParserPosition(tmpprs->state);
663  tmpprs->state->state = TPS_InURLPathFirst;
664 
665  if (TParserGet(tmpprs) && tmpprs->type == URLPATH)
666  {
667  prs->state->posbyte += tmpprs->lenbytetoken;
668  prs->state->poschar += tmpprs->lenchartoken;
669  prs->state->lenbytetoken += tmpprs->lenbytetoken;
670  prs->state->lenchartoken += tmpprs->lenchartoken;
671  prs->state->charlen = tmpprs->state->charlen;
672  res = 1;
673  }
674  TParserCopyClose(tmpprs);
675 
676  return res;
677 }
static bool TParserGet(TParser *prs)
Definition: wparser_def.c:1704
TParserState state
Definition: wparser_def.c:234
static void TParserCopyClose(TParser *prs)
Definition: wparser_def.c:403
#define URLPATH
Definition: wparser_def.c:51
TParserPosition * state
Definition: wparser_def.c:250
static TParser * TParserCopyInit(const TParser *orig)
Definition: wparser_def.c:351
int lenbytetoken
Definition: wparser_def.c:259
int type
Definition: wparser_def.c:261
int lenchartoken
Definition: wparser_def.c:260
static TParserPosition * newTParserPosition(TParserPosition *prev)
Definition: wparser_def.c:270
p_iswhat ( alnum  ,
 
)

Definition at line 460 of file wparser_def.c.

References Assert.

474 {
475  Assert(prs->state);
476  return ((prs->state->charlen == 1 && *(prs->str + prs->state->posbyte) == c)) ? 1 : 0;
477 }
char * c
#define Assert(condition)
Definition: c.h:664
Datum prsd_end ( PG_FUNCTION_ARGS  )

Definition at line 1910 of file wparser_def.c.

References PG_GETARG_POINTER, PG_RETURN_VOID, and TParserClose().

1911 {
1912  TParser *p = (TParser *) PG_GETARG_POINTER(0);
1913 
1914  TParserClose(p);
1915  PG_RETURN_VOID();
1916 }
#define PG_GETARG_POINTER(n)
Definition: fmgr.h:241
static void TParserClose(TParser *prs)
Definition: wparser_def.c:378
#define PG_RETURN_VOID()
Definition: fmgr.h:309
Datum prsd_headline ( PG_FUNCTION_ARGS  )

Definition at line 2440 of file wparser_def.c.

References defGetString(), DefElem::defname, ereport, errcode(), errmsg(), ERROR, HeadlineParsedText::fragdelim, HeadlineParsedText::fragdelimlen, lfirst, mark_hl_fragments(), mark_hl_words(), pg_atoi(), PG_GETARG_POINTER, PG_GETARG_TSQUERY, PG_RETURN_POINTER, pg_strcasecmp(), pstrdup(), HeadlineParsedText::startsel, HeadlineParsedText::startsellen, HeadlineParsedText::stopsel, HeadlineParsedText::stopsellen, and val.

2441 {
2443  List *prsoptions = (List *) PG_GETARG_POINTER(1);
2444  TSQuery query = PG_GETARG_TSQUERY(2);
2445 
2446  /* from opt + start and end tag */
2447  int min_words = 15;
2448  int max_words = 35;
2449  int shortword = 3;
2450  int max_fragments = 0;
2451  int highlight = 0;
2452  ListCell *l;
2453 
2454  /* config */
2455  prs->startsel = NULL;
2456  prs->stopsel = NULL;
2457  foreach(l, prsoptions)
2458  {
2459  DefElem *defel = (DefElem *) lfirst(l);
2460  char *val = defGetString(defel);
2461 
2462  if (pg_strcasecmp(defel->defname, "MaxWords") == 0)
2463  max_words = pg_atoi(val, sizeof(int32), 0);
2464  else if (pg_strcasecmp(defel->defname, "MinWords") == 0)
2465  min_words = pg_atoi(val, sizeof(int32), 0);
2466  else if (pg_strcasecmp(defel->defname, "ShortWord") == 0)
2467  shortword = pg_atoi(val, sizeof(int32), 0);
2468  else if (pg_strcasecmp(defel->defname, "MaxFragments") == 0)
2469  max_fragments = pg_atoi(val, sizeof(int32), 0);
2470  else if (pg_strcasecmp(defel->defname, "StartSel") == 0)
2471  prs->startsel = pstrdup(val);
2472  else if (pg_strcasecmp(defel->defname, "StopSel") == 0)
2473  prs->stopsel = pstrdup(val);
2474  else if (pg_strcasecmp(defel->defname, "FragmentDelimiter") == 0)
2475  prs->fragdelim = pstrdup(val);
2476  else if (pg_strcasecmp(defel->defname, "HighlightAll") == 0)
2477  highlight = (pg_strcasecmp(val, "1") == 0 ||
2478  pg_strcasecmp(val, "on") == 0 ||
2479  pg_strcasecmp(val, "true") == 0 ||
2480  pg_strcasecmp(val, "t") == 0 ||
2481  pg_strcasecmp(val, "y") == 0 ||
2482  pg_strcasecmp(val, "yes") == 0);
2483  else
2484  ereport(ERROR,
2485  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2486  errmsg("unrecognized headline parameter: \"%s\"",
2487  defel->defname)));
2488  }
2489 
2490  if (highlight == 0)
2491  {
2492  if (min_words >= max_words)
2493  ereport(ERROR,
2494  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2495  errmsg("MinWords should be less than MaxWords")));
2496  if (min_words <= 0)
2497  ereport(ERROR,
2498  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2499  errmsg("MinWords should be positive")));
2500  if (shortword < 0)
2501  ereport(ERROR,
2502  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2503  errmsg("ShortWord should be >= 0")));
2504  if (max_fragments < 0)
2505  ereport(ERROR,
2506  (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
2507  errmsg("MaxFragments should be >= 0")));
2508  }
2509 
2510  if (max_fragments == 0)
2511  /* call the default headline generator */
2512  mark_hl_words(prs, query, highlight, shortword, min_words, max_words);
2513  else
2514  mark_hl_fragments(prs, query, highlight, shortword, min_words, max_words, max_fragments);
2515 
2516  if (!prs->startsel)
2517  prs->startsel = pstrdup("<b>");
2518  if (!prs->stopsel)
2519  prs->stopsel = pstrdup("</b>");
2520  if (!prs->fragdelim)
2521  prs->fragdelim = pstrdup(" ... ");
2522  prs->startsellen = strlen(prs->startsel);
2523  prs->stopsellen = strlen(prs->stopsel);
2524  prs->fragdelimlen = strlen(prs->fragdelim);
2525 
2526  PG_RETURN_POINTER(prs);
2527 }
#define PG_RETURN_POINTER(x)
Definition: fmgr.h:321
#define PG_GETARG_TSQUERY(n)
Definition: ts_type.h:238
char * pstrdup(const char *in)
Definition: mcxt.c:1076
int errcode(int sqlerrcode)
Definition: elog.c:575
#define PG_GETARG_POINTER(n)
Definition: fmgr.h:241
int pg_strcasecmp(const char *s1, const char *s2)
Definition: pgstrcasecmp.c:36
static void mark_hl_words(HeadlineParsedText *prs, TSQuery query, int highlight, int shortword, int min_words, int max_words)
Definition: wparser_def.c:2294
static void mark_hl_fragments(HeadlineParsedText *prs, TSQuery query, int highlight, int shortword, int min_words, int max_words, int max_fragments)
Definition: wparser_def.c:2123
signed int int32
Definition: c.h:246
#define ERROR
Definition: elog.h:43
char * defGetString(DefElem *def)
Definition: define.c:49
#define ereport(elevel, rest)
Definition: elog.h:122
#define lfirst(lc)
Definition: pg_list.h:106
int errmsg(const char *fmt,...)
Definition: elog.c:797
char * defname
Definition: parsenodes.h:719
Definition: pg_list.h:45
long val
Definition: informix.c:689
int32 pg_atoi(const char *s, int size, int c)
Definition: numutils.c:37
Datum prsd_lextype ( PG_FUNCTION_ARGS  )

Definition at line 1870 of file wparser_def.c.

References LexDescr::alias, LexDescr::descr, i, LASTNUM, lex_descr, LexDescr::lexid, palloc(), PG_RETURN_POINTER, pstrdup(), and tok_alias.

1871 {
1872  LexDescr *descr = (LexDescr *) palloc(sizeof(LexDescr) * (LASTNUM + 1));
1873  int i;
1874 
1875  for (i = 1; i <= LASTNUM; i++)
1876  {
1877  descr[i - 1].lexid = i;
1878  descr[i - 1].alias = pstrdup(tok_alias[i]);
1879  descr[i - 1].descr = pstrdup(lex_descr[i]);
1880  }
1881 
1882  descr[LASTNUM].lexid = 0;
1883 
1884  PG_RETURN_POINTER(descr);
1885 }
#define PG_RETURN_POINTER(x)
Definition: fmgr.h:321
char * alias
Definition: ts_public.h:28
char * pstrdup(const char *in)
Definition: mcxt.c:1076
static const char *const lex_descr[]
Definition: wparser_def.c:87
static const char *const tok_alias[]
Definition: wparser_def.c:60
#define LASTNUM
Definition: wparser_def.c:58
char * descr
Definition: ts_public.h:29
int lexid
Definition: ts_public.h:27
void * palloc(Size size)
Definition: mcxt.c:848
int i
Datum prsd_nexttoken ( PG_FUNCTION_ARGS  )

Definition at line 1894 of file wparser_def.c.

References TParser::lenbytetoken, PG_GETARG_POINTER, PG_RETURN_INT32, TParser::token, TParserGet(), and TParser::type.

1895 {
1896  TParser *p = (TParser *) PG_GETARG_POINTER(0);
1897  char **t = (char **) PG_GETARG_POINTER(1);
1898  int *tlen = (int *) PG_GETARG_POINTER(2);
1899 
1900  if (!TParserGet(p))
1901  PG_RETURN_INT32(0);
1902 
1903  *t = p->token;
1904  *tlen = p->lenbytetoken;
1905 
1906  PG_RETURN_INT32(p->type);
1907 }
static bool TParserGet(TParser *prs)
Definition: wparser_def.c:1704
#define PG_RETURN_INT32(x)
Definition: fmgr.h:314
#define PG_GETARG_POINTER(n)
Definition: fmgr.h:241
int lenbytetoken
Definition: wparser_def.c:259
int type
Definition: wparser_def.c:261
char * token
Definition: wparser_def.c:258
Datum prsd_start ( PG_FUNCTION_ARGS  )

Definition at line 1888 of file wparser_def.c.

References PG_GETARG_INT32, PG_GETARG_POINTER, PG_RETURN_POINTER, and TParserInit().

1889 {
1891 }
#define PG_RETURN_POINTER(x)
Definition: fmgr.h:321
#define PG_GETARG_INT32(n)
Definition: fmgr.h:234
#define PG_GETARG_POINTER(n)
Definition: fmgr.h:241
static TParser * TParserInit(char *str, int len)
Definition: wparser_def.c:287
static void SpecialFURL ( TParser prs)
static

Definition at line 594 of file wparser_def.c.

References TParserPosition::lenbytetoken, TParserPosition::lenchartoken, TParserPosition::posbyte, TParserPosition::poschar, TParser::state, and TParser::wanthost.

595 {
596  prs->wanthost = true;
597  prs->state->posbyte -= prs->state->lenbytetoken;
598  prs->state->poschar -= prs->state->lenchartoken;
599 }
bool wanthost
Definition: wparser_def.c:252
TParserPosition * state
Definition: wparser_def.c:250
static void SpecialHyphen ( TParser prs)
static
static void SpecialTags ( TParser prs)
static

Definition at line 570 of file wparser_def.c.

References TParser::ignore, TParserPosition::lenchartoken, pg_strncasecmp(), TParser::state, and TParser::token.

571 {
572  switch (prs->state->lenchartoken)
573  {
574  case 8: /* </script */
575  if (pg_strncasecmp(prs->token, "</script", 8) == 0)
576  prs->ignore = false;
577  break;
578  case 7: /* <script || </style */
579  if (pg_strncasecmp(prs->token, "</style", 7) == 0)
580  prs->ignore = false;
581  else if (pg_strncasecmp(prs->token, "<script", 7) == 0)
582  prs->ignore = true;
583  break;
584  case 6: /* <style */
585  if (pg_strncasecmp(prs->token, "<style", 6) == 0)
586  prs->ignore = true;
587  break;
588  default:
589  break;
590  }
591 }
int pg_strncasecmp(const char *s1, const char *s2, size_t n)
Definition: pgstrcasecmp.c:69
TParserPosition * state
Definition: wparser_def.c:250
char * token
Definition: wparser_def.c:258
bool ignore
Definition: wparser_def.c:251
static void SpecialVerVersion ( TParser prs)
static

Definition at line 609 of file wparser_def.c.

References TParserPosition::lenbytetoken, TParserPosition::lenchartoken, TParserPosition::posbyte, TParserPosition::poschar, and TParser::state.

610 {
611  prs->state->posbyte -= prs->state->lenbytetoken;
612  prs->state->poschar -= prs->state->lenchartoken;
613  prs->state->lenbytetoken = 0;
614  prs->state->lenchartoken = 0;
615 }
TParserPosition * state
Definition: wparser_def.c:250
static void TParserClose ( TParser prs)
static

Definition at line 378 of file wparser_def.c.

References pfree(), TParser::pgwstr, TParserPosition::prev, TParser::state, and TParser::wstr.

Referenced by prsd_end().

379 {
380  while (prs->state)
381  {
382  TParserPosition *ptr = prs->state->prev;
383 
384  pfree(prs->state);
385  prs->state = ptr;
386  }
387 
388  if (prs->wstr)
389  pfree(prs->wstr);
390  if (prs->pgwstr)
391  pfree(prs->pgwstr);
392 
393 #ifdef WPARSER_TRACE
394  fprintf(stderr, "closing parser\n");
395 #endif
396  pfree(prs);
397 }
struct TParserPosition * prev
Definition: wparser_def.c:235
void pfree(void *pointer)
Definition: mcxt.c:949
TParserPosition * state
Definition: wparser_def.c:250
pg_wchar * pgwstr
Definition: wparser_def.c:245
wchar_t * wstr
Definition: wparser_def.c:244
static void TParserCopyClose ( TParser prs)
static

Definition at line 403 of file wparser_def.c.

References pfree(), TParserPosition::prev, and TParser::state.

Referenced by p_ishost(), and p_isURLPath().

404 {
405  while (prs->state)
406  {
407  TParserPosition *ptr = prs->state->prev;
408 
409  pfree(prs->state);
410  prs->state = ptr;
411  }
412 
413 #ifdef WPARSER_TRACE
414  fprintf(stderr, "closing parser copy\n");
415 #endif
416  pfree(prs);
417 }
struct TParserPosition * prev
Definition: wparser_def.c:235
void pfree(void *pointer)
Definition: mcxt.c:949
TParserPosition * state
Definition: wparser_def.c:250
static TParser* TParserCopyInit ( const TParser orig)
static

Definition at line 351 of file wparser_def.c.

References TParser::charmaxlen, TParser::lenstr, newTParserPosition(), palloc0(), TParser::pgwstr, TParserPosition::posbyte, TParserPosition::poschar, TParserPosition::state, TParser::state, TParser::str, TPS_Base, TParser::usewide, and TParser::wstr.

Referenced by p_ishost(), and p_isURLPath().

352 {
353  TParser *prs = (TParser *) palloc0(sizeof(TParser));
354 
355  prs->charmaxlen = orig->charmaxlen;
356  prs->str = orig->str + orig->state->posbyte;
357  prs->lenstr = orig->lenstr - orig->state->posbyte;
358  prs->usewide = orig->usewide;
359 
360  if (orig->pgwstr)
361  prs->pgwstr = orig->pgwstr + orig->state->poschar;
362  if (orig->wstr)
363  prs->wstr = orig->wstr + orig->state->poschar;
364 
365  prs->state = newTParserPosition(NULL);
366  prs->state->state = TPS_Base;
367 
368 #ifdef WPARSER_TRACE
369  /* See note above about %.*s */
370  fprintf(stderr, "parsing copy of \"%.*s\"\n", prs->lenstr, prs->str);
371 #endif
372 
373  return prs;
374 }
TParserState state
Definition: wparser_def.c:234
bool usewide
Definition: wparser_def.c:246
char * str
Definition: wparser_def.c:242
TParserPosition * state
Definition: wparser_def.c:250
void * palloc0(Size size)
Definition: mcxt.c:877
pg_wchar * pgwstr
Definition: wparser_def.c:245
int lenstr
Definition: wparser_def.c:243
int charmaxlen
Definition: wparser_def.c:249
wchar_t * wstr
Definition: wparser_def.c:244
static TParserPosition * newTParserPosition(TParserPosition *prev)
Definition: wparser_def.c:270
static bool TParserGet ( TParser prs)
static

Definition at line 1704 of file wparser_def.c.

References A_BINGO, A_CLEAR, A_CLRALL, A_MERGE, A_POP, A_PUSH, A_RERUN, TParserStateAction::action, Assert, TParserStateActionItem::c, TParser::c, TParserPosition::charlen, TParser::charmaxlen, TParserStateActionItem::flags, TParserStateActionItem::isclass, TParserPosition::lenbytetoken, TParser::lenbytetoken, TParserPosition::lenchartoken, TParser::lenchartoken, TParser::lenstr, newTParserPosition(), pfree(), pg_mblen(), TParserPosition::posbyte, TParserPosition::poschar, TParserPosition::prev, TParserPosition::pushedAtAction, TParserStateActionItem::special, TParserPosition::state, TParser::state, TParserStateAction::state, TParser::str, tok_alias, TParser::token, TParserStateActionItem::tostate, TPS_Base, TPS_Null, TParserStateActionItem::type, and TParser::type.

Referenced by p_ishost(), p_isURLPath(), and prsd_nexttoken().

1705 {
1706  const TParserStateActionItem *item = NULL;
1707 
1708  Assert(prs->state);
1709 
1710  if (prs->state->posbyte >= prs->lenstr)
1711  return false;
1712 
1713  prs->token = prs->str + prs->state->posbyte;
1714  prs->state->pushedAtAction = NULL;
1715 
1716  /* look at string */
1717  while (prs->state->posbyte <= prs->lenstr)
1718  {
1719  if (prs->state->posbyte == prs->lenstr)
1720  prs->state->charlen = 0;
1721  else
1722  prs->state->charlen = (prs->charmaxlen == 1) ? prs->charmaxlen :
1723  pg_mblen(prs->str + prs->state->posbyte);
1724 
1725  Assert(prs->state->posbyte + prs->state->charlen <= prs->lenstr);
1726  Assert(prs->state->state >= TPS_Base && prs->state->state < TPS_Null);
1727  Assert(Actions[prs->state->state].state == prs->state->state);
1728 
1729  if (prs->state->pushedAtAction)
1730  {
1731  /* After a POP, pick up at the next test */
1732  item = prs->state->pushedAtAction + 1;
1733  prs->state->pushedAtAction = NULL;
1734  }
1735  else
1736  {
1737  item = Actions[prs->state->state].action;
1738  Assert(item != NULL);
1739  }
1740 
1741  /* find action by character class */
1742  while (item->isclass)
1743  {
1744  prs->c = item->c;
1745  if (item->isclass(prs) != 0)
1746  break;
1747  item++;
1748  }
1749 
1750 #ifdef WPARSER_TRACE
1751  {
1752  TParserPosition *ptr;
1753 
1754  fprintf(stderr, "state ");
1755  /* indent according to stack depth */
1756  for (ptr = prs->state->prev; ptr; ptr = ptr->prev)
1757  fprintf(stderr, " ");
1758  fprintf(stderr, "%s ", Actions[prs->state->state].state_name);
1759  if (prs->state->posbyte < prs->lenstr)
1760  fprintf(stderr, "at %c", *(prs->str + prs->state->posbyte));
1761  else
1762  fprintf(stderr, "at EOF");
1763  fprintf(stderr, " matched rule %d flags%s%s%s%s%s%s%s%s%s%s%s\n",
1764  (int) (item - Actions[prs->state->state].action),
1765  (item->flags & A_BINGO) ? " BINGO" : "",
1766  (item->flags & A_POP) ? " POP" : "",
1767  (item->flags & A_PUSH) ? " PUSH" : "",
1768  (item->flags & A_RERUN) ? " RERUN" : "",
1769  (item->flags & A_CLEAR) ? " CLEAR" : "",
1770  (item->flags & A_MERGE) ? " MERGE" : "",
1771  (item->flags & A_CLRALL) ? " CLRALL" : "",
1772  (item->tostate != TPS_Null) ? " tostate " : "",
1773  (item->tostate != TPS_Null) ? Actions[item->tostate].state_name : "",
1774  (item->type > 0) ? " type " : "",
1775  tok_alias[item->type]);
1776  }
1777 #endif
1778 
1779  /* call special handler if exists */
1780  if (item->special)
1781  item->special(prs);
1782 
1783  /* BINGO, token is found */
1784  if (item->flags & A_BINGO)
1785  {
1786  Assert(item->type > 0);
1787  prs->lenbytetoken = prs->state->lenbytetoken;
1788  prs->lenchartoken = prs->state->lenchartoken;
1789  prs->state->lenbytetoken = prs->state->lenchartoken = 0;
1790  prs->type = item->type;
1791  }
1792 
1793  /* do various actions by flags */
1794  if (item->flags & A_POP)
1795  { /* pop stored state in stack */
1796  TParserPosition *ptr = prs->state->prev;
1797 
1798  pfree(prs->state);
1799  prs->state = ptr;
1800  Assert(prs->state);
1801  }
1802  else if (item->flags & A_PUSH)
1803  { /* push (store) state in stack */
1804  prs->state->pushedAtAction = item; /* remember where we push */
1805  prs->state = newTParserPosition(prs->state);
1806  }
1807  else if (item->flags & A_CLEAR)
1808  { /* clear previous pushed state */
1809  TParserPosition *ptr;
1810 
1811  Assert(prs->state->prev);
1812  ptr = prs->state->prev->prev;
1813  pfree(prs->state->prev);
1814  prs->state->prev = ptr;
1815  }
1816  else if (item->flags & A_CLRALL)
1817  { /* clear all previous pushed state */
1818  TParserPosition *ptr;
1819 
1820  while (prs->state->prev)
1821  {
1822  ptr = prs->state->prev->prev;
1823  pfree(prs->state->prev);
1824  prs->state->prev = ptr;
1825  }
1826  }
1827  else if (item->flags & A_MERGE)
1828  { /* merge posinfo with current and pushed state */
1829  TParserPosition *ptr = prs->state;
1830 
1831  Assert(prs->state->prev);
1832  prs->state = prs->state->prev;
1833 
1834  prs->state->posbyte = ptr->posbyte;
1835  prs->state->poschar = ptr->poschar;
1836  prs->state->charlen = ptr->charlen;
1837  prs->state->lenbytetoken = ptr->lenbytetoken;
1838  prs->state->lenchartoken = ptr->lenchartoken;
1839  pfree(ptr);
1840  }
1841 
1842  /* set new state if pointed */
1843  if (item->tostate != TPS_Null)
1844  prs->state->state = item->tostate;
1845 
1846  /* check for go away */
1847  if ((item->flags & A_BINGO) ||
1848  (prs->state->posbyte >= prs->lenstr &&
1849  (item->flags & A_RERUN) == 0))
1850  break;
1851 
1852  /* go to beginning of loop if we should rerun or we just restore state */
1853  if (item->flags & (A_RERUN | A_POP))
1854  continue;
1855 
1856  /* move forward */
1857  if (prs->state->charlen)
1858  {
1859  prs->state->posbyte += prs->state->charlen;
1860  prs->state->lenbytetoken += prs->state->charlen;
1861  prs->state->poschar++;
1862  prs->state->lenchartoken++;
1863  }
1864  }
1865 
1866  return (item && (item->flags & A_BINGO)) ? true : false;
1867 }
#define A_POP
Definition: wparser_def.c:220
TParserState state
Definition: wparser_def.c:234
struct TParserPosition * prev
Definition: wparser_def.c:235
char * str
Definition: wparser_def.c:242
#define A_CLRALL
Definition: wparser_def.c:225
TParserState state
Definition: wparser_def.c:1604
static const char *const tok_alias[]
Definition: wparser_def.c:60
void pfree(void *pointer)
Definition: mcxt.c:949
TParserSpecial special
Definition: wparser_def.c:214
TParserPosition * state
Definition: wparser_def.c:250
const TParserStateActionItem * pushedAtAction
Definition: wparser_def.c:236
const TParserStateActionItem * action
Definition: wparser_def.c:1603
#define A_BINGO
Definition: wparser_def.c:219
int lenbytetoken
Definition: wparser_def.c:259
int type
Definition: wparser_def.c:261
char * token
Definition: wparser_def.c:258
#define A_CLEAR
Definition: wparser_def.c:223
int lenchartoken
Definition: wparser_def.c:260
static const TParserStateAction Actions[]
Definition: wparser_def.c:1622
char c
Definition: wparser_def.c:255
TParserCharTest isclass
Definition: wparser_def.c:209
#define Assert(condition)
Definition: c.h:664
int lenstr
Definition: wparser_def.c:243
#define A_MERGE
Definition: wparser_def.c:224
int pg_mblen(const char *mbstr)
Definition: mbutils.c:771
int charmaxlen
Definition: wparser_def.c:249
static TParserPosition * newTParserPosition(TParserPosition *prev)
Definition: wparser_def.c:270
#define A_PUSH
Definition: wparser_def.c:221
#define A_RERUN
Definition: wparser_def.c:222
TParserState tostate
Definition: wparser_def.c:212
static TParser* TParserInit ( char *  str,
int  len 
)
static

Definition at line 287 of file wparser_def.c.

References char2wchar(), TParser::charmaxlen, DEFAULT_COLLATION_OID, lc_ctype_is_c(), TParser::lenstr, newTParserPosition(), palloc(), palloc0(), pg_database_encoding_max_length(), pg_mb2wchar_with_len(), TParser::pgwstr, TParserPosition::state, TParser::state, TParser::str, TPS_Base, TParser::usewide, and TParser::wstr.

Referenced by prsd_start().

288 {
289  TParser *prs = (TParser *) palloc0(sizeof(TParser));
290 
292  prs->str = str;
293  prs->lenstr = len;
294 
295  /*
296  * Use wide char code only when max encoding length > 1.
297  */
298  if (prs->charmaxlen > 1)
299  {
300  Oid collation = DEFAULT_COLLATION_OID; /* TODO */
301  pg_locale_t mylocale = 0; /* TODO */
302 
303  prs->usewide = true;
304  if (lc_ctype_is_c(collation))
305  {
306  /*
307  * char2wchar doesn't work for C-locale and sizeof(pg_wchar) could
308  * be different from sizeof(wchar_t)
309  */
310  prs->pgwstr = (pg_wchar *) palloc(sizeof(pg_wchar) * (prs->lenstr + 1));
311  pg_mb2wchar_with_len(prs->str, prs->pgwstr, prs->lenstr);
312  }
313  else
314  {
315  prs->wstr = (wchar_t *) palloc(sizeof(wchar_t) * (prs->lenstr + 1));
316  char2wchar(prs->wstr, prs->lenstr + 1, prs->str, prs->lenstr,
317  mylocale);
318  }
319  }
320  else
321  prs->usewide = false;
322 
323  prs->state = newTParserPosition(NULL);
324  prs->state->state = TPS_Base;
325 
326 #ifdef WPARSER_TRACE
327 
328  /*
329  * Use of %.*s here is a bit risky since it can misbehave if the data is
330  * not in what libc thinks is the prevailing encoding. However, since
331  * this is just a debugging aid, we choose to live with that.
332  */
333  fprintf(stderr, "parsing \"%.*s\"\n", len, str);
334 #endif
335 
336  return prs;
337 }
TParserState state
Definition: wparser_def.c:234
bool usewide
Definition: wparser_def.c:246
char * str
Definition: wparser_def.c:242
unsigned int Oid
Definition: postgres_ext.h:31
TParserPosition * state
Definition: wparser_def.c:250
#define DEFAULT_COLLATION_OID
Definition: pg_collation.h:75
int pg_database_encoding_max_length(void)
Definition: wchar.c:1833
unsigned int pg_wchar
Definition: mbprint.c:31
size_t char2wchar(wchar_t *to, size_t tolen, const char *from, size_t fromlen, pg_locale_t locale)
Definition: pg_locale.c:1677
void * palloc0(Size size)
Definition: mcxt.c:877
int pg_mb2wchar_with_len(const char *from, pg_wchar *to, int len)
Definition: mbutils.c:734
pg_wchar * pgwstr
Definition: wparser_def.c:245
int lenstr
Definition: wparser_def.c:243
int charmaxlen
Definition: wparser_def.c:249
wchar_t * wstr
Definition: wparser_def.c:244
static TParserPosition * newTParserPosition(TParserPosition *prev)
Definition: wparser_def.c:270
void * palloc(Size size)
Definition: mcxt.c:848
bool lc_ctype_is_c(Oid collation)
Definition: pg_locale.c:1178

Variable Documentation

const TParserStateAction Actions[]
static

Definition at line 1622 of file wparser_def.c.

const TParserStateActionItem actionTPS_Base[]
static
Initial value:
= {
{p_isEOF, 0, A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '<', A_PUSH, TPS_InTagFirst, 0, NULL},
{p_isignore, 0, A_NEXT, TPS_InSpace, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InWord, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InUnsignedInt, 0, NULL},
{p_iseqC, '-', A_PUSH, TPS_InSignedIntFirst, 0, NULL},
{p_iseqC, '+', A_PUSH, TPS_InSignedIntFirst, 0, NULL},
{p_iseqC, '&', A_PUSH, TPS_InXMLEntityFirst, 0, NULL},
{p_iseqC, '~', A_PUSH, TPS_InFileTwiddle, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InFileFirst, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InPathFirstFirst, 0, NULL},
{NULL, 0, A_NEXT, TPS_InSpace, 0, NULL}
}
static int p_isignore(TParser *prs)
Definition: wparser_def.c:629
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 965 of file wparser_def.c.

const TParserStateActionItem actionTPS_InAsciiWord[]
static
Initial value:
= {
{p_isasclet, 0, A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InFileNext, 0, NULL},
{p_iseqC, '-', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '_', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '@', A_PUSH, TPS_InEmail, 0, NULL},
{p_iseqC, ':', A_PUSH, TPS_InProtocolFirst, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InFileFirst, 0, NULL},
{p_isdigit, 0, A_PUSH, TPS_InHost, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InNumWord, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InWord, 0, NULL},
{p_isspecial, 0, A_NEXT, TPS_InWord, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, ASCIIWORD, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define ASCIIWORD
Definition: wparser_def.c:34
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 993 of file wparser_def.c.

const TParserStateActionItem actionTPS_InCloseCommentFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{NULL, 0, A_NEXT, TPS_InComment, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1303 of file wparser_def.c.

const TParserStateActionItem actionTPS_InCloseCommentLast[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '>', A_NEXT, TPS_InCommentEnd, 0, NULL},
{NULL, 0, A_NEXT, TPS_InComment, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1309 of file wparser_def.c.

const TParserStateActionItem actionTPS_InComment[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{NULL, 0, A_NEXT, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1297 of file wparser_def.c.

const TParserStateActionItem actionTPS_InCommentEnd[]
static
Initial value:
= {
{NULL, 0, A_BINGO | A_CLRALL, TPS_Base, TAG_T, NULL}
}
#define A_CLRALL
Definition: wparser_def.c:225
#define TAG_T
Definition: wparser_def.c:46
#define A_BINGO
Definition: wparser_def.c:219

Definition at line 1316 of file wparser_def.c.

const TParserStateActionItem actionTPS_InCommentFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_InCommentLast, 0, NULL},
{p_iseqC, 'D', A_NEXT, TPS_InTag, 0, NULL},
{p_iseqC, 'd', A_NEXT, TPS_InTag, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1282 of file wparser_def.c.

const TParserStateActionItem actionTPS_InCommentLast[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_InComment, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1291 of file wparser_def.c.

const TParserStateActionItem actionTPS_InDecimal[]
static
Initial value:
= {
{p_isdigit, 0, A_NEXT, TPS_InDecimal, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InVerVersion, 0, NULL},
{p_iseqC, 'e', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{p_iseqC, 'E', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, DECIMAL_T, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218
#define DECIMAL_T
Definition: wparser_def.c:53

Definition at line 1085 of file wparser_def.c.

const TParserStateActionItem actionTPS_InDecimalFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_CLEAR, TPS_InDecimal, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223

Definition at line 1079 of file wparser_def.c.

const TParserStateActionItem actionTPS_InEmail[]
static
Initial value:
= {
{p_isstophost, 0, A_POP, TPS_Null, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
static int p_isstophost(TParser *prs)
Definition: wparser_def.c:618
#define A_POP
Definition: wparser_def.c:220
#define A_CLRALL
Definition: wparser_def.c:225
#define A_BINGO
Definition: wparser_def.c:219
static int p_ishost(TParser *prs)
Definition: wparser_def.c:635
#define EMAIL
Definition: wparser_def.c:37

Definition at line 1385 of file wparser_def.c.

const TParserStateActionItem actionTPS_InFile[]
static
Initial value:
= {
{p_isasclet, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InFileNext, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InFileFirst, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, FILEPATH, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
#define FILEPATH
Definition: wparser_def.c:52
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1435 of file wparser_def.c.

const TParserStateActionItem actionTPS_InFileFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isasclet, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '.', A_NEXT, TPS_InPathFirst, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '~', A_PUSH, TPS_InFileTwiddle, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1391 of file wparser_def.c.

const TParserStateActionItem actionTPS_InFileNext[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isasclet, 0, A_CLEAR, TPS_InFile, 0, NULL},
{p_isdigit, 0, A_CLEAR, TPS_InFile, 0, NULL},
{p_iseqC, '_', A_CLEAR, TPS_InFile, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487

Definition at line 1446 of file wparser_def.c.

const TParserStateActionItem actionTPS_InFileTwiddle[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isasclet, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '/', A_NEXT, TPS_InFileFirst, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1401 of file wparser_def.c.

const TParserStateActionItem actionTPS_InFURL[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLRALL
Definition: wparser_def.c:225
#define A_BINGO
Definition: wparser_def.c:219
#define URL_T
Definition: wparser_def.c:38
static int p_isURLPath(TParser *prs)
Definition: wparser_def.c:657
static void SpecialFURL(TParser *prs)
Definition: wparser_def.c:594

Definition at line 1470 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHost[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHost, 0, NULL},
{p_isasclet, 0, A_NEXT, TPS_InHost, 0, NULL},
{p_iseqC, '@', A_PUSH, TPS_InEmail, 0, NULL},
{p_iseqC, '-', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '_', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1374 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHostDomain[]
static
Initial value:
= {
{p_isdigit, 0, A_PUSH, TPS_InHost, 0, NULL},
{p_iseqC, ':', A_PUSH, TPS_InPortFirst, 0, NULL},
{p_iseqC, '-', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '_', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '@', A_PUSH, TPS_InEmail, 0, NULL},
{p_isdigit, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InFURL, 0, NULL},
{NULL, 0, A_BINGO | A_CLRALL, TPS_Base, HOST, NULL}
}
static int p_isstophost(TParser *prs)
Definition: wparser_def.c:618
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLRALL
Definition: wparser_def.c:225
#define A_BINGO
Definition: wparser_def.c:219
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218
#define HOST
Definition: wparser_def.c:39

Definition at line 1338 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHostDomainSecond[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_PUSH, TPS_InHost, 0, NULL},
{p_iseqC, '-', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '_', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '@', A_PUSH, TPS_InEmail, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1327 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHostFirstAN[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHost, 0, NULL},
{p_isasclet, 0, A_NEXT, TPS_InHost, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1367 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHostFirstDomain[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHost, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1320 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenAsciiWord[]
static
Initial value:
= {
{p_isalpha, 0, A_NEXT, TPS_InHyphenWord, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenNumWord, 0, NULL},
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLRALL
Definition: wparser_def.c:225
static void SpecialHyphen(TParser *prs)
Definition: wparser_def.c:602
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218
#define ASCIIHWORD
Definition: wparser_def.c:49

Definition at line 1500 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenAsciiWordFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InHyphenWord, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenDigitLookahead, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1492 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenAsciiWordPart[]
static
Initial value:
= {
{p_isalpha, 0, A_NEXT, TPS_InHyphenWordPart, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenNumWordPart, 0, NULL},
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
#define ASCIIPARTHWORD
Definition: wparser_def.c:44
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1573 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenDigitLookahead[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenDigitLookahead, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InHyphenNumWord, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1541 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenNumWord[]
static
Initial value:
= {
{p_isalnum, 0, A_NEXT, TPS_InHyphenNumWord, 0, NULL},
}
#define NUMHWORD
Definition: wparser_def.c:48
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLRALL
Definition: wparser_def.c:225
static void SpecialHyphen(TParser *prs)
Definition: wparser_def.c:602
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1533 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenNumWordFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InHyphenNumWord, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenDigitLookahead, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1526 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenNumWordPart[]
static
Initial value:
= {
{p_isalnum, 0, A_NEXT, TPS_InHyphenNumWordPart, 0, NULL},
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define NUMPARTHWORD
Definition: wparser_def.c:42
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1582 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenUnsignedInt[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_Null, 0, NULL},
{p_isalpha, 0, A_CLEAR, TPS_InHyphenNumWordPart, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1589 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenWord[]
static
Initial value:
= {
{p_isalpha, 0, A_NEXT, TPS_InHyphenWord, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenNumWord, 0, NULL},
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLRALL
Definition: wparser_def.c:225
static void SpecialHyphen(TParser *prs)
Definition: wparser_def.c:602
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218
#define HWORD
Definition: wparser_def.c:50

Definition at line 1517 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenWordFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InHyphenWord, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenDigitLookahead, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1510 of file wparser_def.c.

const TParserStateActionItem actionTPS_InHyphenWordPart[]
static
Initial value:
= {
{p_isalpha, 0, A_NEXT, TPS_InHyphenWordPart, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InHyphenNumWordPart, 0, NULL},
{NULL, 0, A_BINGO, TPS_InParseHyphen, PARTHWORD, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
#define PARTHWORD
Definition: wparser_def.c:43
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1565 of file wparser_def.c.

const TParserStateActionItem actionTPS_InMantissa[]
static
Initial value:
= {
{p_isdigit, 0, A_NEXT, TPS_InMantissa, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, SCIENTIFIC, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
#define SCIENTIFIC
Definition: wparser_def.c:40
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1134 of file wparser_def.c.

const TParserStateActionItem actionTPS_InMantissaFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_CLEAR, TPS_InMantissa, 0, NULL},
{p_iseqC, '+', A_NEXT, TPS_InMantissaSign, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_InMantissaSign, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1120 of file wparser_def.c.

const TParserStateActionItem actionTPS_InMantissaSign[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_CLEAR, TPS_InMantissa, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223

Definition at line 1128 of file wparser_def.c.

const TParserStateActionItem actionTPS_InNumWord[]
static
Initial value:
= {
{p_isalnum, 0, A_NEXT, TPS_InNumWord, 0, NULL},
{p_isspecial, 0, A_NEXT, TPS_InNumWord, 0, NULL},
{p_iseqC, '@', A_PUSH, TPS_InEmail, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InFileFirst, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InFileNext, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, NUMWORD, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
#define NUMWORD
Definition: wparser_def.c:36
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 982 of file wparser_def.c.

const TParserStateActionItem actionTPS_InParseHyphen[]
static
Initial value:
= {
{p_isEOF, 0, A_RERUN, TPS_Base, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InHyphenWordPart, 0, NULL},
{p_isdigit, 0, A_PUSH, TPS_InHyphenUnsignedInt, 0, NULL},
{NULL, 0, A_RERUN, TPS_Base, 0, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218
#define A_RERUN
Definition: wparser_def.c:222

Definition at line 1549 of file wparser_def.c.

const TParserStateActionItem actionTPS_InParseHyphenHyphen[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isalnum, 0, A_BINGO | A_CLEAR, TPS_InParseHyphen, SPACE, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define SPACE
Definition: wparser_def.c:45
#define A_BINGO
Definition: wparser_def.c:219
#define A_CLEAR
Definition: wparser_def.c:223
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686

Definition at line 1558 of file wparser_def.c.

const TParserStateActionItem actionTPS_InPathFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isasclet, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_InFile, 0, NULL},
{p_iseqC, '.', A_NEXT, TPS_InPathSecond, 0, NULL},
{p_iseqC, '/', A_NEXT, TPS_InFileFirst, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1410 of file wparser_def.c.

const TParserStateActionItem actionTPS_InPathFirstFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '.', A_NEXT, TPS_InPathSecond, 0, NULL},
{p_iseqC, '/', A_NEXT, TPS_InFileFirst, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1420 of file wparser_def.c.

const TParserStateActionItem actionTPS_InPathSecond[]
static
Initial value:
= {
{p_iseqC, '/', A_NEXT | A_PUSH, TPS_InFileFirst, 0, NULL},
{p_isspace, 0, A_BINGO | A_CLEAR, TPS_Base, FILEPATH, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
#define A_CLEAR
Definition: wparser_def.c:223
#define FILEPATH
Definition: wparser_def.c:52
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1427 of file wparser_def.c.

const TParserStateActionItem actionTPS_InPort[]
static
Initial value:
= {
{p_isdigit, 0, A_NEXT, TPS_InPort, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InFURL, 0, NULL},
{NULL, 0, A_BINGO | A_CLRALL, TPS_Base, HOST, NULL}
}
static int p_isstophost(TParser *prs)
Definition: wparser_def.c:618
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLRALL
Definition: wparser_def.c:225
#define A_BINGO
Definition: wparser_def.c:219
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218
#define HOST
Definition: wparser_def.c:39

Definition at line 1359 of file wparser_def.c.

const TParserStateActionItem actionTPS_InPortFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InPort, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1353 of file wparser_def.c.

const TParserStateActionItem actionTPS_InProtocolEnd[]
static
Initial value:
= {
{NULL, 0, A_BINGO | A_CLRALL, TPS_Base, PROTOCOL, NULL}
}
#define A_CLRALL
Definition: wparser_def.c:225
#define PROTOCOL
Definition: wparser_def.c:47
#define A_BINGO
Definition: wparser_def.c:219

Definition at line 1488 of file wparser_def.c.

const TParserStateActionItem actionTPS_InProtocolFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '/', A_NEXT, TPS_InProtocolSecond, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1476 of file wparser_def.c.

const TParserStateActionItem actionTPS_InProtocolSecond[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '/', A_NEXT, TPS_InProtocolEnd, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1482 of file wparser_def.c.

const TParserStateActionItem actionTPS_InSignedInt[]
static
Initial value:
= {
{p_isdigit, 0, A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InDecimalFirst, 0, NULL},
{p_iseqC, 'e', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{p_iseqC, 'E', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, SIGNEDINT, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define SIGNEDINT
Definition: wparser_def.c:54
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1043 of file wparser_def.c.

const TParserStateActionItem actionTPS_InSignedIntFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT | A_CLEAR, TPS_InSignedInt, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1037 of file wparser_def.c.

const TParserStateActionItem actionTPS_InSpace[]
static
Initial value:
= {
{p_isEOF, 0, A_BINGO, TPS_Base, SPACE, NULL},
{p_iseqC, '<', A_BINGO, TPS_Base, SPACE, NULL},
{p_isignore, 0, A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '-', A_BINGO, TPS_Base, SPACE, NULL},
{p_iseqC, '+', A_BINGO, TPS_Base, SPACE, NULL},
{p_iseqC, '&', A_BINGO, TPS_Base, SPACE, NULL},
{p_iseqC, '/', A_BINGO, TPS_Base, SPACE, NULL},
{p_isnotalnum, 0, A_NEXT, TPS_InSpace, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, SPACE, NULL}
}
static int p_isignore(TParser *prs)
Definition: wparser_def.c:629
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define SPACE
Definition: wparser_def.c:45
#define A_BINGO
Definition: wparser_def.c:219
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1052 of file wparser_def.c.

const TParserStateActionItem actionTPS_InSVerVersion[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_BINGO | A_CLRALL, TPS_InUnsignedInt, SPACE, NULL},
{NULL, 0, A_NEXT, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLRALL
Definition: wparser_def.c:225
#define SPACE
Definition: wparser_def.c:45
#define A_BINGO
Definition: wparser_def.c:219
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1100 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTag[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '\'', A_NEXT, TPS_InTagEscapeK, 0, NULL},
{p_iseqC, '"', A_NEXT, TPS_InTagEscapeKK, 0, NULL},
{p_isasclet, 0, A_NEXT, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '=', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '#', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '/', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, ':', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '.', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '&', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '?', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '%', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '~', A_NEXT, TPS_Null, 0, NULL},
{p_isspace, 0, A_NEXT, TPS_Null, 0, SpecialTags},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static void SpecialTags(TParser *prs)
Definition: wparser_def.c:570
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1237 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagBackSleshed[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{NULL, 0, A_MERGE, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_MERGE
Definition: wparser_def.c:224

Definition at line 1273 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagBeginEnd[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '>', A_NEXT, TPS_InTagEnd, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1231 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagCloseFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isasclet, 0, A_NEXT, TPS_InTagName, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1211 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagEnd[]
static
Initial value:
= {
{NULL, 0, A_BINGO | A_CLRALL, TPS_Base, TAG_T, NULL}
}
#define A_CLRALL
Definition: wparser_def.c:225
#define TAG_T
Definition: wparser_def.c:46
#define A_BINGO
Definition: wparser_def.c:219

Definition at line 1278 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagEscapeK[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '\\', A_PUSH, TPS_InTagBackSleshed, 0, NULL},
{p_iseqC, '\'', A_NEXT, TPS_InTag, 0, NULL},
{NULL, 0, A_NEXT, TPS_InTagEscapeK, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1259 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagEscapeKK[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '\\', A_PUSH, TPS_InTagBackSleshed, 0, NULL},
{p_iseqC, '"', A_NEXT, TPS_InTag, 0, NULL},
{NULL, 0, A_NEXT, TPS_InTagEscapeKK, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1266 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InTagCloseFirst, 0, NULL},
{p_iseqC, '!', A_PUSH, TPS_InCommentFirst, 0, NULL},
{p_iseqC, '?', A_PUSH, TPS_InXMLBegin, 0, NULL},
{p_isasclet, 0, A_PUSH, TPS_InTagName, 0, NULL},
{p_iseqC, ':', A_PUSH, TPS_InTagName, 0, NULL},
{p_iseqC, '_', A_PUSH, TPS_InTagName, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221

Definition at line 1192 of file wparser_def.c.

const TParserStateActionItem actionTPS_InTagName[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, '/', A_NEXT, TPS_InTagBeginEnd, 0, NULL},
{p_isspace, 0, A_NEXT, TPS_InTag, 0, SpecialTags},
{p_isalnum, 0, A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, ':', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '.', A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_Null, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static void SpecialTags(TParser *prs)
Definition: wparser_def.c:570
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1217 of file wparser_def.c.

const TParserStateActionItem actionTPS_InUDecimal[]
static
Initial value:
= {
{p_isdigit, 0, A_NEXT, TPS_InUDecimal, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InVersionFirst, 0, NULL},
{p_iseqC, 'e', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{p_iseqC, 'E', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, DECIMAL_T, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218
#define DECIMAL_T
Definition: wparser_def.c:53

Definition at line 1070 of file wparser_def.c.

const TParserStateActionItem actionTPS_InUDecimalFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_CLEAR, TPS_InUDecimal, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223

Definition at line 1064 of file wparser_def.c.

const TParserStateActionItem actionTPS_InUnsignedInt[]
static
Initial value:
= {
{p_isdigit, 0, A_NEXT, TPS_Null, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InUDecimalFirst, 0, NULL},
{p_iseqC, 'e', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{p_iseqC, 'E', A_PUSH, TPS_InMantissaFirst, 0, NULL},
{p_iseqC, '-', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '_', A_PUSH, TPS_InHostFirstAN, 0, NULL},
{p_iseqC, '@', A_PUSH, TPS_InEmail, 0, NULL},
{p_isasclet, 0, A_PUSH, TPS_InHost, 0, NULL},
{p_isalpha, 0, A_NEXT, TPS_InNumWord, 0, NULL},
{p_isspecial, 0, A_NEXT, TPS_InNumWord, 0, NULL},
{p_iseqC, '/', A_PUSH, TPS_InFileFirst, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, UNSIGNEDINT, NULL}
}
#define UNSIGNEDINT
Definition: wparser_def.c:55
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1020 of file wparser_def.c.

const TParserStateActionItem actionTPS_InURLPath[]
static
Initial value:
= {
{p_isurlchar, 0, A_NEXT, TPS_InURLPath, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, URLPATH, NULL}
}
#define URLPATH
Definition: wparser_def.c:51
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isurlchar(TParser *prs)
Definition: wparser_def.c:511
#define A_BINGO
Definition: wparser_def.c:219
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1464 of file wparser_def.c.

const TParserStateActionItem actionTPS_InURLPathFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isurlchar, 0, A_NEXT, TPS_InURLPath, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL},
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isurlchar(TParser *prs)
Definition: wparser_def.c:511
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1454 of file wparser_def.c.

const TParserStateActionItem actionTPS_InURLPathStart[]
static
Initial value:
= {
{NULL, 0, A_NEXT, TPS_InURLPath, 0, NULL}
}
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1460 of file wparser_def.c.

const TParserStateActionItem actionTPS_InVersion[]
static
Initial value:
= {
{p_isdigit, 0, A_NEXT, TPS_InVersion, 0, NULL},
{p_iseqC, '.', A_PUSH, TPS_InVersionFirst, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, VERSIONNUMBER, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define VERSIONNUMBER
Definition: wparser_def.c:41
#define A_BINGO
Definition: wparser_def.c:219
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1113 of file wparser_def.c.

const TParserStateActionItem actionTPS_InVersionFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isdigit, 0, A_CLEAR, TPS_InVersion, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_CLEAR
Definition: wparser_def.c:223

Definition at line 1107 of file wparser_def.c.

const TParserStateActionItem actionTPS_InVerVersion[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static void SpecialVerVersion(TParser *prs)
Definition: wparser_def.c:609
#define A_RERUN
Definition: wparser_def.c:222

Definition at line 1094 of file wparser_def.c.

const TParserStateActionItem actionTPS_InWord[]
static
Initial value:
= {
{p_isEOF, 0, A_BINGO, TPS_Base, WORD_T, NULL},
{p_isalpha, 0, A_NEXT, TPS_Null, 0, NULL},
{p_isspecial, 0, A_NEXT, TPS_Null, 0, NULL},
{p_isdigit, 0, A_NEXT, TPS_InNumWord, 0, NULL},
{NULL, 0, A_BINGO, TPS_Base, WORD_T, NULL}
}
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
#define A_BINGO
Definition: wparser_def.c:219
static int p_isspecial(TParser *prs)
Definition: wparser_def.c:686
#define WORD_T
Definition: wparser_def.c:35
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_PUSH
Definition: wparser_def.c:221
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1011 of file wparser_def.c.

const TParserStateActionItem actionTPS_InXMLBegin[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, 'x', A_NEXT, TPS_InTag, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1203 of file wparser_def.c.

const TParserStateActionItem actionTPS_InXMLEntity[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isalnum, 0, A_NEXT, TPS_InXMLEntity, 0, NULL},
{p_iseqC, ':', A_NEXT, TPS_InXMLEntity, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_InXMLEntity, 0, NULL},
{p_iseqC, '.', A_NEXT, TPS_InXMLEntity, 0, NULL},
{p_iseqC, '-', A_NEXT, TPS_InXMLEntity, 0, NULL},
{p_iseqC, ';', A_NEXT, TPS_InXMLEntityEnd, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1149 of file wparser_def.c.

const TParserStateActionItem actionTPS_InXMLEntityEnd[]
static
Initial value:
= {
{NULL, 0, A_BINGO | A_CLEAR, TPS_Base, XMLENTITY, NULL}
}
#define XMLENTITY
Definition: wparser_def.c:56
#define A_BINGO
Definition: wparser_def.c:219
#define A_CLEAR
Definition: wparser_def.c:223

Definition at line 1188 of file wparser_def.c.

const TParserStateActionItem actionTPS_InXMLEntityFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_iseqC, ':', A_NEXT, TPS_InXMLEntity, 0, NULL},
{p_iseqC, '_', A_NEXT, TPS_InXMLEntity, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_isasclet(TParser *prs)
Definition: wparser_def.c:505
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1140 of file wparser_def.c.

const TParserStateActionItem actionTPS_InXMLEntityHexNum[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isxdigit, 0, A_NEXT, TPS_InXMLEntityHexNum, 0, NULL},
{p_iseqC, ';', A_NEXT, TPS_InXMLEntityEnd, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220
static int p_isEOF(TParser *prs)
Definition: wparser_def.c:480
static int p_iseqC(TParser *prs)
Definition: wparser_def.c:487
#define A_NEXT
Definition: wparser_def.c:218

Definition at line 1181 of file wparser_def.c.

const TParserStateActionItem actionTPS_InXMLEntityHexNumFirst[]
static
Initial value:
= {
{p_isEOF, 0, A_POP, TPS_Null, 0, NULL},
{p_isxdigit, 0, A_NEXT, TPS_InXMLEntityHexNum, 0, NULL},
{NULL, 0, A_POP, TPS_Null, 0, NULL}
}
#define A_POP
Definition: wparser_def.c:220