1: # include   <stdio.h>
   2: # include   <ingres.h>
   3: # include   <range.h>
   4: # include   <tree.h>
   5: # include   <func.h>
   6: # include   <pv.h>
   7: # include   "parser.h"
   8: # include   <sccs.h>
   9: # include   <errors.h>
  10: 
  11: SCCSID(@(#)parser.c	8.3	2/8/85)
  12: 
  13: short           tTparser[100];
  14: 
  15: extern int      parser();
  16: extern int      par_init();
  17: 
  18: struct fn_def       ParserFn =
  19:             {
  20:                 "PARSER",
  21:                 parser,
  22:                 par_init,
  23:                 NULL,
  24:                 NULL,
  25:                 0,
  26:                 tTparser,
  27:                 100,
  28:                 'P',
  29:                 0
  30:             };
  31: 
  32: DESC    Reldesc;
  33: struct atstash      Attable[MAXATT];/* attrib stash space, turned into a list later */
  34: struct atstash      *Freeatt;   /* free list of attrib stash */
  35: QTREE   *Tidnode;   /* pointer to tid node of targ list
  36: 					   for REPLACE, DELETE */
  37: QTREE   *Lastree;   /* pointer to root node of tree */
  38: DELIMLIST   *Delimhead; /* pointer to head of Delim queue */
  39: static int  FirstCall = 1;  /* true for the very first call of the parser */
  40: extern struct atstash   Faketid;    /* atstash structure for TID node */
  41: #ifdef  DISTRIB
  42: extern struct atstash   Fakesid;    /* atstash structure for SID node */
  43: #endif
  44: 
  45: int         Rsdmno;     /* result domain number */
  46: int         Opflag;     /* operator flag contains query mode */
  47: char            *Relspec;   /* ptr to storage structure of result relation */
  48: char            *Indexspec; /* ptr to stor strctr of index */
  49: char            *Indexname; /* ptr to name of index */
  50: char            Trfrmt;     /* format for type checking */
  51: char            Trfrml;     /* format length for type checking */
  52: char            *Trname;    /* pointer to attribute name */
  53: int         Agflag;     /* how many aggs in this qry */
  54: int         Equel;      /* indicates EQUEL preprocessor on */
  55: int         Ingerr;     /* set to error num if a query returns
  56: 					   an error from processes below */
  57: int         Qlflag;     /* set when processing a qual */
  58: int         Noupdt;     /* INGRES user override of no update restriction */
  59: int         Err_fnd;    /* no actions done if 1 */
  60: int         Err_current;    /* 1 if error found in current statement */
  61: int         yyline;     /* line counter */
  62: int         Dcase;      /* default case mapping */
  63: int         Permcomd;
  64: int         Qrymod;     /* qrymod on in database flag */
  65: TID         tid;
  66: char            *malloc();
  67: 
  68: 
  69: /*
  70: **  PARSER -- the actual main routine
  71: **
  72: **	Trace Flags:
  73: **		Parser ~~ 64
  74: */
  75: 
  76: parser()
  77: {
  78: 
  79:     int i;
  80: 
  81: 
  82: # ifdef xPTR1
  83:     tTfp(64, 0, "Parser %d\n", getpid());
  84: # endif
  85: 
  86:     if (FirstCall)
  87:     {
  88:         FirstCall = 0;
  89:         if ((i = openr(&Reldesc, OR_WRITE, "rdelim")) < 0)
  90:         syserr("relname: error in openr '%d'", i);
  91:         if (i > 0)
  92:         {
  93:             /* invalid relation name */
  94:             par_error(RNGEXIST, WARN, "rdelim", 0);
  95:         }
  96:         else
  97:         {
  98:             if ((i = make_list(&Reldesc, "system")) < 0)
  99:                 par_error(DELEXIST, WARN, 0);
 100:         }
 101:         closer(&Reldesc);
 102:     }
 103:     if (startgo() < 0)
 104:     {
 105:         endgo();
 106:         return (-1);
 107:     }
 108: 
 109:     if (yyparse())      /* yyparse returns 1 in case of error */
 110:     {
 111:         endgo();
 112:         return (-2);
 113:     }
 114: 
 115:     if (endgo() < 0)
 116:         return (-3);
 117: 
 118:     return(0);
 119: }

Defined functions

parser defined in line 76; used 2 times

Defined variables

Agflag defined in line 53; never used
Attable defined in line 33; never used
Dcase defined in line 62; never used
Equel defined in line 54; never used
Err_current defined in line 60; never used
Err_fnd defined in line 59; never used
FirstCall defined in line 39; used 2 times
Freeatt defined in line 34; never used
Indexname defined in line 49; never used
Indexspec defined in line 48; never used
Ingerr defined in line 55; never used
Noupdt defined in line 58; never used
Opflag defined in line 46; never used
ParserFn defined in line 18; never used
Permcomd defined in line 63; never used
Qlflag defined in line 57; never used
Qrymod defined in line 64; never used
Relspec defined in line 47; never used
Rsdmno defined in line 45; never used
Trfrml defined in line 51; never used
Trfrmt defined in line 50; never used
Trname defined in line 52; never used
tTparser defined in line 13; used 1 times
  • in line 26
yyline defined in line 61; never used
Last modified: 1986-04-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 842
Valid CSS Valid XHTML 1.0 Strict