Question about Parser()

From: "Bin Liu" <bliu(at)ece(dot)gatech(dot)edu>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Question about Parser()
Date: 2004-10-11 22:13:43
Message-ID: 016c01c4afdf$923ebf10$b419a8c0@ece.gatech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Can somebody explain how the 'parsetree' in the parser( ) function get populated? What I saw is just a NIL. And it is not touched else where in this file.

This file is src/backend/parser/parser.c

Thanks!

Bin

/*
* parser
* Given a query in string form, and optionally info about
* parameter types, do lexical and syntactic analysis.
*
* Returns a list of raw (un-analyzed) parse trees.
*/
List *
parser(StringInfo str, Oid *typev, int nargs)
{
int yyresult;

parsetree = NIL; /* in case parser forgets to set it */
have_lookahead = false;

scanner_init(str);
parser_init();
parse_expr_init();
parser_param_set(typev, nargs);

yyresult = yyparse();

scanner_finish();
clearerr(stdin);

if (yyresult) /* error */
return NIL;

return parsetree;
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2004-10-11 22:22:57 Need for DLLINIT in Makefile.shlib
Previous Message Robert Treat 2004-10-11 21:30:11 Re: PL/PgSQL for counting all rows in all tables.