PostgreSQL Source Code git master
pgc.l File Reference
#include "postgres_fe.h"
#include <ctype.h>
#include <limits.h>
#include "common/string.h"
#include "preproc_extern.h"
#include "preproc.h"
Include dependency graph for pgc.l:

Go to the source code of this file.

Data Structures

struct  _yy_buffer
 
struct  _if_value
 

Macros

#define startlit()   (literalbuf[0] = '\0', literallen = 0)
 
#define MAX_NESTED_IF   128
 

Functions

static void addlit (char *ytext, int yleng)
 
static void addlitchar (unsigned char ychar)
 
static int process_integer_literal (const char *token, YYSTYPE *lval, int base)
 
static void parse_include (void)
 
static bool ecpg_isspace (char ch)
 
static bool isdefine (void)
 
static bool isinformixdefine (void)
 
int yylex (void)
 
void lex_init (void)
 

Variables

YYSTYPE base_yylval
 
static int xcdepth = 0
 
static char * dolqstart = NULL
 
static char * literalbuf = NULL
 
static int literallen
 
static int literalalloc
 
static int parenths_open
 
static bool include_next
 
char * token_start
 
static int state_before_str_start
 
static int state_before_str_stop
 
static struct _yy_bufferyy_buffer = NULL
 
static short preproc_tos
 
static bool ifcond
 
static struct _if_value stacked_if_value [MAX_NESTED_IF]
 

Macro Definition Documentation

◆ MAX_NESTED_IF

#define MAX_NESTED_IF   128

Definition at line 102 of file pgc.l.

◆ startlit

#define startlit ( )    (literalbuf[0] = '\0', literallen = 0)

Definition at line 57 of file pgc.l.

Function Documentation

◆ addlit()

static void addlit ( char *  ytext,
int  yleng 
)
static

Definition at line 1642 of file pgc.l.

1643{
1644 /* enlarge buffer if needed */
1645 if ((literallen + yleng) >= literalalloc)
1646 {
1647 do
1648 literalalloc *= 2;
1649 while ((literallen + yleng) >= literalalloc);
1651 }
1652 /* append new data, add trailing null */
1653 memcpy(literalbuf + literallen, ytext, yleng);
1654 literallen += yleng;
1655 literalbuf[literallen] = '\0';
#define realloc(a, b)
Definition: header.h:60
static int literallen
Definition: pgc.l:48
static char * literalbuf
Definition: pgc.l:47
static int literalalloc
Definition: pgc.l:49
1656}

References literalalloc, literalbuf, literallen, and realloc.

◆ addlitchar()

static void addlitchar ( unsigned char  ychar)
static

Definition at line 1659 of file pgc.l.

1660{
1661 /* enlarge buffer if needed */
1662 if ((literallen + 1) >= literalalloc)
1663 {
1664 literalalloc *= 2;
1666 }
1667 /* append new data, add trailing null */
1668 literalbuf[literallen] = ychar;
1669 literallen += 1;
1670 literalbuf[literallen] = '\0';
1671}

References literalalloc, literalbuf, literallen, and realloc.

◆ ecpg_isspace()

static bool ecpg_isspace ( char  ch)
static

Definition at line 1806 of file pgc.l.

1807{
1808 if (ch == ' ' ||
1809 ch == '\t' ||
1810 ch == '\n' ||
1811 ch == '\r' ||
1812 ch == '\f' ||
1813 ch == '\v')
1814 return true;
1815 return false;
1816}

Referenced by parse_include().

◆ isdefine()

static bool isdefine ( void  )
static

Definition at line 1823 of file pgc.l.

1824{
1825 struct _defines *ptr;
Definition: type.h:180
1826
1827 /* is it a define? */
1828 for (ptr = defines; ptr; ptr = ptr->next)
1829 {
1830 /* notice we do not match anything being actively expanded */
1831 if (strcmp(yytext, ptr->name) == 0 &&
1832 ptr->value != NULL &&
1833 ptr->used == NULL)
1834 {
1835 /* Save state associated with the current buffer */
1836 struct _yy_buffer *yb;
struct _defines * defines
Definition: ecpg.c:31
struct _defines * next
Definition: type.h:185
char * value
Definition: type.h:182
char * name
Definition: type.h:181
void * used
Definition: type.h:184
Definition: pgc.l:80
1837
1838 yb = mm_alloc(sizeof(struct _yy_buffer));
void * mm_alloc(size_t size)
Definition: util.c:85
1839
1840 yb->buffer = YY_CURRENT_BUFFER;
1841 yb->lineno = yylineno;
1843 yb->next = yy_buffer;
1844 yy_buffer = yb;
static struct _yy_buffer * yy_buffer
char * mm_strdup(const char *string)
Definition: util.c:97
char * input_filename
long lineno
Definition: pgc.l:82
YY_BUFFER_STATE buffer
Definition: pgc.l:81
struct _yy_buffer * next
Definition: pgc.l:84
char * filename
Definition: pgc.l:83
1845
1846 /* Mark symbol as being actively expanded */
1847 ptr->used = yb;
1848
1849 /*
1850 * We use yy_scan_string which will copy the value, so there's no
1851 * need to worry about a possible undef happening while we are
1852 * still scanning it.
1853 */
1854 yy_scan_string(ptr->value);
1855 return true;
1856 }
1857 }
1858
1859 return false;
1860}

References _yy_buffer::buffer, defines, _yy_buffer::filename, input_filename, _yy_buffer::lineno, mm_alloc(), mm_strdup(), _defines::name, _yy_buffer::next, _defines::next, _defines::used, _defines::value, and yy_buffer.

◆ isinformixdefine()

static bool isinformixdefine ( void  )
static

Definition at line 1867 of file pgc.l.

1868{
1869 const char *new = NULL;
1870
1871 if (strcmp(yytext, "dec_t") == 0)
1872 new = "decimal";
1873 else if (strcmp(yytext, "intrvl_t") == 0)
1874 new = "interval";
1875 else if (strcmp(yytext, "dtime_t") == 0)
1876 new = "timestamp";
1877
1878 if (new)
1879 {
1880 struct _yy_buffer *yb;
1881
1882 yb = mm_alloc(sizeof(struct _yy_buffer));
1883
1884 yb->buffer = YY_CURRENT_BUFFER;
1885 yb->lineno = yylineno;
1887 yb->next = yy_buffer;
1888 yy_buffer = yb;
1889
1890 yy_scan_string(new);
1891 return true;
1892 }
1893
1894 return false;
1895}

