
# line 49 "aqlparse.y"

#include "acedb.h"
#include "aceio.h"
#include "waql/aql_.h"

/**************************************************************/

static mytime_t timeCreateFromString (char *dateString);

/********* globals for this module - NOT threadsafe **********/

static AQL aql_L;		/* current aql object to work with */

static int tokPos[1024];

/**************************************************************/

  /* macros for creating new nodes, they should really used some
     standard interface, like aqlcheck.c:makeNewNode()  */
  /* create a node of type t */
#define zMake(t)			AqlNode* z = halloc(sizeof(AqlNode),aql_L->query->handle); yyval.Ptr = z; z->type = t; z->vtype = '0'

  /* used to chain multiples of select_fields, sortfields or table_exprs together */
#define zzFinal(x)			AqlNode* zz = (AqlNode*)x; yyval.Ptr = zz; while (zz->nxt) zz = zz->nxt

  /* used to chain local field dereferencer together, e.g. a->paper->author->name */
#define zzFinalMake(x,t)		zzFinal(x); zz->nxt = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle); zz = zz->nxt; zz->type = t; zz->vtype = '0'
#define posSet(x,t)			(x)->pos = tokPos[t]

/**************************************************************/


# line 82 "aqlparse.y"
typedef union
#ifdef __cplusplus
	YYSTYPE
#endif
  {
  char*          String;          
  int		 Int;
  float		 Float;
  int		 Command;
  void*		 Ptr;		
} YYSTYPE;
# define Identifier 257
# define Number 258
# define FloatLiteral 259
# define StringLiteral 260
# define DateLiteral 261
# define Comparator 262
# define TableFunc 263
# define LocatorFunc 264
# define ExprFunc 265
# define ExprExprFunc 266
# define Ordering 267
# define SELECT 268
# define FROM 269
# define WHERE 270
# define ALL 271
# define ORDER 272
# define BY 273
# define TRUEtok 274
# define FALSEtok 275
# define AS 276
# define OBJECT 277
# define EXISTS 278
# define EXISTS_TAG 279
# define CLASS 280
# define ARROW 281
# define ASSIGN 282
# define DOUBLE_COLON 283
# define IN 284
# define NOW 285
# define TODAY 286
# define AND 287
# define OR 288
# define XOR 289
# define UNION 290
# define INTERSECT 291
# define DIFF 292
# define NOT 293
# define UMINUS 294

#include <inttypes.h>

#ifdef __STDC__
#include <stdlib.h>
#include <string.h>
#define	YYCONST	const
#else
#include <malloc.h>
#include <memory.h>
#define	YYCONST
#endif

#include <values.h>

#if defined(__cplusplus) || defined(__STDC__)

#if defined(__cplusplus) && defined(__EXTERN_C__)
extern "C" {
#endif
#ifndef yyerror
#if defined(__cplusplus)
	void yyerror(YYCONST char *);
#endif
#endif
#ifndef yylex
	int yylex(void);
#endif
	int yyparse(void);
#if defined(__cplusplus) && defined(__EXTERN_C__)
}
#endif

#endif

#define yyclearin yychar = -1
#define yyerrok yyerrflag = 0
extern int yychar;
extern int yyerrflag;
YYSTYPE yylval;
YYSTYPE yyval;
typedef int yytabelem;
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 150
#endif
#if YYMAXDEPTH > 0
int yy_yys[YYMAXDEPTH], *yys = yy_yys;
YYSTYPE yy_yyv[YYMAXDEPTH], *yyv = yy_yyv;
#else	/* user does initial allocation */
int *yys;
YYSTYPE *yyv;
#endif
static int yymaxdepth = YYMAXDEPTH;
# define YYERRCODE 256

# line 291 "aqlparse.y"


/************ entry point: aqlParse() ***********************/

static char *lexString;
static int   lexPos;
int yyparse ();

void aqlParse (AQL aql)
{
#ifdef LINUX
  extern FILE *yyin;
  extern FILE *yyout;
  
  /* this will fool the flex generated lexer into thinking that we 
   * have an input file stream. It avoids the default setting to 'stdin'. */
  yyin = (FILE*)1; yyout = (FILE*)1;
#endif

  aql_L = aql;		/* make current object global to this file (not threadsafe)*/

  lexString = strnew (aql_L->query->text, aql_L->query->handle); /* let the lexer work on a copy */
			       /* global char * pointer lexString is modified during parsing */
  lexPos = 0;


  yyparse ();			/* return code ignored - error handle by aqlError longjmp */

  return;
} /* aqlParse */

static mytime_t timeCreateFromString (char *dateString)
{
  mytime_t returnTimeElement;
  
  returnTimeElement = timeParse (dateString);
  if (!returnTimeElement)
    aqlError (aql_L, 702, lexPos-1, "Bad date/time literal");

  return returnTimeElement;
}

/***************** lex code ************************/

#include "lex.yy.c"

/***************** end of file **********************/
static YYCONST yytabelem yyexca[] ={
-1, 1,
	0, -1,
	-2, 0,
	};
