|
|
1.1 root 1: # include <ingres.h>
2: # include <range.h>
3: # include <tree.h>
4: # include <func.h>
5: # include <pv.h>
6: # include "parser.h"
7: # include <sccs.h>
8:
9: SCCSID(@(#)parser.c 7.1 2/5/81)
10:
11: short tTparser[100];
12:
13: extern int parser();
14: extern int par_init();
15:
16: struct fn_def ParserFn =
17: {
18: "PARSER",
19: parser,
20: par_init,
21: NULL,
22: NULL,
23: 0,
24: tTparser,
25: 100,
26: 'P',
27: 0
28: };
29:
30: DESC Reldesc;
31: struct atstash Attable[MAXATT];/* attrib stash space, turned into a list later */
32: struct atstash *Freeatt; /* free list of attrib stash */
33: QTREE *Tidnode; /* pointer to tid node of targ list
34: for REPLACE, DELETE */
35: QTREE *Lastree; /* pointer to root node of tree */
36: extern struct atstash Faketid; /* atstash structure for TID node */
37: #ifdef DISTRIB
38: extern struct atstash Fakesid; /* atstash structure for SID node */
39: #endif
40:
41: int Rsdmno; /* result domain number */
42: int Opflag; /* operator flag contains query mode */
43: char *Relspec; /* ptr to storage structure of result relation */
44: char *Indexspec; /* ptr to stor strctr of index */
45: char *Indexname; /* ptr to name of index */
46: char Trfrmt; /* format for type checking */
47: char Trfrml; /* format length for type checking */
48: char *Trname; /* pointer to attribute name */
49: int Agflag; /* how many aggs in this qry */
50: int Equel; /* indicates EQUEL preprocessor on */
51: int Ingerr; /* set to error num if a query returns
52: an error from processes below */
53: int Patflag; /* signals a pattern match reduction */
54: int Qlflag; /* set when processing a qual */
55: int Noupdt; /* INGRES user override of no update restriction */
56: int Err_fnd; /* no actions done if 1 */
57: int Err_current; /* 1 if error found in current statement */
58: int yyline; /* line counter */
59: int Dcase; /* default case mapping */
60: int Permcomd;
61: int Qrymod; /* qrymod on in database flag */
62:
63:
64: /*
65: ** PARSER -- the actual main routine
66: **
67: ** Trace Flags:
68: ** Parser ~~ 64
69: */
70:
71: parser()
72: {
73:
74: # ifdef xPTR1
75: tTfp(64, 0, "Parser %d\n", getpid());
76: # endif
77:
78: if (startgo() < 0)
79: {
80: endgo();
81: return (-1);
82: }
83:
84: if (yyparse()) /* yyparse returns 1 in case of error */
85: {
86: endgo();
87: return (-2);
88: }
89:
90: if (endgo() < 0)
91: return (-3);
92:
93: return(0);
94: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.