/*
 ast.syn -- Create an Abstract Syntax Tree
 Copyright (c) 2002 Parsifal Software. All Rights Reserved.

 Modified to support structures and instances.

 The grammar contained in this file describes the same language as the
 grammar in pll.syn. The differences can be categorized as follows:
   . Rules rewritten to make computation easier. In pll.syn all of the
     arithmetic operators have been factored out. Here the arithmetic
     operators have been substituted back into the rules for expressions to
     make computation more straightforward.
   . Rules rewritten to handle looping. The rules for loop constructs have
     been rewritten to handle repetitive parsing of loops.
   . Semantically determined rules (true, false) added to support parse time
     implementation of loops and if-else statements.

 The actual parser modules, ast.h and ast.cpp are created from
 ast.syn by the AnaGram parser generator using the Build Parser command.

 To build a demonstration program that illustrates the use of this parser in
 an interpreter that executes from an abstract syntax tree, compile and link
 as a single single project:
   astxi.cpp               // Execution module
   demo.cpp                // Demo program
   ast.cpp                 // This parser, creates abstract syntax tree
   astdefs.cpp             // Node definitions
   comdefs.cpp             // Common script definitions
   agclib1\src\ag*.cpp     // Supporting class library
 Include files describing the class library are in agclib1\include

 To build a demonstration program that illustrates the use of this parser in
 an interpreter that compiles bytecode from an abstract syntax tree, compile
 and link as a single single project:
   astci.cpp               // Execution module
   demo.cpp                // Demo program
   ast.cpp                 // This parser, creates abstract syntax tree
   astdefs.cpp             // Node definitions
   bcidefs.cpp             // Bytecode and compiler definitions
   comdefs.cpp             // Common script definitions
   agclib1\src\ag*.cpp     // Supporting class library
 Include files describing the class library are in agclib1\include


 This grammar describes a language that is somewhat similar to Pascal.

 The language consists of Pascal like statements and expressions. The
 language also implements Fortran-style exponentiation and simple dump and
 print statements. The syntax below uses "open" and "closed" statements to
 eliminate the traditional "dangling else" or "if-else" ambiguity problem.
 See http://www.parsifalsoft.com/ifelse.html or doc/ifelse.htm for a more
 detailed discussion.

 Statement types supported are:
   assignment statements
   compound statements
   if/else statements
   while statements
   repeat/until statements
   for statements
   dump and print statements

 There are no declarations. Scalar values may be explicitly cast to (long) or
 (double). Both integer and floating point values are stored as doubles.

 Scripts may contain any number of statements. White space may be used
 freely, including both C and C++ style comments.

 For further information about this program or the AnaGram
 parser generator, please contact:
   Parsifal Software
   http://www.parsifalsoft.com
   info@parsifalsoft.com
   +1-800-879-2577, Voice/Fax +1-508-358-2564
   P.O. Box 219
   Wayland, Massachusetts 01778
   USA
*/

#include "comdefs.h"
#include <math.h>
#include "astdefs.h"         // Defines node structure of abstract syntax tree
#include <ctype.h>


// Forward reference for parxer control block
struct parse_pcb_struct;

struct Tree : public AbstractSyntaxTree {
  parse_pcb_struct *pcbPointer;
  FileLocation context() const;
};

#define AST PCB.ast

/*
AnaGram, A System for Syntax Directed Programming
Copyright (c) 1993-2002, Parsifal Software.
All Rights Reserved.

Version 2.01.08a   Feb 26 2002

Serial number 2P17253
Registered to:
  Parsifal Software
  AnaGram 2.01.08a Master
*/

#ifndef AST_H_1027348776
#include "ast.h"
#endif

#ifndef AST_H_1027348776
#error Mismatched header file
#endif

#include <ctype.h>
#include <stdio.h>

#define RULE_CONTEXT (&((PCB).cs[(PCB).ssx]))
#define ERROR_CONTEXT ((PCB).cs[(PCB).error_frame_ssx])
#define CONTEXT ((PCB).cs[(PCB).ssx])


#ifndef PCB_TYPE
#define PCB_TYPE parse_pcb_type
#endif


#define PCB (*pcb_pointer)
#define PCB_DECL PCB_TYPE *pcb_pointer
#define PCB_POINTER pcb_pointer
static void ag_delete_wrappers(PCB_DECL);
#ifndef DELETE_WRAPPERS
#define DELETE_WRAPPERS ag_delete_wrappers(PCB_POINTER)
#endif

