Thread

  1. Re: [HACKERS] Lex and things...

    Leon <leon@udmnet.ru> — 1999-08-24T14:09:06Z

    Ansley, Michael wrote:
    > 
    > As far as I understand it, the MAX_PARSE_BUFFER limit only applies if char
    > parsestring[] is used, not if char *parsestring is used.  This is the whole
    > reason for using flex.  And scan.l is set up to compile using char
    > *parsestring, not char parsestring[].
    > 
    
    What is defined explicitly:
    
    #ifdef  YY_READ_BUF_SIZE
    #undef  YY_READ_BUF_SIZE
    #endif
    #define YY_READ_BUF_SIZE	MAX_PARSE_BUFFER
    
    (these strings are repeated twice :)
    
    ...
    char literal[MAX_PARSE_BUFFER];
    
    ...
    <xq>{xqliteral} {
    					if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
    						elog(ERROR,"quoted string parse buffer of %d chars
    exceeded",MAX_PARSE_BUFFER);
    					memcpy(literal+llen, yytext, yyleng+1);
    					llen += yyleng;
    				}
    
    Seems that limits are everywhere ;)
    
    -- 
    Leon.