References _yy_buffer::buffer, _yy_buffer::filename, input_filename, _yy_buffer::lineno, mm_alloc(), mm_strdup(), _yy_buffer::next, and yy_buffer.

◆ lex_init()

void lex_init ( void  )

Definition at line 1616 of file pgc.l.

1617{
1618 braces_open = 0;
1619 parenths_open = 0;
1620 current_function = NULL;
static int parenths_open
Definition: pgc.l:52
int braces_open
char * current_function
1621
1622 yylineno = 1;
1623
1624 /* initialize state for if/else/endif */
1625 preproc_tos = 0;
static short preproc_tos
Definition: pgc.l:103
static struct _if_value stacked_if_value[MAX_NESTED_IF]
bool active
Definition: pgc.l:107
bool else_branch
Definition: pgc.l:109
bool saw_active
Definition: pgc.l:108
1629
1630 /* initialize literal buffer to a reasonable but expansible size */
1631 if (literalbuf == NULL)
1632 {
1633 literalalloc = 1024;
1634 literalbuf = (char *) mm_alloc(literalalloc);
1635 }
1636 startlit();
#define startlit()
Definition: pgc.l:57
1637
1638 BEGIN(C);
1639}

References _if_value::active, braces_open, current_function, _if_value::else_branch, literalalloc, literalbuf, mm_alloc(), parenths_open, preproc_tos, _if_value::saw_active, stacked_if_value, and startlit.

Referenced by main().

◆ parse_include()

static void parse_include ( void  )
static

Definition at line 1696 of file pgc.l.