/*  Line 507, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
 // Begin embedded C++

// Don't use default error handling.
#define SYNTAX_ERROR PCB.reportError()

#define GET_CONTEXT CONTEXT = FileLocation(PCB.pointer, PCB.line, PCB.column)

FileLocation Tree::context() const {
  return PCONTEXT(*pcbPointer);
}

// Function definitions for parser control block

// Constructor
parse_pcb_struct::parse_pcb_struct(const char *text)
  : pointer((const unsigned char *) text), loopDepth(0)
{
  ast.pcbPointer = this;
}

void parse_pcb_struct::checkLoop() {
  if (loopDepth) return;
  char buf[100];
  FileLocation &context = PCONTEXT(*this);
  sprintf(buf, "Error(%d,%d): No loop active", context.line, context.column);
  throw ErrorDiagnostic(buf);
}

// Record syntax error
void parse_pcb_struct::reportError() {
  ag_delete_wrappers(this);
  char buf[100];
  sprintf(buf, "Error(%d,%d): %s", line, column, error_message);
  throw ErrorDiagnostic(buf);
}

// External Interface
AbstractSyntaxTree buildTree(const char *text) {
  parse_pcb_type pcb(text);
  parse(&pcb);
  return pcb.ast;
}


#ifndef CONVERT_CASE

static const char agCaseTable[31] = {
  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,    0,
  0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
};

static int agConvertCase(int c) {
  if (c >= 'a' && c <= 'z') return c ^= 0x20;
  if (c >= 0xe0 && c < 0xff) c ^= agCaseTable[c-0xe0];
  return c;
}

#define CONVERT_CASE(c) agConvertCase(c)

#endif


#ifndef TAB_SPACING
#define TAB_SPACING 8
#endif

static inline void ag_rp_1(PCB_DECL, AgStack<AstNode *> &sl) {
/* Line 149, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  AST.root = AST.node(typeScript, AST.listNode(typeStatementBlock, sl));
}

static inline AgStack<AstNode *> ag_rp_2(PCB_DECL) {
/* Line 153, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgStack<AstNode *>();
}

static inline AgStack<AstNode *> ag_rp_3(PCB_DECL, AgStack<AstNode *> &s, AstNode * x) {
/* Line 154, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return s.push(x);
}

static inline AstNode * ag_rp_4(PCB_DECL, AstNode * x, AstNode * s) {
/* Line 172, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeIfStatement, x, s);
}

static inline AstNode * ag_rp_5(PCB_DECL, AstNode * x, AstNode * s1, AstNode * s2) {
/* Line 174, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeIfElseStatement, x, s1, s2);
}

static inline AstNode * ag_rp_6(PCB_DECL, AstNode * x, AstNode * s) {
/* Line 176, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return PCB.loopDepth--, AST.node(typeWhileStatement, x, s);
}

static inline AstNode * ag_rp_7(PCB_DECL, AstNode * lv, AstNode * b, AstNode * i, AstNode * e, AstNode * s) {
/* Line 179, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeSimpleFor, lv, b, i, e, s);
}

static inline AstNode * ag_rp_8(PCB_DECL, AstNode * x, AstNode * s1, AstNode * s2) {
/* Line 183, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeIfElseStatement,x,s1,s2);
}

static inline AstNode * ag_rp_9(PCB_DECL, AstNode * x, AstNode * s) {
/* Line 185, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeWhileStatement,x,s);
}

static inline AstNode * ag_rp_10(PCB_DECL, AstNode * lv, AstNode * b, AstNode * i, AstNode * e, AstNode * s) {
/* Line 188, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeSimpleFor, lv, b, i, e, s);
}

static inline AstNode * ag_rp_11(PCB_DECL, AstNode * x) {
/* Line 189, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x;
}

static inline AstNode * ag_rp_12(PCB_DECL) {
/* Line 192, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.constantNode(1);
}

static inline AstNode * ag_rp_13(PCB_DECL, AstNode * x) {
/* Line 193, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x;
}

static inline AstNode * ag_rp_14(PCB_DECL, AgStack<AstNode *> &s, AstNode * x) {
/* Line 202, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeRepeatStatement,AST.listNode(typeStatementBlock, s), x);
}

static inline AstNode * ag_rp_15(PCB_DECL, AstNode * lv, AstNode * x) {
/* Line 203, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.assignmentNode(lv,SAP,x);
}

static inline AstNode * ag_rp_16(PCB_DECL) {
/* Line 204, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeNull);
}

static inline AstNode * ag_rp_17(PCB_DECL, AstNode * x) {
/* Line 206, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeReturn, x);
}

static inline AstNode * ag_rp_18(PCB_DECL, AgStack<AstNode *> &ns) {
/* Line 207, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.listNode(typeDump, ns);
}

static inline AstNode * ag_rp_19(PCB_DECL, AgStack<AstNode *> &ns) {
/* Line 208, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.listNode(typePrint, ns);
}

static inline AstNode * ag_rp_20(PCB_DECL, AstNode * x) {
/* Line 224, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x;
}

static inline AstNode * ag_rp_21(PCB_DECL, AgStack<AstNode *> &s) {
/* Line 227, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.listNode(typeStatementBlock, s);
}

static inline AgStack<AstNode *> ag_rp_22(PCB_DECL, AgString &k) {
/* Line 231, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgStack<AstNode *>().push(AST.variableNode(k));
}

static inline AgStack<AstNode *> ag_rp_23(PCB_DECL, AgStack<AstNode *> &ns, AgString &k) {
/* Line 232, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return ns.push(AST.variableNode(k));
}

static inline AgStack<AstNode *> ag_rp_24(PCB_DECL, AstNode * x) {
/* Line 236, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgStack<AstNode *>().push(x);
}

static inline AgStack<AstNode *> ag_rp_25(PCB_DECL, AgStack<AstNode *> &s, AstNode * x) {
/* Line 237, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return s.push(x);
}

static AstNode * ag_rp_26(PCB_DECL, AgString &n, AgStack<AgString> &fl, AgStack<AgString> &il) {
/* Line 241, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
     return AST.node(typeStructureDecl,
                     AST.variableNode(n),
                     AST.nameListNode(fl),
                     AST.nameListNode(il));
 
}

static AstNode * ag_rp_27(PCB_DECL, AgString &n, AgStack<AgString> &fl) {
/* Line 247, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
     return AST.node(typeStructureDecl,
                     AST.variableNode(n),
                     AST.nameListNode(fl),
                     AST.nameListNode(AgStack<AgString>()));
 
}

static AstNode * ag_rp_28(PCB_DECL, AgStack<AgString> &fl, AgStack<AgString> &nl) {
/* Line 253, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
     return AST.node(typeStructureDecl,
                     AST.node(typeNull),
                     AST.nameListNode(fl),
                     AST.nameListNode(nl));
 
}

static AstNode * ag_rp_29(PCB_DECL, AgString &n, AgStack<AgString> &nl) {
/* Line 260, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
     return AST.node(typeStructureDecl,
                     AST.variableNode(n),
                     AST.nameListNode(AgStack<AgString>()),
                     AST.nameListNode(nl));
 
}

static inline AgStack<AgString> ag_rp_30(PCB_DECL, AgString &n) {
/* Line 267, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgStack<AgString>().push(n);
}

static inline AgStack<AgString> ag_rp_31(PCB_DECL, AgStack<AgString> &stack, AgString &n) {
/* Line 268, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return stack.push(n);
}

static inline AstNode * ag_rp_32(PCB_DECL) {
/* Line 271, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeNull);
}

static inline AstNode * ag_rp_33(PCB_DECL, AstNode * x, Opcode op, AstNode * y) {
/* Line 278, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.binaryNode(op,x,y);
}

static inline AstNode * ag_rp_34(PCB_DECL, AstNode * x, Opcode op, AstNode * y) {
/* Line 282, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.binaryNode(op,x,y);
}

static inline AstNode * ag_rp_35(PCB_DECL, AstNode * x, Opcode op, AstNode * y) {
/* Line 286, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.binaryNode(op,x,y);
}

static inline AstNode * ag_rp_36(PCB_DECL, AstNode * x) {
/* Line 290, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x;
}

static inline AstNode * ag_rp_37(PCB_DECL, Opcode op, AstNode * x) {
/* Line 291, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.unaryNode(op, x);
}

static inline AstNode * ag_rp_38(PCB_DECL, AstNode * x, AstNode * y) {
/* Line 299, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.binaryNode(POW, x, y);
}

static inline AstNode * ag_rp_39(PCB_DECL, AstNode * x) {
/* Line 307, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x;
}

static inline AstNode * ag_rp_40(PCB_DECL, AstNode * x) {
/* Line 309, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.unaryNode(FETCH, x);
}

static inline AstNode * ag_rp_41(PCB_DECL, AstNode * x) {
/* Line 311, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.unaryNode(CAST_LONG, x);
}

static inline AstNode * ag_rp_42(PCB_DECL, AstNode * x) {
/* Line 312, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.unaryNode(CAST_DOUBLE, x);
}

static inline AstNode * ag_rp_43(PCB_DECL, AgString &n) {
/* Line 315, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.variableNode(n);
}

static inline AstNode * ag_rp_44(PCB_DECL, AstNode * lv, AgString &n) {
/* Line 316, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.node(typeMember, lv, AST.nameNode(n));
}

static inline AstNode * ag_rp_45(PCB_DECL, AgString &k, AgStack<AstNode *> &args) {
/* Line 319, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.functionCallNode(k, args);
}

static inline AgStack<AstNode *> ag_rp_46(PCB_DECL) {
/* Line 322, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgStack<AstNode *>();
}

static inline AgStack<AstNode *> ag_rp_47(PCB_DECL, AstNode * x) {
/* Line 326, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgStack<AstNode *>().push(x);
}

static inline AgStack<AstNode *> ag_rp_48(PCB_DECL, AgStack<AstNode *> &al, AstNode * x) {
/* Line 327, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return al.push(x);
}

static inline AstNode * ag_rp_49(PCB_DECL, long x) {
/* Line 330, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.constantNode(x);
}

static inline AstNode * ag_rp_50(PCB_DECL, double x) {
/* Line 331, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.constantNode(x);
}

static inline AstNode * ag_rp_51(PCB_DECL, Value &x) {
/* Line 332, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.constantNode(x);
}

static inline AstNode * ag_rp_52(PCB_DECL, int x) {
/* Line 333, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AST.constantNode(x);
}

static inline Opcode ag_rp_53(PCB_DECL) {
/* Line 337, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return EQ;
}

static inline Opcode ag_rp_54(PCB_DECL) {
/* Line 338, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return NE;
}

static inline Opcode ag_rp_55(PCB_DECL) {
/* Line 339, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return LT;
}

static inline Opcode ag_rp_56(PCB_DECL) {
/* Line 340, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return LE;
}

static inline Opcode ag_rp_57(PCB_DECL) {
/* Line 341, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return GT;
}

static inline Opcode ag_rp_58(PCB_DECL) {
/* Line 342, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return GE;
}

static inline Opcode ag_rp_59(PCB_DECL) {
/* Line 345, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return ADD;
}

static inline Opcode ag_rp_60(PCB_DECL) {
/* Line 346, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return SUB;
}

static inline Opcode ag_rp_61(PCB_DECL) {
/* Line 347, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return IOR;
}

static inline Opcode ag_rp_62(PCB_DECL) {
/* Line 348, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return XOR;
}

static inline Opcode ag_rp_63(PCB_DECL) {
/* Line 351, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return MUL;
}

static inline Opcode ag_rp_64(PCB_DECL) {
/* Line 352, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return RDIV;
}

static inline Opcode ag_rp_65(PCB_DECL) {
/* Line 353, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return IDIV;
}

static inline Opcode ag_rp_66(PCB_DECL) {
/* Line 354, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return MOD;
}

static inline Opcode ag_rp_67(PCB_DECL) {
/* Line 355, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AND;
}

static inline Opcode ag_rp_68(PCB_DECL) {
/* Line 356, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return LS;
}

static inline Opcode ag_rp_69(PCB_DECL) {
/* Line 357, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return RS;
}

static inline Opcode ag_rp_70(PCB_DECL) {
/* Line 360, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return NEG;
}

static inline Opcode ag_rp_71(PCB_DECL) {
/* Line 361, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return NOT;
}

static inline AgString ag_rp_72(PCB_DECL, int c) {
/* Line 379, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgString().append(tolower(c));
}

static inline AgString ag_rp_73(PCB_DECL, AgString &ns, int c) {
/* Line 380, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return ns.append(tolower(c));
}

static inline double ag_rp_74(PCB_DECL, double x, long e) {
/* Line 386, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x*pow(10,e);
}

static inline double ag_rp_75(PCB_DECL, double x, long e) {
/* Line 387, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x*pow(10,e);
}

static inline double ag_rp_76(PCB_DECL, double i, double f) {
/* Line 390, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return i+f;
}

static inline double ag_rp_77(PCB_DECL, double i) {
/* Line 391, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return i;
}

static inline double ag_rp_78(PCB_DECL, double f) {
/* Line 392, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return f;
}

static inline double ag_rp_79(PCB_DECL, long x) {
/* Line 395, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x;
}

static inline double ag_rp_80(PCB_DECL, long x) {
/* Line 396, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x;
}

static inline double ag_rp_81(PCB_DECL, long x) {
/* Line 397, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return makeDecimal(x);
}

static inline long ag_rp_82(PCB_DECL, long x) {
/* Line 400, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return (long)x;
}

static inline long ag_rp_83(PCB_DECL, long x) {
/* Line 401, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return -(long)x;
}

static inline double ag_rp_84(PCB_DECL, int d) {
/* Line 404, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return (d-'0')/10.0;
}

static inline double ag_rp_85(PCB_DECL, int d, double f) {
/* Line 405, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return (d-'0' + f)/10.0;
}

static inline long ag_rp_86(PCB_DECL, int d) {
/* Line 413, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return d-'0';
}

static inline long ag_rp_87(PCB_DECL, long x, int d) {
/* Line 414, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 10*x + d-'0';
}

static inline long ag_rp_88(PCB_DECL, int d) {
/* Line 417, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return d-'0';
}

static inline long ag_rp_89(PCB_DECL, long x, int d) {
/* Line 418, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 10*x + d-'0';
}

static inline long ag_rp_90(PCB_DECL, long x, int d) {
/* Line 421, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 10*makeDecimal(x) + d - '0';
}

static inline long ag_rp_91(PCB_DECL, long x, int d) {
/* Line 422, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 10*x + d-'0';
}

static inline long ag_rp_92(PCB_DECL) {
/* Line 425, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 0;
}

static inline long ag_rp_93(PCB_DECL, long n, int d) {
/* Line 426, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 8*n + d - '0';
}

static inline long ag_rp_94(PCB_DECL) {
/* Line 429, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 0;
}

static inline long ag_rp_95(PCB_DECL, long n, int d) {
/* Line 430, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 16*n + d;
}

static inline int ag_rp_96(PCB_DECL, int x) {
/* Line 433, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return x - '0';
}

static inline int ag_rp_97(PCB_DECL, int d) {
/* Line 434, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return (d & 7) + 9;
}

static inline Value ag_rp_98(PCB_DECL, Value &s, Value &e) {
/* Line 440, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return s+=e;
}

static inline Value ag_rp_99(PCB_DECL, AgString &b) {
/* Line 443, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return Value(b);
}

static inline AgString ag_rp_100(PCB_DECL) {
/* Line 447, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return AgString();
}

static inline AgString ag_rp_101(PCB_DECL, AgString &s, int c) {
/* Line 448, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return s.append(c);
}

static inline int ag_rp_102(PCB_DECL) {
/* Line 460, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\'';
}

static inline int ag_rp_103(PCB_DECL) {
/* Line 461, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '"';
}

static inline int ag_rp_104(PCB_DECL) {
/* Line 462, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\?';
}

static inline int ag_rp_105(PCB_DECL) {
/* Line 463, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\\';
}

static inline int ag_rp_106(PCB_DECL) {
/* Line 464, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\a';
}

static inline int ag_rp_107(PCB_DECL) {
/* Line 465, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\b';
}

static inline int ag_rp_108(PCB_DECL) {
/* Line 466, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\f';
}

static inline int ag_rp_109(PCB_DECL) {
/* Line 467, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\n';
}

static inline int ag_rp_110(PCB_DECL) {
/* Line 468, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\r';
}

static inline int ag_rp_111(PCB_DECL) {
/* Line 469, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\t';
}

static inline int ag_rp_112(PCB_DECL) {
/* Line 470, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return '\v';
}

static inline int ag_rp_113(PCB_DECL, int d) {
/* Line 476, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return d-'0';
}

static inline int ag_rp_114(PCB_DECL, int n, int d) {
/* Line 479, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 8*n + d-'0';
}

static inline int ag_rp_115(PCB_DECL, int n, int d) {
/* Line 482, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 8*n + d-'0';
}

static inline int ag_rp_116(PCB_DECL, int d) {
/* Line 485, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return d;
}

static inline int ag_rp_117(PCB_DECL, int n, int d) {
/* Line 486, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 16*n + d;
}

static inline int ag_rp_118(PCB_DECL, int d) {
/* Line 489, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return d-'0';
}

static inline int ag_rp_119(PCB_DECL, int d) {
/* Line 490, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return 9 + (d & 7);
}

static inline int ag_rp_120(PCB_DECL, int c) {
/* Line 499, W:/agdev/agex/packages/xidek/pll/struct/ast.syn */
  return c;
}


#define READ_COUNTS 
#define WRITE_COUNTS 
#undef V
#define V(i,t) (*t (&(PCB).vs[(PCB).ssx + i]))
#undef VS
#define VS(i) (PCB).vs[(PCB).ssx + i]

#ifndef GET_CONTEXT
#define GET_CONTEXT CONTEXT = (PCB).input_context
#endif

typedef enum {
  ag_action_1,
  ag_action_2,
  ag_action_3,
  ag_action_4,
  ag_action_5,
  ag_action_6,
  ag_action_7,
  ag_action_8,
  ag_action_9,
  ag_action_10,
  ag_action_11,
  ag_action_12
} ag_parser_action;


#ifndef NULL_VALUE_INITIALIZER
#define NULL_VALUE_INITIALIZER = { 0 }
#endif


static const char ag_wdf[] = {
  0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0,
  0, 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
  0, 0, 6, 0, 0, 0, 0, 7, 7, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 6, 6, 0, 0, 0, 0,
  0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0
};

#undef  VW
#define VW(i,t) *(t) (&(PCB).vs[(PCB).ssx + (i)])
#undef  VNO
#define VNO new(&(PCB).vs[(PCB).ssx])
#undef  VRO
#define VRO(to,v) ag_replace_object((to) &(PCB).vs[(PCB).ssx], v)
#undef  VWD
#define VWD(i,t) ag_delete_object((t) &(PCB).vs[(PCB).ssx + (i)]);
#undef  VDO
#define VDO(to, v) ag_delete_object((to) &(PCB).vs[(PCB).ssx], v)

template <class NewObject, class OldObject>
static inline void ag_replace_object(AgObjectWrapper<OldObject> *p, const NewObject &o) {
  delete p;
  new(p) AgObjectWrapper<NewObject >(o);
}

template <class Object>
static inline void ag_delete_object(AgObjectWrapper<Object> *p) {
  delete p;
}

template <class NewObject, class OldObject>
static inline const NewObject &ag_delete_object(AgObjectWrapper<OldObject> *p, const NewObject &o) {
  delete p;
  return o;
}


#undef AG_WRAP_4
#define AG_WRAP_4 AgObjectWrapper<AgString >
#undef AG_WRAP_5
#define AG_WRAP_5 AgObjectWrapper<Value >
#undef AG_WRAP_6
#define AG_WRAP_6 AgObjectWrapper<AgStack<AstNode *> >
#undef AG_WRAP_7
#define AG_WRAP_7 AgObjectWrapper<AgStack<AgString> >

static void ag_delete_wrappers(PCB_DECL) {
  int sn = (PCB).sn;
  int sx = (PCB).ssx;
  while (sx--) {
    switch (ag_wdf[sn]) {
      case 4: ag_delete_object((AG_WRAP_4 *) &(PCB).vs[sx]); break;
      case 5: ag_delete_object((AG_WRAP_5 *) &(PCB).vs[sx]); break;
      case 6: ag_delete_object((AG_WRAP_6 *) &(PCB).vs[sx]); break;
      case 7: ag_delete_object((AG_WRAP_7 *) &(PCB).vs[sx]); break;
      default: break;
    }
    sn = (PCB).ss[sx];
  }
}

static parse_vs_type const ag_null_value NULL_VALUE_INITIALIZER;

static const unsigned char ag_rpx[] = {
    0,  1,  2,  3,  0,  0,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15,
   16,  0, 17, 18, 19,  0,  0,  0,  0,  0, 20, 21, 22, 23, 24, 25, 26, 27,
   28, 29, 30, 31, 32,  0,  0, 33,  0, 34,  0, 35,  0, 36, 37,  0, 38, 39,
    0, 40,  0, 41, 42, 43, 44, 45, 46,  0, 47, 48, 49, 50, 51, 52, 53, 54,
   55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,  0,
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 72, 73,  0, 74, 75, 76, 77, 78,
   79, 80, 81,  0,  0, 82, 83, 84, 85,  0,  0,  0, 86, 87, 88, 89, 90, 91,
   92, 93, 94, 95, 96, 97,  0, 98, 99,100,101,  0,  0,  0,  0,  0,102,103,
  104,105,106,107,108,109,110,111,112,  0,  0,  0,113,114,115,116,117,118,
  119,120
};