# define YYNPROD 103
# define YYLAST 688
static YYCONST yytabelem yyact[]={

    22,    12,    13,   119,    36,    75,    55,    54,   181,    30,
    41,   118,    49,   142,    10,    70,   103,   179,    50,   189,
    68,    66,    40,    67,   116,    69,    57,   162,    46,   178,
   117,    22,    11,    12,    13,    36,   141,   177,   183,   102,
    30,    41,   156,   158,   138,   140,    70,   139,   157,   182,
   188,    68,    66,    40,    67,    39,    69,   135,   137,    46,
   136,     5,    22,   161,    79,     8,    36,     8,   170,   169,
   120,    30,    41,   121,   153,   154,    78,    70,   100,   101,
   105,   172,    68,    66,    40,    67,    39,    69,    80,     4,
    46,    46,    15,    22,    14,   132,   134,    36,   133,    61,
   168,    60,    30,    41,    97,    99,   106,    98,    70,    77,
   167,     9,   108,    68,    66,    40,    67,    39,    69,   109,
   174,    46,   166,   152,    22,    79,    94,    96,    36,    95,
   151,   150,     8,    30,    41,   104,   143,    78,    21,    70,
    58,    18,   165,   148,    68,    66,    40,    67,    39,    69,
   164,   114,    46,    70,   155,    22,    46,    93,    68,    36,
    83,    70,    82,    69,    30,    41,    68,    66,    70,    67,
    77,    69,    86,    88,     2,    26,   107,    40,    16,    39,
    70,    47,     3,    46,    48,    68,    66,     1,    67,     0,
    69,     3,    22,    51,    52,    53,    36,   112,     0,   113,
   115,    30,    41,     0,     0,     0,     0,    70,     0,     0,
    39,     0,    68,    66,    40,    67,   159,    69,     0,   163,
    46,    62,    23,    24,    25,    45,   146,    27,   147,    29,
    28,     0,     0,    59,     0,     0,   110,     0,    31,    32,
    71,    37,    33,    34,    65,    38,     0,    39,     0,    43,
    44,    56,    85,    23,    24,    25,    45,    35,    27,     0,
    29,    28,     0,     0,     0,    72,    73,    74,   176,    31,
    32,    71,    37,    33,    34,    65,    38,     0,     0,     0,
    43,    44,     0,    62,    23,    24,    25,    45,    35,    27,
     0,    29,    28,     7,     0,     7,    72,    73,    74,    76,
    31,    32,    71,    37,    33,    34,    65,    38,     0,     0,
     0,    43,    44,     0,    85,    23,    24,    25,    45,    35,
    27,     0,    29,    28,     0,     7,     0,    72,    73,    74,
     0,    31,    32,    71,    37,    33,    34,    10,    38,     0,
     0,     0,    43,    44,     0,    20,    23,    24,    25,    45,
    35,    27,     0,    29,    28,    11,    12,    13,    72,    17,
    76,     0,    31,    32,    71,    37,    33,    34,     0,    38,
   173,     0,     0,    43,    44,    79,    85,    23,    24,    25,
    45,    35,    27,     0,    29,    28,    71,    78,     0,    72,
    73,    74,     0,    31,    32,     0,    37,    33,    34,     0,
    38,    70,     0,     0,    43,    44,    68,    66,   175,    67,
     0,    69,    35,    20,    23,    24,    25,    45,    70,    27,
    77,    29,    28,    68,    66,   171,    67,     0,    69,     0,
    31,    32,    71,    37,    33,    34,     0,    38,     8,     0,
     0,    43,    44,     0,    41,    89,    87,     0,     0,    35,
     0,    41,    41,     0,     0,     0,    40,    72,    73,    74,
     0,     0,    46,    40,    40,     0,     0,     0,    63,    46,
    46,     0,     0,    42,     6,     0,    19,     0,     0,     0,
     0,     0,     6,     6,     0,     6,     6,     6,     0,    39,
     0,    64,     0,     0,     0,     0,    39,    39,     0,    84,
     0,    81,     0,     0,    90,    91,     0,     0,     0,     0,
    92,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,   111,     0,    19,     0,     6,     0,
    64,     0,     0,    64,     0,   122,   123,   124,   125,   126,
   127,   128,   129,   130,   131,     0,     0,     0,     0,     0,
     0,   144,   145,     0,     0,     0,     0,     0,     0,     0,
     0,    92,   149,    92,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,   160,     0,     0,    64,     0,
     0,     0,     0,    64,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    76,     0,     0,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,    71,     0,     0,     0,
     0,   180,     0,     0,     0,     0,     0,     0,     0,     0,
   184,     0,     0,    71,   185,     0,     0,     0,   186,     0,
   187,    72,    73,    74,     0,    85,     0,     0,     0,     0,
     0,     0,    85,    85,     0,     0,     7,     0,    72,    73,
    74,     0,     0,     0,     0,    37,     0,     0,     0,    38,
     0,     0,    37,    37,     0,     0,    38,    38 };
static YYCONST yytabelem yypact[]={

    25,-10000000,    52,  -258,  -163,  -165,-10000000,    88,    27,    25,
  -255,    27,    27,    27,  -275,  -276,   -18,   -36,-10000000,   170,
  -278,    18,  -169,-10000000,-10000000,-10000000,-10000000,    92,   122,   120,
   119,-10000000,-10000000,   406,   405,   119,    57,   117,  -131,  -153,
  -179,  -241,    77,-10000000,-10000000,-10000000,  -177,    65,-10000000,-10000000,
    61,  -290,-10000000,-10000000,    27,   119,    26,   156,   107,    26,
-10000000,  -246,  -281,   170,    77,  -187,   119,   119,   119,   119,
   119,   119,   119,   119,   119,   119,  -162,  -200,  -213,  -244,
-10000000,    78,   119,   119,-10000000,-10000000,    18,   398,    18,   398,
   124,   102,    77,   119,-10000000,-10000000,-10000000,    38,    37,    30,
-10000000,-10000000,-10000000,-10000000,  -183,-10000000,-10000000,   110,-10000000,  -215,
  -258,   170,   107,-10000000,    26,   107,   119,  -194,  -243,    -5,
   104,    96,   116,   116,   131,   131,-10000000,   143,   124,    71,
    71,   170,-10000000,-10000000,-10000000,    29,    17,     7,-10000000,-10000000,
-10000000,-10000000,-10000000,  -189,   381,    40,   329,    79,-10000000,   364,
-10000000,-10000000,-10000000,-10000000,-10000000,    61,  -230,-10000000,  -238,-10000000,
   170,  -253,   119,  -262,  -211,  -222,-10000000,-10000000,-10000000,-10000000,
-10000000,   119,-10000000,-10000000,-10000000,   119,-10000000,-10000000,-10000000,   119,
   170,   119,-10000000,-10000000,     9,   -22,   170,   170,-10000000,-10000000 };
static YYCONST yytabelem yypgo[]={

     0,   187,   174,   181,   468,   473,   178,   140,   176,   112,
   141,   101,    99,   138,   175 };
static YYCONST yytabelem yyr1[]={

     0,     1,     2,     2,     2,     2,     3,     3,     3,     3,
     3,     3,     3,     3,     3,     3,     3,     5,     5,     8,
     8,     9,     9,     9,     9,     9,     6,     6,    10,    10,
     7,     7,    11,    11,    11,    11,    11,    11,    11,    11,
    12,    12,    12,    12,    12,    12,    13,    13,    13,    13,
    13,    13,    13,    13,    13,    13,    13,    13,    13,    13,
    13,    13,    13,    13,    13,    13,    13,    13,    13,    13,
    13,     4,     4,     4,     4,     4,     4,     4,     4,     4,
     4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
     4,     4,     4,     4,     4,     4,     4,     4,     4,     4,
    14,    14,    14 };
static YYCONST yytabelem yyr2[]={

     0,     3,     3,     7,     9,     9,     3,     5,     9,     7,
     9,     5,     7,     9,     7,     7,     7,     7,     5,     3,
     7,     5,     5,     5,     7,     7,     3,     7,     3,     7,
     3,     7,     3,     7,     7,    11,     7,    11,     5,     9,
     3,     3,     5,     9,     5,     9,     3,    13,     7,     7,
     7,     9,     9,     9,     7,     7,     7,     7,     7,     5,
     5,     5,     7,     7,     7,     5,     5,     5,     5,     7,
     7,     3,     5,     3,     3,     3,     3,     5,     9,     9,
    13,     9,     7,     7,     7,     7,     5,     7,     3,     3,
     5,     5,     9,     9,     7,     5,     7,     7,     7,     7,
     3,     3,     3 };
