/*
 dxi.syn -- Direct Execution Script Interpreter
 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, dxi.h and dxi.cpp are created from
 dxi.syn by the AnaGram parser generator using the Build Parser command.

 To build a demonstration program for this parser, compile and link as a
 single project:
   demo.cpp                // Demo program
   comdefs.cpp             // Common script definitions
   dxi.cpp                 // Direct execution parser
   agclib1.lib             // 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"                // Contains definitions of support classes
#include <math.h>
#include <ctype.h>                                     // to declare tolower()
#include <iostream.h>                     // Used by dump and print statements

/*
 It is sometimes necessary to skip over code without executing it. The Mode
 enumeration specifies the various execution modes.
*/
enum Mode {
  executeMode,                                                    // executing
  continueMode,         // continue statement encountered, skip to end of loop
  breakMode,               // break statement encountered, skip to end of loop
  elseMode,                                      // Skipping to else statement
  blockMode,                                       // skipping a block of code
  scanMode                       // scanning code to determine loop parameters
};

/*
 The parser uses "pointer input". The ParseContext struct is used to store
 the value of the pointer and the execution mode at critical locations in the
 script, such as at the head of a loop, at the exit point of a loop, or at
 the increment and condition fields of a for loop. Since ParseContext
 inherits from FileLocation, it also stores line and column number.

 In the configuration section of the parser, the "context type" is specified
 as ParseContext. The GET_CONTEXT macro constructs a ParseContext object to
 store on the context stack.

 dxi_pcb_struct is the "parser control block". The ParseContext constructor
 retrieves the necessary information from the pcb.
*/
struct dxi_pcb_struct;          // Because of forward reference in constructor
struct ParseContext : public FileLocation {
  Mode mode;
  ParseContext() : FileLocation(), mode(executeMode) {}
  ParseContext(const char *key)
    : FileLocation((const unsigned char *) key), mode(executeMode) {}
  ParseContext(dxi_pcb_struct &);
};

// struct to describe a for loop
struct ForControl {
  Value lvalue;
  long begin;
  long increment;
  long end;
  ForControl() : lvalue(), begin(0), increment(1), end(0) {}
  ForControl(const Value &lv,
      const Value &b, const Value &i,
      const Value &e)
  : lvalue(lv),
    begin(b.getLong()),
    increment(i.getLong()),
    end(e.getLong())
  {
    // Nothing to do
  }
};

/*
 The VALUE macro controls the execution of expressions in accordance with the
 current execution mode.
*/
#define VALUE(x) PCB.mode == executeMode ? Value(x) : Value()

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

Version 2.01.08a   Feb 28 2002

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

#ifndef DXI_H_1031146419
#include "dxi.h"
#endif

#ifndef DXI_H_1031146419
#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 dxi_pcb_type
#endif


#define PCB (*pcb_pointer)
#define PCB_DECL PCB_TYPE *pcb_pointer
#define PCB_POINTER pcb_pointer

Value dxi_value(PCB_DECL);

static void ag_delete_wrappers(PCB_DECL);
#ifndef DELETE_WRAPPERS
#define DELETE_WRAPPERS ag_delete_wrappers(PCB_POINTER)
#endif

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

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

// implement context tracking
#define GET_CONTEXT CONTEXT = PCB.location()

ParseContext::ParseContext(dxi_pcb_struct &pcb)
  : FileLocation(pcb.pointer, pcb.line, pcb.column),
    mode(pcb.mode)
{ /* empty */ }

// constructor for parser control block
dxi_pcb_struct::dxi_pcb_struct(Dataset &d)
  : dataset(d),
    mode(executeMode),
    returnValue()
{ /* empty */ }

void dxi_pcb_struct::parseSyntax
    (const char *selector, const FileLocation &s) {
  pointer = (const unsigned char *) selector;
  startLocation = s;
  try {
    dxi(this);
  }
  catch (ErrorMessage e) {
    reportError(e.message());
  }
}

void dxi_pcb_type::setStart() {
  setLocation(startLocation);
}

void dxi_pcb_struct::simpleLoop(const char *selector) {
  ParseContext loopLocation(*this);
  dxi_pcb_struct loopPCB(dataset);
  loopPCB.mode = mode == executeMode ? executeMode : breakMode;    // Set mode
  for (;;) {
    loopPCB.parseSyntax(selector, loopLocation);
    setLocation(ParseContext(loopPCB));          //Transfer location to parent
    if (loopPCB.mode == breakMode) return;
    loopPCB.mode = executeMode;    // mode could have been set to continueMode
  }
}

ForControl dxi_pcb_struct::forControl(const Value &lv, const Value &b, const Value &i, const Value &e) {
  if (mode == executeMode) return ForControl(lv, b, i, e);
  return ForControl();
}

void dxi_pcb_struct::forLoop(ForControl &fc) {
  restoreMode();       // mode was set to scanMode to pick up loop header info
  ParseContext statementLocation(*this);         // Capture statement location
  dxi_pcb_struct loopPCB(dataset);
  if (fc.increment == 0) reportError("Loop increment is zero");
  // Calculate number of times through the loop
  int count = (fc.end + fc.increment - fc.begin)/fc.increment;
  int index = fc.begin;
  // Set mode for parsing loop
  loopPCB.mode = (mode == executeMode && count > 0) ? executeMode : breakMode;
  if (loopPCB.mode == executeMode) fc.lvalue = index;
  while (count--) {
    loopPCB.parseSyntax("statement", statementLocation);
    setLocation(ParseContext(loopPCB));       // Set location in parent parser
    index += fc.increment;
    if (loopPCB.mode == executeMode) fc.lvalue = index;
    if (loopPCB.mode == breakMode) return;
  }
}

ParseContext dxi_pcb_struct::location() {
  return ParseContext(*this);
}

// Set parse location in source text
void dxi_pcb_struct::setLocation(const FileLocation &l) {
	pointer = l.pointer;
	line = l.line;
	column = l.column;
}

// Set return value
void dxi_pcb_struct::setReturnValue(const Value &v) {
  if (mode != executeMode) return;   // exit setReturnValue
  returnValue = v;
  exit_flag = AG_SUCCESS_CODE;  // Exit parser
}

// if mode == currentMode change mode to desiredMode and return true.
// Otherwise, leave mode unchanged and return false.
int dxi_pcb_struct::changeMode(Mode currentMode, Mode desiredMode) {
  if (mode != currentMode) return 0;
  mode = desiredMode;
  return 1;
}

// if mode == currentMode, restore the mode in effect at the beginning of the
// rule. Otherwise, leave the mode unchanged.
void dxi_pcb_struct::restoreMode(Mode currentMode) {
  if (mode == currentMode) mode = PCONTEXT(*this).mode;
}

// Unconditionally restore the mode in effect at the beginning of the rule.
void dxi_pcb_struct::restoreMode() {
  mode = PCONTEXT(*this).mode;
}

// dump variable name and value
void dxi_pcb_struct::dump(const AgString &n) const {
  if (mode != executeMode) return;
  cout << (const char *) n
       << " = "
       << (const char *) dataset.value(n).asLiteral()
       << "\n";
}

// print value
void dxi_pcb_struct::print(const Value &value) const {
  if (mode != executeMode) return;
  cout << (const char *) value.asString();
}

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

void dxi_pcb_struct::reportError(const char *msg) {
  ag_delete_wrappers(this);
  char buf[100];
  ParseContext &context = PCONTEXT(*this);
  sprintf(buf, "Error(%d,%d): %s", context.line, context.column, msg);
  throw ErrorDiagnostic(buf);
}

Value interpret(const char *text, Dataset &d) {
  dxi_pcb_struct pcb(d);
  pcb.parseSyntax("script", FileLocation((const unsigned char *)text));
  return pcb.returnValue;
}

// declare structure
void dxi_pcb_struct::defineStructure (
    const AgString &structureName,
    const AgStack<AgString> &fieldNames)
{
  if (mode != executeMode) return;
  AgDictionary<AgString> fieldDictionary(fieldNames.contents());
  Value structure(fieldDictionary);
  dataset.value(structureName) = structure;
}

// define instances of named structure
void dxi_pcb_struct::defineInstances (
    const AgString &structureName,
    const AgStack<AgString> &instanceNames)
{
  if (mode != executeMode) return;
  const AgDictionary<AgString> &fieldDictionary = dataset.value(structureName).getDictionary();
  for (int i = 0; i < instanceNames.size(); i++) {
    Instance instance(fieldDictionary);
    dataset.value(instanceNames[i]) = Value(instance);
  }
}

// define instances of an anonymous structure
void dxi_pcb_struct::defineInstances (
    const AgStack<AgString> &fieldNames,
    const AgStack<AgString> &instanceNames)
{
  if (mode != executeMode) return;
  AgDictionary<AgString> fieldDictionary(fieldNames.contents());
  for (int i = 0; i < instanceNames.size(); i++) {
    Instance instance(fieldDictionary);
    dataset.value(instanceNames[i]) = Value(instance);
  }
}


#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
Value dxi_value(PCB_DECL) {
  Value returnValue;
  returnValue = (*(AgObjectWrapper< Value > *) &(PCB).vs[(PCB).ssx]);
  return returnValue;
}

