#include "postgres_fe.h"#include "extern.h"#include "preproc.h"
Go to the source code of this file.
Functions | |
| int | filtered_base_yylex (void) |
Variables | |
| static bool | have_lookahead |
| static int | lookahead_token |
| static YYSTYPE | lookahead_yylval |
| static YYLTYPE | lookahead_yylloc |
| int filtered_base_yylex | ( | void | ) |
Definition at line 48 of file parser.c.
References base_yylex(), have_lookahead, lookahead_token, lookahead_yylloc, lookahead_yylval, and YYLTYPE.
{
int cur_token;
int next_token;
YYSTYPE cur_yylval;
YYLTYPE cur_yylloc;
/* Get next token --- we might already have it */
if (have_lookahead)
{
cur_token = lookahead_token;
base_yylval = lookahead_yylval;
base_yylloc = lookahead_yylloc;
have_lookahead = false;
}
else
cur_token = base_yylex();
/* Do we need to look ahead for a possible multiword token? */
switch (cur_token)
{
case NULLS_P:
/*
* NULLS FIRST and NULLS LAST must be reduced to one token
*/
cur_yylval = base_yylval;
cur_yylloc = base_yylloc;
next_token = base_yylex();
switch (next_token)
{
case FIRST_P:
cur_token = NULLS_FIRST;
break;
case LAST_P:
cur_token = NULLS_LAST;
break;
default:
/* save the lookahead token for next time */
lookahead_token = next_token;
lookahead_yylval = base_yylval;
lookahead_yylloc = base_yylloc;
have_lookahead = true;
/* and back up the output info to cur_token */
base_yylval = cur_yylval;
base_yylloc = cur_yylloc;
break;
}
break;
case WITH:
/*
* WITH TIME must be reduced to one token
*/
cur_yylval = base_yylval;
cur_yylloc = base_yylloc;
next_token = base_yylex();
switch (next_token)
{
case TIME:
cur_token = WITH_TIME;
break;
default:
/* save the lookahead token for next time */
lookahead_token = next_token;
lookahead_yylval = base_yylval;
lookahead_yylloc = base_yylloc;
have_lookahead = true;
/* and back up the output info to cur_token */
base_yylval = cur_yylval;
base_yylloc = cur_yylloc;
break;
}
break;
default:
break;
}
return cur_token;
}
bool have_lookahead [static] |
Definition at line 28 of file parser.c.
Referenced by filtered_base_yylex().
int lookahead_token [static] |
Definition at line 29 of file parser.c.
Referenced by filtered_base_yylex().
YYLTYPE lookahead_yylloc [static] |
Definition at line 31 of file parser.c.
Referenced by filtered_base_yylex().
YYSTYPE lookahead_yylval [static] |
Definition at line 30 of file parser.c.
Referenced by filtered_base_yylex().
1.7.1