aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/ecpg/ChangeLog6
-rw-r--r--src/interfaces/ecpg/TODO2
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l7
-rw-r--r--src/interfaces/ecpg/preproc/preproc.y9
-rw-r--r--src/interfaces/ecpg/test/Makefile2
-rw-r--r--src/interfaces/ecpg/test/test_init.pgc11
6 files changed, 26 insertions, 11 deletions
diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog
index 9a9e9527392..f078672eb87 100644
--- a/src/interfaces/ecpg/ChangeLog
+++ b/src/interfaces/ecpg/ChangeLog
@@ -972,6 +972,10 @@ Mon Oct 16 21:33:17 CEST 2000
Tue Oct 17 08:09:16 CEST 2000
- - Simplified parsing ofr connect rule.
+ - Simplified parsing of connect rule.
+
+Tue Oct 17 17:36:30 CEST 2000
+
+ - Fixed some bugs in C language parsing.
- Set ecpg version to 2.8.0.
- Set library version to 3.2.0.
diff --git a/src/interfaces/ecpg/TODO b/src/interfaces/ecpg/TODO
index 330597567e0..3f38592658f 100644
--- a/src/interfaces/ecpg/TODO
+++ b/src/interfaces/ecpg/TODO
@@ -20,5 +20,7 @@ instead of libpq so we can write backend functions using ecpg.
remove space_or_nl and line_end from pgc.l
+nested C comments do not work
+
Missing features:
- SQLSTATE
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index b05b5544f77..08457d4b083 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.64 2000/09/26 11:41:44 meskes Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.65 2000/10/17 15:38:25 meskes Exp $
*
*-------------------------------------------------------------------------
*/
@@ -676,6 +676,11 @@ cppline {space}*#(.*\\{line_end})*.*
<C>\[ { return('['); }
<C>\] { return(']'); }
<C>\= { return('='); }
+<C>"->" { return(S_MEMBER); }
+<C>">>" { return(S_RSHIFT); }
+<C>"<<" { return(S_LSHIFT); }
+<C>"||" { return(S_OR); }
+<C>"&&" { return(S_AND); }
<C>{other} { return S_ANYTHING; }
<C>{exec_sql}{define}{space_or_nl}* { BEGIN(def_ident); }
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y
index 4c6b6eb2ec5..9e6eaaa09aa 100644
--- a/src/interfaces/ecpg/preproc/preproc.y
+++ b/src/interfaces/ecpg/preproc/preproc.y
@@ -174,8 +174,8 @@ make_name(void)
%token SQL_VALUE SQL_VAR SQL_WHENEVER
/* C token */
-%token S_ANYTHING S_AUTO S_CONST S_EXTERN
-%token S_REGISTER S_STATIC S_VOLATILE
+%token S_AND S_ANYTHING S_AUTO S_CONST S_EXTERN S_LSHIFT
+%token S_MEMBER S_OR S_REGISTER S_RSHIFT S_STATIC S_VOLATILE
/* I need this and don't know where it is defined inside the backend */
%token TYPECAST
@@ -5298,11 +5298,16 @@ c_anything: IDENT { $$ = $1; }
| '-' { $$ = make_str("-"); }
| '/' { $$ = make_str("/"); }
| '%' { $$ = make_str("%"); }
+ | S_AND { $$ = make_str("&&"); }
| S_ANYTHING { $$ = make_name(); }
| S_AUTO { $$ = make_str("auto"); }
| S_CONST { $$ = make_str("const"); }
| S_EXTERN { $$ = make_str("extern"); }
+ | S_LSHIFT { $$ = make_str("<<"); }
+ | S_MEMBER { $$ = make_str("->"); }
+ | S_OR { $$ = make_str("||"); }
| S_REGISTER { $$ = make_str("register"); }
+ | S_RSHIFT { $$ = make_str(">>"); }
| S_STATIC { $$ = make_str("static"); }
| SQL_BOOL { $$ = make_str("bool"); }
| SQL_ENUM { $$ = make_str("enum"); }
diff --git a/src/interfaces/ecpg/test/Makefile b/src/interfaces/ecpg/test/Makefile
index 62dcba1f1fa..b2bffa168e7 100644
--- a/src/interfaces/ecpg/test/Makefile
+++ b/src/interfaces/ecpg/test/Makefile
@@ -1,4 +1,4 @@
-all: test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100
+all: test1 test2 test3 test4 perftest dyntest dyntest2 test_notice test_code100 test_init
#LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq
LDFLAGS=-g -I ../include -I /usr/include/postgresql -L /usr/lib -lecpg -lpq
diff --git a/src/interfaces/ecpg/test/test_init.pgc b/src/interfaces/ecpg/test/test_init.pgc
index 980319981c8..b8e16a9b2c4 100644
--- a/src/interfaces/ecpg/test/test_init.pgc
+++ b/src/interfaces/ecpg/test/test_init.pgc
@@ -31,14 +31,13 @@ int g=fb(2);
int i=3^1;
int j=1?1:2;
-/*int e=y->member; /* compile error */
-/*int c=10>>2; /* compile error */
-/*bool h=2||1; /* compile error */
-long long iax;
+int e=y->member;
+int c=10>>2;
+bool h=2||1;
+long iay /* = 1L */ ;
+long long iax /* = 40000000000LL */ ;
exec sql end declare section;
-iax = 40000000000LL;
-
/* not working */
int f=fa();