static YYCONST yytabelem yychk[]={

-10000000,    -1,    -2,    -3,    64,    36,    -5,   268,    40,    59,
   272,   290,   291,   292,   257,   257,    -6,   271,   -10,    -4,
   257,   -13,    36,   258,   259,   260,   -14,   263,   266,   265,
    45,   274,   275,   278,   279,   293,    40,   277,   281,    91,
    58,    46,    -5,   285,   286,   261,    64,    -3,    -2,   267,
   273,    -3,    -3,    -3,   282,   282,   269,    44,    -7,   269,
   -11,   -12,   257,    -4,    -5,   280,    43,    45,    42,    47,
    37,   262,   287,   288,   289,   283,   281,    91,    58,    46,
   257,    -5,    40,    40,    -4,   257,   -13,    40,   -13,    40,
    -4,    -4,    -5,    40,   257,   260,   258,   257,   260,   258,
   257,   258,   280,   257,    58,   257,    41,    -8,    -9,    58,
    -3,    -4,    -7,   -10,    44,    -7,   270,   276,   257,   284,
   257,   260,    -4,    -4,    -4,    -4,    -4,    -4,    -4,    -4,
    -4,    -4,   257,   260,   258,   257,   260,   258,   257,   260,
   258,   280,   257,    58,    -4,    -4,   -13,   -13,    41,    -4,
    93,    93,    93,   257,   258,    44,   257,   263,   258,   -11,
    -4,   257,   270,   -12,    46,    46,    93,    93,    93,   258,
   257,    44,    41,    41,    41,    44,    -9,   267,   267,   270,
    -4,   270,   260,   260,    -4,    -4,    -4,    -4,    41,    41 };
static YYCONST yytabelem yydef[]={

     0,    -2,     1,     2,     0,     0,     6,     0,     0,     0,
    11,     0,     0,     0,    18,     0,     7,     0,    26,    28,
    46,    71,     0,    73,    74,    75,    76,     0,     0,     0,
     0,    88,    89,     0,     0,     0,     0,     0,     0,     0,
     0,     0,     0,   100,   101,   102,     0,     0,     3,    12,
     0,    14,    15,    16,     0,     0,     0,     0,     9,     0,
    30,    32,    46,    40,    41,     0,     0,     0,     0,     0,
     0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
    72,    77,     0,     0,    86,    46,    90,     0,    91,     0,
    95,     0,     6,     0,    59,    60,    61,     0,     0,     0,
    65,    66,    67,    68,     0,    18,    17,    13,    19,     0,
     4,     5,     8,    27,     0,    10,     0,     0,    38,     0,
    42,    44,    82,    83,    84,    85,    87,    94,    96,    97,
    98,    29,    48,    49,    50,     0,     0,     0,    54,    55,
    56,    57,    58,     0,     0,     0,     0,     0,    99,     0,
    62,    63,    64,    69,    70,     0,    21,    22,    23,    31,
    33,    36,     0,    34,     0,     0,    51,    52,    53,    78,
    79,     0,    81,    92,    93,     0,    20,    24,    25,     0,
    39,     0,    43,    45,     0,     0,    37,    35,    80,    47 };
typedef struct
#ifdef __cplusplus
	yytoktype
#endif
{
#ifdef __cplusplus
const
#endif
char *t_name; int t_val; } yytoktype;
#ifndef YYDEBUG
#	define YYDEBUG	0	/* don't allow debugging */
#endif

#if YYDEBUG

yytoktype yytoks[] =
{
	"Identifier",	257,
	"Number",	258,
	"FloatLiteral",	259,
	"StringLiteral",	260,
	"DateLiteral",	261,
	"Comparator",	262,
	"TableFunc",	263,
	"LocatorFunc",	264,
	"ExprFunc",	265,
	"ExprExprFunc",	266,
	"Ordering",	267,
	"SELECT",	268,
	"FROM",	269,
	"WHERE",	270,
	"ALL",	271,
	"ORDER",	272,
	"BY",	273,
	"TRUEtok",	274,
	"FALSEtok",	275,
	"AS",	276,
	"OBJECT",	277,
	"EXISTS",	278,
	"EXISTS_TAG",	279,
	"CLASS",	280,
	"ARROW",	281,
	"ASSIGN",	282,
	"DOUBLE_COLON",	283,
	"IN",	284,
	"NOW",	285,
	"TODAY",	286,
	"AND",	287,
	"OR",	288,
	"XOR",	289,
	"UNION",	290,
	"INTERSECT",	291,
	"DIFF",	292,
	";",	59,
	"NOT",	293,
	"+",	43,
	"-",	45,
	"*",	42,
	"/",	47,
	"%",	37,
	"UMINUS",	294,
	"-unknown-",	-1	/* ends search */
};

#ifdef __cplusplus
const
#endif
char * yyreds[] =
{
	"-no such reduction-",
	"start : query",
	"query : table_expr",
	"query : query ';' query",
	"query : '@' Identifier ASSIGN table_expr",
	"query : '$' Identifier ASSIGN expr",
	"table_expr : safe_table",
	"table_expr : SELECT fieldlist",
	"table_expr : SELECT fieldlist FROM fwlist",
	"table_expr : SELECT ALL fwlist",
	"table_expr : SELECT ALL FROM fwlist",
	"table_expr : table_expr ORDER",
	"table_expr : table_expr ORDER Ordering",
	"table_expr : table_expr ORDER BY sortlist",
	"table_expr : table_expr UNION table_expr",
	"table_expr : table_expr INTERSECT table_expr",
	"table_expr : table_expr DIFF table_expr",
	"safe_table : '(' table_expr ')'",
	"safe_table : '@' Identifier",
	"sortlist : sort_criterion",
	"sortlist : sortlist ',' sort_criterion",
	"sort_criterion : ':' Identifier",
	"sort_criterion : ':' TableFunc",
	"sort_criterion : ':' Number",
	"sort_criterion : ':' Identifier Ordering",
	"sort_criterion : ':' Number Ordering",
	"fieldlist : field",
	"fieldlist : fieldlist ',' field",
	"field : expr",
	"field : Identifier DOUBLE_COLON expr",
	"fwlist : fw",
	"fwlist : fwlist ',' fw",
	"fw : basic_decl",
	"fw : basic_decl WHERE expr",
	"fw : Identifier IN basic_decl",
	"fw : Identifier IN basic_decl WHERE expr",
	"fw : basic_decl AS Identifier",
	"fw : basic_decl AS Identifier WHERE expr",
	"fw : basic_decl Identifier",
	"fw : basic_decl Identifier WHERE expr",
	"basic_decl : expr",
	"basic_decl : safe_table",
	"basic_decl : CLASS Identifier",
	"basic_decl : CLASS Identifier '.' StringLiteral",
	"basic_decl : CLASS StringLiteral",
	"basic_decl : CLASS StringLiteral '.' StringLiteral",
	"locator : Identifier",
	"locator : OBJECT '(' expr ',' expr ')'",
	"locator : locator ARROW Identifier",
	"locator : locator ARROW StringLiteral",
	"locator : locator ARROW Number",
	"locator : locator '[' Identifier ']'",
	"locator : locator '[' StringLiteral ']'",
	"locator : locator '[' Number ']'",
	"locator : locator ':' Identifier",
	"locator : locator ':' StringLiteral",
	"locator : locator ':' Number",
	"locator : locator '.' CLASS",
	"locator : locator '.' Identifier",
	"locator : ARROW Identifier",
	"locator : ARROW StringLiteral",
	"locator : ARROW Number",
	"locator : '[' Identifier ']'",
	"locator : '[' StringLiteral ']'",
	"locator : '[' Number ']'",
	"locator : ':' Identifier",
	"locator : ':' Number",
	"locator : '.' CLASS",
	"locator : '.' Identifier",
	"locator : safe_table ':' Identifier",
	"locator : safe_table ':' Number",
	"expr : locator",
	"expr : '$' Identifier",
	"expr : Number",
	"expr : FloatLiteral",
	"expr : StringLiteral",
	"expr : date",
	"expr : TableFunc safe_table",
	"expr : TableFunc safe_table ':' Number",
	"expr : TableFunc safe_table ':' Identifier",
	"expr : ExprExprFunc '(' expr ',' expr ')'",
	"expr : ExprFunc '(' expr ')'",
	"expr : expr '+' expr",
	"expr : expr '-' expr",
	"expr : expr '*' expr",
	"expr : expr '/' expr",
	"expr : '-' expr",
	"expr : expr '%' expr",
	"expr : TRUEtok",
	"expr : FALSEtok",
	"expr : EXISTS locator",
	"expr : EXISTS_TAG locator",
	"expr : EXISTS '(' locator ')'",
	"expr : EXISTS_TAG '(' locator ')'",
	"expr : expr Comparator expr",
	"expr : NOT expr",
	"expr : expr AND expr",
	"expr : expr OR expr",
	"expr : expr XOR expr",
	"expr : '(' expr ')'",
	"date : NOW",
	"date : TODAY",
	"date : DateLiteral",
};
#endif /* YYDEBUG */
# line	1 "/usr/ccs/bin/yaccpar"
/*
 * Copyright (c) 1993 by Sun Microsystems, Inc.
 */

