Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
4c4a667f
Commit
4c4a667f
authored
21 years ago
by
Michael Meskes
Browse files
Options
Downloads
Patches
Plain Diff
Applied Peter's patch to use yyless instead of my string_unput function.
parent
b2312c4e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/interfaces/ecpg/preproc/pgc.l
+19
-44
19 additions, 44 deletions
src/interfaces/ecpg/preproc/pgc.l
with
19 additions
and
44 deletions
src/interfaces/ecpg/preproc/pgc.l
+
19
−
44
View file @
4c4a667f
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.11
8
2003/0
6
/2
6 11:37:05
meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.11
9
2003/0
7
/2
5 05:42:27
meskes Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -42,7 +42,6 @@ static int literalalloc; /* current allocated buffer size */
...
@@ -42,7 +42,6 @@ static int literalalloc; /* current allocated buffer size */
#define startlit() (literalbuf[0] = '\0', literallen = 0)
#define startlit() (literalbuf[0] = '\0', literallen = 0)
static void addlit(char *ytext, int yleng);
static void addlit(char *ytext, int yleng);
static void addlitchar (unsigned char);
static void addlitchar (unsigned char);
static void string_unput (char *);
static void parse_include (void);
static void parse_include (void);
char *token_start;
char *token_start;
...
@@ -721,9 +720,7 @@ cppline {space}*#(.*\\{space})+.*
...
@@ -721,9 +720,7 @@ cppline {space}*#(.*\\{space})+.*
}
}
else
else
{
{
string_unput("define ");
yyless(1);
/* remove the "define " part of the text */
yytext[1] = '\0';
return (S_ANYTHING);
return (S_ANYTHING);
}
}
}
}
...
@@ -732,14 +729,12 @@ cppline {space}*#(.*\\{space})+.*
...
@@ -732,14 +729,12 @@ cppline {space}*#(.*\\{space})+.*
/* are we simulating Informix? */
/* are we simulating Informix? */
if (INFORMIX_MODE)
if (INFORMIX_MODE)
{
{
BEGIN(incl);
BEGIN(incl);
}
}
else
else
{
{
string_unput("include ");
yyless(1);
/* remove the "include " part of the text */
return (S_ANYTHING);
yytext[1] = '\0';
return (S_ANYTHING);
}
}
}
}
<C,xskip>{exec_sql}{ifdef}{space}* { ifcond = TRUE; BEGIN(xcond); }
<C,xskip>{exec_sql}{ifdef}{space}* { ifcond = TRUE; BEGIN(xcond); }
...
@@ -747,15 +742,13 @@ cppline {space}*#(.*\\{space})+.*
...
@@ -747,15 +742,13 @@ cppline {space}*#(.*\\{space})+.*
/* are we simulating Informix? */
/* are we simulating Informix? */
if (INFORMIX_MODE)
if (INFORMIX_MODE)
{
{
ifcond = TRUE;
ifcond = TRUE;
BEGIN(xcond);
BEGIN(xcond);
}
}
else
else
{
{
string_unput("ifdef ");
yyless(1);
/* remove the "ifdef " part of the text */
return (S_ANYTHING);
yytext[1] = '\0';
return (S_ANYTHING);
}
}
}
}
<C,xskip>{exec_sql}{ifndef}{space}* { ifcond = FALSE; BEGIN(xcond); }
<C,xskip>{exec_sql}{ifndef}{space}* { ifcond = FALSE; BEGIN(xcond); }
...
@@ -763,15 +756,13 @@ cppline {space}*#(.*\\{space})+.*
...
@@ -763,15 +756,13 @@ cppline {space}*#(.*\\{space})+.*
/* are we simulating Informix? */
/* are we simulating Informix? */
if (INFORMIX_MODE)
if (INFORMIX_MODE)
{
{
ifcond = FALSE;
ifcond = FALSE;
BEGIN(xcond);
BEGIN(xcond);
}
}
else
else
{
{
string_unput("ifndef ");
yyless(1);
/* remove the "ifndef " part of the text */
return (S_ANYTHING);
yytext[1] = '\0';
return (S_ANYTHING);
}
}
}
}
<C,xskip>{exec_sql}{elif}{space}* { /* pop stack */
<C,xskip>{exec_sql}{elif}{space}* { /* pop stack */
...
@@ -801,10 +792,8 @@ cppline {space}*#(.*\\{space})+.*
...
@@ -801,10 +792,8 @@ cppline {space}*#(.*\\{space})+.*
}
}
else
else
{
{
string_unput("elif ");
yyless(1);
/* remove the "elif " part of the text */
return (S_ANYTHING);
yytext[1] = '\0';
return (S_ANYTHING);
}
}
}
}
...
@@ -845,10 +834,8 @@ cppline {space}*#(.*\\{space})+.*
...
@@ -845,10 +834,8 @@ cppline {space}*#(.*\\{space})+.*
}
}
else
else
{
{
string_unput("else ");
yyless(1);
/* remove the "else " part of the text */
return (S_ANYTHING);
yytext[1] = '\0';
return (S_ANYTHING);
}
}
}
}
<C,xskip>{exec_sql}{endif}{space}*";" {
<C,xskip>{exec_sql}{endif}{space}*";" {
...
@@ -878,10 +865,8 @@ cppline {space}*#(.*\\{space})+.*
...
@@ -878,10 +865,8 @@ cppline {space}*#(.*\\{space})+.*
}
}
else
else
{
{
string_unput("endif ");
yyless(1);
/* remove the "endif " part of the text */
return (S_ANYTHING);
yytext[1] = '\0';
return (S_ANYTHING);
}
}
}
}
...
@@ -1045,16 +1030,6 @@ addlitchar(unsigned char ychar)
...
@@ -1045,16 +1030,6 @@ addlitchar(unsigned char ychar)
literalbuf[literallen] = '\0';
literalbuf[literallen] = '\0';
}
}
/* put string back on stack */
static void
string_unput (char *string)
{
int i;
for (i = strlen(string)-1; i>=0; i--)
unput(string[i]);
}
static void
static void
parse_include(void)
parse_include(void)
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment