]> git.8kb.co.uk Git - pgpool-ii/pgpool-ii_2.2.5/blob - test/parser/main.c
Attempt to send a proper failure message to frontend when authentication
[pgpool-ii/pgpool-ii_2.2.5] / test / parser / main.c
1 /* $Header: /cvsroot/pgpool/pgpool-II/test/parser/main.c,v 1.1 2007/10/03 04:47:18 y-asaba Exp $ */
2 #include "pool.h"
3 #include "pool_memory.h"
4 #include "parsenodes.h"
5 #include "gramparse.h"
6 #include "parse.h"
7 #include "parser.h"
8
9 #include <stdio.h>
10 #include <stdlib.h>
11
12 int main(int argc, char **argv)
13 {
14         List *tree;
15         ListCell *l;
16
17         if (argc != 2)
18         {
19                 fprintf(stderr, "./parser-test query\n");
20                 exit(1);
21         }
22
23         tree = raw_parser(argv[1]);
24
25         if (tree == NULL)
26         {
27                 printf("syntax error: %s\n", argv[1]);
28         }
29         else
30         {
31                 foreach(l, tree)
32                 {
33                         Node *node = (Node *) lfirst(l);
34                         printf("%s\n", nodeToString(node));
35                 }
36         }
37
38         free_parser();
39         return 0;
40 }