#pragma ident	"@(#)yaccpar	6.16	99/01/20 SMI"

/*
** Skeleton parser driver for yacc output
*/

/*
** yacc user known macros and defines
*/
#define YYERROR		goto yyerrlab
#define YYACCEPT	return(0)
#define YYABORT		return(1)
#define YYBACKUP( newtoken, newvalue )\
{\
	if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
	{\
		yyerror( "syntax error - cannot backup" );\
		goto yyerrlab;\
	}\
	yychar = newtoken;\
	yystate = *yyps;\
	yylval = newvalue;\
	goto yynewstate;\
}
#define YYRECOVERING()	(!!yyerrflag)
#define YYNEW(type)	malloc(sizeof(type) * yynewmax)
#define YYCOPY(to, from, type) \
	(type *) memcpy(to, (char *) from, yymaxdepth * sizeof (type))
#define YYENLARGE( from, type) \
	(type *) realloc((char *) from, yynewmax * sizeof(type))
#ifndef YYDEBUG
#	define YYDEBUG	1	/* make debugging available */
#endif

/*
** user known globals
*/
int yydebug;			/* set to 1 to get debugging */

/*
** driver internal defines
*/
#define YYFLAG		(-10000000)

/*
** global variables used by the parser
*/
YYSTYPE *yypv;			/* top of value stack */
int *yyps;			/* top of state stack */

int yystate;			/* current state */
int yytmp;			/* extra var (lasts between blocks) */

int yynerrs;			/* number of errors */
int yyerrflag;			/* error recovery flag */
int yychar;			/* current input token number */



#ifdef YYNMBCHARS
#define YYLEX()		yycvtok(yylex())
/*
** yycvtok - return a token if i is a wchar_t value that exceeds 255.
**	If i<255, i itself is the token.  If i>255 but the neither 
**	of the 30th or 31st bit is on, i is already a token.
*/
#if defined(__STDC__) || defined(__cplusplus)
int yycvtok(int i)
#else
int yycvtok(i) int i;
#endif
{
	int first = 0;
	int last = YYNMBCHARS - 1;
	int mid;
	wchar_t j;

	if(i&0x60000000){/*Must convert to a token. */
		if( yymbchars[last].character < i ){
			return i;/*Giving up*/
		}
		while ((last>=first)&&(first>=0)) {/*Binary search loop*/
			mid = (first+last)/2;
			j = yymbchars[mid].character;
			if( j==i ){/*Found*/ 
				return yymbchars[mid].tvalue;
			}else if( j<i ){
				first = mid + 1;
			}else{
				last = mid -1;
			}
		}
		/*No entry in the table.*/
		return i;/* Giving up.*/
	}else{/* i is already a token. */
		return i;
	}
}
#else/*!YYNMBCHARS*/
#define YYLEX()		yylex()
#endif/*!YYNMBCHARS*/