static const unsigned char ag_key_itt[] = {
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 0
};

static const unsigned short ag_key_pt[] = {
  0,155,  0,156,  0,157,  0,159,  0,161,  0,162,  0,163,  0,164,
  0,165,  0,167,  0,166,  0,169,  0,168,  0,171,  0,173,  0,176,
  0,181,  0,182,  0,194,  0,195,  0,198,  0,199,  0,200,  0,201,
  0,202,  0,203,0
};

static const unsigned char ag_key_ch[] = {
    0, 42, 47,255, 80, 84,255, 69,255, 47, 66, 68, 70, 73, 80, 82, 83, 87,
  255, 42,255, 42, 47,255, 61, 62,255, 69, 89,255, 85,255, 73, 79, 85,255,
   76, 78,255, 80, 84,255, 69,255, 76, 82,255, 72, 84,255, 72, 79,255, 42,
   47, 48, 58, 60, 62, 65, 66, 68, 69, 70, 73, 76, 77, 78, 79, 80, 82, 83,
   84, 85, 87, 88,255, 80, 84,255, 69,255, 66, 68, 70, 73, 80, 82, 83, 87,
  255, 42, 47,255, 47,255, 42, 47,255, 47, 48, 78,255, 42, 47,255, 80, 84,
  255, 69,255, 47, 66, 68, 69, 70, 73, 80, 82, 83, 87,255, 42, 47,255, 61,
   62,255, 42, 47, 58, 60, 62,255, 42, 47,255, 80, 84,255, 69,255, 47, 66,
   68, 70, 73, 80, 82, 83, 85, 87,255, 48, 78,255, 80, 84,255, 69,255, 66,
   68, 69, 70, 73, 80, 82, 83, 87,255, 42, 47,255, 76, 78,255, 80, 84,255,
   69,255, 47, 66, 68, 69, 70, 73, 80, 82, 83, 85, 87,255, 58,255, 80, 84,
  255, 69,255, 66, 68, 70, 73, 80, 82, 83, 85, 87,255, 34, 39, 63, 65, 66,
   70, 78, 82, 84, 86, 88, 92,255, 92,255, 42, 47,255, 61, 62,255, 73, 79,
  255, 76, 82,255, 72,255, 72, 79,255, 42, 47, 60, 62, 65, 66, 68, 77, 79,
   83, 84, 88,255, 42, 47,255, 61, 62,255, 76, 82,255, 72,255, 72, 79,255,
   42, 47, 60, 62, 77, 79, 83, 84, 88,255, 61, 62,255, 73, 79,255, 76, 82,
  255, 72,255, 72, 79,255, 42, 60, 62, 65, 66, 68, 77, 79, 83, 84, 88,255,
   42, 47,255, 47, 48, 68, 76, 78,255, 48, 68, 76, 78,255, 61, 62,255, 73,
   79,255, 76, 82,255, 72,255, 72, 79,255, 60, 62, 65, 66, 68, 77, 79, 83,
   84, 88,255, 61, 62,255, 72, 79,255, 60, 62, 66, 68, 79, 84, 88,255, 84,
  255, 68,255, 76, 78,255, 80, 84,255, 69,255, 66, 68, 69, 70, 73, 80, 82,
   83, 85, 87,255, 42, 47,255, 61, 62,255, 73, 79,255, 76, 82,255, 72,255,
   72, 79,255, 42, 47, 48, 60, 62, 65, 66, 68, 77, 79, 83, 84, 88,255, 48,
  255, 72, 79,255, 66, 68, 79, 84, 88,255, 66, 84,255, 84,255
};

static const unsigned char ag_key_act[] = {
  0,0,0,4,7,7,4,2,4,2,7,7,7,7,7,2,7,7,4,3,4,0,0,4,0,0,4,7,5,4,7,4,7,6,7,
  4,7,7,4,7,7,4,2,4,5,5,4,2,7,4,7,5,4,3,2,3,3,2,3,7,2,2,2,7,7,7,7,7,7,7,
  2,2,2,7,7,7,4,7,7,4,2,4,7,7,7,7,7,2,7,7,4,0,0,4,2,4,0,0,4,2,3,7,4,0,0,
  4,7,7,4,2,4,2,7,7,7,7,7,7,2,7,7,4,0,0,4,0,0,4,3,2,3,2,3,4,0,0,4,7,7,4,
  2,4,2,7,7,7,7,7,2,7,7,7,4,3,7,4,7,7,4,2,4,7,7,7,7,7,7,2,7,7,4,0,0,4,7,
  7,4,7,7,4,2,4,2,7,7,2,7,7,7,2,7,7,7,4,3,4,7,7,4,2,4,7,7,7,7,7,2,7,7,7,
  4,0,0,0,0,0,0,0,0,0,0,0,0,4,2,4,0,0,4,0,0,4,7,5,4,5,5,4,2,4,7,5,4,3,2,
  2,3,7,7,2,7,7,2,2,7,4,0,0,4,0,0,4,5,5,4,2,4,7,5,4,3,2,2,3,7,7,2,2,7,4,
  0,0,4,7,5,4,5,5,4,2,4,7,5,4,3,2,3,7,7,2,7,7,2,2,7,4,0,0,4,2,3,7,7,7,4,
  3,7,7,7,4,0,0,4,7,5,4,5,5,4,2,4,7,5,4,2,3,7,7,2,7,7,2,2,7,4,0,0,4,7,5,
  4,2,3,7,7,7,2,7,4,7,4,7,4,7,7,4,7,7,4,2,4,7,7,2,7,7,7,2,7,7,7,4,0,0,4,
  0,0,4,7,5,4,5,5,4,2,4,7,5,4,3,2,3,2,3,7,7,2,7,7,2,2,7,4,3,4,7,5,4,7,7,
  7,2,7,4,7,7,4,7,4
};

static const unsigned char ag_key_parm[] = {
    0, 88, 93,  0, 10,  8,  0,  0,  0,  0, 22, 26, 16, 18, 28,  0, 30, 14,
    0, 92,  0, 88, 93,  0,190,188,  0, 22,  6,  0, 34,  0, 40,  2, 26,  0,
    0, 24,  0, 10,  8,  0,  0,  0, 46, 48,  0,  0, 30,  0, 20,  4,  0,178,
    0,117,158,  0,192, 44,  0,  0,  0, 16, 18, 32, 42, 50, 36, 28,  0,  0,
    0, 12, 14, 38,  0, 10,  8,  0,  0,  0, 22, 26, 16, 18, 28,  0, 30, 14,
    0, 88, 93,  0,  0,  0, 88, 93,  0,  0,117, 50,  0, 88, 93,  0, 10,  8,
    0,  0,  0,  0, 22, 26, 24, 16, 18, 28,  0, 30, 14,  0, 88, 93,  0,190,
  188,  0,178,  0,158,  0,192,  0, 88, 93,  0, 10,  8,  0,  0,  0,  0, 22,
   26, 16, 18, 28,  0, 30, 12, 14,  0,117, 50,  0, 10,  8,  0,  0,  0, 22,
   26, 24, 16, 18, 28,  0, 30, 14,  0, 88, 93,  0,  0, 24,  0, 10,  8,  0,
    0,  0,  0, 22, 26,  0, 16, 18, 28,  0, 30, 12, 14,  0,158,  0, 10,  8,
    0,  0,  0, 22, 26, 16, 18, 28,  0, 30, 12, 14,  0,129,128,130,132,133,
  134,135,136,137,138,143,131,  0,  0,  0, 88, 93,  0,190,188,  0, 40,  2,
    0, 46, 48,  0,  0,  0, 20,  4,  0,178,  0,  0,192, 44,  6,  0, 42, 36,
    0,  0, 38,  0, 88, 93,  0,190,188,  0, 46, 48,  0,  0,  0, 20,  4,  0,
  178,  0,  0,192, 42, 36,  0,  0, 38,  0,190,188,  0, 40,  2,  0, 46, 48,
    0,  0,  0, 20,  4,  0,178,  0,192, 44,  6,  0, 42, 36,  0,  0, 38,  0,
   88, 93,  0,  0,117, 34, 32, 50,  0,117, 34, 32, 50,  0,190,188,  0, 40,
    2,  0, 46, 48,  0,  0,  0, 20,  4,  0,  0,192, 44,  6,  0, 42, 36,  0,
    0, 38,  0,190,188,  0, 20,  4,  0,  0,192,  6,  2, 36,  0, 38,  0, 20,
    0,  2,  0,  0, 24,  0, 10,  8,  0,  0,  0, 22, 26,  0, 16, 18, 28,  0,
   30, 12, 14,  0, 88, 93,  0,190,188,  0, 40,  2,  0, 46, 48,  0,  0,  0,
   20,  4,  0,178,  0,117,  0,192, 44,  6,  0, 42, 36,  0,  0, 38,  0,117,
    0, 20,  4,  0,  6,  2, 36,  0, 38,  0,  6,  4,  0,  4,  0
};

static const unsigned short ag_key_jmp[] = {
    0,  0,  0,  0, 19, 23,  0,  4,  0,  1,  0,  5,  9, 12, 14,  7, 27, 33,
    0, 38,  0,  0,  0,  0,  0,  0,  0, 51,  0,  0, 57,  0, 55, 30, 61,  0,
   64, 67,  0, 91, 95,  0, 39,  0,  0,  0,  0, 44, 99,  0,104,  0,  0, 40,
   21, 42, 44, 24, 46, 48, 27, 32, 36, 69, 72, 74, 78, 81, 84, 86, 42, 47,
   50,107,112,117,  0,139,143,  0, 77,  0,120,125,129,132,134, 80,147,153,
    0,  0,  0,  0, 91,  0,  0,  0,  0, 96,158,160,  0,  0,  0,  0,185,189,
    0,106,  0,103,163,168,172,175,178,180,109,193,199,  0,  0,  0,  0,  0,
    0,  0,204,122,206,125,208,  0,  0,  0,  0,229,233,  0,137,  0,134,210,
  215,219,222,224,140,237,243,248,  0,253,255,  0,280,284,  0,156,  0,258,
  263,267,270,273,275,159,288,294,  0,  0,  0,  0,308,311,  0,323,327,  0,
  177,  0,171,299,304,174,313,316,318,180,331,337,342,  0,347,  0,368,372,
    0,196,  0,349,354,358,361,363,199,376,382,387,  0,  0,  0,  0,  0,  0,
    0,  0,  0,  0,  0,  0,  0,  0,211,  0,  0,  0,  0,  0,  0,  0,401,  0,
    0,  0,  0,  0,235,  0,408,  0,  0,392,226,229,394,396,399,232,403,406,
  238,240,411,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,262,  0,423,  0,  0,
  414,256,259,416,418,421,265,267,426,  0,  0,  0,  0,438,  0,  0,  0,  0,
    0,286,  0,445,  0,  0,429,280,431,433,436,283,440,443,289,291,448,  0,
    0,  0,  0,306,451,453,459,463,  0,466,468,474,478,  0,  0,  0,  0,488,
    0,  0,  0,  0,  0,326,  0,495,  0,  0,320,481,483,486,323,490,493,329,
  331,498,  0,  0,  0,  0,509,  0,  0,345,501,503,505,507,348,512,  0,515,
    0,519,  0,530,533,  0,545,549,  0,366,  0,521,526,363,535,538,540,369,
  553,559,564,  0,  0,  0,  0,  0,  0,  0,580,  0,  0,  0,  0,  0,391,  0,
  587,  0,  0,569,382,571,385,573,575,578,388,582,585,394,396,590,  0,593,
    0,601,  0,  0,595,597,599,415,604,  0,607,609,  0,611,  0
};

static const unsigned short ag_key_index[] = {
    9,  0, 19, 53, 82,  0,  0, 19, 19, 82, 94, 99, 94,111,128,142,  0,153,
    0, 99,161,182, 94, 99, 99,  0,  0,  0,153,194,201,153,  0,153, 82, 94,
    0,  0,224,  0,  0,224,243,  0,243,270,243,243,243,243,243,294,294,309,
   99, 99,294,315, 99,294,153,153,334,351,161, 99,153,  0,  0, 94,  0, 99,
  153,201,359,194,361,371,  0,  0,  0,224,243,  0,  0,224,224,224,  0,243,
    0,  0,153, 94,  0, 94,  0,  0, 99,153, 99, 99, 99, 99, 99, 99, 99,153,
   99, 99,153, 99, 99, 99, 99, 99, 99,153,182,  0, 99,153,  9,153,  9, 82,
    9, 82,  0, 94,  0,  0,  0,  0,  0,  0,399,413,413,334,418,  0,424,  0,
    0,243,243,153, 99,153,427,  0, 99,153,361, 82
};

