12
12
*
13
13
*
14
14
* IDENTIFICATION
15
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.118 2003/06/26 11:37:05 meskes Exp $
15
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.119 2003/07/25 05:42:27 meskes Exp $
16
16
*
17
17
*-------------------------------------------------------------------------
18
18
*/
@@ -42,7 +42,6 @@ static intliteralalloc;/* current allocated buffer size */
42
42
#define startlit ()(literalbuf[0 ] =' \0 ' , literallen =0 )
43
43
static void addlit (char *ytext,int yleng);
44
44
static void addlitchar (unsigned char );
45
- static void string_unput (char *);
46
45
static void parse_include (void );
47
46
48
47
char *token_start;
@@ -721,9 +720,7 @@ cppline{space}*#(.*\\{space})+.*
721
720
}
722
721
else
723
722
{
724
- string_unput (" define" );
725
- /* remove the "define " part of the text */
726
- yytext[1 ] =' \0 ' ;
723
+ yyless (1 );
727
724
return (S_ANYTHING);
728
725
}
729
726
}
@@ -732,46 +729,40 @@ cppline{space}*#(.*\\{space})+.*
732
729
/* are we simulating Informix? */
733
730
if (INFORMIX_MODE)
734
731
{
735
- BEGIN (incl);
732
+ BEGIN (incl);
736
733
}
737
734
else
738
735
{
739
- string_unput (" include" );
740
- /* remove the "include " part of the text */
741
- yytext[1 ] =' \0 ' ;
742
- return (S_ANYTHING);
736
+ yyless (1 );
737
+ return (S_ANYTHING);
743
738
}
744
739
}
745
740
<C ,xskip >{exec_sql }{ifdef }{space }* { ifcond =TRUE ;BEGIN (xcond); }
746
741
<C ,xskip >{informix_special }{ifdef }{space }* {
747
742
/* are we simulating Informix? */
748
743
if (INFORMIX_MODE)
749
744
{
750
- ifcond =TRUE ;
751
- BEGIN (xcond);
745
+ ifcond =TRUE ;
746
+ BEGIN (xcond);
752
747
}
753
748
else
754
749
{
755
- string_unput (" ifdef" );
756
- /* remove the "ifdef " part of the text */
757
- yytext[1 ] =' \0 ' ;
758
- return (S_ANYTHING);
750
+ yyless (1 );
751
+ return (S_ANYTHING);
759
752
}
760
753
}
761
754
<C ,xskip >{exec_sql }{ifndef }{space }* { ifcond =FALSE ;BEGIN (xcond); }
762
755
<C ,xskip >{informix_special }{ifndef }{space }* {
763
756
/* are we simulating Informix? */
764
757
if (INFORMIX_MODE)
765
758
{
766
- ifcond =FALSE ;
767
- BEGIN (xcond);
759
+ ifcond =FALSE ;
760
+ BEGIN (xcond);
768
761
}
769
762
else
770
763
{
771
- string_unput (" ifndef" );
772
- /* remove the "ifndef " part of the text */
773
- yytext[1 ] =' \0 ' ;
774
- return (S_ANYTHING);
764
+ yyless (1 );
765
+ return (S_ANYTHING);
775
766
}
776
767
}
777
768
<C ,xskip >{exec_sql }{elif }{space }* {/* pop stack */
@@ -801,10 +792,8 @@ cppline{space}*#(.*\\{space})+.*
801
792
}
802
793
else
803
794
{
804
- string_unput (" elif" );
805
- /* remove the "elif " part of the text */
806
- yytext[1 ] =' \0 ' ;
807
- return (S_ANYTHING);
795
+ yyless (1 );
796
+ return (S_ANYTHING);
808
797
}
809
798
}
810
799
@@ -845,10 +834,8 @@ cppline{space}*#(.*\\{space})+.*
845
834
}
846
835
else
847
836
{
848
- string_unput (" else" );
849
- /* remove the "else " part of the text */
850
- yytext[1 ] =' \0 ' ;
851
- return (S_ANYTHING);
837
+ yyless (1 );
838
+ return (S_ANYTHING);
852
839
}
853
840
}
854
841
<C ,xskip >{exec_sql }{endif }{space }* " ;" {
@@ -878,10 +865,8 @@ cppline{space}*#(.*\\{space})+.*
878
865
}
879
866
else
880
867
{
881
- string_unput (" endif" );
882
- /* remove the "endif " part of the text */
883
- yytext[1 ] =' \0 ' ;
884
- return (S_ANYTHING);
868
+ yyless (1 );
869
+ return (S_ANYTHING);
885
870
}
886
871
}
887
872
@@ -1045,16 +1030,6 @@ addlitchar(unsigned char ychar)
1045
1030
literalbuf[literallen] =' \0 ' ;
1046
1031
}
1047
1032
1048
- /* put string back on stack */
1049
- static void
1050
- string_unput (char *string)
1051
- {
1052
- int i;
1053
-
1054
- for (i =strlen (string)-1 ; i>=0 ; i--)
1055
- unput (string[i]);
1056
- }
1057
-
1058
1033
static void
1059
1034
parse_include (void )
1060
1035
{