/*
** yyparse - return 0 if worked, 1 if syntax error not recovered from
*/
#if defined(__STDC__) || defined(__cplusplus)
int yyparse(void)
#else
int yyparse()
#endif
{
	register YYSTYPE *yypvt = 0;	/* top of value stack for $vars */

#if defined(__cplusplus) || defined(lint)
/*
	hacks to please C++ and lint - goto's inside
	switch should never be executed
*/
	static int __yaccpar_lint_hack__ = 0;
	switch (__yaccpar_lint_hack__)
	{
		case 1: goto yyerrlab;
		case 2: goto yynewstate;
	}
#endif

	/*
	** Initialize externals - yyparse may be called more than once
	*/
	yypv = &yyv[-1];
	yyps = &yys[-1];
	yystate = 0;
	yytmp = 0;
	yynerrs = 0;
	yyerrflag = 0;
	yychar = -1;

#if YYMAXDEPTH <= 0
	if (yymaxdepth <= 0)
	{
		if ((yymaxdepth = YYEXPAND(0)) <= 0)
		{
			yyerror("yacc initialization error");
			YYABORT;
		}
	}
#endif

	{
		register YYSTYPE *yy_pv;	/* top of value stack */
		register int *yy_ps;		/* top of state stack */
		register int yy_state;		/* current state */
		register int  yy_n;		/* internal state number info */
	goto yystack;	/* moved from 6 lines above to here to please C++ */

		/*
		** get globals into registers.
		** branch to here only if YYBACKUP was called.
		*/
	yynewstate:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;
		goto yy_newstate;

		/*
		** get globals into registers.
		** either we just started, or we just finished a reduction
		*/
	yystack:
		yy_pv = yypv;
		yy_ps = yyps;
		yy_state = yystate;

		/*
		** top of for (;;) loop while no reductions done
		*/
	yy_stack:
		/*
		** put a state and value onto the stacks
		*/
#if YYDEBUG
		/*
		** if debugging, look up token value in list of value vs.
		** name pairs.  0 and negative (-1) are special values.
		** Note: linear search is used since time is not a real
		** consideration while debugging.
		*/
		if ( yydebug )
		{
			register int yy_i;

			printf( "State %d, token ", yy_state );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ++yy_ps >= &yys[ yymaxdepth ] )	/* room on stack? */
		{
			/*
			** reallocate and recover.  Note that pointers
			** have to be reset, or bad things will happen
			*/
			long yyps_index = (yy_ps - yys);
			long yypv_index = (yy_pv - yyv);
			long yypvt_index = (yypvt - yyv);
			int yynewmax;
#ifdef YYEXPAND
			yynewmax = YYEXPAND(yymaxdepth);
#else
			yynewmax = 2 * yymaxdepth;	/* double table size */
			if (yymaxdepth == YYMAXDEPTH)	/* first time growth */
			{
				char *newyys = (char *)YYNEW(int);
				char *newyyv = (char *)YYNEW(YYSTYPE);
				if (newyys != 0 && newyyv != 0)
				{
					yys = YYCOPY(newyys, yys, int);
					yyv = YYCOPY(newyyv, yyv, YYSTYPE);
				}
				else
					yynewmax = 0;	/* failed */
			}
			else				/* not first time */
			{
				yys = YYENLARGE(yys, int);
				yyv = YYENLARGE(yyv, YYSTYPE);
				if (yys == 0 || yyv == 0)
					yynewmax = 0;	/* failed */
			}
#endif
			if (yynewmax <= yymaxdepth)	/* tables not expanded */
			{
				yyerror( "yacc stack overflow" );
				YYABORT;
			}
			yymaxdepth = yynewmax;

			yy_ps = yys + yyps_index;
			yy_pv = yyv + yypv_index;
			yypvt = yyv + yypvt_index;
		}
		*yy_ps = yy_state;
		*++yy_pv = yyval;

		/*
		** we have a new state - find out what to do
		*/
	yy_newstate:
		if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
			goto yydefault;		/* simple state */
#if YYDEBUG
		/*
		** if debugging, need to mark whether new token grabbed
		*/
		yytmp = yychar < 0;
#endif
		if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
			yychar = 0;		/* reached EOF */
#if YYDEBUG
		if ( yydebug && yytmp )
		{
			register int yy_i;

			printf( "Received token " );
			if ( yychar == 0 )
				printf( "end-of-file\n" );
			else if ( yychar < 0 )
				printf( "-none-\n" );
			else
			{
				for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
					yy_i++ )
				{
					if ( yytoks[yy_i].t_val == yychar )
						break;
				}
				printf( "%s\n", yytoks[yy_i].t_name );
			}
		}
#endif /* YYDEBUG */
		if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
			goto yydefault;
		if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )	/*valid shift*/
		{
			yychar = -1;
			yyval = yylval;
			yy_state = yy_n;
			if ( yyerrflag > 0 )
				yyerrflag--;
			goto yy_stack;
		}

	yydefault:
		if ( ( yy_n = yydef[ yy_state ] ) == -2 )
		{
#if YYDEBUG
			yytmp = yychar < 0;
#endif
			if ( ( yychar < 0 ) && ( ( yychar = YYLEX() ) < 0 ) )
				yychar = 0;		/* reached EOF */
#if YYDEBUG
			if ( yydebug && yytmp )
			{
				register int yy_i;

				printf( "Received token " );
				if ( yychar == 0 )
					printf( "end-of-file\n" );
				else if ( yychar < 0 )
					printf( "-none-\n" );
				else
				{
					for ( yy_i = 0;
						yytoks[yy_i].t_val >= 0;
						yy_i++ )
					{
						if ( yytoks[yy_i].t_val
							== yychar )
						{
							break;
						}
					}
					printf( "%s\n", yytoks[yy_i].t_name );
				}
			}
#endif /* YYDEBUG */
			/*
			** look through exception table
			*/
			{
				register YYCONST int *yyxi = yyexca;

				while ( ( *yyxi != -1 ) ||
					( yyxi[1] != yy_state ) )
				{
					yyxi += 2;
				}
				while ( ( *(yyxi += 2) >= 0 ) &&
					( *yyxi != yychar ) )
					;
				if ( ( yy_n = yyxi[1] ) < 0 )
					YYACCEPT;
			}
		}

		/*
		** check for syntax error
		*/
		if ( yy_n == 0 )	/* have an error */
		{
			/* no worry about speed here! */
			switch ( yyerrflag )
			{
			case 0:		/* new error */
				yyerror( "syntax error" );
				goto skip_init;
			yyerrlab:
				/*
				** get globals into registers.
				** we have a user generated syntax type error
				*/
				yy_pv = yypv;
				yy_ps = yyps;
				yy_state = yystate;
			skip_init:
				yynerrs++;
				/* FALLTHRU */
			case 1:
			case 2:		/* incompletely recovered error */
					/* try again... */
				yyerrflag = 3;
				/*
				** find state where "error" is a legal
				** shift action
				*/
				while ( yy_ps >= yys )
				{
					yy_n = yypact[ *yy_ps ] + YYERRCODE;
					if ( yy_n >= 0 && yy_n < YYLAST &&
						yychk[yyact[yy_n]] == YYERRCODE)					{
						/*
						** simulate shift of "error"
						*/
						yy_state = yyact[ yy_n ];
						goto yy_stack;
					}
					/*
					** current state has no shift on
					** "error", pop stack
					*/
#if YYDEBUG
#	define _POP_ "Error recovery pops state %d, uncovers state %d\n"
					if ( yydebug )
						printf( _POP_, *yy_ps,
							yy_ps[-1] );
#	undef _POP_
#endif
					yy_ps--;
					yy_pv--;
				}
				/*
				** there is no state on stack with "error" as
				** a valid shift.  give up.
				*/
				YYABORT;
			case 3:		/* no shift yet; eat a token */
#if YYDEBUG
				/*
				** if debugging, look up token in list of
				** pairs.  0 and negative shouldn't occur,
				** but since timing doesn't matter when
				** debugging, it doesn't hurt to leave the
				** tests here.
				*/
				if ( yydebug )
				{
					register int yy_i;

					printf( "Error recovery discards " );
					if ( yychar == 0 )
						printf( "token end-of-file\n" );
					else if ( yychar < 0 )
						printf( "token -none-\n" );
					else
					{
						for ( yy_i = 0;
							yytoks[yy_i].t_val >= 0;
							yy_i++ )
						{
							if ( yytoks[yy_i].t_val
								== yychar )
							{
								break;
							}
						}
						printf( "token %s\n",
							yytoks[yy_i].t_name );
					}
				}
#endif /* YYDEBUG */
				if ( yychar == 0 )	/* reached EOF. quit */
					YYABORT;
				yychar = -1;
				goto yy_newstate;
			}
		}/* end if ( yy_n == 0 ) */
		/*
		** reduction by production yy_n
		** put stack tops, etc. so things right after switch
		*/