static const unsigned char ag_key_ends[] = {
69,71,73,78,0, 85,77,80,0, 79,82,0, 70,0, 82,73,78,84,0, 
69,65,84,0, 85,82,78,0, 84,82,85,67,84,0, 72,73,76,69,0, 47,0, 
42,0, 88,0, 61,0, 61,0, 78,68,0, 71,73,78,0, 86,0, 66,76,69,0, 
77,80,0, 83,69,0, 68,0, 79,82,0, 70,0, 79,78,71,0, 79,68,0, 
79,84,0, 82,0, 82,73,78,84,0, 69,65,84,0, 85,82,78,0, 
82,85,67,84,0, 69,78,0, 78,84,73,76,0, 72,73,76,69,0, 79,82,0, 
69,71,73,78,0, 85,77,80,0, 79,82,0, 70,0, 82,73,78,84,0, 
69,65,84,0, 85,82,78,0, 84,82,85,67,84,0, 72,73,76,69,0, 88,0, 
79,84,0, 69,71,73,78,0, 85,77,80,0, 78,68,0, 79,82,0, 70,0, 
82,73,78,84,0, 69,65,84,0, 85,82,78,0, 84,82,85,67,84,0, 
72,73,76,69,0, 42,0, 61,0, 61,0, 69,71,73,78,0, 85,77,80,0, 
79,82,0, 70,0, 82,73,78,84,0, 69,65,84,0, 85,82,78,0, 
84,82,85,67,84,0, 78,84,73,76,0, 72,73,76,69,0, 88,0, 79,84,0, 
69,71,73,78,0, 85,77,80,0, 78,68,0, 79,82,0, 70,0, 
82,73,78,84,0, 69,65,84,0, 85,82,78,0, 84,82,85,67,84,0, 
72,73,76,69,0, 69,71,73,78,0, 85,77,80,0, 83,69,0, 68,0, 
79,82,0, 70,0, 82,73,78,84,0, 69,65,84,0, 85,82,78,0, 
84,82,85,67,84,0, 78,84,73,76,0, 72,73,76,69,0, 61,0, 
69,71,73,78,0, 85,77,80,0, 79,82,0, 70,0, 82,73,78,84,0, 
69,65,84,0, 85,82,78,0, 84,82,85,67,84,0, 78,84,73,76,0, 
72,73,76,69,0, 42,0, 61,0, 78,68,0, 89,0, 86,0, 79,68,0, 82,0, 
69,78,0, 79,82,0, 42,0, 61,0, 79,68,0, 82,0, 69,78,0, 79,82,0, 
42,0, 61,0, 78,68,0, 89,0, 86,0, 79,68,0, 82,0, 69,78,0, 
79,82,0, 88,0, 79,85,66,76,69,0, 79,78,71,0, 79,84,0, 88,0, 
79,85,66,76,69,0, 79,78,71,0, 79,84,0, 61,0, 78,68,0, 89,0, 
86,0, 79,68,0, 82,0, 69,78,0, 79,82,0, 61,0, 89,0, 79,0, 
82,0, 69,78,0, 79,82,0, 72,69,78,0, 79,0, 69,71,73,78,0, 
85,77,80,0, 83,69,0, 68,0, 79,82,0, 70,0, 82,73,78,84,0, 
69,65,84,0, 85,82,78,0, 84,82,85,67,84,0, 78,84,73,76,0, 
72,73,76,69,0, 42,0, 88,0, 61,0, 78,68,0, 89,0, 86,0, 79,68,0, 
82,0, 69,78,0, 79,82,0, 88,0, 89,0, 79,0, 82,0, 69,78,0, 
79,82,0, 89,0, 79,0, 79,0, 
};

#define AG_TCV(x) ag_tcv[(x)]

static const unsigned char ag_tcv[] = {
    9,149,149,149,149,149,149,149,149,148, 97,148,148,148,149,149,149,149,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,148,149,120,149,
  149,149,149,145,180,179,196,177,172,193,183,197,115,150,150,150,150,150,
  150,150,114,114,149,160,189,187,191,149,149,151,151,151,151,101,151,152,
  152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,
  152,149,142,149,149,152,149,151,151,151,151,101,151,152,152,152,152,152,
  152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,175,149,174,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
  149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,
  149,149,149,149
};

#ifndef SYNTAX_ERROR
#define SYNTAX_ERROR fprintf(stderr,"%s, line %d, column %d\n", \
  (PCB).error_message, (PCB).line, (PCB).column)
#endif

#ifndef FIRST_LINE
#define FIRST_LINE 1
#endif

#ifndef FIRST_COLUMN
#define FIRST_COLUMN 1
#endif

#ifndef PARSER_STACK_OVERFLOW
#define PARSER_STACK_OVERFLOW {fprintf(stderr, \
   "\nParser stack overflow, line %d, column %d\n",\
   (PCB).line, (PCB).column);}
#endif

#ifndef REDUCTION_TOKEN_ERROR
#define REDUCTION_TOKEN_ERROR {fprintf(stderr, \
    "\nReduction token error, line %d, column %d\n", \
    (PCB).line, (PCB).column);}
#endif


#ifndef INPUT_CODE
#define INPUT_CODE(T) (T)
#endif

typedef enum
  {ag_accept_key, ag_set_key, ag_jmp_key, ag_end_key, ag_no_match_key,
   ag_cf_accept_key, ag_cf_set_key, ag_cf_end_key} key_words;

static void ag_get_key_word(PCB_DECL, int ag_k) {
  int ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
  const  unsigned char *ag_p;
  int ag_ch;
  while (1) {
    switch (ag_key_act[ag_k]) {
    case ag_cf_end_key: {
      const  unsigned char *sp = ag_key_ends + ag_key_jmp[ag_k];
      do {
        if ((ag_ch = *sp++) == 0) {
          int ag_k1 = ag_key_parm[ag_k];
          int ag_k2 = ag_key_pt[ag_k1];
          if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)]) goto ag_fail;
          (PCB).token_number = (parse_token_type) ag_key_pt[ag_k1 + 1];
          return;
        }
      } while (CONVERT_CASE(*(PCB).la_ptr++) == ag_ch);
      goto ag_fail;
    }
    case ag_end_key: {
      const  unsigned char *sp = ag_key_ends + ag_key_jmp[ag_k];
      do {
        if ((ag_ch = *sp++) == 0) {
          (PCB).token_number = (parse_token_type) ag_key_parm[ag_k];
          return;
        }
      } while (CONVERT_CASE(*(PCB).la_ptr++) == ag_ch);
    }
    case ag_no_match_key:
ag_fail:
      (PCB).la_ptr = (PCB).pointer + ag_save;
      return;
    case ag_cf_set_key: {
      int ag_k1 = ag_key_parm[ag_k];
      int ag_k2 = ag_key_pt[ag_k1];
      ag_k = ag_key_jmp[ag_k];
      if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)]) break;
      ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
      (PCB).token_number = (parse_token_type) ag_key_pt[ag_k1+1];
      break;
    }
    case ag_set_key:
      ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
      (PCB).token_number = (parse_token_type) ag_key_parm[ag_k];
    case ag_jmp_key:
      ag_k = ag_key_jmp[ag_k];
      break;
    case ag_accept_key:
      (PCB).token_number = (parse_token_type) ag_key_parm[ag_k];
      return;
    case ag_cf_accept_key: {
      int ag_k1 = ag_key_parm[ag_k];
      int ag_k2 = ag_key_pt[ag_k1];
      if (ag_key_itt[ag_k2 + CONVERT_CASE(*(PCB).la_ptr)])
        (PCB).la_ptr = (PCB).pointer + ag_save;
      else (PCB).token_number = (parse_token_type) ag_key_pt[ag_k1+1];
      return;
    }
    }
    ag_ch = CONVERT_CASE(*(PCB).la_ptr++);
    ag_p = &ag_key_ch[ag_k];
    if (ag_ch <= 255) while (*ag_p < ag_ch) ag_p++;
    if (ag_ch > 255 || *ag_p != ag_ch) {
      (PCB).la_ptr = (PCB).pointer + ag_save;
      return;
    }
    ag_k = (int) (ag_p - ag_key_ch);
  }
}


#ifndef AG_NEWLINE
#define AG_NEWLINE 10
#endif

#ifndef AG_RETURN
#define AG_RETURN 13
#endif

#ifndef AG_FORMFEED
#define AG_FORMFEED 12
#endif

#ifndef AG_TABCHAR
#define AG_TABCHAR 9
#endif

static void ag_track(PCB_DECL) {
  int ag_k = (int) ((PCB).la_ptr - (PCB).pointer);
  while (ag_k--) {
    switch (*(PCB).pointer++) {
    case AG_NEWLINE:
      (PCB).column = 1, (PCB).line++;
    case AG_RETURN:
    case AG_FORMFEED:
      break;
    case AG_TABCHAR:
      (PCB).column += (TAB_SPACING) - ((PCB).column - 1) % (TAB_SPACING);
      break;
    default:
      (PCB).column++;
    }
  }
}


static void ag_prot(PCB_DECL) {
  int ag_k;
  ag_k = 128 - ++(PCB).btsx;
  if (ag_k <= (PCB).ssx) {
    (PCB).exit_flag = AG_STACK_ERROR_CODE;
    PARSER_STACK_OVERFLOW;
    return;
  }
  (PCB).bts[(PCB).btsx] = (PCB).sn;
  (PCB).bts[ag_k] = (PCB).ssx;
  (PCB).vs[ag_k] = (PCB).vs[(PCB).ssx];
  (PCB).ss[ag_k] = (PCB).ss[(PCB).ssx];
  (PCB).cs[ag_k] = (PCB).cs[(PCB).ssx];
}

static void ag_undo(PCB_DECL) {
  if ((PCB).drt == -1) return;
  while ((PCB).btsx) {
    int ag_k = 128 - (PCB).btsx;
    (PCB).sn = (PCB).bts[(PCB).btsx--];
    (PCB).ssx = (PCB).bts[ag_k];
    (PCB).vs[(PCB).ssx] = (PCB).vs[ag_k];
    (PCB).ss[(PCB).ssx] = (PCB).ss[ag_k];
    (PCB).cs[(PCB).ssx] = (PCB).cs[ag_k];
  }
  (PCB).token_number = (parse_token_type) (PCB).drt;
  (PCB).ssx = (PCB).dssx;
  (PCB).sn = (PCB).dsn;
  (PCB).drt = -1;
}


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

};


static unsigned const char ag_astt[3037] = {
  8,8,8,8,8,8,8,8,8,8,8,8,1,8,1,1,1,8,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,8,7,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,8,7,1,1,9,9,1,1,5,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,0,1,9,9,9,9,9,9,9,
  9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,5,3,7,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
  9,9,9,9,9,9,9,9,9,9,5,3,7,1,1,1,1,1,1,1,1,1,1,2,2,2,2,7,2,2,2,2,1,1,1,1,2,
  1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5,1,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,
  5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,1,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,
  1,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,10,10,10,1,10,10,
  10,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,1,1,1,7,1,1,3,1,2,2,2,7,1,1,
  1,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,
  1,1,1,1,1,1,1,1,1,1,2,2,2,7,2,1,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,
  1,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,1,1,
  1,5,7,1,1,3,5,5,1,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,
  1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,7,3,1,1,7,2,1,1,1,7,2,1,
  1,1,1,1,1,4,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,
  1,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,7,1,1,1,1,1,1,
  2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,
  1,1,1,1,2,2,2,7,2,1,1,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,
  1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,7,2,2,2,
  1,1,1,1,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,1,5,1,1,1,7,1,1,3,2,2,2,7,
  2,1,1,1,2,2,2,7,2,1,1,1,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,4,4,4,4,4,4,4,4,7,1,10,10,10,4,2,1,1,1,7,2,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,7,1,1,1,1,1,1,1,1,5,5,5,
  5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,1,1,1,7,1,1,3,1,1,7,1,5,2,
  2,2,2,2,5,2,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,5,5,5,5,5,5,5,5,5,10,5,10,2,
  4,5,5,5,7,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,5,5,5,5,5,5,5,5,5,10,5,10,10,4,
  5,5,5,7,2,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,1,1,1,7,1,1,
  3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,1,1,1,7,1,1,3,5,5,5,
  5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,1,1,1,7,1,1,3,1,4,1,1,4,2,1,
  5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,
  5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,4,1,1,1,
  1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,
  1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,5,1,1,
  1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,2,2,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,2,2,1,1,1,1,1,1,1,2,2,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,
  5,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,2,2,2,7,2,2,2,2,1,1,1,1,2,
  1,2,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,
  1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,
  1,1,1,1,1,1,1,1,1,1,1,2,2,2,7,2,1,1,7,2,5,5,1,5,1,1,1,7,1,1,3,2,2,2,7,2,1,
  5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,
  2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,2,2,2,7,2,2,2,2,1,1,1,1,2,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  7,2,1,1,7,1,1,1,7,1,1,5,1,1,1,7,1,1,1,4,1,2,2,2,7,2,1,1,10,10,10,10,10,10,
  10,10,10,10,10,10,10,10,10,10,10,10,10,10,1,1,2,2,2,2,2,2,2,2,2,2,2,2,10,
  10,10,7,2,2,2,2,1,1,1,2,1,1,1,4,2,1,2,2,7,2,2,2,2,2,7,2,2,2,5,2,2,5,2,2,2,
  2,2,5,2,2,7,1,1,1,4,2,1,1,1,8,8,8,7,2,1,1,1,8,8,8,7,2,1,1,1,1,1,4,1,2,2,2,
  1,1,2,2,2,2,7,2,2,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,
  1,1,1,5,1,1,1,1,7,1,1,3,1,7,1,5,1,1,1,1,7,1,1,3,1,7,1,1,7,2,5,5,5,5,5,5,5,
  5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,2,
  2,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,
  1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,
  5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,
  5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,
  1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,2,2,2,1,1,
  2,2,2,2,7,2,2,1,1,2,1,2,2,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,
  5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,
  1,1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,2,2,1,
  1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,
  5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,
  1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,
  5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,2,
  2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,
  1,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,1,1,1,5,7,1,1,3,1,7,2,5,5,5,5,5,5,5,
  5,1,5,5,5,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,
  1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,
  5,1,1,1,7,1,1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,
  1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,1,1,1,7,1,1,
  3,1,1,1,1,1,1,1,1,1,1,2,2,2,7,2,2,2,1,1,1,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,
  1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,1,1,2,2,2,7,
  2,2,2,1,1,1,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,7,2,1,5,5,5,1,5,1,1,
  1,7,1,1,3,2,2,2,7,2,1,1,1,1,7,1,1,2,2,2,7,1,2,2,2,7,1,1,5,1,1,7,2,5,5,5,5,
  5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,5,5,5,1,1,1,7,
  1,1,3,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,4,1,2,2,2,2,2,2,2,1,1,1,1,4,1,2,2,2,2,1,7,2,1,4,7,1,1,1,4,1,2,2,2,
  4,2,1,1,10,10,10,4,2,10,10,10,4,2,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,
  2,1,1,1,1,1,1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,5,5,5,5,5,5,5,5,1,5,5,
  5,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,2,1,1,1,1,1,
  1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,4,1,5,5,5,5,5,5,5,5,1,5,5,
  5,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,2,2,2,1,1,2,2,2,2,7,2,2,1,1,2,1,1,1,1,1,1,
  1,1,1,1,1,1,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,7,1,1,1,1,1,1,1,1,1,1,1,2,2,2,7,
  2,2,2,1,1,1,1,2,1,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1
};