static inline Value ag_rp_1(PCB_DECL) {
/* Line 209, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return Value();
}

static inline void ag_rp_5(PCB_DECL) {
/* Line 216, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.setStart();
}

static inline void ag_rp_6(PCB_DECL) {
/* Line 219, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.setStart();
}

static inline void ag_rp_7(PCB_DECL) {
/* Line 222, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.setStart();
}

static inline void ag_rp_8(PCB_DECL) {
/* Line 225, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.setStart();
}

static inline void ag_rp_9(PCB_DECL) {
/* Line 248, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.restoreMode(elseMode);
}

static inline void ag_rp_10(PCB_DECL) {
/* Line 250, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.restoreMode(blockMode);
}

static inline void ag_rp_11(PCB_DECL) {
/* Line 254, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.restoreMode(blockMode);
}

static inline void ag_rp_12(PCB_DECL) {
/* Line 268, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.simpleLoop("repeatLoop");
}

static inline void ag_rp_13(PCB_DECL) {
/* Line 269, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.simpleLoop("whileLoop");
}

static inline void ag_rp_14(PCB_DECL, ForControl &fc) {
/* Line 270, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.forLoop(fc);
}

static inline void ag_rp_15(PCB_DECL, Value &x) {
/* Line 274, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.setReturnValue(x);
}

static inline void ag_rp_16(PCB_DECL) {
/* Line 283, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.changeMode(continueMode, executeMode);
}

static void ag_rp_17(PCB_DECL, Value &x) {
/* Line 294, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
if (PCB.mode != executeMode || x.isFalse()) PCB.mode = breakMode;
}

static void ag_rp_18(PCB_DECL, Value &x) {
/* Line 298, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
if (PCB.mode != executeMode || x.isTrue()) PCB.mode = breakMode;
}

static inline ForControl ag_rp_19(PCB_DECL, Value &lv, Value &b, Value &i, Value &e) {
/* Line 302, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return PCB.forControl(lv, b, i, e);
}

static inline Value ag_rp_20(PCB_DECL) {
/* Line 305, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(1);
}

static inline Value ag_rp_21(PCB_DECL, Value &x) {
/* Line 306, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return x;
}

static void ag_rp_22(PCB_DECL, Value &x) {
/* Line 311, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
if (PCB.mode == executeMode && x.isFalse()) PCB.mode = elseMode;
}

static inline void ag_rp_23(PCB_DECL) {
/* Line 315, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.changeMode(executeMode, blockMode),PCB.changeMode(elseMode, executeMode);
}

static inline void ag_rp_24(PCB_DECL, Value &lv, Value &x) {
/* Line 318, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  VALUE(lv = x);
}

static inline void ag_rp_25(PCB_DECL, AgString &n) {
/* Line 325, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.dump(n);
}

static inline void ag_rp_26(PCB_DECL, AgString &n) {
/* Line 326, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.dump(n);
}

static inline void ag_rp_27(PCB_DECL, Value &x) {
/* Line 330, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.print(x);
}

static inline void ag_rp_28(PCB_DECL, Value &x) {
/* Line 331, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.print(x);
}

static void ag_rp_29(PCB_DECL, AgString &name, AgStack<AgString> &fields, AgStack<AgString> &instances) {
/* Line 335, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
      PCB.defineStructure(name, fields);
      PCB.defineInstances(name, instances);
    
}

static inline void ag_rp_30(PCB_DECL, AgString &name, AgStack<AgString> &fields) {
/* Line 339, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.defineStructure(name, fields);
}

static inline void ag_rp_31(PCB_DECL, AgStack<AgString> &fields, AgStack<AgString> &instances) {
/* Line 341, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.defineInstances(fields, instances);
}

static inline void ag_rp_32(PCB_DECL, AgString &name, AgStack<AgString> &instances) {
/* Line 343, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  PCB.defineInstances(name, instances);
}

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

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

static inline Value ag_rp_35(PCB_DECL) {
/* Line 350, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return Value();
}

static inline Value ag_rp_36(PCB_DECL, Value &x, Value &y) {
/* Line 356, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x < y);
}

static inline Value ag_rp_37(PCB_DECL, Value &x, Value &y) {
/* Line 357, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x <= y);
}

static inline Value ag_rp_38(PCB_DECL, Value &x, Value &y) {
/* Line 358, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x > y);
}

static inline Value ag_rp_39(PCB_DECL, Value &x, Value &y) {
/* Line 359, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x >= y);
}

static inline Value ag_rp_40(PCB_DECL, Value &x, Value &y) {
/* Line 360, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x == y);
}

static inline Value ag_rp_41(PCB_DECL, Value &x, Value &y) {
/* Line 361, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x != y);
}

static inline Value ag_rp_42(PCB_DECL, Value &x, Value &y) {
/* Line 365, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x + y);
}

static inline Value ag_rp_43(PCB_DECL, Value &x, Value &y) {
/* Line 366, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x - y);
}

static inline Value ag_rp_44(PCB_DECL, Value &x, Value &y) {
/* Line 367, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x | y);
}

static inline Value ag_rp_45(PCB_DECL, Value &x, Value &y) {
/* Line 368, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x ^ y);
}

static inline Value ag_rp_46(PCB_DECL, Value &x, Value &y) {
/* Line 372, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x * y);
}

static inline Value ag_rp_47(PCB_DECL, Value &x, Value &y) {
/* Line 373, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x.rdiv(y));
}

static inline Value ag_rp_48(PCB_DECL, Value &x, Value &y) {
/* Line 374, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x.idiv(y));
}

static inline Value ag_rp_49(PCB_DECL, Value &x, Value &y) {
/* Line 375, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x % y);
}

static inline Value ag_rp_50(PCB_DECL, Value &x, Value &y) {
/* Line 376, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x & y);
}

static inline Value ag_rp_51(PCB_DECL, Value &x, Value &y) {
/* Line 377, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x << y);
}

static inline Value ag_rp_52(PCB_DECL, Value &x, Value &y) {
/* Line 378, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x >> y);
}

static inline Value ag_rp_53(PCB_DECL, Value &x) {
/* Line 382, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x);
}

static inline Value ag_rp_54(PCB_DECL, Value &x) {
/* Line 383, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(-x);
}

static inline Value ag_rp_55(PCB_DECL, Value &x) {
/* Line 384, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(!x);
}

static inline Value ag_rp_56(PCB_DECL, Value &x, Value &y) {
/* Line 392, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(pow(x, y));
}

static inline Value ag_rp_57(PCB_DECL, Value &x) {
/* Line 400, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return x;
}

static inline Value ag_rp_58(PCB_DECL, Value &lv) {
/* Line 402, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(lv.deref());
}

static inline Value ag_rp_59(PCB_DECL, Value &x) {
/* Line 404, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x.makeInteger());
}

static inline Value ag_rp_60(PCB_DECL, Value &x) {
/* Line 405, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x.makeReal());
}

static inline Value ag_rp_61(PCB_DECL, AgString &n) {
/* Line 408, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(&PCB.dataset.value(n));
}

static inline Value ag_rp_62(PCB_DECL, Value &lv, AgString &n) {
/* Line 409, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(&lv.getMember(n));
}

static inline Value ag_rp_63(PCB_DECL, AgString &n, AgStack<Value> &args) {
/* Line 412, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(callFunction(n, args));
}

static inline AgStack<Value> ag_rp_64(PCB_DECL) {
/* Line 415, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return AgStack<Value>();
}

static inline AgStack<Value> ag_rp_65(PCB_DECL, Value &x) {
/* Line 419, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return AgStack<Value>().push(x);
}

static inline AgStack<Value> ag_rp_66(PCB_DECL, AgStack<Value> &stack, Value &x) {
/* Line 420, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return stack.push(x);
}

static inline Value ag_rp_67(PCB_DECL, long x) {
/* Line 423, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x);
}

static inline Value ag_rp_68(PCB_DECL, double x) {
/* Line 424, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x);
}

static inline Value ag_rp_69(PCB_DECL, int x) {
/* Line 426, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(x);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static inline Value ag_rp_97(PCB_DECL, AgString &b) {
/* Line 508, W:/agdev/agex/packages/xidek/pll/struct/dxi.syn */
  return VALUE(b);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static inline int ag_rp_118(PCB_DECL, int c) {
/* Line 563, W:/agdev/agex/packages/xidek/pll/struct/dxi.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, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 5,
  0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 0, 5, 0, 0, 0, 0, 5, 0, 0, 0, 5, 5, 0,
  0, 0, 0, 4, 0, 0, 0, 0, 0, 5, 0, 0, 0, 5, 0, 5, 0, 0, 0, 4, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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, 8, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 0, 0, 0, 5, 5, 5, 5, 5,
  5, 5, 5, 5, 5, 0, 0, 0, 8, 5, 0, 0, 0, 8, 0, 0, 0, 5, 8, 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<Value> >
#undef AG_WRAP_7
#define AG_WRAP_7 AgObjectWrapper<ForControl >
#undef AG_WRAP_8
#define AG_WRAP_8 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;
      case 8: ag_delete_object((AG_WRAP_8 *) &(PCB).vs[sx]); break;
      default: break;
    }
    sn = (PCB).ss[sx];
  }
}

static dxi_vs_type const ag_null_value NULL_VALUE_INITIALIZER;

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

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,165,  0, 20,  0, 21,  0, 22,  0, 23,  0,170,  0,171,  0,172,
  0,173,  0,174,  0,175,  0,177,  0,179,  0,178,  0,180,  0,182,
  0,181,  0,184,  0,186,  0,189,  0,198,  0,199,  0,202,  0,203,
  0,204,  0,205,  0,206,  0,207,  0,211,  0,212,0
};

static const unsigned char ag_key_ch[] = {
    0, 42, 47,255, 67, 84,255, 47, 82, 83, 87,255, 42,255, 42, 47,255, 61,
   62,255, 69, 89,255, 85,255, 73, 79, 85,255, 76, 78,255, 76,255, 84,255,
   65,255, 69,255, 80, 84,255, 69,255, 76, 82,255, 65, 82,255, 67, 72, 84,
  255, 72, 79,255, 76,255, 69,255, 76,255, 73,255, 72,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, 67, 84,255, 82, 83, 87,255, 42, 47,255, 80, 84,255, 69,255, 47,
   66, 68, 70, 73, 80, 82, 83, 87,255, 42, 47,255, 80, 84,255, 69,255, 47,
   66, 68, 70, 73, 80, 82, 83, 85, 87,255, 42, 47,255, 47, 48, 78,255, 80,
   84,255, 69,255, 66, 68, 70, 73, 80, 82, 83, 87,255, 80, 84,255, 69,255,
   66, 68, 70, 73, 80, 82, 83, 85, 87,255, 48, 78,255, 42, 47,255, 61, 62,
  255, 42, 47, 58, 60, 62,255, 42, 47,255, 47,255, 42, 47,255, 80, 84,255,
   69,255, 47, 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,
   80, 84,255, 69,255, 66, 68, 69, 70, 73, 80, 82, 83, 87,255, 58,255, 68,
  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, 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,7,2,7,4,3,4,0,0,4,0,0,4,7,5,4,7,4,7,6,7,4,7,7,4,7,4,6,
  4,2,4,2,4,2,7,4,2,4,5,5,4,7,7,4,7,2,2,4,7,5,4,7,4,6,4,2,4,2,4,2,4,3,2,
  3,3,2,3,7,2,2,2,7,7,7,7,7,7,7,2,2,2,7,2,7,4,7,7,4,7,2,7,4,0,0,4,7,7,4,
  2,4,2,7,7,7,7,7,2,7,7,4,0,0,4,7,7,4,2,4,2,7,7,7,7,7,2,7,7,7,4,0,0,4,2,
  3,7,4,7,7,4,2,4,7,7,7,7,7,2,7,7,4,7,7,4,2,4,7,7,7,7,7,2,7,7,7,4,3,7,4,
  0,0,4,0,0,4,3,2,3,2,3,4,0,0,4,2,4,0,0,4,7,7,4,2,4,2,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,7,7,4,2,4,7,7,7,7,7,7,
  2,7,7,4,3,4,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,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, 97,102,  0,  2,  8,  0,  0,  6,  0,  4,  0,101,  0, 97,102,  0,191,
  195,  0, 30, 22,  0, 58,  0, 44,  0, 34,  0, 28, 32,  0,  6,  0, 12,  0,
    0,  0,  0,  0,  0, 10,  0,  0,  0, 50, 52,  0,  8, 38,  0,  2,  0,  0,
    0, 26, 20,  0,  4,  0, 16,  0,  0,  0,  0,  0,  0,  0,208,  0,126,176,
    0,193, 48,  0,  0,  0, 18, 24, 56, 46, 54, 40, 36,  0,  0,  0, 14,  0,
   42,  0,  2,  8,  0,  6,  0,  4,  0, 97,102,  0, 12, 10,  0,  0,  0,  0,
   30, 34, 18, 24, 36,  0, 38, 16,  0, 97,102,  0, 12, 10,  0,  0,  0,  0,
   30, 34, 18, 24, 36,  0, 38, 14, 16,  0, 97,102,  0,  0,126, 54,  0, 12,
   10,  0,  0,  0, 30, 34, 18, 24, 36,  0, 38, 16,  0, 12, 10,  0,  0,  0,
   30, 34, 18, 24, 36,  0, 38, 14, 16,  0,126, 54,  0, 97,102,  0,191,195,
    0,208,  0,176,  0,193,  0, 97,102,  0,  0,  0, 97,102,  0, 12, 10,  0,
    0,  0,  0, 30, 34, 32, 18, 24, 36,  0, 38, 16,  0, 97,102,  0, 28, 32,
    0, 12, 10,  0,  0,  0,  0, 30, 34,  0, 18, 24, 36,  0, 38, 14, 16,  0,
   12, 10,  0,  0,  0, 30, 34, 32, 18, 24, 36,  0, 38, 16,  0,176,  0,  0,
    0,138,137,139,141,142,143,144,145,146,147,152,140,  0,  0,  0, 97,102,
    0,191,195,  0, 44,  0,  0, 50, 52,  0,  0,  0, 26, 20,  0,208,  0,  0,
  193, 48, 22,  0, 46, 40,  0,  0, 42,  0, 97,102,  0,191,195,  0, 50, 52,
    0,  0,  0, 26, 20,  0,208,  0,  0,193, 46, 40,  0,  0, 42,  0,191,195,
    0, 44,  0,  0, 50, 52,  0,  0,  0, 26, 20,  0,208,  0,193, 48, 22,  0,
   46, 40,  0,  0, 42,  0, 97,102,  0,  0,126, 58, 56, 54,  0,126, 58, 56,
   54,  0,191,195,  0, 44,  0,  0, 50, 52,  0,  0,  0, 26, 20,  0,  0,193,
   48, 22,  0, 46, 40,  0,  0, 42,  0,191,195,  0, 26, 20,  0,  0,193, 22,
    0, 40,  0, 42,  0, 26,  0, 28, 32,  0, 12, 10,  0,  0,  0, 30, 34,  0,
   18, 24, 36,  0, 38, 14, 16,  0, 97,102,  0,191,195,  0, 44,  0,  0, 50,
   52,  0,  0,  0, 26, 20,  0,208,  0,126,  0,193, 48, 22,  0, 46, 40,  0,
    0, 42,  0,126,  0, 26, 20,  0, 22,  0, 40,  0, 42,  0, 22, 20,  0, 20,
    0
};

static const unsigned short ag_key_jmp[] = {
    0,  0,  0,  0, 10, 15,  0,  1,  0,  4, 23,  0, 32,  0,  0,  0,  0,  0,
    0,  0, 45,  0,  0, 51,  0, 49, 23, 55,  0, 58, 61,  0, 85,  0, 32,  0,
   34,  0, 36,  0, 38, 89,  0, 40,  0,  0,  0,  0, 98,105,  0, 93, 45, 48,
    0,109,  0,  0,117,  0, 58,  0, 60,  0, 62,  0, 64,  0, 34, 14, 36, 38,
   17, 40, 42, 20, 25, 29, 63, 66, 68, 72, 75, 78, 80, 43, 51, 55,112, 66,
  121,  0,134,139,  0,124, 92,147,  0,  0,  0,  0,175,179,  0,102,  0, 99,
  156,161,165,168,170,105,183,189,  0,  0,  0,  0,213,217,  0,120,  0,117,
  194,199,203,206,208,123,221,227,232,  0,  0,  0,  0,136,237,239,  0,261,
  265,  0,143,  0,242,247,251,254,256,146,269,275,  0,299,303,  0,157,  0,
  280,285,289,292,294,160,307,313,318,  0,323,325,  0,  0,  0,  0,  0,  0,
    0,328,175,330,178,332,  0,  0,  0,  0,187,  0,  0,  0,  0,356,360,  0,
  195,  0,192,334,339,343,346,349,351,198,364,370,  0,  0,  0,  0,384,387,
    0,399,403,  0,217,  0,211,375,380,214,389,392,394,220,407,413,418,  0,
  445,449,  0,234,  0,423,428,432,435,438,440,237,453,459,  0,464,  0,466,
    0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,253,  0,  0,  0,
    0,  0,  0,  0,477,  0,  0,  0,  0,  0,277,  0,484,  0,  0,468,268,271,
  470,472,475,274,479,482,280,282,487,  0,  0,  0,  0,  0,  0,  0,  0,  0,
    0,304,  0,499,  0,  0,490,298,301,492,494,497,307,309,502,  0,  0,  0,
    0,514,  0,  0,  0,  0,  0,328,  0,521,  0,  0,505,322,507,509,512,325,
  516,519,331,333,524,  0,  0,  0,  0,348,527,529,535,539,  0,542,544,550,
  554,  0,  0,  0,  0,564,  0,  0,  0,  0,  0,368,  0,571,  0,  0,362,557,
  559,562,365,566,569,371,373,574,  0,  0,  0,  0,585,  0,  0,387,577,579,
  581,583,390,588,  0,591,  0,604,607,  0,619,623,  0,406,  0,595,600,403,
  609,612,614,409,627,633,638,  0,  0,  0,  0,  0,  0,  0,654,  0,  0,  0,
    0,  0,431,  0,661,  0,  0,643,422,645,425,647,649,652,428,656,659,434,
  436,664,  0,667,  0,675,  0,  0,669,671,673,455,678,  0,681,683,  0,685,
    0
};

static const unsigned short ag_key_index[] = {
    7,  0, 12, 68, 95,  0,  0, 12, 12,107,125,139,107,148,162,172,148,181,
  190,190,139,190,200,222,222,  0,172,  0,139,239,222,249,  0,139,  0,  0,
    0,172,  0,251,172,148,162,266,  0,  0,266,285,  0,285,312,285,285,285,
  285,285,336,336,351,336,357,139,139,139,336,172,172,172,376,393,251,148,
  190,  0,  0,239,190,  0,139,172,249,139,172,  0,  0,222,401,411,139,172,
  266,285,  0,  0,266,266,266,  0,285,  0,  0,172,190,  0,190,  0,  0,139,
  172,139,172,139,172,139,172,139,172,139,172,139,172,139,172,139,172,139,
  172,172,172,139,172,139,172,139,172,139,172,139,172,139,172,148,  0,  0,
    0,222,172,107,107,148,  0,  0,  0,  0,  0,439,453,453,376,376,376,376,
  458,458,458,458,458,458,  0,190,  0,  0,464,285,285,172,  0,  0,139,172,
  467,  0,139,172
};

static const unsigned char ag_key_ends[] = {
69,80,69,65,84,76,79,79,80,0, 82,73,80,84,0, 
65,84,69,77,69,78,84,0, 72,73,76,69,76,79,79,80,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, 79,79,80,0, 85,82,78,0, 
82,73,80,84,0, 84,69,77,69,78,84,0, 85,67,84,0, 69,78,0, 
78,84,73,76,0, 79,79,80,0, 79,82,0, 69,80,69,65,84,76,79,79,80,0, 
82,73,80,84,0, 65,84,69,77,69,78,84,0, 72,73,76,69,76,79,79,80,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, 
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, 
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, 
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, 
42,0, 61,0, 61,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, 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, 61,0, 79,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, 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[] = {
   13,158,158,158,158,158,158,158,158,157,106,157,157,157,158,158,158,158,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,157,158,129,158,
  158,158,158,154,210,209,200,196,185,197,213,201,124,159,159,159,159,159,
  159,159,123,123,158,167,190,194,192,158,158,160,160,160,160,110,160,161,
  161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,
  161,158,151,158,158,161,158,160,160,160,160,110,160,161,161,161,161,161,
  161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,188,158,187,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,
  158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,
  158,158,158,158
};

#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 = (dxi_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 = (dxi_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 = (dxi_token_type) ag_key_pt[ag_k1+1];
      break;
    }
    case ag_set_key:
      ag_save = (int) ((PCB).la_ptr - (PCB).pointer);
      (PCB).token_number = (dxi_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 = (dxi_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 = (dxi_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 = (dxi_token_type) (PCB).drt;
  (PCB).ssx = (PCB).dssx;
  (PCB).sn = (PCB).dsn;
  (PCB).drt = -1;
}


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

};


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


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

};


static const unsigned short ag_sbt[] = {
     0,  12,  41,  71,  77,  91, 117, 119, 146, 148, 169, 191, 213, 235,
   276, 292, 338, 354, 387, 398, 410, 432, 443, 465, 490, 515, 523, 568,
   574, 597, 613, 638, 643, 650, 672, 675, 680, 685, 732, 735, 738, 783,
   824, 868, 907, 912, 918, 963, 997,1000,1002,1009,1044,1080,1113,1146,
  1179,1182,1186,1211,1214,1263,1285,1307,1329,1332,1374,1416,1458,1473,
  1494,1497,1539,1550,1557,1566,1609,1620,1626,1648,1693,1698,1720,1765,
  1771,1774,1799,1802,1806,1828,1874,1920,1926,1929,1936,1939,1942,1949,
  1951,1957,1965,1973,2021,2030,2033,2042,2045,2048,2070,2112,2134,2176,
  2198,2240,2262,2304,2326,2368,2390,2432,2454,2496,2518,2560,2582,2625,
  2647,2690,2733,2776,2798,2842,2864,2908,2930,2974,2996,3040,3062,3106,
  3128,3172,3213,3218,3221,3228,3253,3298,3319,3340,3380,3383,3388,3393,
  3396,3399,3443,3477,3511,3526,3541,3556,3571,3580,3589,3598,3607,3616,
  3625,3631,3643,3650,3655,3660,3665,3670,3715,3718,3725,3747,3792,3795,
  3798,3820,3865
};


static const unsigned short ag_sbe[] = {
     8,  38,  68,  75,  81, 116, 118, 145, 147, 165, 187, 209, 231, 248,
   290, 306, 352, 383, 394, 406, 428, 439, 461, 486, 511, 519, 537, 571,
   593, 611, 634, 640, 646, 668, 673, 677, 682, 700, 733, 736, 752, 796,
   838, 905, 910, 915, 954, 993, 999,1001,1007,1043,1078,1109,1142,1175,
  1180,1183,1207,1212,1230,1281,1303,1325,1330,1346,1388,1430,1465,1483,
  1495,1511,1546,1553,1561,1580,1616,1623,1644,1662,1695,1716,1734,1768,
  1772,1795,1800,1803,1824,1842,1911,1923,1928,1934,1938,1941,1947,1950,
  1954,1962,1970,1988,2026,2031,2038,2043,2046,2066,2084,2130,2148,2194,
  2212,2258,2276,2322,2340,2386,2404,2450,2468,2514,2532,2578,2596,2643,
  2661,2704,2747,2794,2812,2860,2878,2926,2944,2992,3010,3058,3076,3124,
  3142,3185,3215,3219,3224,3249,3267,3315,3336,3353,3381,3386,3391,3394,
  3397,3439,3454,3488,3518,3533,3548,3563,3575,3584,3593,3602,3611,3620,
  3628,3639,3646,3652,3657,3663,3668,3684,3716,3721,3743,3761,3793,3796,
  3816,3834,3865
};


static const unsigned char ag_fl[] = {
  2,3,4,5,2,1,1,1,1,0,2,1,1,2,4,4,1,1,1,2,2,1,1,3,2,2,2,1,1,1,1,1,1,7,0,
  2,3,1,3,3,2,3,2,3,6,5,5,3,1,3,0,1,1,3,3,3,3,3,3,1,3,3,3,3,1,3,3,3,3,3,
  3,3,1,2,2,2,1,3,3,1,1,1,4,4,1,3,4,0,1,1,3,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,2,2,2,2
};

static const unsigned char ag_ptt[] = {
    0, 11, 11, 11, 11,164,166,168,169, 12, 12, 16, 16, 24, 24, 25, 25, 28,
   28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 17, 30, 42, 14, 18, 31, 47, 47,
   26, 27, 32, 33, 36, 36, 37, 37, 38, 38, 38, 38, 60, 60, 35, 35, 44, 44,
   44, 44, 44, 44, 44, 62, 62, 62, 62, 62, 69, 69, 69, 69, 69, 69, 69, 69,
   74, 74, 74, 74, 82, 82, 84, 84, 84, 84, 84, 84, 45, 45, 89, 93, 93, 94,
   94, 88, 88, 88, 88,  1, 99, 99,100,100,  1,104,104,105,105,  1,183,183,
  215,215,215,109,109,109,112,112,112,117,117,111,111,113,113,214,214,214,
  114,114,118,118,115,115,116,116,120,120,127,127, 95, 95,217,130,130,131,
  131,133,133,133,134,134,134,134,134,134,134,134,134,134,134,135,135,135,
  148,149,150,136,136,153,153,216,155,155,119, 96, 96, 98, 98, 98, 98, 98,
   98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
   98, 98, 98,103,103,103,103,103,103,103,103,103,103,103,103,103,103,103,
  103,103,103,103,103,103,103,103,103,103,107,107,107,108,108,108,108,108,
  108,121,121,122,122,122,125,125,128,128,132,132,132,132,132,132,132,132,
  132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,156,156,156,
  156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,
  156,156,162,162,163,163,  7, 15,  8, 19,  9, 10, 34, 39, 40, 41, 43, 48,
   46, 49, 51, 50, 52, 54, 53,  4, 55, 56, 57, 61, 59, 58, 63, 64, 65, 66,
   67, 68, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 83, 85, 87, 86, 90,
   91, 92,  2,  3,  6,  5
};


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

#define TOKEN_NAMES dxi_token_names
const char *const dxi_token_names[218] = {
  "syntax selection",
  "white space",
  "integer",
  "real",
  "name",
  "string element",
  "character constant",
  "SCRIPT",
  "WHILE LOOP",
  "REPEAT LOOP",
  "STATEMENT",
  "syntax selection",
  "statement list",
  "eof",
  "loop condition",
  "\"DO\"",
  "statement",
  "UNTIL",
  "until condition",
  "';'",
  "\"SCRIPT\"",
  "\"WHILELOOP\"",
  "\"REPEATLOOP\"",
  "\"STATEMENT\"",
  "open statement",
  "closed statement",
  "if condition",
  "ELSE",
  "simple statement",
  "REPEAT",
  "WHILE",
  "for initialization",
  "assignment statement",
  "compound statement",
  "\"RETURN\"",
  "optional expression",
  "dump statement",
  "print statement",
  "structure declaration",
  "\"REPEAT\"",
  "\"UNTIL\"",
  "\"WHILE\"",
  "FOR",
  "\"FOR\"",
  "expression",
  "lvalue",
  "\":=\"",
  "for increment",
  "\"TO\"",
  "\"BY\"",
  "\"IF\"",
  "\"THEN\"",
  "\"ELSE\"",
  "\"BEGIN\"",
  "\"END\"",
  "\"DUMP\"",
  "','",
  "\"PRINT\"",
  "\"STRUCT\"",
  "'{'",
  "name list",
  "'}'",
  "simple expression",
  "'<'",
  "\"<=\"",
  "'>'",
  "\">=\"",
  "'='",
  "\"<>\"",
  "term",
  "'+'",
  "'-'",
  "\"OR\"",
  "\"XOR\"",
  "unary expression",
  "'*'",
  "'/'",
  "\"DIV\"",
  "\"MOD\"",
  "\"AND\"",
  "\"SHL\"",
  "\"SHR\"",
  "factor",
  "\"NOT\"",
  "primary",
  "\"**\"",
  "'('",
  "')'",
  "constant",
  "function call",
  "\"LONG\"",
  "\"DOUBLE\"",
  "'.'",
  "optional arg list",
  "arg list",
  "string",
  "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",
  "",
  "",
  "",
  "",
  "",
  "",
  "",
  "",
  "SCRIPT",
  "\"DO\"",
  "WHILE LOOP",
  "';'",
  "REPEAT LOOP",
  "STATEMENT",
  "\"RETURN\"",
  "\"REPEAT\"",
  "\"UNTIL\"",
  "\"WHILE\"",
  "\"FOR\"",
  "\"TO\"",
  "\":=\"",
  "\"BY\"",
  "\"THEN\"",
  "\"IF\"",
  "\"ELSE\"",
  "\"END\"",
  "\"BEGIN\"",
  "name",
  "\"DUMP\"",
  "','",
  "\"PRINT\"",
  "'}'",
  "'{'",
  "\"STRUCT\"",
  "'<'",
  "\"<=\"",
  "'>'",
  "\">=\"",
  "'='",
  "\"<>\"",
  "'+'",
  "'-'",
  "\"OR\"",
  "\"XOR\"",
  "'*'",
  "'/'",
  "\"DIV\"",
  "\"MOD\"",
  "\"AND\"",
  "\"SHL\"",
  "\"SHR\"",
  "\"NOT\"",
  "\"**\"",
  "')'",
  "'('",
  "\"LONG\"",
  "\"DOUBLE\"",
  "'.'",
  "integer",
  "real",
  "character constant",
  "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 = (dxi_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 == (dxi_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 = (dxi_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 == (dxi_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 = (dxi_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 = (dxi_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 = (dxi_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 = (dxi_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 = (dxi_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 = (dxi_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 = (dxi_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_dxi(dxi_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 dxi(dxi_pcb_type *PCB_POINTER) {
  init_dxi(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 = (dxi_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);
  }
}