#if YYDEBUG
		/*
		** if debugging, print the string that is the user's
		** specification of the reduction which is just about
		** to be done.
		*/
		if ( yydebug )
			printf( "Reduce by (%d) \"%s\"\n",
				yy_n, yyreds[ yy_n ] );
#endif
		yytmp = yy_n;			/* value to switch over */
		yypvt = yy_pv;			/* $vars top of value stack */
		/*
		** Look in goto table for next state
		** Sorry about using yy_state here as temporary
		** register variable, but why not, if it works...
		** If yyr2[ yy_n ] doesn't have the low order bit
		** set, then there is no action to be done for
		** this reduction.  So, no saving & unsaving of
		** registers done.  The only difference between the
		** code just after the if and the body of the if is
		** the goto yy_stack in the body.  This way the test
		** can be made before the choice of what to do is needed.
		*/
		{
			/* length of production doubled with extra bit */
			register int yy_len = yyr2[ yy_n ];

			if ( !( yy_len & 01 ) )
			{
				yy_len >>= 1;
				yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
				yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
					*( yy_ps -= yy_len ) + 1;
				if ( yy_state >= YYLAST ||
					yychk[ yy_state =
					yyact[ yy_state ] ] != -yy_n )
				{
					yy_state = yyact[ yypgo[ yy_n ] ];
				}
				goto yy_stack;
			}
			yy_len >>= 1;
			yyval = ( yy_pv -= yy_len )[1];	/* $$ = $1 */
			yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
				*( yy_ps -= yy_len ) + 1;
			if ( yy_state >= YYLAST ||
				yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
			{
				yy_state = yyact[ yypgo[ yy_n ] ];
			}
		}
					/* save until reenter driver code */
		yystate = yy_state;
		yyps = yy_ps;
		yypv = yy_pv;
	}
	/*
	** code supplied by user is placed in this switch
	*/
	switch( yytmp )
	{
		
case 1:
# line 127 "aqlparse.y"
{ aql_L->query->root = yypvt[-0].Ptr; yyval.Ptr = yypvt[-0].Ptr; } break;
case 2:
# line 129 "aqlparse.y"
{ yyval.Ptr = yypvt[-0].Ptr; } break;
case 3:
# line 130 "aqlparse.y"
{ zzFinal(yypvt[-2].Ptr); zz->nxt = yypvt[-0].Ptr; aql_L->query->root = yypvt[-2].Ptr; } break;
case 4:
# line 131 "aqlparse.y"
{ zMake(nTABLE_ASSIGN); z->left = yypvt[-0].Ptr; z->name = yypvt[-2].String; yyval.Ptr = z; posSet(z,ASSIGN); } break;
case 5:
# line 132 "aqlparse.y"
{ zMake(nVAR_ASSIGN); z->left = yypvt[-0].Ptr;  z->name = yypvt[-2].String; yyval.Ptr = z; posSet(z,ASSIGN); } break;
case 6:
# line 136 "aqlparse.y"
{ yyval.Ptr = yypvt[-0].Ptr; } break;
case 7:
# line 137 "aqlparse.y"
{ zMake(nTABLE_SFW); z->right = yypvt[-0].Ptr; posSet(z,SELECT); } break;
case 8:
# line 138 "aqlparse.y"
{ zMake(nTABLE_SFW); z->left = yypvt[-0].Ptr; z->right = yypvt[-2].Ptr; posSet(z,SELECT); } break;
case 9:
# line 139 "aqlparse.y"
{ zMake(nTABLE_SFW_ALL); z->left = yypvt[-0].Ptr; posSet(z,SELECT); } break;
case 10:
# line 142 "aqlparse.y"
{ zMake(nTABLE_SFW_ALL); z->left = yypvt[-0].Ptr; posSet(z,SELECT); } break;
case 11:
# line 143 "aqlparse.y"
{ zMake(nTABLE_ORDER); z->left = yypvt[-1].Ptr; z->op = oASC; posSet(z,ORDER); } break;
case 12:
# line 144 "aqlparse.y"
{ zMake(nTABLE_ORDER); z->left = yypvt[-2].Ptr; z->op = yypvt[-0].Int; posSet(z,ORDER); } break;
case 13:
# line 145 "aqlparse.y"
{ zMake(nTABLE_ORDER); z->left = yypvt[-3].Ptr; z->right = yypvt[-0].Ptr; yyval.Ptr = z; posSet(z,ORDER); } break;
case 14:
# line 146 "aqlparse.y"
{ zMake(nTABLE_OP); z->op = oUNION; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,UNION); } break;
case 15:
# line 147 "aqlparse.y"
{ zMake(nTABLE_OP); z->op = oINTERSECT; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,INTERSECT); } break;
case 16:
# line 148 "aqlparse.y"
{ zMake(nTABLE_OP); z->op = oDIFF; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,DIFF); } break;
case 17:
# line 152 "aqlparse.y"
{ yyval.Ptr = yypvt[-1].Ptr; } break;
case 18:
# line 153 "aqlparse.y"
{ zMake(nTABLE_VAR); z->name = yypvt[-0].String; posSet(z,'@'); } break;
case 19:
# line 156 "aqlparse.y"
{ yyval.Ptr = yypvt[-0].Ptr; } break;
case 20:
# line 157 "aqlparse.y"
{ zzFinal(yypvt[-2].Ptr); zz->nxt = yypvt[-0].Ptr; } break;
case 21:
# line 160 "aqlparse.y"
{ zMake(nSORT_FIELD_NAME); z->name = yypvt[-0].String; posSet(z,':'); } break;
case 22:
# line 161 "aqlparse.y"
{ zMake(nSORT_FIELD_NAME); z->name = strnew(aqlOpTypeName(yypvt[-0].Int), aql_L->query->handle); posSet(z,':'); } break;
case 23:
# line 162 "aqlparse.y"
{ zMake(nSORT_FIELD); z->number = yypvt[-0].Int; posSet(z,':'); } break;
case 24:
# line 163 "aqlparse.y"
{ zMake(nSORT_FIELD_NAME); z->name = yypvt[-1].String;
					  z->left = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
	      				  z->left->type = nSORT_QUALIFIER; z->left->op = yypvt[-0].Int; posSet(z,':'); } break;
case 25:
# line 166 "aqlparse.y"
{ zMake(nSORT_FIELD); z->number = yypvt[-1].Int; 
	                                  z->left = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
					  z->left->type = nSORT_QUALIFIER; z->left->op = yypvt[-0].Int; posSet(z,':'); } break;