static const unsigned short ag_pstt[] = {
4,4,4,4,4,4,4,4,4,4,4,4,3,4,3,1,2,4,0,3,3,4,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,1,5,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,2,7,8,
285,285,1,2,287,285,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,4,0,9,
96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,96,
  98,
99,6,
91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,91,
  91,93,
94,8,
10,11,12,13,24,22,23,15,19,21,100,100,100,1,9,59,3,3,3,34,33,32,29,13,30,18,
  13,28,27,26,25,30,33,32,31,20,18,17,16,14,
286,286,286,3,286,3,1,2,10,3,3,309,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,11,3,3,306,
286,286,3,286,3,1,2,12,3,3,304,
286,286,286,286,286,286,286,286,286,286,286,286,286,3,286,3,1,2,13,3,3,302,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
  101,101,101,3,101,101,101,3,1,2,14,3,3,303,
286,286,286,286,286,286,286,286,286,286,286,286,286,3,286,3,1,2,15,3,3,295,
35,100,100,100,16,37,36,14,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,17,66,67,51,52,69,32,56,63,
  62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
100,100,100,18,30,14,
286,286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,19,3,3,
  294,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,20,64,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,3,286,3,1,2,286,
  21,3,3,293,
286,286,3,286,3,1,2,22,3,3,298,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,23,3,3,297,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,24,3,3,300,
21,25,23,
65,21,26,22,66,
65,21,27,21,67,
54,55,40,53,58,40,100,100,120,41,38,128,126,120,100,28,66,67,51,52,69,68,56,
  68,63,62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,
  42,
69,71,29,72,70,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,30,73,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,31,66,67,51,52,69,74,56,63,
  62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
100,100,100,32,59,75,14,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,33,66,67,51,52,69,76,56,63,
  62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
10,11,12,13,24,22,23,15,19,21,100,100,100,34,59,6,6,77,34,33,32,29,13,30,18,
  13,28,27,26,25,30,33,32,31,20,18,17,16,14,
286,286,3,286,3,1,2,35,3,3,308,
100,100,100,36,38,78,14,
35,100,100,100,37,38,80,79,14,
135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,
  135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,
  38,81,
125,125,125,109,125,
82,82,82,40,107,82,
88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,88,84,83,152,151,150,
  149,148,147,146,145,144,143,142,88,88,88,88,41,88,88,88,87,86,85,88,88,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
  286,286,286,286,286,286,3,286,3,1,2,42,3,3,337,
89,90,43,
91,102,
131,130,130,130,131,119,129,
118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,118,110,118,118,
  118,118,118,118,118,118,118,127,118,127,124,110,118,118,118,46,
117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117,108,117,117,
  117,117,117,117,117,117,117,121,117,121,121,108,117,117,117,47,121,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
  286,286,286,286,286,286,3,3,1,2,48,3,3,319,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
  286,286,286,286,286,286,3,3,1,2,49,3,3,318,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
  286,286,286,286,286,286,3,3,1,2,50,3,3,317,
53,59,92,
38,68,133,42,
286,286,286,286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,
  53,3,3,313,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,54,3,3,336,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,55,3,3,326,
69,55,70,
54,55,40,93,95,53,58,100,100,120,41,38,128,126,120,100,57,66,67,51,52,69,97,
  56,63,62,62,62,61,60,59,57,59,59,96,94,52,87,88,44,43,47,39,46,45,14,50,
  49,48,42,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,58,3,3,310,
98,51,99,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,60,66,67,51,52,69,56,50,50,
  61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,61,66,67,51,52,69,56,49,49,
  61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
100,101,102,103,104,105,106,44,107,80,81,82,83,84,85,86,
108,109,55,111,112,113,114,115,116,58,42,117,110,76,70,71,72,73,74,75,77,78,
  79,
10,11,12,13,118,24,22,23,15,19,21,100,100,100,64,59,3,3,3,34,33,32,29,13,30,
  18,13,28,27,26,25,30,33,32,31,20,29,18,17,16,14,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,65,3,3,305,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,66,66,67,51,52,69,33,56,63,
  62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
100,100,100,67,31,14,
21,68,20,
286,286,3,286,3,1,2,69,3,3,316,
100,100,100,70,60,14,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,71,3,3,291,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,72,66,67,51,52,69,119,56,
  63,62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
10,11,12,13,24,22,23,120,15,19,21,100,100,100,73,59,3,3,3,34,33,32,29,13,30,
  121,18,13,28,27,26,25,30,121,33,32,31,20,18,17,16,14,
122,74,28,
69,71,75,123,70,
124,76,125,
126,5,127,
129,65,78,128,130,
65,37,128,
100,100,100,80,38,131,14,
136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,
  136,84,83,152,151,150,149,148,147,146,145,144,143,142,134,136,136,136,
  81,136,136,136,136,87,86,85,136,
82,82,82,115,116,82,
156,156,83,
162,161,161,161,162,84,159,
158,158,154,
157,157,153,
162,161,161,161,162,141,160,
163,88,
82,82,82,106,105,82,
132,133,133,133,133,90,104,133,
132,133,133,133,133,91,103,133,
54,55,40,53,62,58,100,100,120,41,38,128,126,120,100,92,66,67,51,52,69,64,56,
  63,62,62,62,61,60,59,57,59,59,135,134,52,87,88,44,43,47,39,46,45,14,50,
  49,48,42,
286,3,3,1,2,93,3,3,315,
136,94,137,
286,3,3,1,2,95,3,3,314,
136,96,138,
136,97,53,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,98,3,3,311,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,99,66,67,51,52,69,56,52,52,
  61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,100,3,3,335,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,101,3,3,334,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,102,3,3,333,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,103,3,3,332,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,104,3,3,331,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,105,3,3,330,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,106,3,3,329,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,107,66,67,51,52,69,56,47,
  47,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,108,3,3,328,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,109,3,3,327,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,110,66,67,51,52,69,56,139,
  139,139,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,111,3,3,325,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,112,3,3,324,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,113,3,3,323,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,114,3,3,322,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,115,3,3,321,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,116,3,3,320,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,117,66,67,51,52,69,56,140,
  62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,3,286,3,1,2,286,
  118,3,3,301,
21,119,17,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,120,3,3,296,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,121,66,67,51,52,69,141,56,
  63,62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
286,286,286,286,286,286,286,286,286,286,286,286,3,286,3,1,2,122,3,3,299,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,123,66,67,51,52,69,142,56,
  63,62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
286,286,286,286,286,286,286,286,286,286,286,286,3,286,3,1,2,124,3,3,289,
10,11,12,13,24,22,23,15,19,21,100,100,100,125,59,8,11,34,33,32,29,13,30,18,
  13,28,27,26,25,30,33,32,31,20,18,17,16,14,
286,286,286,286,286,286,286,286,286,286,286,286,3,286,3,1,2,126,3,3,288,
10,11,12,13,24,22,23,15,19,21,100,100,100,127,59,7,10,34,33,32,29,13,30,18,
  13,28,27,26,25,30,33,32,31,20,18,17,16,14,
100,100,100,128,39,14,
286,286,286,3,286,3,1,2,129,3,3,307,
100,100,100,130,38,143,14,
129,65,131,128,144,
122,122,122,132,145,
122,122,122,133,146,
65,63,147,
136,135,61,
286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,286,
  286,286,286,286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,
  1,2,136,3,3,312,
40,53,100,100,120,41,38,128,126,120,100,137,66,67,51,52,69,56,58,57,58,58,
  52,44,43,47,39,46,45,14,50,49,48,42,
40,53,100,100,120,41,38,128,126,120,100,138,66,67,51,52,69,56,57,57,57,57,
  52,44,43,47,39,46,45,14,50,49,48,42,
100,101,102,103,104,105,106,45,107,80,81,82,83,84,85,86,
108,109,55,58,43,110,76,77,78,79,
21,141,16,
148,14,142,150,149,
65,36,128,
100,100,100,35,38,151,14,
123,123,123,114,123,
123,123,123,113,123,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,147,66,67,51,52,69,65,56,
  63,62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,148,3,3,292,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,149,66,67,51,52,69,15,56,
  63,62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
152,150,153,
65,34,128,
286,286,286,286,286,286,286,286,3,286,286,286,286,286,286,3,1,2,152,3,3,290,
54,55,40,53,58,100,100,120,41,38,128,126,120,100,153,66,67,51,52,69,154,56,
  63,62,62,62,61,60,59,57,59,59,52,87,88,44,43,47,39,46,45,14,50,49,48,42,
124,154,155,
10,11,12,13,24,22,23,15,19,21,100,100,100,155,59,9,12,34,33,32,29,13,30,18,
  13,28,27,26,25,30,33,32,31,20,18,17,16,14,

};


static const unsigned short ag_sbt[] = {
     0,  22,  51,  81,  87, 104, 130, 132, 159, 161, 201, 213, 235, 246,
   268, 301, 323, 331, 377, 383, 406, 422, 447, 458, 480, 502, 505, 510,
   515, 563, 568, 584, 630, 637, 683, 722, 733, 740, 749, 788, 793, 799,
   844, 878, 881, 883, 890, 925, 961, 994,1027,1060,1063,1067,1092,1114,
  1136,1139,1189,1211,1214,1257,1300,1316,1339,1380,1402,1448,1454,1457,
  1468,1474,1496,1542,1584,1587,1592,1595,1598,1603,1606,1613,1659,1665,
  1668,1675,1678,1681,1688,1690,1696,1704,1712,1761,1770,1773,1782,1785,
  1788,1810,1853,1875,1897,1919,1941,1963,1985,2007,2050,2072,2094,2138,
  2160,2182,2204,2226,2248,2270,2315,2340,2343,2365,2411,2432,2478,2499,
  2537,2558,2596,2602,2614,2621,2626,2631,2636,2639,2642,2686,2720,2754,
  2770,2780,2783,2788,2791,2798,2803,2808,2854,2876,2922,2925,2928,2950,
  2996,2999,3037
};


static const unsigned short ag_sbe[] = {
    18,  48,  78,  85, 101, 129, 131, 158, 160, 175, 209, 231, 242, 264,
   297, 319, 327, 345, 380, 402, 420, 443, 454, 476, 498, 503, 507, 512,
   530, 565, 582, 598, 633, 651, 696, 729, 736, 744, 786, 791, 796, 835,
   874, 880, 882, 888, 924, 959, 990,1023,1056,1061,1064,1088,1110,1132,
  1137,1155,1207,1212,1228,1271,1307,1326,1353,1398,1416,1451,1455,1464,
  1471,1492,1510,1556,1585,1589,1593,1596,1600,1604,1609,1650,1662,1667,
  1673,1677,1680,1686,1689,1693,1701,1709,1727,1766,1771,1778,1783,1786,
  1806,1824,1871,1893,1915,1937,1959,1981,2003,2021,2068,2090,2108,2156,
  2178,2200,2222,2244,2266,2284,2336,2341,2361,2379,2428,2446,2495,2512,
  2554,2571,2599,2610,2617,2623,2629,2634,2637,2640,2682,2697,2731,2761,
  2774,2781,2785,2789,2794,2801,2806,2822,2872,2890,2923,2926,2946,2964,
  2997,3012,3037
};