1697{
1698 /* got the include file name */
1699 struct _yy_buffer *yb;
1700 struct _include_path *ip;
1701 char inc_file[MAXPGPATH];
1702 unsigned int i;
int i
Definition: isn.c:72
#define MAXPGPATH
1703
1704 yb = mm_alloc(sizeof(struct _yy_buffer));
1705
1706 yb->buffer = YY_CURRENT_BUFFER;
1707 yb->lineno = yylineno;
1709 yb->next = yy_buffer;
1710
1711 yy_buffer = yb;
1712
1713 /*
1714 * skip the ";" if there is one and trailing whitespace. Note that yytext
1715 * contains at least one non-space character plus the ";"
1716 */
1717 for (i = strlen(yytext) - 2;
1718 i > 0 && ecpg_isspace(yytext[i]);
1719 i--)
1720 ;
static bool ecpg_isspace(char ch)
Definition: pgc.l:1806
1721
1722 if (yytext[i] == ';')
1723 i--;
1724
1725 yytext[i + 1] = '\0';
1726
1727 yyin = NULL;
1728
1729 /* If file name is enclosed in '"' remove these and look only in '.' */
1730
1731 /*
1732 * Informix does look into all include paths though, except filename
1733 * starts with '/'
1734 */
1735 if (yytext[0] == '"' && yytext[i] == '"' &&
1736 ((compat != ECPG_COMPAT_INFORMIX && compat != ECPG_COMPAT_INFORMIX_SE) || yytext[1] == '/'))
1737 {
1738 yytext[i] = '\0';
1739 memmove(yytext, yytext + 1, strlen(yytext));
enum COMPAT_MODE compat
Definition: ecpg.c:26
@ ECPG_COMPAT_INFORMIX
@ ECPG_COMPAT_INFORMIX_SE
1740
1741 strlcpy(inc_file, yytext, sizeof(inc_file));
1742 yyin = fopen(inc_file, "r");
1743 if (!yyin)
1744 {
1745 if (strlen(inc_file) <= 2 || strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
1746 {
1747 strcat(inc_file, ".h");
1748 yyin = fopen(inc_file, "r");
1749 }
1750 }
size_t strlcpy(char *dst, const char *src, size_t siz)
Definition: strlcpy.c:45
1751
1752 }
1753 else
1754 {
1755 if ((yytext[0] == '"' && yytext[i] == '"') || (yytext[0] == '<' && yytext[i] == '>'))
1756 {
1757 yytext[i] = '\0';
1758 memmove(yytext, yytext + 1, strlen(yytext));
1759 }
1760
1761 for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next)
1762 {
1763 if (strlen(ip->path) + strlen(yytext) + 4 > MAXPGPATH)
1764 {
1765 fprintf(stderr, _("Error: include path \"%s/%s\" is too long on line %d, skipping\n"), ip->path, yytext, yylineno);
1766 continue;
1767 }
1768 snprintf(inc_file, sizeof(inc_file), "%s/%s", ip->path, yytext);
1769 yyin = fopen(inc_file, "r");
1770 if (!yyin)
1771 {
1772 if (strcmp(inc_file + strlen(inc_file) - 2, ".h") != 0)
1773 {
1774 strcat(inc_file, ".h");
1775 yyin = fopen(inc_file, "r");
1776 }
1777 }
#define fprintf(file, fmt, msg)
Definition: cubescan.l:21
struct _include_path * include_paths
Definition: ecpg.c:28
#define _(x)
Definition: elog.c:90
#define snprintf
Definition: port.h:239
struct _include_path * next
Definition: type.h:134
char * path
Definition: type.h:133
1778
1779 /*
1780 * if the command was "include_next" we have to disregard the
1781 * first hit
1782 */
1783 if (yyin && include_next)
1784 {
1785 fclose(yyin);
1786 yyin = NULL;
1787 include_next = false;
1788 }
1789 }
1790 }
1791 if (!yyin)
1792 mmfatal(NO_INCLUDE_FILE, "could not open include file \"%s\" on line %d", yytext, yylineno);
static bool include_next
Definition: pgc.l:55
#define NO_INCLUDE_FILE
void void mmfatal(int error_code, const char *error,...) pg_attribute_printf(2
1793
1794 input_filename = mm_strdup(inc_file);
1795 yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
1796 yylineno = 1;
void output_line_number(void)
Definition: output.c:10
1798
1799 BEGIN(C);
1800}

References _, _yy_buffer::buffer, compat, ECPG_COMPAT_INFORMIX, ECPG_COMPAT_INFORMIX_SE, ecpg_isspace(), _yy_buffer::filename, fprintf, i, include_next, include_paths, input_filename, _yy_buffer::lineno, MAXPGPATH, mm_alloc(), mm_strdup(), mmfatal(), _yy_buffer::next, _include_path::next, NO_INCLUDE_FILE, output_line_number(), _include_path::path, snprintf, strlcpy(), and yy_buffer.

◆ process_integer_literal()

static int process_integer_literal ( const char *  token,
YYSTYPE lval,
int  base 
)
static

Definition at line 1678 of file pgc.l.

1679{
1680 int val;
1681 char *endptr;
long val
Definition: informix.c:689
1682
1683 errno = 0;
1684 val = strtoint(base == 10 ? token : token + 2, &endptr, base);
1685 if (*endptr != '\0' || errno == ERANGE)
1686 {
1687 /* integer too large (or contains decimal pt), treat it as a float */
1688 lval->str = loc_strdup(token);
1689 return FCONST;
1690 }
1691 lval->ival = val;
1692 return ICONST;
#define token
Definition: indent_globs.h:126
char * loc_strdup(const char *string)
Definition: util.c:170
int strtoint(const char *pg_restrict str, char **pg_restrict endptr, int base)
Definition: string.c:50
1693}

References loc_strdup(), strtoint(), token, and val.

◆ yylex()

int yylex ( void  )

Definition at line 463 of file pgc.l.

465 {
466 /* code to execute during start of each call of yylex() */
467 char *newdefsymbol = NULL;
468
469 token_start = NULL;
char * token_start
Definition: pgc.l:66
470%}
471
472<SQL>{
473{whitespace} {
474 /* ignore */
475 }
476} /* <SQL> */
477
478<C,SQL>{
479{xcstart} {
480 token_start = yytext;
481 state_before_str_start = YYSTATE;
482 xcdepth = 0;
483 BEGIN(xc);
484 /* Put back any characters past slash-star; see above */
485 yyless(2);
486 fputs("/*", yyout);
487 }
static int state_before_str_start
Definition: pgc.l:69
static int xcdepth
Definition: pgc.l:38
488} /* <C,SQL> */
489
490<xc>{
491{xcstart} {
492 if (state_before_str_start == SQL)
493 {
494 xcdepth++;
495 /* Put back any characters past slash-star; see above */
496 yyless(2);
497 fputs("/_*", yyout);
498 }
499 else if (state_before_str_start == C)
500 {
501 ECHO;
502 }
503 }
#define ECHO
Definition: psqlscanslash.l:58
504
505{xcstop} {
506 if (state_before_str_start == SQL)
507 {
508 if (xcdepth <= 0)
509 {
510 ECHO;
511 BEGIN(SQL);
512 token_start = NULL;
513 }
514 else
515 {
516 xcdepth--;
517 fputs("*_/", yyout);
518 }
519 }
520 else if (state_before_str_start == C)
521 {
522 ECHO;
523 BEGIN(C);
524 token_start = NULL;
525 }
526 }
527
528{xcinside} {
529 ECHO;
530 }
531
532{op_chars} {
533 ECHO;
534 }
535
536\*+ {
537 ECHO;
538 }
539
540<<EOF>> {
541 mmfatal(PARSE_ERROR, "unterminated /* comment");
542 }
#define PARSE_ERROR
543} /* <xc> */
544
545<SQL>{
546{xbstart} {
547 token_start = yytext;
548 state_before_str_start = YYSTATE;
549 BEGIN(xb);
550 startlit();
551 }
552} /* <SQL> */
553
554<xh>{xhinside} |
555<xb>{xbinside} {
556 addlit(yytext, yyleng);
557 }
static void addlit(char *ytext, int yleng)
Definition: pgc.l:1642
#define yyleng
Definition: scan.l:1124
558<xb><<EOF>> {
559 mmfatal(PARSE_ERROR, "unterminated bit string literal");
560 }
561
562<SQL>{xhstart} {
563 token_start = yytext;
564 state_before_str_start = YYSTATE;
565 BEGIN(xh);
566 startlit();
567 }
568<xh><<EOF>> {
569 mmfatal(PARSE_ERROR, "unterminated hexadecimal string literal");
570 }
571
572<C>{xqstart} {
573 token_start = yytext;
574 state_before_str_start = YYSTATE;
575 BEGIN(xqc);
576 startlit();
577 }
578
579<SQL>{
580{xnstart} {
581 /* National character. Transfer it as-is to the backend. */
582 token_start = yytext;
583 state_before_str_start = YYSTATE;
584 BEGIN(xn);
585 startlit();
586 }
587
588{xqstart} {
589 token_start = yytext;
590 state_before_str_start = YYSTATE;
591 BEGIN(xq);
592 startlit();
593 }
594{xestart} {
595 token_start = yytext;
596 state_before_str_start = YYSTATE;
597 BEGIN(xe);
598 startlit();
599 }
600{xusstart} {
601 token_start = yytext;
602 state_before_str_start = YYSTATE;
603 BEGIN(xus);
604 startlit();
605 }
606} /* <SQL> */
607
608<xb,xh,xq,xqc,xe,xn,xus>{quote} {
609 /*
610 * When we are scanning a quoted string and see an end
611 * quote, we must look ahead for a possible continuation.
612 * If we don't see one, we know the end quote was in fact
613 * the end of the string. To reduce the lexer table size,
614 * we use a single "xqs" state to do the lookahead for all
615 * types of strings.
616 */
617 state_before_str_stop = YYSTATE;
618 BEGIN(xqs);
619 }
static int state_before_str_stop
Definition: pgc.l:70
620<xqs>{quotecontinue} {
621 /*
622 * Found a quote continuation, so return to the in-quote
623 * state and continue scanning the literal. Nothing is
624 * added to the literal's contents.
625 */
627 }
628<xqs>{quotecontinuefail} |
629<xqs>{other} |
630<xqs><<EOF>> {
631 /*
632 * Failed to see a quote continuation. Throw back
633 * everything after the end quote, and handle the string
634 * according to the state we were in previously.
635 */
636 yyless(0);
638
639 switch (state_before_str_stop)
640 {
641 case xb:
642 if (literalbuf[strspn(literalbuf, "01")] != '\0')
643 mmerror(PARSE_ERROR, ET_ERROR, "invalid bit string literal");
644 base_yylval.str = make3_str("b'", literalbuf, "'");
645 return BCONST;
646 case xh:
647 if (literalbuf[strspn(literalbuf, "0123456789abcdefABCDEF")] != '\0')
648 mmerror(PARSE_ERROR, ET_ERROR, "invalid hexadecimal string literal");
649 base_yylval.str = make3_str("x'", literalbuf, "'");
650 return XCONST;
651 case xq:
652 /* fallthrough */
653 case xqc:
654 base_yylval.str = make3_str("'", literalbuf, "'");
655 return SCONST;
656 case xe:
657 base_yylval.str = make3_str("E'", literalbuf, "'");
658 return SCONST;
659 case xn:
660 base_yylval.str = make3_str("N'", literalbuf, "'");
661 return SCONST;
662 case xus:
663 base_yylval.str = make3_str("U&'", literalbuf, "'");
664 return USCONST;
665 default:
666 mmfatal(PARSE_ERROR, "unhandled previous state in xqs\n");
667 }
668 }
YYSTYPE base_yylval
void mmerror(int error_code, enum errortype type, const char *error,...) pg_attribute_printf(3
char * make3_str(const char *str1, const char *str2, const char *str3)
Definition: util.c:256
@ ET_ERROR
Definition: type.h:220
669
670<xq,xe,xn,xus>{xqdouble} {
671 addlit(yytext, yyleng);
672 }
673<xqc>{xqcquote} {
674 addlit(yytext, yyleng);
675 }
676<xq,xqc,xn,xus>{xqinside} {
677 addlit(yytext, yyleng);
678 }
679<xe>{xeinside} {
680 addlit(yytext, yyleng);
681 }
682<xe>{xeunicode} {
683 addlit(yytext, yyleng);
684 }
685<xe>{xeescape} {
686 addlit(yytext, yyleng);
687 }
688<xe>{xeoctesc} {
689 addlit(yytext, yyleng);
690 }
691<xe>{xehexesc} {
692 addlit(yytext, yyleng);
693 }
694<xe>. {
695 /* This is only needed for \ just before EOF */
696 addlitchar(yytext[0]);
697 }
static void addlitchar(unsigned char ychar)
Definition: pgc.l:1659
698<xq,xqc,xe,xn,xus><<EOF>> {
699 mmfatal(PARSE_ERROR, "unterminated quoted string");
700 }
701
702<SQL>{
703{dolqdelim} {
704 token_start = yytext;
705 if (dolqstart)
707 dolqstart = mm_strdup(yytext);
708 BEGIN(xdolq);
709 startlit();
710 addlit(yytext, yyleng);
711 }
#define free(a)
Definition: header.h:65
static char * dolqstart
Definition: pgc.l:39
712{dolqfailed} {
713 /* throw back all but the initial "$" */
714 yyless(1);
715 /* and treat it as {other} */
716 return yytext[0];
717 }
718} /* <SQL> */
719
720<xdolq>{dolqdelim} {
721 if (strcmp(yytext, dolqstart) == 0)
722 {
723 addlit(yytext, yyleng);
725 dolqstart = NULL;
726 BEGIN(SQL);
728 return SCONST;
729 }
730 else
731 {
732 /*
733 * When we fail to match $...$ to dolqstart, transfer
734 * the $... part to the output, but put back the final
735 * $ for rescanning. Consider $delim$...$junk$delim$
736 */
737 addlit(yytext, yyleng - 1);
738 yyless(yyleng - 1);
739 }
740 }
741<xdolq>{dolqinside} {
742 addlit(yytext, yyleng);
743 }
744<xdolq>{dolqfailed} {
745 addlit(yytext, yyleng);
746 }
747<xdolq>. {
748 /* single quote or dollar sign */
749 addlitchar(yytext[0]);
750 }
751<xdolq><<EOF>> {
752 mmfatal(PARSE_ERROR, "unterminated dollar-quoted string");
753 }
754
755<SQL>{
756{xdstart} {
757 state_before_str_start = YYSTATE;
758 BEGIN(xd);
759 startlit();
760 }
761{xuistart} {
762 state_before_str_start = YYSTATE;
763 BEGIN(xui);
764 startlit();
765 }
766} /* <SQL> */
767
768<xd>{xdstop} {
770 if (literallen == 0)
771 mmerror(PARSE_ERROR, ET_ERROR, "zero-length delimited identifier");
772
773 /*
774 * The server will truncate the identifier here. We do
775 * not, as (1) it does not change the result; (2) we don't
776 * know what NAMEDATALEN the server might use; (3) this
777 * code path is also taken for literal query strings in
778 * PREPARE and EXECUTE IMMEDIATE, which can certainly be
779 * longer than NAMEDATALEN.
780 */
782 return CSTRING;
783 }
784<xdc>{xdstop} {
787 return CSTRING;
788 }
789<xui>{dquote} {
791 if (literallen == 0)
792 mmerror(PARSE_ERROR, ET_ERROR, "zero-length delimited identifier");
793
794 /*
795 * The backend will truncate the identifier here. We do
796 * not as it does not change the result.
797 */
798 base_yylval.str = make3_str("U&\"", literalbuf, "\"");
799 return UIDENT;
800 }
801<xd,xui>{xddouble} {
802 addlit(yytext, yyleng);
803 }
804<xd,xui>{xdinside} {
805 addlit(yytext, yyleng);
806 }
807<xd,xui><<EOF>> {
808 mmfatal(PARSE_ERROR, "unterminated quoted identifier");
809 }
810<C>{xdstart} {
811 state_before_str_start = YYSTATE;
812 BEGIN(xdc);
813 startlit();
814 }
815<xdc>{xdcinside} {
816 addlit(yytext, yyleng);
817 }
818<xdc><<EOF>> {
819 mmfatal(PARSE_ERROR, "unterminated quoted string");
820 }
821
822<SQL>{
823{typecast} {
824 return TYPECAST;
825 }
826
827{dot_dot} {
828 return DOT_DOT;
829 }
830
831{colon_equals} {
832 return COLON_EQUALS;
833 }
834
835{equals_greater} {
836 return EQUALS_GREATER;
837 }
838
839{less_equals} {
840 return LESS_EQUALS;
841 }
842
843{greater_equals} {
844 return GREATER_EQUALS;
845 }
846
847{less_greater} {
848 /* We accept both "<>" and "!=" as meaning NOT_EQUALS */
849 return NOT_EQUALS;
850 }
851
852{not_equals} {
853 /* We accept both "<>" and "!=" as meaning NOT_EQUALS */
854 return NOT_EQUALS;
855 }
856
857{informix_special} {
858 /* are we simulating Informix? */
859 if (INFORMIX_MODE)
860 {
861 unput(':');
862 }
863 else
864 return yytext[0];
865 }
#define INFORMIX_MODE(X)
866
867{self} {
868 /*
869 * We may find a ';' inside a structure definition in a
870 * TYPE or VAR statement. This is not an EOL marker.
871 */
872 if (yytext[0] == ';' && struct_level == 0)
873 BEGIN(C);
874 return yytext[0];
875 }
int struct_level
876
877{operator} {
878 /*
879 * Check for embedded slash-star or dash-dash; those
880 * are comment starts, so operator must stop there.
881 * Note that slash-star or dash-dash at the first
882 * character will match a prior rule, not this one.
883 */
884 int nchars = yyleng;
885 char *slashstar = strstr(yytext, "/*");
886 char *dashdash = strstr(yytext, "--");
887
888 if (slashstar && dashdash)
889 {
890 /* if both appear, take the first one */
891 if (slashstar > dashdash)
892 slashstar = dashdash;
893 }
894 else if (!slashstar)
895 slashstar = dashdash;
896 if (slashstar)
897 nchars = slashstar - yytext;
898
899 /*
900 * For SQL compatibility, '+' and '-' cannot be the
901 * last char of a multi-char operator unless the operator
902 * contains chars that are not in SQL operators.
903 * The idea is to lex '=-' as two operators, but not
904 * to forbid operator names like '?-' that could not be
905 * sequences of SQL operators.
906 */
907 if (nchars > 1 &&
908 (yytext[nchars - 1] == '+' ||
909 yytext[nchars - 1] == '-'))
910 {
911 int ic;
912
913 for (ic = nchars - 2; ic >= 0; ic--)
914 {
915 char c = yytext[ic];
char * c
916
917 if (c == '~' || c == '!' || c == '@' ||
918 c == '#' || c == '^' || c == '&' ||
919 c == '|' || c == '`' || c == '?' ||
920 c == '%')
921 break;
922 }
923 if (ic < 0)
924 {
925 /*
926 * didn't find a qualifying character, so remove
927 * all trailing [+-]
928 */
929 do
930 {
931 nchars--;
932 } while (nchars > 1 &&
933 (yytext[nchars - 1] == '+' ||
934 yytext[nchars - 1] == '-'));
935 }
936 }
937
938 if (nchars < yyleng)
939 {
940 /* Strip the unwanted chars from the token */
941 yyless(nchars);
942
943 /*
944 * If what we have left is only one char, and it's
945 * one of the characters matching "self", then
946 * return it as a character token the same way
947 * that the "self" rule would have.
948 */
949 if (nchars == 1 &&
950 strchr(",()[].;:+-*/%^<>=", yytext[0]))
951 return yytext[0];
952
953 /*
954 * Likewise, if what we have left is two chars, and
955 * those match the tokens ">=", "<=", "=>", "<>" or
956 * "!=", then we must return the appropriate token
957 * rather than the generic Op.
958 */
959 if (nchars == 2)
960 {
961 if (yytext[0] == '=' && yytext[1] == '>')
962 return EQUALS_GREATER;
963 if (yytext[0] == '>' && yytext[1] == '=')
964 return GREATER_EQUALS;
965 if (yytext[0] == '<' && yytext[1] == '=')
966 return LESS_EQUALS;
967 if (yytext[0] == '<' && yytext[1] == '>')
968 return NOT_EQUALS;
969 if (yytext[0] == '!' && yytext[1] == '=')
970 return NOT_EQUALS;
971 }
972 }
973
974 base_yylval.str = loc_strdup(yytext);
975 return Op;
976 }
977
978{param} {
979 int val;
980
981 errno = 0;
982 val = strtoint(yytext + 1, NULL, 10);
983 if (errno == ERANGE)
984 mmfatal(PARSE_ERROR, "parameter number too large");
985 base_yylval.ival = val;
986 return PARAM;
987 }
988{param_junk} {
989 mmfatal(PARSE_ERROR, "trailing junk after parameter");
990 }
991
992{ip} {
993 base_yylval.str = loc_strdup(yytext);
994 return IP;
995 }
static uint8 IP[64]
Definition: crypt-des.c:74
996} /* <SQL> */
997
998<C,SQL>{
999{decinteger} {
1000 return process_integer_literal(yytext, &base_yylval, 10);
1001 }
static int process_integer_literal(const char *token, YYSTYPE *lval, int base)
Definition: pgc.l:1678
1002{hexinteger} {
1003 return process_integer_literal(yytext, &base_yylval, 16);
1004 }
1005{numeric} {
1006 base_yylval.str = loc_strdup(yytext);
1007 return FCONST;
1008 }
1009{numericfail} {
1010 /* throw back the .., and treat as integer */
1011 yyless(yyleng - 2);
1012 return process_integer_literal(yytext, &base_yylval, 10);
1013 }
1014{real} {
1015 base_yylval.str = loc_strdup(yytext);
1016 return FCONST;
1017 }
1018{realfail} {
1019 /*
1020 * throw back the [Ee][+-], and figure out whether what
1021 * remains is an {decinteger} or {numeric}.
1022 */
1023 yyless(yyleng - 2);
1024 return process_integer_literal(yytext, &base_yylval, 10);
1025 }
1026} /* <C,SQL> */
1027
1028<SQL>{
1029{octinteger} {
1030 return process_integer_literal(yytext, &base_yylval, 8);
1031 }
1032{bininteger} {
1033 return process_integer_literal(yytext, &base_yylval, 2);
1034 }
1035
1036 /*
1037 * Note that some trailing junk is valid in C (such as 100LL), so we
1038 * contain this to SQL mode.
1039 */
1040{integer_junk} {
1041 mmfatal(PARSE_ERROR, "trailing junk after numeric literal");
1042 }
1043{numeric_junk} {
1044 mmfatal(PARSE_ERROR, "trailing junk after numeric literal");
1045 }
1046{real_junk} {
1047 mmfatal(PARSE_ERROR, "trailing junk after numeric literal");
1048 }
1049
1050:{identifier}((("->"|\.){identifier})|(\[{array}\]))* {
1051 base_yylval.str = loc_strdup(yytext + 1);
1052 return CVARIABLE;
1053 }
1054
1055{identifier} {
1056 /* First check to see if it's a define symbol to expand */
1057 if (!isdefine())
1058 {
1059 int kwvalue;
static bool isdefine(void)
Definition: pgc.l:1823
1060
1061 /*
1062 * User-defined typedefs override SQL keywords, but
1063 * not C keywords. Currently, a typedef name is just
1064 * reported as IDENT, but someday we might need to
1065 * return a distinct token type.
1066 */
1067 if (get_typedef(yytext, true) == NULL)
1068 {
1069 /* Is it an SQL/ECPG keyword? */
1070 kwvalue = ScanECPGKeywordLookup(yytext);
1071 if (kwvalue >= 0)
1072 return kwvalue;
1073 }
int ScanECPGKeywordLookup(const char *text)
Definition: ecpg_keywords.c:39
struct typedefs * get_typedef(const char *name, bool noerror)
Definition: variable.c:523
1074
1075 /* Is it a C keyword? */
1076 kwvalue = ScanCKeywordLookup(yytext);
1077 if (kwvalue >= 0)
1078 return kwvalue;
int ScanCKeywordLookup(const char *text)
Definition: c_keywords.c:36
1079
1080 /*
1081 * None of the above. Return it as an identifier.
1082 *
1083 * The backend will attempt to truncate and case-fold
1084 * the identifier, but I see no good reason for ecpg
1085 * to do so; that's just another way that ecpg could
1086 * get out of step with the backend.
1087 */
1088 base_yylval.str = loc_strdup(yytext);
1089 return IDENT;
1090 }
1091 }
1092
1093{other} {
1094 return yytext[0];
1095 }
1096} /* <SQL> */
1097
1098 /*
1099 * Begin ECPG-specific rules
1100 */
1101
1102<C>{exec_sql} {
1103 BEGIN(SQL);
1104 return SQL_START;
1105 }
1106<C>{informix_special} {
1107 /* are we simulating Informix? */
1108 if (INFORMIX_MODE)
1109 {
1110 BEGIN(SQL);
1111 return SQL_START;
1112 }
1113 else
1114 return S_ANYTHING;
1115 }
1116<C>{ccomment} {
1117 ECHO;
1118 }
1119<C>{cppinclude} {
1120 if (system_includes)
1121 {
1122 include_next = false;
1123 BEGIN(incl);
1124 }
1125 else
1126 {
1127 base_yylval.str = loc_strdup(yytext);
1128 return CPP_LINE;
1129 }
1130 }
bool system_includes
Definition: ecpg.c:17
1131<C>{cppinclude_next} {
1132 if (system_includes)
1133 {
1134 include_next = true;
1135 BEGIN(incl);
1136 }
1137 else
1138 {
1139 base_yylval.str = loc_strdup(yytext);
1140 return CPP_LINE;
1141 }
1142 }
1143<C,SQL>{cppline} {
1144 base_yylval.str = loc_strdup(yytext);
1145 return CPP_LINE;
1146 }
1147<C>{identifier} {
1148 /*
1149 * Try to detect a function name:
1150 * look for identifiers at the global scope
1151 * keep the last identifier before the first '(' and '{'
1152 */
1153 if (braces_open == 0 && parenths_open == 0)
1154 {
1155 if (current_function)
1157 current_function = mm_strdup(yytext);
1158 }
1159 /* Informix uses SQL defines only in SQL space */
1160 /* however, some defines have to be taken care of for compatibility */
1161 if ((!INFORMIX_MODE || !isinformixdefine()) && !isdefine())
1162 {
1163 int kwvalue;
static bool isinformixdefine(void)
Definition: pgc.l:1867
1164
1165 kwvalue = ScanCKeywordLookup(yytext);
1166 if (kwvalue >= 0)
1167 return kwvalue;
1168 else
1169 {
1170 base_yylval.str = loc_strdup(yytext);
1171 return IDENT;
1172 }
1173 }
1174 }
1175<C>{xcstop} {
1176 mmerror(PARSE_ERROR, ET_ERROR, "nested /* ... */ comments");
1177 }
1178<C>":" { return ':'; }
1179<C>";" { return ';'; }
1180<C>"," { return ','; }
1181<C>"*" { return '*'; }
1182<C>"%" { return '%'; }
1183<C>"/" { return '/'; }
1184<C>"+" { return '+'; }
1185<C>"-" { return '-'; }
1186<C>"(" { parenths_open++; return '('; }
1187<C>")" { parenths_open--; return ')'; }
1188<C,xskip>{space} { ECHO; }
1189<C>\{ { return '{'; }
1190<C>\} { return '}'; }
1191<C>\[ { return '['; }
1192<C>\] { return ']'; }
1193<C>\= { return '='; }
1194<C>"->" { return S_MEMBER; }
1195<C>">>" { return S_RSHIFT; }
1196<C>"<<" { return S_LSHIFT; }
1197<C>"||" { return S_OR; }
1198<C>"&&" { return S_AND; }
1199<C>"++" { return S_INC; }
1200<C>"--" { return S_DEC; }
1201<C>"==" { return S_EQUAL; }
1202<C>"!=" { return S_NEQUAL; }
1203<C>"+=" { return S_ADD; }
1204<C>"-=" { return S_SUB; }
1205<C>"*=" { return S_MUL; }
1206<C>"/=" { return S_DIV; }
1207<C>"%=" { return S_MOD; }
1208<C>"->*" { return S_MEMPOINT; }
1209<C>".*" { return S_DOTPOINT; }
1210<C>{other} { return S_ANYTHING; }
1211<C>{exec_sql}{define}{space}* { BEGIN(def_ident); }
1212<C>{informix_special}{define}{space}* {
1213 /* are we simulating Informix? */
1214 if (INFORMIX_MODE)
1215 {
1216 BEGIN(def_ident);
1217 }
1218 else
1219 {
1220 yyless(1);
1221 return S_ANYTHING;
1222 }
1223 }
1224<C>{exec_sql}{undef}{space}* {
1225 BEGIN(undef);
1226 }
1227<C>{informix_special}{undef}{space}* {
1228 /* are we simulating Informix? */
1229 if (INFORMIX_MODE)
1230 {
1231 BEGIN(undef);
1232 }
1233 else
1234 {
1235 yyless(1);
1236 return S_ANYTHING;
1237 }
1238 }
1239<undef>{identifier}{space}*";" {
1240 struct _defines *ptr,
1241 *ptr2 = NULL;
1242 int i;
1243
1244 /*
1245 * Skip the ";" and trailing whitespace. Note that yytext
1246 * contains at least one non-space character plus the ";"
1247 */
1248 for (i = strlen(yytext) - 2;
1249 i > 0 && ecpg_isspace(yytext[i]);
1250 i--)
1251 ;
1252 yytext[i + 1] = '\0';
1253
1254 /* Find and unset any matching define; should be only 1 */
1255 for (ptr = defines; ptr; ptr2 = ptr, ptr = ptr->next)
1256 {
1257 if (strcmp(yytext, ptr->name) == 0)
1258 {
1259 free(ptr->value);
1260 ptr->value = NULL;
1261 /* We cannot forget it if there's a cmdvalue */
1262 if (ptr->cmdvalue == NULL)
1263 {
1264 if (ptr2 == NULL)
1265 defines = ptr->next;
1266 else
1267 ptr2->next = ptr->next;
1268 free(ptr->name);
1269 free(ptr);
1270 }
1271 break;
1272 }
1273 }
1274
1275 BEGIN(C);
1276 }
1277<undef>{other}|\n {
1278 mmfatal(PARSE_ERROR, "missing identifier in EXEC SQL UNDEF command");
1279 yyterminate();
1280 }
1281<C>{exec_sql}{include}{space}* {
1282 BEGIN(incl);
1283 }
1284<C>{informix_special}{include}{space}* {
1285 /* are we simulating Informix? */
1286 if (INFORMIX_MODE)
1287 {
1288 BEGIN(incl);
1289 }
1290 else
1291 {
1292 yyless(1);
1293 return S_ANYTHING;
1294 }
1295 }
1296<C,xskip>{exec_sql}{ifdef}{space}* {
1297 if (preproc_tos >= MAX_NESTED_IF - 1)
1298 mmfatal(PARSE_ERROR, "too many nested EXEC SQL IFDEF conditions");
1299 preproc_tos++;
1303 ifcond = true;
1304 BEGIN(xcond);
1305 }
#define MAX_NESTED_IF
Definition: pgc.l:102
static bool ifcond
Definition: pgc.l:104
1306<C,xskip>{informix_special}{ifdef}{space}* {
1307 /* are we simulating Informix? */
1308 if (INFORMIX_MODE)
1309 {
1310 if (preproc_tos >= MAX_NESTED_IF - 1)
1311 mmfatal(PARSE_ERROR, "too many nested EXEC SQL IFDEF conditions");
1312 preproc_tos++;
1316 ifcond = true;
1317 BEGIN(xcond);
1318 }
1319 else
1320 {
1321 yyless(1);
1322 return S_ANYTHING;
1323 }
1324 }
1325<C,xskip>{exec_sql}{ifndef}{space}* {
1326 if (preproc_tos >= MAX_NESTED_IF - 1)
1327 mmfatal(PARSE_ERROR, "too many nested EXEC SQL IFDEF conditions");
1328 preproc_tos++;
1332 ifcond = false;
1333 BEGIN(xcond);
1334 }
1335<C,xskip>{informix_special}{ifndef}{space}* {
1336 /* are we simulating Informix? */
1337 if (INFORMIX_MODE)
1338 {
1339 if (preproc_tos >= MAX_NESTED_IF - 1)
1340 mmfatal(PARSE_ERROR, "too many nested EXEC SQL IFDEF conditions");
1341 preproc_tos++;
1345 ifcond = false;
1346 BEGIN(xcond);
1347 }
1348 else
1349 {
1350 yyless(1);
1351 return S_ANYTHING;
1352 }
1353 }
1354<C,xskip>{exec_sql}{elif}{space}* {
1355 if (preproc_tos == 0)
1356 mmfatal(PARSE_ERROR, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
1357 if (stacked_if_value[preproc_tos].else_branch)
1358 mmfatal(PARSE_ERROR, "missing \"EXEC SQL ENDIF;\"");
1359 ifcond = true;
1360 BEGIN(xcond);
1361 }
1362<C,xskip>{informix_special}{elif}{space}* {
1363 /* are we simulating Informix? */
1364 if (INFORMIX_MODE)
1365 {
1366 if (preproc_tos == 0)
1367 mmfatal(PARSE_ERROR, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
1368 if (stacked_if_value[preproc_tos].else_branch)
1369 mmfatal(PARSE_ERROR, "missing \"EXEC SQL ENDIF;\"");
1370 ifcond = true;
1371 BEGIN(xcond);
1372 }
1373 else
1374 {
1375 yyless(1);
1376 return S_ANYTHING;
1377 }
1378 }
1379
1380<C,xskip>{exec_sql}{else}{space}*";" {
1381 /* only exec sql endif pops the stack, so take care of duplicated 'else' */
1382 if (preproc_tos == 0)
1383 mmfatal(PARSE_ERROR, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
1384 else if (stacked_if_value[preproc_tos].else_branch)
1385 mmfatal(PARSE_ERROR, "more than one EXEC SQL ELSE");
1386 else
1387 {
1393
1394 if (stacked_if_value[preproc_tos].active)
1395 BEGIN(C);
1396 else
1397 BEGIN(xskip);
1398 }
1399 }
1400<C,xskip>{informix_special}{else}{space}*";" {
1401 /* are we simulating Informix? */
1402 if (INFORMIX_MODE)
1403 {
1404 if (preproc_tos == 0)
1405 mmfatal(PARSE_ERROR, "missing matching \"EXEC SQL IFDEF\" / \"EXEC SQL IFNDEF\"");
1406 else if (stacked_if_value[preproc_tos].else_branch)
1407 mmfatal(PARSE_ERROR, "more than one EXEC SQL ELSE");
1408 else
1409 {
1415
1416 if (stacked_if_value[preproc_tos].active)
1417 BEGIN(C);
1418 else
1419 BEGIN(xskip);
1420 }
1421 }
1422 else
1423 {
1424 yyless(1);
1425 return S_ANYTHING;
1426 }
1427 }
1428<C,xskip>{exec_sql}{endif}{space}*";" {
1429 if (preproc_tos == 0)
1430 mmfatal(PARSE_ERROR, "unmatched EXEC SQL ENDIF");
1431 else
1432 preproc_tos--;
1433
1434 if (stacked_if_value[preproc_tos].active)
1435 BEGIN(C);
1436 else
1437 BEGIN(xskip);
1438 }
1439<C,xskip>{informix_special}{endif}{space}*";" {
1440 /* are we simulating Informix? */
1441 if (INFORMIX_MODE)
1442 {
1443 if (preproc_tos == 0)
1444 mmfatal(PARSE_ERROR, "unmatched EXEC SQL ENDIF");
1445 else
1446 preproc_tos--;
1447
1448 if (stacked_if_value[preproc_tos].active)
1449 BEGIN(C);
1450 else
1451 BEGIN(xskip);
1452 }
1453 else
1454 {
1455 yyless(1);
1456 return S_ANYTHING;
1457 }
1458 }
1459
1460<xskip>{other} { /* ignore */ }
1461
1462<xcond>{identifier}{space}*";" {
1463 {
1464 struct _defines *defptr;
1465 unsigned int i;
1466 bool this_active;
1467
1468 /*
1469 * Skip the ";" and trailing whitespace. Note that
1470 * yytext contains at least one non-space character
1471 * plus the ";"
1472 */
1473 for (i = strlen(yytext) - 2;
1474 i > 0 && ecpg_isspace(yytext[i]);
1475 i--)
1476 /* skip */ ;
1477 yytext[i + 1] = '\0';
1478
1479 /* Does a definition exist? */
1480 for (defptr = defines; defptr; defptr = defptr->next)
1481 {
1482 if (strcmp(yytext, defptr->name) == 0)
1483 {
1484 /* Found it, but is it currently undefined? */
1485 if (defptr->value == NULL)
1486 defptr = NULL; /* pretend it's not found */
1487 break;
1488 }
1489 }
1490
1491 this_active = (defptr ? ifcond : !ifcond);
1495 this_active);
1496 stacked_if_value[preproc_tos].saw_active |= this_active;
1497 }
1498
1499 if (stacked_if_value[preproc_tos].active)
1500 BEGIN(C);
1501 else
1502 BEGIN(xskip);
1503 }
1504
1505<xcond>{other}|\n {
1506 mmfatal(PARSE_ERROR, "missing identifier in EXEC SQL IFDEF command");
1507 yyterminate();
1508 }
1509<def_ident>{identifier} {
1510 newdefsymbol = mm_strdup(yytext);
1511 BEGIN(def);
1512 startlit();
1513 }
1514<def_ident>{other}|\n {
1515 mmfatal(PARSE_ERROR, "missing identifier in EXEC SQL DEFINE command");
1516 yyterminate();
1517 }
1518<def>{space}*";" {
1519 struct _defines *ptr;
1520
1521 /* Does it already exist? */
1522 for (ptr = defines; ptr != NULL; ptr = ptr->next)
1523 {
1524 if (strcmp(newdefsymbol, ptr->name) == 0)
1525 {
1526 free(ptr->value);
1527 ptr->value = mm_strdup(literalbuf);
1528 /* Don't leak newdefsymbol */
1529 free(newdefsymbol);
1530 break;
1531 }
1532 }
1533 if (ptr == NULL)
1534 {
1535 /* Not present, make a new entry */
1536 ptr = (struct _defines *) mm_alloc(sizeof(struct _defines));
1537
1538 ptr->name = newdefsymbol;
1539 ptr->value = mm_strdup(literalbuf);
1540 ptr->cmdvalue = NULL;
1541 ptr->used = NULL;
1542 ptr->next = defines;
1543 defines = ptr;
1544 }
const char * cmdvalue
Definition: type.h:183
1545
1546 BEGIN(C);
1547 }
1548<def>[^;] { addlit(yytext, yyleng); }
1549<incl><[^>]+>{space}*";"? { parse_include(); }
1550<incl>{dquote}{xdinside}{dquote}{space}*";"? { parse_include(); }
1551<incl>[^;<>\"]+";" { parse_include(); }
1552<incl>{other}|\n {
1553 mmfatal(PARSE_ERROR, "syntax error in EXEC SQL INCLUDE command");
1554 yyterminate();
1555 }
1556
1557<<EOF>> {
1558 if (yy_buffer == NULL)
1559 {
1560 /* No more input */
1561 if (preproc_tos > 0)
1562 {
1563 preproc_tos = 0;
1564 mmfatal(PARSE_ERROR, "missing \"EXEC SQL ENDIF;\"");
1565 }
1566 yyterminate();
1567 }
1568 else
1569 {
1570 /* Revert to previous input source */
1571 struct _yy_buffer *yb = yy_buffer;
1572 int i;
1573 struct _defines *ptr;
1574
1575 /* Check to see if we are exiting a macro value */
1576 for (ptr = defines; ptr; ptr = ptr->next)
1577 {
1578 if (ptr->used == yy_buffer)
1579 {
1580 ptr->used = NULL;
1581 break; /* there can't be multiple matches */
1582 }
1583 }
1584
1585 if (yyin != NULL)
1586 fclose(yyin);
1587
1588 yy_delete_buffer(YY_CURRENT_BUFFER);
1589 yy_switch_to_buffer(yy_buffer->buffer);
1590
1591 yylineno = yy_buffer->lineno;
1592
1593 /* We have to output the filename only if we change files here */
1594 i = strcmp(input_filename, yy_buffer->filename);
1595
1598
1600 free(yb);
1601
1602 if (i != 0)
1604 }
1605 }
1606
1607<INITIAL>{other}|\n {
1608 mmfatal(PARSE_ERROR, "internal error: unreachable state; please report this to <%s>", PACKAGE_BUGREPORT);
1609 }
1610
1611%%

Variable Documentation

◆ base_yylval

YYSTYPE base_yylval
extern

◆ dolqstart

char* dolqstart = NULL
static

Definition at line 39 of file pgc.l.

◆ ifcond

bool ifcond
static

Definition at line 104 of file pgc.l.

◆ include_next

bool include_next
static

Definition at line 55 of file pgc.l.

Referenced by parse_include().

◆ literalalloc

int literalalloc
static

Definition at line 49 of file pgc.l.

Referenced by addlit(), addlitchar(), and lex_init().

◆ literalbuf

char* literalbuf = NULL
static

Definition at line 47 of file pgc.l.

Referenced by addlit(), addlitchar(), and lex_init().

◆ literallen

int literallen
static

Definition at line 48 of file pgc.l.

Referenced by addlit(), and addlitchar().

◆ parenths_open

int parenths_open
static

Definition at line 52 of file pgc.l.

Referenced by lex_init().

◆ preproc_tos

short preproc_tos
static

Definition at line 103 of file pgc.l.

Referenced by lex_init().

◆ stacked_if_value

struct _if_value stacked_if_value[MAX_NESTED_IF]
static

Referenced by lex_init().

◆ state_before_str_start

int state_before_str_start
static

Definition at line 69 of file pgc.l.

◆ state_before_str_stop

int state_before_str_stop
static

Definition at line 70 of file pgc.l.

◆ token_start

char* token_start

Definition at line 66 of file pgc.l.

◆ xcdepth

int xcdepth = 0
static

Definition at line 38 of file pgc.l.

◆ yy_buffer

struct _yy_buffer * yy_buffer = NULL
static