case 26:
# line 172 "aqlparse.y"
{ yyval.Ptr = yypvt[-0].Ptr; } break;
case 27:
# line 173 "aqlparse.y"
{ zzFinal(yypvt[-2].Ptr); zz->nxt = yypvt[-0].Ptr; } break;
case 28:
# line 176 "aqlparse.y"
{ zMake(nSELECT_FIELD); z->left = yypvt[-0].Ptr; } break;
case 29:
# line 177 "aqlparse.y"
{ zMake(nSELECT_FIELD); z->name = yypvt[-2].String; z->left = yypvt[-0].Ptr; posSet(z,DOUBLE_COLON); } break;
case 30:
# line 180 "aqlparse.y"
{ yyval.Ptr = yypvt[-0].Ptr; } break;
case 31:
# line 181 "aqlparse.y"
{ zzFinal(yypvt[-2].Ptr); zz->nxt = yypvt[-0].Ptr; } break;
case 32:
# line 184 "aqlparse.y"
{ AqlNode *z = yypvt[-0].Ptr; z->name = "_DEF"; yyval.Ptr = z; } break;
case 33:
# line 185 "aqlparse.y"
{ AqlNode *z = yypvt[-2].Ptr; z->name = "_DEF"; z->right = yypvt[-0].Ptr; yyval.Ptr = z; } break;
case 34:
# line 186 "aqlparse.y"
{ AqlNode *z = yypvt[-0].Ptr; z->name = yypvt[-2].String; yyval.Ptr = z; } break;
case 35:
# line 187 "aqlparse.y"
{ AqlNode *z = yypvt[-2].Ptr; z->name = yypvt[-4].String; z->right = yypvt[-0].Ptr; yyval.Ptr = z; } break;
case 36:
# line 188 "aqlparse.y"
{ AqlNode *z = yypvt[-2].Ptr; z->name = yypvt[-0].String; yyval.Ptr = z; } break;
case 37:
# line 189 "aqlparse.y"
{ AqlNode *z = yypvt[-4].Ptr; z->name = yypvt[-2].String; z->right = yypvt[-0].Ptr; yyval.Ptr = z; } break;
case 38:
# line 190 "aqlparse.y"
{ AqlNode *z = yypvt[-1].Ptr; z->name = yypvt[-0].String; yyval.Ptr = z; } break;
case 39:
# line 191 "aqlparse.y"
{ AqlNode *z = yypvt[-3].Ptr; z->name = yypvt[-2].String; z->right = yypvt[-0].Ptr; yyval.Ptr = z; } break;
case 40:
# line 194 "aqlparse.y"
{ zMake(nFROM_LOC); z->left = yypvt[-0].Ptr; z->pos = z->left->pos; } break;
case 41:
# line 195 "aqlparse.y"
{ zMake(nFROM_TABLE); z->left = yypvt[-0].Ptr; z->pos = z->left->pos; } break;
case 42:
# line 196 "aqlparse.y"
{ zMake(nFROM_LOC); z->left = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
	    				  z = z->left; z->type = nCLASS; z->name = yypvt[-0].String; posSet(z,Identifier); } break;
case 43:
# line 198 "aqlparse.y"
{ zMake(nFROM_LOC); z->left = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
	    				  z = z->left; z->type = nCLASS; z->name = yypvt[-2].String; posSet(z,Identifier); 
	                                  z->nxt = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
					  z->nxt->type = nTEXT; z->nxt->isValue = KNOWNVAL; z->nxt->value.s = yypvt[-0].String; z->nxt->vtype = 's';
	                                  } break;
case 44:
# line 203 "aqlparse.y"
{ zMake(nFROM_LOC); z->left = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
	    				  z = z->left; z->type = nCLASS; z->name = yypvt[-0].String; posSet(z,StringLiteral); } break;
case 45:
# line 205 "aqlparse.y"
{ zMake(nFROM_LOC); z->left = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
	    				  z = z->left; z->type = nCLASS; z->name = yypvt[-2].String; posSet(z,StringLiteral); 
	                                  z->nxt = (AqlNode*)halloc(sizeof(AqlNode),aql_L->query->handle);
					  z->nxt->type = nTEXT; z->nxt->isValue = KNOWNVAL; z->nxt->value.s = yypvt[-0].String; z->nxt->vtype = 's';
	                                  } break;
case 46:
# line 212 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = yypvt[-0].String; posSet(z,Identifier); } break;
case 47:
# line 213 "aqlparse.y"
{ zMake(nOBJECT); z->left = yypvt[-3].Ptr; z->right = yypvt[-1].Ptr; posSet(z,'('); } break;
case 48:
# line 214 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_FOLLOW_TAG_NAME); zz->name = yypvt[-0].String; posSet(zz,ARROW); } break;
case 49:
# line 215 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_FOLLOW_TAG_NAME); zz->name = yypvt[-0].String; posSet(zz,ARROW); } break;
case 50:
# line 216 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_FOLLOW_POS); zz->number = yypvt[-0].Int; posSet(zz,ARROW); } break;
case 51:
# line 217 "aqlparse.y"
{ zzFinalMake(yypvt[-3].Ptr,nLOC_LOCAL_TAG_NAME); zz->name = yypvt[-1].String; posSet(zz,'['); } break;
case 52:
# line 218 "aqlparse.y"
{ zzFinalMake(yypvt[-3].Ptr,nLOC_LOCAL_TAG_NAME); zz->name = yypvt[-1].String; posSet(zz,'['); } break;
case 53:
# line 219 "aqlparse.y"
{ zzFinalMake(yypvt[-3].Ptr,nLOC_LOCAL_POS); zz->number = yypvt[-1].Int; posSet(zz,'['); } break;
case 54:
# line 220 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_LOCAL_FIELD_NAME); zz->name = yypvt[-0].String; posSet(zz,':'); } break;
case 55:
# line 221 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_LOCAL_FIELD_NAME); zz->name = yypvt[-0].String; posSet(zz,':'); } break;
case 56:
# line 222 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_LOCAL_FIELD); zz->number = yypvt[-0].Int; posSet(zz,':'); } break;
case 57:
# line 223 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_METHOD); zz->name = yypvt[-0].String; posSet(zz,'.');
                                          /* by matching the keyword 'class' we can write loc.class as a valid method. All other
					   * method names are matched by the Identifier rule below */
	                                } break;
case 58:
# line 227 "aqlparse.y"
{ zzFinalMake(yypvt[-2].Ptr,nLOC_METHOD); zz->name = yypvt[-0].String; posSet(zz,'.'); } break;
case 59:
# line 229 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF"; 
					  { zzFinalMake(z,nLOC_FOLLOW_TAG_NAME); zz->name = yypvt[-0].String; posSet(zz,Identifier); }} break;
case 60:
# line 231 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF"; 
					  { zzFinalMake(z,nLOC_FOLLOW_TAG_NAME); zz->name = yypvt[-0].String; posSet(zz,StringLiteral); }} break;
case 61:
# line 233 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF"; 
					  { zzFinalMake(z,nLOC_FOLLOW_POS); zz->number = yypvt[-0].Int; posSet(zz,Number); }} break;