static const unsigned char ag_fl[] = {
  2,2,0,2,1,1,2,4,4,9,4,4,9,1,0,2,5,4,1,1,3,2,2,2,1,1,1,1,3,3,2,3,2,3,6,
  5,5,3,1,3,0,1,1,3,1,3,1,3,1,2,2,1,3,3,1,1,1,4,4,1,3,4,0,1,1,3,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,0,1,3,1,2,0,1,3,1,2,1,3,3,
  3,2,2,1,1,1,0,1,2,2,1,2,1,1,1,1,2,1,2,2,2,1,2,1,2,1,1,1,2,3,0,2,1,1,1,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,1,1,3,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
  1,1,1,1,1,2,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
  2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
};

static const unsigned char ag_ptt[] = {
    0,  7,  8,  8, 10, 10, 11, 11, 11, 11, 12, 12, 12, 12, 21, 21, 23, 23,
   23, 23, 23, 23, 23, 23, 25, 26, 15, 18, 13, 28, 31, 31, 32, 32, 33, 33,
   33, 33, 47, 47, 30, 30, 16, 16, 49, 49, 51, 51, 53, 53, 53, 55, 55, 58,
   58, 58, 58, 58, 58, 19, 19, 63, 67, 67, 68, 68, 62, 62, 62, 62, 50, 50,
   50, 50, 50, 50, 52, 52, 52, 52, 54, 54, 54, 54, 54, 54, 54, 57, 57,  1,
   90, 90, 91, 91,  1, 95, 95, 96, 96,  1,170,170,185,185,185,100,100,100,
  103,103,103,108,108,102,102,104,104,184,184,184,105,105,109,109,106,106,
  107,107,111,111,118,118, 69, 69,204,121,121,122,122,124,124,124,125,125,
  125,125,125,125,125,125,125,125,125,126,126,126,139,140,141,127,127,144,
  144,186,146,146,110, 87, 87, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
   89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 94, 94, 94,
   94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
   94, 94, 94, 94, 98, 98, 98, 99, 99, 99, 99, 99, 99,112,112,113,113,113,
  116,116,119,119,123,123,123,123,123,123,123,123,123,123,123,123,123,123,
  123,123,123,123,123,123,123,123,123,147,147,147,147,147,147,147,147,147,
  147,147,147,147,147,147,147,147,147,147,147,147,147,147,153,153,154,154,
   14, 17, 22, 20, 24, 27, 29, 34, 35, 36, 37, 39, 38, 41, 40,  4, 42, 43,
   44, 48, 46, 45, 56, 59, 61, 60, 64, 65, 66,  2,  3,  6, 70, 71, 72, 73,
   74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86,  5
};


static void ag_ra(PCB_DECL)
{
  switch(ag_rpx[(PCB).ag_ap]) {
    case 1: ag_rp_1(PCB_POINTER, VW(0, AG_WRAP_6 *)); 
            VWD(0, AG_WRAP_6 *); break;
    case 2: VNO AG_WRAP_6(ag_rp_2(PCB_POINTER)); break;
    case 3: VRO(AG_WRAP_6 *, ag_rp_3(PCB_POINTER, VW(0, AG_WRAP_6 *), V(1,(AstNode * *)))); break;
    case 4: V(0,(AstNode * *)) = ag_rp_4(PCB_POINTER, V(0,(AstNode * *)), V(1,(AstNode * *))); break;
    case 5: V(0,(AstNode * *)) = ag_rp_5(PCB_POINTER, V(0,(AstNode * *)), V(1,(AstNode * *)), V(3,(AstNode * *))); break;
    case 6: V(0,(AstNode * *)) = ag_rp_6(PCB_POINTER, V(1,(AstNode * *)), V(3,(AstNode * *))); break;
    case 7: V(0,(AstNode * *)) = ag_rp_7(PCB_POINTER, V(1,(AstNode * *)), V(3,(AstNode * *)), V(4,(AstNode * *)), V(6,(AstNode * *)), V(8,(AstNode * *))); break;
    case 8: V(0,(AstNode * *)) = ag_rp_8(PCB_POINTER, V(0,(AstNode * *)), V(1,(AstNode * *)), V(3,(AstNode * *))); break;
    case 9: V(0,(AstNode * *)) = ag_rp_9(PCB_POINTER, V(1,(AstNode * *)), V(3,(AstNode * *))); break;
    case 10: V(0,(AstNode * *)) = ag_rp_10(PCB_POINTER, V(1,(AstNode * *)), V(3,(AstNode * *)), V(4,(AstNode * *)), V(6,(AstNode * *)), V(8,(AstNode * *))); break;
    case 11: V(0,(AstNode * *)) = ag_rp_11(PCB_POINTER, V(0,(AstNode * *))); break;
    case 12: V(0,(AstNode * *)) = ag_rp_12(PCB_POINTER); break;
    case 13: V(0,(AstNode * *)) = ag_rp_13(PCB_POINTER, V(1,(AstNode * *))); break;
    case 14: V(0,(AstNode * *)) = ag_rp_14(PCB_POINTER, VW(1, AG_WRAP_6 *), V(3,(AstNode * *))); 
            VWD(1, AG_WRAP_6 *); break;
    case 15: V(0,(AstNode * *)) = ag_rp_15(PCB_POINTER, V(0,(AstNode * *)), V(2,(AstNode * *))); break;
    case 16: V(0,(AstNode * *)) = ag_rp_16(PCB_POINTER); break;
    case 17: V(0,(AstNode * *)) = ag_rp_17(PCB_POINTER, V(1,(AstNode * *))); break;
    case 18: V(0,(AstNode * *)) = VDO(AG_WRAP_6 *, ag_rp_18(PCB_POINTER, VW(0, AG_WRAP_6 *))); break;
    case 19: V(0,(AstNode * *)) = VDO(AG_WRAP_6 *, ag_rp_19(PCB_POINTER, VW(0, AG_WRAP_6 *))); break;
    case 20: V(0,(AstNode * *)) = ag_rp_20(PCB_POINTER, V(1,(AstNode * *))); break;
    case 21: V(0,(AstNode * *)) = ag_rp_21(PCB_POINTER, VW(1, AG_WRAP_6 *)); 
            VWD(1, AG_WRAP_6 *); break;
    case 22: VNO AG_WRAP_6(ag_rp_22(PCB_POINTER, VW(1, AG_WRAP_4 *))); 
            VWD(1, AG_WRAP_4 *); break;
    case 23: VRO(AG_WRAP_6 *, ag_rp_23(PCB_POINTER, VW(0, AG_WRAP_6 *), VW(2, AG_WRAP_4 *))); 
            VWD(2, AG_WRAP_4 *); break;
    case 24: VNO AG_WRAP_6(ag_rp_24(PCB_POINTER, V(1,(AstNode * *)))); break;
    case 25: VRO(AG_WRAP_6 *, ag_rp_25(PCB_POINTER, VW(0, AG_WRAP_6 *), V(2,(AstNode * *)))); break;
    case 26: V(0,(AstNode * *)) = ag_rp_26(PCB_POINTER, VW(1, AG_WRAP_4 *), VW(3, AG_WRAP_7 *), VW(5, AG_WRAP_7 *)); 
            VWD(1, AG_WRAP_4 *); VWD(3, AG_WRAP_7 *); VWD(5, AG_WRAP_7 *); break;
    case 27: V(0,(AstNode * *)) = ag_rp_27(PCB_POINTER, VW(1, AG_WRAP_4 *), VW(3, AG_WRAP_7 *)); 
            VWD(1, AG_WRAP_4 *); VWD(3, AG_WRAP_7 *); break;
    case 28: V(0,(AstNode * *)) = ag_rp_28(PCB_POINTER, VW(2, AG_WRAP_7 *), VW(4, AG_WRAP_7 *)); 
            VWD(2, AG_WRAP_7 *); VWD(4, AG_WRAP_7 *); break;
    case 29: V(0,(AstNode * *)) = ag_rp_29(PCB_POINTER, VW(1, AG_WRAP_4 *), VW(2, AG_WRAP_7 *)); 
            VWD(1, AG_WRAP_4 *); VWD(2, AG_WRAP_7 *); break;
    case 30: VRO(AG_WRAP_4 *, ag_rp_30(PCB_POINTER, VW(0, AG_WRAP_4 *))); break;
    case 31: VRO(AG_WRAP_7 *, ag_rp_31(PCB_POINTER, VW(0, AG_WRAP_7 *), VW(2, AG_WRAP_4 *))); 
            VWD(2, AG_WRAP_4 *); break;
    case 32: V(0,(AstNode * *)) = ag_rp_32(PCB_POINTER); break;
    case 33: V(0,(AstNode * *)) = ag_rp_33(PCB_POINTER, V(0,(AstNode * *)), V(1,(Opcode *)), V(2,(AstNode * *))); break;
    case 34: V(0,(AstNode * *)) = ag_rp_34(PCB_POINTER, V(0,(AstNode * *)), V(1,(Opcode *)), V(2,(AstNode * *))); break;
    case 35: V(0,(AstNode * *)) = ag_rp_35(PCB_POINTER, V(0,(AstNode * *)), V(1,(Opcode *)), V(2,(AstNode * *))); break;
    case 36: V(0,(AstNode * *)) = ag_rp_36(PCB_POINTER, V(1,(AstNode * *))); break;
    case 37: V(0,(AstNode * *)) = ag_rp_37(PCB_POINTER, V(0,(Opcode *)), V(1,(AstNode * *))); break;
    case 38: V(0,(AstNode * *)) = ag_rp_38(PCB_POINTER, V(0,(AstNode * *)), V(2,(AstNode * *))); break;
    case 39: V(0,(AstNode * *)) = ag_rp_39(PCB_POINTER, V(1,(AstNode * *))); break;
    case 40: V(0,(AstNode * *)) = ag_rp_40(PCB_POINTER, V(0,(AstNode * *))); break;
    case 41: V(0,(AstNode * *)) = ag_rp_41(PCB_POINTER, V(3,(AstNode * *))); break;
    case 42: V(0,(AstNode * *)) = ag_rp_42(PCB_POINTER, V(3,(AstNode * *))); break;
    case 43: V(0,(AstNode * *)) = VDO(AG_WRAP_4 *, ag_rp_43(PCB_POINTER, VW(0, AG_WRAP_4 *))); break;
    case 44: V(0,(AstNode * *)) = ag_rp_44(PCB_POINTER, V(0,(AstNode * *)), VW(2, AG_WRAP_4 *)); 
            VWD(2, AG_WRAP_4 *); break;
    case 45: V(0,(AstNode * *)) = VDO(AG_WRAP_4 *, ag_rp_45(PCB_POINTER, VW(0, AG_WRAP_4 *), VW(2, AG_WRAP_6 *))); 
            VWD(2, AG_WRAP_6 *); break;
    case 46: VNO AG_WRAP_6(ag_rp_46(PCB_POINTER)); break;
    case 47: VNO AG_WRAP_6(ag_rp_47(PCB_POINTER, V(0,(AstNode * *)))); break;
    case 48: VRO(AG_WRAP_6 *, ag_rp_48(PCB_POINTER, VW(0, AG_WRAP_6 *), V(2,(AstNode * *)))); break;
    case 49: V(0,(AstNode * *)) = ag_rp_49(PCB_POINTER, V(0,(long *))); break;
    case 50: V(0,(AstNode * *)) = ag_rp_50(PCB_POINTER, V(0,(double *))); break;
    case 51: V(0,(AstNode * *)) = VDO(AG_WRAP_5 *, ag_rp_51(PCB_POINTER, VW(0, AG_WRAP_5 *))); break;
    case 52: V(0,(AstNode * *)) = ag_rp_52(PCB_POINTER, V(0,(int *))); break;
    case 53: V(0,(Opcode *)) = ag_rp_53(PCB_POINTER); break;
    case 54: V(0,(Opcode *)) = ag_rp_54(PCB_POINTER); break;
    case 55: V(0,(Opcode *)) = ag_rp_55(PCB_POINTER); break;
    case 56: V(0,(Opcode *)) = ag_rp_56(PCB_POINTER); break;
    case 57: V(0,(Opcode *)) = ag_rp_57(PCB_POINTER); break;
    case 58: V(0,(Opcode *)) = ag_rp_58(PCB_POINTER); break;
    case 59: V(0,(Opcode *)) = ag_rp_59(PCB_POINTER); break;
    case 60: V(0,(Opcode *)) = ag_rp_60(PCB_POINTER); break;
    case 61: V(0,(Opcode *)) = ag_rp_61(PCB_POINTER); break;
    case 62: V(0,(Opcode *)) = ag_rp_62(PCB_POINTER); break;
    case 63: V(0,(Opcode *)) = ag_rp_63(PCB_POINTER); break;
    case 64: V(0,(Opcode *)) = ag_rp_64(PCB_POINTER); break;
    case 65: V(0,(Opcode *)) = ag_rp_65(PCB_POINTER); break;
    case 66: V(0,(Opcode *)) = ag_rp_66(PCB_POINTER); break;
    case 67: V(0,(Opcode *)) = ag_rp_67(PCB_POINTER); break;
    case 68: V(0,(Opcode *)) = ag_rp_68(PCB_POINTER); break;
    case 69: V(0,(Opcode *)) = ag_rp_69(PCB_POINTER); break;
    case 70: V(0,(Opcode *)) = ag_rp_70(PCB_POINTER); break;
    case 71: V(0,(Opcode *)) = ag_rp_71(PCB_POINTER); break;
    case 72: VNO AG_WRAP_4(ag_rp_72(PCB_POINTER, V(0,(int *)))); break;
    case 73: VRO(AG_WRAP_4 *, ag_rp_73(PCB_POINTER, VW(0, AG_WRAP_4 *), V(1,(int *)))); break;
    case 74: V(0,(double *)) = ag_rp_74(PCB_POINTER, V(0,(double *)), V(2,(long *))); break;
    case 75: V(0,(double *)) = ag_rp_75(PCB_POINTER, V(0,(double *)), V(2,(long *))); break;
    case 76: V(0,(double *)) = ag_rp_76(PCB_POINTER, V(0,(double *)), V(2,(double *))); break;
    case 77: V(0,(double *)) = ag_rp_77(PCB_POINTER, V(0,(double *))); break;
    case 78: V(0,(double *)) = ag_rp_78(PCB_POINTER, V(1,(double *))); break;
    case 79: V(0,(double *)) = ag_rp_79(PCB_POINTER, V(0,(long *))); break;
    case 80: V(0,(double *)) = ag_rp_80(PCB_POINTER, V(0,(long *))); break;
    case 81: V(0,(double *)) = ag_rp_81(PCB_POINTER, V(0,(long *))); break;
    case 82: V(0,(long *)) = ag_rp_82(PCB_POINTER, V(1,(long *))); break;
    case 83: V(0,(long *)) = ag_rp_83(PCB_POINTER, V(1,(long *))); break;
    case 84: V(0,(double *)) = ag_rp_84(PCB_POINTER, V(0,(int *))); break;
    case 85: V(0,(double *)) = ag_rp_85(PCB_POINTER, V(0,(int *)), V(1,(double *))); break;
    case 86: V(0,(long *)) = ag_rp_86(PCB_POINTER, V(0,(int *))); break;
    case 87: V(0,(long *)) = ag_rp_87(PCB_POINTER, V(0,(long *)), V(1,(int *))); break;
    case 88: V(0,(long *)) = ag_rp_88(PCB_POINTER, V(0,(int *))); break;
    case 89: V(0,(long *)) = ag_rp_89(PCB_POINTER, V(0,(long *)), V(1,(int *))); break;
    case 90: V(0,(long *)) = ag_rp_90(PCB_POINTER, V(0,(long *)), V(1,(int *))); break;
    case 91: V(0,(long *)) = ag_rp_91(PCB_POINTER, V(0,(long *)), V(1,(int *))); break;
    case 92: V(0,(long *)) = ag_rp_92(PCB_POINTER); break;
    case 93: V(0,(long *)) = ag_rp_93(PCB_POINTER, V(0,(long *)), V(1,(int *))); break;
    case 94: V(0,(long *)) = ag_rp_94(PCB_POINTER); break;
    case 95: V(0,(long *)) = ag_rp_95(PCB_POINTER, V(0,(long *)), V(1,(int *))); break;
    case 96: V(0,(int *)) = ag_rp_96(PCB_POINTER, V(0,(int *))); break;
    case 97: V(0,(int *)) = ag_rp_97(PCB_POINTER, V(0,(int *))); break;
    case 98: VRO(AG_WRAP_5 *, ag_rp_98(PCB_POINTER, VW(0, AG_WRAP_5 *), VW(1, AG_WRAP_5 *))); 
            VWD(1, AG_WRAP_5 *); break;
    case 99: VNO AG_WRAP_5(ag_rp_99(PCB_POINTER, VW(1, AG_WRAP_4 *))); 
            VWD(1, AG_WRAP_4 *); break;
    case 100: VNO AG_WRAP_4(ag_rp_100(PCB_POINTER)); break;
    case 101: VRO(AG_WRAP_4 *, ag_rp_101(PCB_POINTER, VW(0, AG_WRAP_4 *), V(1,(int *)))); break;
    case 102: V(0,(int *)) = ag_rp_102(PCB_POINTER); break;
    case 103: V(0,(int *)) = ag_rp_103(PCB_POINTER); break;
    case 104: V(0,(int *)) = ag_rp_104(PCB_POINTER); break;
    case 105: V(0,(int *)) = ag_rp_105(PCB_POINTER); break;
    case 106: V(0,(int *)) = ag_rp_106(PCB_POINTER); break;
    case 107: V(0,(int *)) = ag_rp_107(PCB_POINTER); break;
    case 108: V(0,(int *)) = ag_rp_108(PCB_POINTER); break;
    case 109: V(0,(int *)) = ag_rp_109(PCB_POINTER); break;
    case 110: V(0,(int *)) = ag_rp_110(PCB_POINTER); break;
    case 111: V(0,(int *)) = ag_rp_111(PCB_POINTER); break;
    case 112: V(0,(int *)) = ag_rp_112(PCB_POINTER); break;
    case 113: V(0,(int *)) = ag_rp_113(PCB_POINTER, V(1,(int *))); break;
    case 114: V(0,(int *)) = ag_rp_114(PCB_POINTER, V(0,(int *)), V(1,(int *))); break;
    case 115: V(0,(int *)) = ag_rp_115(PCB_POINTER, V(0,(int *)), V(1,(int *))); break;
    case 116: V(0,(int *)) = ag_rp_116(PCB_POINTER, V(1,(int *))); break;
    case 117: V(0,(int *)) = ag_rp_117(PCB_POINTER, V(0,(int *)), V(1,(int *))); break;
    case 118: V(0,(int *)) = ag_rp_118(PCB_POINTER, V(0,(int *))); break;
    case 119: V(0,(int *)) = ag_rp_119(PCB_POINTER, V(0,(int *))); break;
    case 120: V(0,(int *)) = ag_rp_120(PCB_POINTER, V(1,(int *))); break;
  }
  (PCB).la_ptr = (PCB).pointer;
}

#define TOKEN_NAMES parse_token_names
const char *const parse_token_names[205] = {
  "script",
  "white space",
  "integer",
  "real",
  "name",
  "string element",
  "character constant",
  "script",
  "statement list",
  "eof",
  "statement",
  "open statement",
  "closed statement",
  "if condition",
  "\"ELSE\"",
  "WHILE",
  "expression",
  "\"DO\"",
  "FOR",
  "lvalue",
  "\":=\"",
  "for increment",
  "\"TO\"",
  "simple statement",
  "\"BY\"",
  "REPEAT",
  "UNTIL",
  "';'",
  "compound statement",
  "\"RETURN\"",
  "optional expression",
  "dump statement",
  "print statement",
  "structure declaration",
  "\"REPEAT\"",
  "\"UNTIL\"",
  "\"WHILE\"",
  "\"FOR\"",
  "\"IF\"",
  "\"THEN\"",
  "\"BEGIN\"",
  "\"END\"",
  "\"DUMP\"",
  "','",
  "\"PRINT\"",
  "\"STRUCT\"",
  "'{'",
  "name list",
  "'}'",
  "simple expression",
  "relational op",
  "term",
  "additive op",
  "unary expression",
  "multiplicative op",
  "factor",
  "'+'",
  "unary op",
  "primary",
  "\"**\"",
  "'('",
  "')'",
  "constant",
  "function call",
  "\"LONG\"",
  "\"DOUBLE\"",
  "'.'",
  "optional arg list",
  "arg list",
  "string",
  "'='",
  "\"<>\"",
  "'<'",
  "\"<=\"",
  "'>'",
  "\">=\"",
  "'-'",
  "\"OR\"",
  "\"XOR\"",
  "'*'",
  "'/'",
  "\"DIV\"",
  "\"MOD\"",
  "\"AND\"",
  "\"SHL\"",
  "\"SHR\"",
  "\"NOT\"",
  "space",
  "\"/*\"",
  "",
  "",
  "",
  "\"*/\"",
  "\"//\"",
  "",
  "",
  "",
  "'\\n'",
  "letter",
  "",
  "simple real",
  "",
  "signed exponent",
  "integer part",
  "fraction part",
  "decimal integer",
  "hybrid integer",
  "octal integer",
  "",
  "exponent",
  "digit",
  "hex integer",
  "",
  "",
  "",
  "'0'",
  "",
  "\"0X\"",
  "hex digit",
  "",
  "'\\\"'",
  "s char sequence",
  "s char",
  "",
  "escape sequence",
  "simple escape sequence",
  "octal escape sequence",
  "hexadecimal escape sequence",
  "\"\\\\\\'\"",
  "\"\\\\\\\"\"",
  "\"\\\\?\"",
  "\"\\\\\\\\\"",
  "\"\\\\A\"",
  "\"\\\\B\"",
  "\"\\\\F\"",
  "\"\\\\N\"",
  "\"\\\\R\"",
  "\"\\\\T\"",
  "\"\\\\V\"",
  "one octal",
  "two octal",
  "three octal",
  "'\\\\'",
  "\"\\\\X\"",
  "hexadecimal digit",
  "'\\''",
  "c char",
  "",
  "",
  "",
  "",
  "",
  "",
  "",
  "",
  "\"ELSE\"",
  "\"DO\"",
  "\"TO\"",
  "\":=\"",
  "\"BY\"",
  "';'",
  "\"RETURN\"",
  "\"REPEAT\"",
  "\"UNTIL\"",
  "\"WHILE\"",
  "\"FOR\"",
  "\"THEN\"",
  "\"IF\"",
  "\"END\"",
  "\"BEGIN\"",
  "name",
  "\"DUMP\"",
  "','",
  "\"PRINT\"",
  "'}'",
  "'{'",
  "\"STRUCT\"",
  "'+'",
  "\"**\"",
  "')'",
  "'('",
  "\"LONG\"",
  "\"DOUBLE\"",
  "'.'",
  "integer",
  "real",
  "character constant",
  "'='",
  "\"<>\"",
  "'<'",
  "\"<=\"",
  "'>'",
  "\">=\"",
  "'-'",
  "\"OR\"",
  "\"XOR\"",
  "'*'",
  "'/'",
  "\"DIV\"",
  "\"MOD\"",
  "\"AND\"",
  "\"SHL\"",
  "\"SHR\"",
  "\"NOT\"",
  "string element",

};

#ifndef MISSING_FORMAT
#define MISSING_FORMAT "Missing %s"
#endif
#ifndef UNEXPECTED_FORMAT
#define UNEXPECTED_FORMAT "Unexpected %s"
#endif
#ifndef UNNAMED_TOKEN
#define UNNAMED_TOKEN "input"
#endif


static void ag_diagnose(PCB_DECL) {
  int ag_snd = (PCB).sn;
  int ag_k = ag_sbt[ag_snd];

  if (*TOKEN_NAMES[ag_tstt[ag_k]] && ag_astt[ag_k + 1] == ag_action_8) {
    sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
  }
  else if (ag_astt[ag_sbe[(PCB).sn]] == ag_action_8
          && (ag_k = (int) ag_sbe[(PCB).sn] + 1) == (int) ag_sbt[(PCB).sn+1] - 1
          && *TOKEN_NAMES[ag_tstt[ag_k]]) {
    sprintf((PCB).ag_msg, MISSING_FORMAT, TOKEN_NAMES[ag_tstt[ag_k]]);
  }
  else if ((PCB).token_number && *TOKEN_NAMES[(PCB).token_number]) {
    sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, TOKEN_NAMES[(PCB).token_number]);
  }
  else if (isprint(INPUT_CODE((*(PCB).pointer))) && INPUT_CODE((*(PCB).pointer)) != '\\') {
    char buf[20];
    sprintf(buf, "\'%c\'", (char) INPUT_CODE((*(PCB).pointer)));
    sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, buf);
  }
  else sprintf((PCB).ag_msg, UNEXPECTED_FORMAT, UNNAMED_TOKEN);
  (PCB).error_message = (PCB).ag_msg;


}
static int ag_action_1_r_proc(PCB_DECL);
static int ag_action_2_r_proc(PCB_DECL);
static int ag_action_3_r_proc(PCB_DECL);
static int ag_action_4_r_proc(PCB_DECL);
static int ag_action_1_s_proc(PCB_DECL);
static int ag_action_3_s_proc(PCB_DECL);
static int ag_action_1_proc(PCB_DECL);
static int ag_action_2_proc(PCB_DECL);
static int ag_action_3_proc(PCB_DECL);
static int ag_action_4_proc(PCB_DECL);
static int ag_action_5_proc(PCB_DECL);
static int ag_action_6_proc(PCB_DECL);
static int ag_action_7_proc(PCB_DECL);
static int ag_action_8_proc(PCB_DECL);
static int ag_action_9_proc(PCB_DECL);
static int ag_action_10_proc(PCB_DECL);
static int ag_action_11_proc(PCB_DECL);
static int ag_action_8_proc(PCB_DECL);