case 62:
# line 235 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF"; 
					  { zzFinalMake(z,nLOC_LOCAL_TAG_NAME); zz->name = yypvt[-1].String; posSet(zz,Identifier); }} break;
case 63:
# line 237 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF"; 
					  { zzFinalMake(z,nLOC_LOCAL_TAG_NAME); zz->name = yypvt[-1].String; posSet(zz,StringLiteral); }} break;
case 64:
# line 239 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF"; 
					  { zzFinalMake(z,nLOC_LOCAL_POS); zz->number = yypvt[-1].Int; posSet(zz,Number); }} break;
case 65:
# line 241 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF";
					  { zzFinalMake(z,nLOC_LOCAL_FIELD_NAME); zz->name = yypvt[-0].String; posSet(zz,Identifier); }} break;
case 66:
# line 243 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF";
					  { zzFinalMake(z,nLOC_LOCAL_FIELD); zz->number = yypvt[-0].Int; posSet(zz,Number); }} break;
case 67:
# line 245 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF";
					  { zzFinalMake(z,nLOC_METHOD); zz->name = yypvt[-0].String; posSet(zz,'.'); }} break;
case 68:
# line 247 "aqlparse.y"
{ zMake(nLOC_VAR); z->name = "_DEF";
					  { zzFinalMake(z,nLOC_METHOD); zz->name = yypvt[-0].String; posSet(zz,'.'); }} break;
case 69:
# line 249 "aqlparse.y"
{ zMake(nLOC_TABLE_FIELD_NAME); z->left = yypvt[-2].Ptr; z->name = yypvt[-0].String; posSet(z,':'); } break;
case 70:
# line 250 "aqlparse.y"
{ zMake(nLOC_TABLE_FIELD); z->left = yypvt[-2].Ptr; z->number = yypvt[-0].Int; posSet(z,':'); } break;
case 71:
# line 253 "aqlparse.y"
{ yyval.Ptr = yypvt[-0].Ptr; } break;
case 72:
# line 254 "aqlparse.y"
{ zMake(nVAR); z->name = yypvt[-0].String; posSet(z,'$'); } break;
case 73:
# line 255 "aqlparse.y"
{ zMake(nINT); z->value.i = yypvt[-0].Int; posSet(z,Number); } break;
case 74:
# line 256 "aqlparse.y"
{ zMake(nFLOAT); z->value.f = yypvt[-0].Float; posSet(z,FloatLiteral); } break;
case 75:
# line 257 "aqlparse.y"
{ zMake(nTEXT); z->value.s = yypvt[-0].String; posSet(z,StringLiteral); } break;
case 76:
# line 258 "aqlparse.y"
{ yyval.Ptr = yypvt[-0].Ptr; } break;
case 77:
# line 260 "aqlparse.y"
{ zMake(nEXPR_TABLE_FUNC); z->op = yypvt[-1].Int; z->left = yypvt[-0].Ptr; posSet(z,'(');} break;
case 78:
# line 261 "aqlparse.y"
{ zMake(nEXPR_TABLE_FUNC_FIELD); 
                                                    z->op = yypvt[-3].Int; z->left = yypvt[-2].Ptr; z->number = yypvt[-0].Int; posSet(z,':');} break;
case 79:
# line 263 "aqlparse.y"
{ zMake(nEXPR_TABLE_FUNC_FIELD_NAME); 
                                                    z->op = yypvt[-3].Int; z->left = yypvt[-2].Ptr; z->name = yypvt[-0].String; posSet(z,':');} break;
case 80:
# line 265 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = yypvt[-5].Int; z->left = yypvt[-3].Ptr; z->right = yypvt[-1].Ptr; posSet(z,'('); } break;
case 81:
# line 266 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = yypvt[-3].Int; z->left = yypvt[-1].Ptr; posSet(z,'('); } break;
case 82:
# line 267 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = oPLUS; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,'+'); } break;
case 83:
# line 268 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = oMINUS; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,'-'); } break;
case 84:
# line 269 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = oTIMES; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,'*'); } break;
case 85:
# line 270 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = oDIVIDE; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,'/'); } break;
case 86:
# line 271 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = oUMINUS; z->left = yypvt[-0].Ptr; posSet(z,'-'); } break;
case 87:
# line 272 "aqlparse.y"
{ zMake(nEXPR_OP); z->op = oMOD; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,'%'); } break;
case 88:
# line 273 "aqlparse.y"
{ zMake(nBOOL); z->value.b = TRUE; posSet(z,TRUEtok); } break;
case 89:
# line 274 "aqlparse.y"
{ zMake(nBOOL); z->value.b = FALSE; posSet(z,FALSEtok); } break;
case 90:
# line 275 "aqlparse.y"
{ zMake(nBOOL_EXISTS); z->left = yypvt[-0].Ptr; posSet(z,EXISTS); } break;
case 91:
# line 276 "aqlparse.y"
{ zMake(nBOOL_EXISTS_TAG); z->left = yypvt[-0].Ptr; posSet(z,EXISTS_TAG); } break;
case 92:
# line 277 "aqlparse.y"
{ zMake(nBOOL_EXISTS); z->left = yypvt[-1].Ptr; posSet(z,EXISTS); } break;
case 93:
# line 278 "aqlparse.y"
{ zMake(nBOOL_EXISTS_TAG); z->left = yypvt[-1].Ptr; posSet(z,EXISTS_TAG); } break;
case 94:
# line 279 "aqlparse.y"
{ zMake(nBOOL_COMPARISON); z->op = yypvt[-1].Int; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,Comparator); } break;
case 95:
# line 280 "aqlparse.y"
{ zMake(nBOOL_NOT); z->left = yypvt[-0].Ptr; posSet(z,NOT); } break;
case 96:
# line 281 "aqlparse.y"
{ zMake(nBOOL_OP); z->op = oAND; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,AND); } break;
case 97:
# line 282 "aqlparse.y"
{ zMake(nBOOL_OP); z->op = oOR; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,OR); } break;
case 98:
# line 283 "aqlparse.y"
{ zMake(nBOOL_OP); z->op = oXOR; z->left = yypvt[-2].Ptr; z->right = yypvt[-0].Ptr; posSet(z,XOR); } break;
case 99:
# line 284 "aqlparse.y"
{ yyval.Ptr = yypvt[-1].Ptr; } break;
case 100:
# line 287 "aqlparse.y"
{ zMake(nDATE); z->value.t = timeParse ("now"); posSet(z,NOW); } break;
case 101:
# line 288 "aqlparse.y"
{ zMake(nDATE); z->value.t = timeParse ("today"); posSet(z,TODAY); } break;
case 102:
# line 289 "aqlparse.y"
{ zMake(nDATE); z->value.t = timeCreateFromString (yypvt[-0].String); posSet(z,DateLiteral); } break;
# line	531 "/usr/ccs/bin/yaccpar"
	}
	goto yystack;		/* reset registers in driver code */
}