static int (*const  ag_r_procs_scan[])(PCB_DECL) = {
  ag_action_1_r_proc,
  ag_action_2_r_proc,
  ag_action_3_r_proc,
  ag_action_4_r_proc
};

static int (*const  ag_s_procs_scan[])(PCB_DECL) = {
  ag_action_1_s_proc,
  ag_action_2_r_proc,
  ag_action_3_s_proc,
  ag_action_4_r_proc
};

static int (*const  ag_gt_procs_scan[])(PCB_DECL) = {
  ag_action_1_proc,
  ag_action_2_proc,
  ag_action_3_proc,
  ag_action_4_proc,
  ag_action_5_proc,
  ag_action_6_proc,
  ag_action_7_proc,
  ag_action_8_proc,
  ag_action_9_proc,
  ag_action_10_proc,
  ag_action_11_proc,
  ag_action_8_proc
};


static int ag_action_10_proc(PCB_DECL) {
  int ag_t = (PCB).token_number;
  (PCB).btsx = 0, (PCB).drt = -1;
  do {
    ag_track(PCB_POINTER);
    (PCB).token_number = (parse_token_type) AG_TCV(INPUT_CODE(*(PCB).la_ptr));
    (PCB).la_ptr++;
    if (ag_key_index[(PCB).sn]) {
      unsigned ag_k = ag_key_index[(PCB).sn];
      int ag_ch = CONVERT_CASE(INPUT_CODE(*(PCB).pointer));
      if (ag_ch <= 255) {
        while (ag_key_ch[ag_k] < ag_ch) ag_k++;
        if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word((PCB_TYPE *)PCB_POINTER, ag_k);
      }
    }
  } while ((PCB).token_number == (parse_token_type) ag_t);
  (PCB).la_ptr =  (PCB).pointer;
  return 1;
}

static int ag_action_11_proc(PCB_DECL) {
  int ag_t = (PCB).token_number;

  (PCB).btsx = 0, (PCB).drt = -1;
  do {
    (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
    (PCB).ssx--;
    ag_track(PCB_POINTER);
    ag_ra(PCB_POINTER);
    if ((PCB).exit_flag != AG_RUNNING_CODE) return 0;
    (PCB).ssx++;
    (PCB).token_number = (parse_token_type) AG_TCV(INPUT_CODE(*(PCB).la_ptr));
    (PCB).la_ptr++;
    if (ag_key_index[(PCB).sn]) {
      unsigned ag_k = ag_key_index[(PCB).sn];
      int ag_ch = CONVERT_CASE(INPUT_CODE(*(PCB).pointer));
      if (ag_ch <= 255) {
        while (ag_key_ch[ag_k] < ag_ch) ag_k++;
        if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word((PCB_TYPE *)PCB_POINTER, ag_k);
      }
    }
  }
  while ((PCB).token_number == (parse_token_type) ag_t);
  (PCB).la_ptr =  (PCB).pointer;
  return 1;
}

static int ag_action_3_r_proc(PCB_DECL) {
  int ag_sd = ag_fl[(PCB).ag_ap] - 1;
  if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
  (PCB).btsx = 0, (PCB).drt = -1;
  (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
  ag_ra(PCB_POINTER);
  return (PCB).exit_flag == AG_RUNNING_CODE;
}

static int ag_action_3_s_proc(PCB_DECL) {
  int ag_sd = ag_fl[(PCB).ag_ap] - 1;
  if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
  (PCB).btsx = 0, (PCB).drt = -1;
  (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
  ag_ra(PCB_POINTER);
  return (PCB).exit_flag == AG_RUNNING_CODE;;
}

static int ag_action_4_r_proc(PCB_DECL) {
  int ag_sd = ag_fl[(PCB).ag_ap] - 1;
  if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
  (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
  return 1;
}

static int ag_action_2_proc(PCB_DECL) {
  (PCB).btsx = 0, (PCB).drt = -1;
  if ((PCB).ssx >= 128) {
    (PCB).exit_flag = AG_STACK_ERROR_CODE;
    PARSER_STACK_OVERFLOW;
  }
  (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
  GET_CONTEXT;
  (PCB).ss[(PCB).ssx] = (PCB).sn;
  (PCB).ssx++;
  (PCB).sn = (PCB).ag_ap;
  ag_track(PCB_POINTER);
  return 0;
}

static int ag_action_9_proc(PCB_DECL) {
  if ((PCB).drt == -1) {
    (PCB).drt=(PCB).token_number;
    (PCB).dssx=(PCB).ssx;
    (PCB).dsn=(PCB).sn;
  }
  ag_prot(PCB_POINTER);
  (PCB).vs[(PCB).ssx] = ag_null_value;
  GET_CONTEXT;
  (PCB).ss[(PCB).ssx] = (PCB).sn;
  (PCB).ssx++;
  (PCB).sn = (PCB).ag_ap;
  (PCB).la_ptr =  (PCB).pointer;
  return (PCB).exit_flag == AG_RUNNING_CODE;
}

static int ag_action_2_r_proc(PCB_DECL) {
  (PCB).ssx++;
  (PCB).sn = (PCB).ag_ap;
  return 0;
}

static int ag_action_7_proc(PCB_DECL) {
  --(PCB).ssx;
  (PCB).la_ptr =  (PCB).pointer;
  (PCB).exit_flag = AG_SUCCESS_CODE;
  return 0;
}

static int ag_action_1_proc(PCB_DECL) {
  ag_track(PCB_POINTER);
  (PCB).exit_flag = AG_SUCCESS_CODE;
  return 0;
}

static int ag_action_1_r_proc(PCB_DECL) {
  (PCB).exit_flag = AG_SUCCESS_CODE;
  return 0;
}

static int ag_action_1_s_proc(PCB_DECL) {
  (PCB).exit_flag = AG_SUCCESS_CODE;
  return 0;
}

static int ag_action_4_proc(PCB_DECL) {
  int ag_sd = ag_fl[(PCB).ag_ap] - 1;
  (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
  (PCB).btsx = 0, (PCB).drt = -1;
  (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
  if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
  else GET_CONTEXT;
  (PCB).ss[(PCB).ssx] = (PCB).sn;
  ag_track(PCB_POINTER);
  while ((PCB).exit_flag == AG_RUNNING_CODE) {
    unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
    unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
    do {
      unsigned ag_tx = (ag_t1 + ag_t2)/2;
      if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
      else ag_t2 = ag_tx;
    } while (ag_t1 < ag_t2);
    (PCB).ag_ap = ag_pstt[ag_t1];
    if ((ag_s_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
  }
  return 0;
}

static int ag_action_3_proc(PCB_DECL) {
  int ag_sd = ag_fl[(PCB).ag_ap] - 1;
  (PCB).btsx = 0, (PCB).drt = -1;
  (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer;
  if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
  else GET_CONTEXT;
  (PCB).ss[(PCB).ssx] = (PCB).sn;
  ag_track(PCB_POINTER);
  (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
  ag_ra(PCB_POINTER);
  while ((PCB).exit_flag == AG_RUNNING_CODE) {
    unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
    unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
    do {
      unsigned ag_tx = (ag_t1 + ag_t2)/2;
      if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
      else ag_t2 = ag_tx;
    } while (ag_t1 < ag_t2);
    (PCB).ag_ap = ag_pstt[ag_t1];
    if ((ag_s_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
  }
  return 0;
}

static int ag_action_8_proc(PCB_DECL) {
  ag_undo(PCB_POINTER);
  (PCB).la_ptr =  (PCB).pointer;
  (PCB).exit_flag = AG_SYNTAX_ERROR_CODE;
  ag_diagnose(PCB_POINTER);
  SYNTAX_ERROR;
  {(PCB).la_ptr = (PCB).pointer + 1; ag_track(PCB_POINTER);}
  return (PCB).exit_flag == AG_RUNNING_CODE;
}

static int ag_action_5_proc(PCB_DECL) {
  int ag_sd = ag_fl[(PCB).ag_ap];
  (PCB).btsx = 0, (PCB).drt = -1;
  if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
  else {
    GET_CONTEXT;
    (PCB).ss[(PCB).ssx] = (PCB).sn;
  }
  (PCB).la_ptr =  (PCB).pointer;
  (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
  ag_ra(PCB_POINTER);
  while ((PCB).exit_flag == AG_RUNNING_CODE) {
    unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
    unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
    do {
      unsigned ag_tx = (ag_t1 + ag_t2)/2;
      if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
      else ag_t2 = ag_tx;
    } while (ag_t1 < ag_t2);
    (PCB).ag_ap = ag_pstt[ag_t1];
    if ((ag_r_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
  }
  return (PCB).exit_flag == AG_RUNNING_CODE;
}

static int ag_action_6_proc(PCB_DECL) {
  int ag_sd = ag_fl[(PCB).ag_ap];
  (PCB).reduction_token = (parse_token_type) ag_ptt[(PCB).ag_ap];
  if ((PCB).drt == -1) {
    (PCB).drt=(PCB).token_number;
    (PCB).dssx=(PCB).ssx;
    (PCB).dsn=(PCB).sn;
  }
  if (ag_sd) {
    (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd];
  }
  else {
    ag_prot(PCB_POINTER);
    (PCB).vs[(PCB).ssx] = ag_null_value;
    GET_CONTEXT;
    (PCB).ss[(PCB).ssx] = (PCB).sn;
  }
  (PCB).la_ptr =  (PCB).pointer;
  while ((PCB).exit_flag == AG_RUNNING_CODE) {
    unsigned ag_t1 = ag_sbe[(PCB).sn] + 1;
    unsigned ag_t2 = ag_sbt[(PCB).sn+1] - 1;
    do {
      unsigned ag_tx = (ag_t1 + ag_t2)/2;
      if (ag_tstt[ag_tx] < (unsigned char)(PCB).reduction_token) ag_t1 = ag_tx + 1;
      else ag_t2 = ag_tx;
    } while (ag_t1 < ag_t2);
    (PCB).ag_ap = ag_pstt[ag_t1];
    if ((ag_r_procs_scan[ag_astt[ag_t1]])(PCB_POINTER) == 0) break;
  }
  return (PCB).exit_flag == AG_RUNNING_CODE;
}


void init_parse(parse_pcb_type *PCB_POINTER) {
  (PCB).la_ptr = (PCB).pointer;
  (PCB).ss[0] = (PCB).sn = (PCB).ssx = 0;
  (PCB).exit_flag = AG_RUNNING_CODE;
  (PCB).line = FIRST_LINE;
  (PCB).column = FIRST_COLUMN;
  (PCB).btsx = 0, (PCB).drt = -1;
}

void parse(parse_pcb_type *PCB_POINTER) {
  init_parse(PCB_POINTER);
  (PCB).exit_flag = AG_RUNNING_CODE;
  while ((PCB).exit_flag == AG_RUNNING_CODE) {
    unsigned ag_t1 = ag_sbt[(PCB).sn];
    if (ag_tstt[ag_t1]) {
      unsigned ag_t2 = ag_sbe[(PCB).sn] - 1;
      (PCB).token_number = (parse_token_type) AG_TCV(INPUT_CODE(*(PCB).la_ptr));
      (PCB).la_ptr++;
      if (ag_key_index[(PCB).sn]) {
        unsigned ag_k = ag_key_index[(PCB).sn];
        int ag_ch = CONVERT_CASE(INPUT_CODE(*(PCB).pointer));
        if (ag_ch <= 255) {
          while (ag_key_ch[ag_k] < ag_ch) ag_k++;
          if (ag_key_ch[ag_k] == ag_ch) ag_get_key_word((PCB_TYPE *)PCB_POINTER, ag_k);
        }
      }
      do {
        unsigned ag_tx = (ag_t1 + ag_t2)/2;
        if (ag_tstt[ag_tx] > (unsigned char)(PCB).token_number)
          ag_t1 = ag_tx + 1;
        else ag_t2 = ag_tx;
      } while (ag_t1 < ag_t2);
      if (ag_tstt[ag_t1] != (unsigned char)(PCB).token_number)
        ag_t1 = ag_sbe[(PCB).sn];
    }
    (PCB).ag_ap = ag_pstt[ag_t1];
    (ag_gt_procs_scan[ag_astt[ag_t1]])((PCB_TYPE *)PCB_POINTER);
  }
}


