Mercurial > ~dholland > hg > ag > index.cgi
diff tests/agcl/parsifal/good/ss-sscx.cpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/agcl/parsifal/good/ss-sscx.cpp Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,1511 @@ +/* + Copyright 1992, Jerome T. Holland + See the file COPYING for license and usage terms. + + An example syntax and supporting classes for implementing a spreadsheet + + Class definitions are found in sscxdefs.h + + This example is largely intended to serve as an illustration, and is + incomplete in a number of ways. In particular, the expression syntax + is that of C, except for identifiers, and only a few functions are + implemented. More may be implemented trivially by following the + patterns provided. + + The supported operations are: + Conditional expressions: ? : + Logical operators: !, &, | + Comparison operators: ==, !=, <, <=, >, >= + Binary arithmetic operators: +, -, *, / + Exponentiation: ** + Unary arithmetic operators: +, - + Parentheses + Function calls abs, sin, asin, atan + + A note on the technique used for compilation: + + The basic approach is to build a Reverse Polish Notation stack. + During parsing, the constants, cell locators, and operators are + stacked on separate temporary stacks. When parsing is complete, + these stacks are unloaded into arrays belonging to the cell + expression object. Note that there is a one to one correspondence + between items on the constant stack and fd (fetch double) operators + in the op stack. Since there are no branching instructions, there + there is one and ony one constant corresponding to a fd operation + so it is sufficient to simply increment an index into the constant + array as execution progresses, to know which constant to use. The + same logic holds for cell locators. +*/ + +#include <math.h> +#include "agstk.h" +#include <string.h> +#include <errno.h> +#include "sscxdefs.h" + + +/* + * AnaGram, A System for Syntax Directed Programming + * File generated by: ... + * + * AnaGram Parsing Engine + * Copyright 1993-2002 Parsifal Software. All Rights Reserved. + * + * This software is provided 'as-is', without any express or implied + * warranty. In no event will the authors be held liable for any damages + * arising from the use of this software. + * + * Permission is granted to anyone to use this software for any purpose, + * including commercial applications, and to alter it and redistribute it + * freely, subject to the following restrictions: + * + * 1. The origin of this software must not be misrepresented; you must not + * claim that you wrote the original software. If you use this software + * in a product, an acknowledgment in the product documentation would be + * appreciated but is not required. + * 2. Altered source versions must be plainly marked as such, and must not be + * misrepresented as being the original software. + * 3. This notice may not be removed or altered from any source distribution. + */ + +#ifndef SS-SSCX_H +#include "ss-sscx.h" +#endif + +#ifndef SS-SSCX_H +#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]) + + + +parseKernel_pcb_type parseKernel_pcb; +#define PCB parseKernel_pcb + +#line - "ss-sscx.syn" +// Stacks for use in parsing and compiling + +AgStack<double> doubleStack; +AgStack<Locator> locatorStack; +AgStack<CellExpression::Op> opStack; + +// Data for a simple minded test + +CellExpression *Locator::expression[3][3]; +int Locator::maxRow = 3; +int Locator::maxCol = 3; + +char *expressionText[3][3] = { + {"17", "19", "-23"}, + {"2*a1", "b1 - a2", "a2+b2"}, + {"b2 + c2", "a3-a2", "a2/b2"} +}; + +/* + Constructor for CellExpression + + Parses the input text and creates byte code for later execution by + the value() function. +*/ + +CellExpression::CellExpression(char *text) + : constant(0), nConstants(0), + locator(0), nLocators(0), + op(0), nOps(0), + errorFlag(0), busy(0), cycle(0) +{ + doubleStack.reset(); + locatorStack.reset(); + opStack.reset(); + PCB.pointer = (unsigned char *) text; + parseKernel(); // Parse expression + if (PCB.exit_flag != AG_SUCCESS_CODE) {errorFlag = 1; return;} + // save parse results + nConstants = doubleStack.size(); + nLocators = locatorStack.size(); + nOps = opStack.size(); + constant = new double[nConstants]; + locator = new Locator[nLocators]; + op = new Op[nOps]; + int i; + for (i = nConstants; i--;) constant[i] = doubleStack.pop(); + for (i = nLocators; i--;) locator[i] = locatorStack.pop(); + for (i = nOps; i--;) op[i] = opStack.pop(); +} + +// Function to execute byte code + +Number CellExpression::value() { + if (errorFlag) return Number(); + if (busy) { // Check for cyclic definition + errorFlag = cycle = 1; + return Number(); + } + busy = 1; + int constantIndex = 0; + int locatorIndex = 0; + + AgStack<Number> stack; // Arithmetic stack for byte code interpreter + + Number temp; // temporary variable + int pc = 0; + while (pc < nOps && errorFlag == 0) { + switch (op[pc]) { + case add: stack.pop(temp); stack.top() += temp; break; + case sub: stack.pop(temp); stack.top() -= temp; break; + case mpy: stack.pop(temp); stack.top() *= temp; break; + case div: stack.pop(temp); stack.top() /= temp; break; + case pow: stack.pop(temp); stack.top() = stack.top().pow(temp); break; + case lt: stack.pop(temp); stack.top() = stack.top() < temp; break; + case le: stack.pop(temp); stack.top() = stack.top() <= temp; break; + case gt: stack.pop(temp); stack.top() = stack.top() > temp; break; + case ge: stack.pop(temp); stack.top() = stack.top() >= temp; break; + case eq: stack.pop(temp); stack.top() = stack.top() == temp; break; + case ne: stack.pop(temp); stack.top() = stack.top() != temp; break; + case and: stack.pop(temp); stack.top() = stack.top() != Number(0) & temp != Number(0); break; + case or: stack.pop(temp); stack.top() = stack.top() != Number(0) | temp != Number(0); break; + case minus: stack.top() = -stack.top(); break; + case not: stack.top() = stack.top() == Number(0); break; + case cond: { + Number secondOption = stack.pop(); + Number firstOption = stack.pop(); + if (stack.top().bad) break; + stack.top() = (stack.top() != Number(0)) ? firstOption : secondOption; + break; + } + case abs: stack.top() = stack.top().abs(); break; + case sin: stack.top() = stack.top().sin(); break; + case asin: stack.top() = stack.top().asin(); break; + case atan: stack.top() = stack.top().atan(); break; + case atan2: temp = stack.pop(); stack.top() = stack.top().atan2(temp); break; +// Fetch double + case fd: stack.push(constant[constantIndex++]); break; +// Fetch cell value + case fc: { + CellExpression *x = locator[locatorIndex++].cellExpression(); + Number temp; + if (x != 0) temp = x->value(); + stack.push(temp); + break; + } + } + pc++; + } + busy = 0; + return stack.top(); +} + +// Rather trivial test + +int main() { + int i, j; +// Initialize CellExpresions + for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) { + Locator::expression[i][j] = new CellExpression(expressionText[i][j]); + } +// Calculate and print out values + for (i = 0; i < 3; i++) for (j = 0; j < 3; j++) { + printf("cell[%d][%d] = %G\n", i, j, (double) (Locator::expression[i][j]->value())); + } + return 0; +} + +#line - "ss-sscx.cpp" + +#ifndef CONVERT_CASE +#define CONVERT_CASE(c) (c) +#endif +#ifndef TAB_SPACING +#define TAB_SPACING 8 +#endif + +#define ag_rp_1() (opStack.push(CellExpression::cond)) + +#define ag_rp_2() (opStack.push(CellExpression::or)) + +#define ag_rp_3() (opStack.push(CellExpression::and)) + +#define ag_rp_4(x, y) (opStack.push(CellExpression::eq)) + +#define ag_rp_5(x, y) (opStack.push(CellExpression::ne)) + +#define ag_rp_6() (opStack.push(CellExpression::lt)) + +#define ag_rp_7() (opStack.push(CellExpression::le)) + +#define ag_rp_8() (opStack.push(CellExpression::gt)) + +#define ag_rp_9() (opStack.push(CellExpression::ge)) + +#define ag_rp_10() (opStack.push(CellExpression::add)) + +#define ag_rp_11() (opStack.push(CellExpression::sub)) + +#define ag_rp_12(x, y) (opStack.push(CellExpression::mpy)) + +#define ag_rp_13(x, y) (opStack.push(CellExpression::div)) + +#define ag_rp_14() (opStack.push(CellExpression::pow)) + +#define ag_rp_15(x) (doubleStack.push(x), opStack.push(CellExpression::fd)) + +#define ag_rp_16(n) (locatorStack.push(n), opStack.push(CellExpression::fc)) + +#define ag_rp_17() (opStack.push(CellExpression::abs)) + +#define ag_rp_18() (opStack.push(CellExpression::sin)) + +#define ag_rp_19() (opStack.push(CellExpression::sin)) + +#define ag_rp_20() (opStack.push(CellExpression::atan)) + +#define ag_rp_21() (opStack.push(CellExpression::atan2)) + +#define ag_rp_22() (opStack.push(CellExpression::minus)) + +#define ag_rp_23() (opStack.push(CellExpression::not)) + +#define ag_rp_24(x, e) (x*pow(10,e)) + +#define ag_rp_25(x, e) (x*pow(10,-e)) + +#define ag_rp_26(i, f) (i+f) + +#define ag_rp_27(f) (f) + +#define ag_rp_28(d) (d-'0') + +#define ag_rp_29(x, d) (10*x + d-'0') + +#define ag_rp_30(d) ((d-'0')/10.) + +#define ag_rp_31(d, f) ((d-'0' + f)/10.) + +#define ag_rp_32(d) (d-'0') + +#define ag_rp_33(x, d) (10*x + d-'0') + +#define ag_rp_34(c, r) (Locator(r-1,c)) + +#define ag_rp_35(c, r) (Locator(r-1,c).setAbsoluteCol()) + +#define ag_rp_36(c, r) (Locator(r-1,c).setAbsoluteRow()) + +#define ag_rp_37(c, r) (Locator(r-1,c).setAbsoluteRow().setAbsoluteCol()) + +#define ag_rp_38(c) (c - 'a') + +#define ag_rp_39(c) (c = 'A') + +#define ag_rp_40(n) (n) + +#define ag_rp_41(c, n) (26*c + n) + +#define ag_rp_42(d) (d - '0') + +#define ag_rp_43(n, d) (10*n + d - '0') + + +#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 parseKernel_vs_type const ag_null_value NULL_VALUE_INITIALIZER; + +static const unsigned char ag_rpx[] = { + 0, 0, 0, 1, 0, 2, 0, 3, 0, 4, 5, 0, 6, 7, 8, 9, 0, 10, + 11, 0, 12, 13, 0, 14, 15, 16, 17, 18, 19, 20, 21, 0, 22, 0, 23, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 25, 26, 0, 0, + 0, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43 +}; + +static const unsigned char ag_key_itt[] = { + 0 +}; + +static const unsigned short ag_key_pt[] = { +0 +}; + +static const unsigned char ag_key_ch[] = { + 0, 42, 47,255, 98,115,116,255, 47, 97,115,255, 42,255, 42, 47,255, 98, + 115,116,255, 33, 42, 47, 60, 61, 62, 97,115,255, 98,115,116,255, 97,115, + 255, 42, 47,255, 33, 42, 47, 60, 61, 62,255, 42, 47,255, 47,255, 33, 42, + 60, 61, 62,255, 33, 60, 61, 62,255, 33, 61,255 +}; + +static const unsigned char ag_key_act[] = { + 0,0,0,4,3,3,3,4,2,2,3,4,3,4,0,0,4,3,3,3,4,3,3,2,3,3,3,2,3,4,3,3,3,4,2, + 3,4,0,0,4,3,3,2,3,3,3,4,0,0,4,2,4,3,3,3,3,3,4,3,3,3,3,4,3,3,4 +}; + +static const unsigned char ag_key_parm[] = { + 0, 39, 44, 0, 91, 93, 94, 0, 0, 0, 92, 0, 43, 0, 39, 44, 0, 91, + 93, 94, 0, 77, 86, 0, 79, 76, 81, 0, 92, 0, 91, 93, 94, 0, 0, 92, + 0, 39, 44, 0, 77, 86, 0, 79, 76, 81, 0, 39, 44, 0, 0, 0, 77, 86, + 79, 76, 81, 0, 77, 79, 76, 81, 0, 77, 76, 0 +}; + +static const unsigned char ag_key_jmp[] = { + 0, 0, 0, 0, 0, 2, 5, 0, 1, 4, 8, 0, 11, 0, 0, 0, 0, 23, + 25, 28, 0, 13, 15, 14, 17, 19, 21, 17, 31, 0, 34, 36, 39, 0, 30, 42, + 0, 0, 0, 0, 45, 47, 37, 49, 51, 53, 0, 0, 0, 0, 47, 0, 55, 57, + 59, 61, 63, 0, 65, 67, 69, 71, 0, 73, 75, 0 +}; + +static const unsigned char ag_key_index[] = { + 8, 0, 12, 21, 34, 0, 0, 12, 12, 0, 40, 0, 0, 40, 8, 8, 8, 8, + 50, 50, 50, 50, 40, 40, 34, 34, 34, 34, 0, 0, 0, 0, 52, 58, 58, 58, + 63, 0, 0, 0, 40, 40, 0, 0, 40, 0, 0, 34, 34, 34, 34, 8, 34, 8, + 34, 8, 34, 34, 34, 8, 34, 8, 34, 8, 34, 8, 34, 8, 34, 8, 34, 8, + 34, 8, 34, 8, 34, 0, 40, 40, 0, 0, 40, 0, 0, 0, 0, 58, 58, 58, + 58, 58, 58, 58, 58, 63, 0, 0, 40, 40, 40, 8, 34, 8, 34, 0 +}; + +static const unsigned char ag_key_ends[] = { +115,0, 105,110,0, 97,110,0, 105,110,0, 47,0, 61,0, 42,0, +61,0, 61,0, 61,0, 115,0, 105,110,0, 97,110,0, 105,110,0, 115,0, +105,110,0, 97,110,0, 105,110,0, 61,0, 42,0, 61,0, 61,0, 61,0, +61,0, 42,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, 61,0, +61,0, +}; + +#define AG_TCV(x) ag_tcv[(x)] + +static const unsigned char ag_tcv[] = { + 6, 65, 65, 65, 65, 65, 65, 65, 65, 64, 48, 64, 64, 64, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 64, 96, 65, 65, + 60, 65, 75, 65, 90, 89, 84, 82, 95, 83, 54, 85, 57, 57, 57, 57, 57, 57, + 57, 57, 57, 57, 72, 65, 78, 65, 80, 73, 65, 66, 66, 66, 66, 67, 66, 66, + 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, + 66, 65, 65, 65, 65, 65, 65, 68, 68, 68, 68, 69, 68, 68, 68, 68, 68, 68, + 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 65, 74, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, + 65, 65, 65, 65 +}; + +#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(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 = (parseKernel_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 = (parseKernel_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 = (parseKernel_token_type) ag_key_pt[ag_k1+1]; + break; + } + case ag_set_key: + ag_save = (int) ((PCB).la_ptr - (PCB).pointer); + (PCB).token_number = (parseKernel_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 = (parseKernel_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 = (parseKernel_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(void) { + 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(void) { + 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]; +} + +static void ag_undo(void) { + 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).token_number = (parseKernel_token_type) (PCB).drt; + (PCB).ssx = (PCB).dssx; + (PCB).sn = (PCB).dsn; + (PCB).drt = -1; +} + + +static const unsigned char ag_tstt[] = { +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,95,90,89,85,84,83,82,80,78,75,74,73,72,69,68,67,66,65,64,60,57,54,48,0, + 46,47, +96,95,90,89,85,84,83,82,80,78,75,74,73,72,69,68,67,66,65,64,60,57,54,48,43, + 0,41,42, +64,48,44,39,0,1, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,4,5,7,10,12,14,17,22,23, + 24,25,28,30,31,33,34,35,37,49,53,58,61,87,88, +96,95,90,89,85,84,83,82,80,78,75,74,73,72,69,68,67,66,65,64,60,57,54,0, +48,0, +96,95,90,89,85,84,83,82,80,78,75,74,73,72,69,68,67,66,65,64,60,57,54,48,0, +43,0, +57,0,55, +95,89,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,69,67,64,57,54,48,44,39, + 6,0,56, +69,68,67,66,0,58,61, +69,68,67,66,60,57,0,59,61, +69,67,0, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +90,64,48,44,39,0,1,70,71, +90,64,48,44,39,0,1,70,71, +90,64,48,44,39,0,1,70,71, +90,64,48,44,39,0,1,70,71, +95,89,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,64,48,44,39,6,0,1,70,71, +95,89,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,64,48,44,39,6,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,23,24,28,30,31,33,34,35, + 37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,23,24,28,30,31,33,34,35, + 37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,23,24,28,30,31,33,34,35, + 37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +90,0,31, +90,0,31, +90,0,31, +90,0,31, +86,0,29, +85,84,0,26,27, +83,82,0,23,24, +81,80,79,78,0,18,19,20,21, +77,76,0,15,16, +75,0,13, +74,73,0,8,11, +6,0, +57,0,55, +57,0,55, +69,68,67,66,60,57,0,59,61, +57,0,59, +57,0, +83,82,57,0,51, +89,0,32, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,23,24,25,28,30,31,33,34, + 35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,23,24,25,28,30,31,33,34, + 35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,23,24,25,28,30,31,33,34, + 35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,22,23,24,25,28,30,31,33, + 34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,22,23,24,25,28,30,31,33, + 34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,17,22,23,24,25,28,30,31, + 33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,17,22,23,24,25,28,30,31, + 33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,17,22,23,24,25,28,30,31, + 33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,17,22,23,24,25,28,30,31, + 33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,14,17,22,23,24,25,28,30, + 31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,14,17,22,23,24,25,28,30, + 31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,12,14,17,22,23,24,25,28, + 30,31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,10,12,14,17,22,23,24,25, + 28,30,31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +57,0,59, +57,0, +57,0, +57,0,52, +57,0,52, +95,89,86,85,84,83,82,81,80,79,78,77,76,75,74,73,72,64,48,44,39,6,0,1,70,71, +95,89,0,32,36, +89,0,32, +89,0,32, +89,0,32, +85,84,0,26,27, +85,84,0,26,27, +83,82,0,23,24, +83,82,0,23,24, +83,82,0,23,24, +83,82,0,23,24, +81,80,79,78,0,18,19,20,21, +81,80,79,78,0,18,19,20,21, +77,76,0,15,16, +75,0,13, +72,0,9, +57,0, +57,0, +57,0, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +96,94,93,92,91,90,83,82,69,68,67,66,64,60,57,54,48,44,39,0,1,70,71, +96,94,93,92,91,90,83,82,69,68,67,66,60,57,54,0,2,3,5,7,10,12,14,17,22,23,24, + 25,28,30,31,33,34,35,37,49,53,58,61,87,88, +89,0,32, + +}; + + +static unsigned const char ag_astt[1823] = { + 8,8,8,8,8,8,8,8,8,8,8,8,1,8,8,8,1,1,1,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,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, + 8,7,1,1,9,9,1,1,5,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,0,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,2,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,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,5,3,7,1,7,2,5,5,5, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,10,1,5,5,5,5,7,3,2,2,2,2,7,1,2,2,2,2,2,1, + 2,7,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5, + 5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1, + 1,3,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,5,1,1,1,1,7,1,1,3,5,1,1, + 1,1,7,1,1,3,5,1,1,1,1,7,1,1,3,5,1,1,1,1,7,1,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5, + 5,5,5,5,1,1,1,1,5,7,1,1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,1,1,1,5,7,1, + 1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1, + 1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,3,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1, + 1,1,2,2,2,2,1,2,1,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,2, + 2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,7,1,1,7,1, + 1,7,1,1,7,1,1,5,1,1,1,5,1,1,1,1,5,1,1,1,1,1,1,5,1,1,1,1,1,1,5,1,1,1,5,1,1, + 1,5,1,1,3,7,1,4,2,1,5,2,2,2,2,2,1,2,7,1,2,2,7,1,10,4,1,1,8,7,1,1,7,3,1,1,1, + 1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1, + 1,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1, + 1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5, + 5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2, + 1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1, + 1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,2,1,1,1,1,1,1,1,1,1,1,2,1,1,1, + 1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,1,1,1, + 1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5, + 5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7, + 1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2, + 1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2, + 1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1, + 5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1, + 1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5, + 5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1, + 7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2, + 2,2,2,1,2,1,7,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5, + 5,5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,2,7,1,10,4,10,4,2,7,1,2,7,1,5,5,5, + 5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,1,1,1,5,7,1,1,3,1,1,7,2,1,1,7,2,1,7,2,1,7,2, + 1,1,4,1,1,1,1,4,1,1,1,1,4,1,1,1,1,4,1,1,1,1,4,1,1,1,1,4,1,1,1,1,1,1,4,1,1, + 1,1,1,1,1,1,4,1,1,1,1,1,1,4,1,1,1,4,1,1,7,1,10,4,10,4,10,4,5,5,5,5,5,5,5,5, + 5,5,5,5,1,5,5,5,1,1,1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,1,1,1,1, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,1,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,5,1,1, + 1,7,1,1,3,1,1,1,1,1,1,1,1,2,2,2,2,1,2,1,7,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1, + 1,1,1,1,1,1,2,1,1,1,7,2 +}; + + +static const unsigned char ag_pstt[] = { +4,4,4,4,4,4,4,4,4,4,4,4,3,4,4,4,3,1,2,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,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,8,2,7,8, +128,128,1,2,130,128, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,4,24,25,0,39,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,42,44, +45,6, +37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,37,39, +40,8, +40,9,55, +52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,57,41,52,52,52, + 52,10,54, +66,66,67,67,11,42,68, +66,66,67,67,43,70,12,44,69, +45,45,46, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,14,3,3, + 155, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,15,3,3, + 141, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,16,3,3, + 142, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,17,3,3, + 149, +129,3,3,1,2,18,3,3,153, +129,3,3,1,2,19,3,3,152, +129,3,3,1,2,20,3,3,151, +129,3,3,1,2,21,3,3,150, +129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,3,3,1,2, + 129,22,3,3,147, +129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,3,3,1,2, + 129,23,3,3,146, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,24,24,25,25,26,34,31,27,30,29, + 28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,25,24,25,25,26,33,31,27,30,29, + 28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,26,24,25,25,26,32,31,27,30,29, + 28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,27,24,25,46,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +17,28,47, +17,29,48, +17,30,49, +17,31,50, +51,22,52, +53,55,16,56,54, +16,15,11,58,57, +59,61,63,65,8,66,64,62,60, +67,69,6,70,68, +71,4,72, +73,75,2,76,74, +1,39, +40,58,59, +40,53,51, +66,66,67,67,77,70,42,78,69, +70,43,79, +71,62, +80,81,81,45,81, +82,46,31, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,47,24,25,83,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,48,24,25,84,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,49,24,25,85,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,50,24,25,86,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,51,3,3, + 145, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,52,24,25,25,26,23,32,31,27,30, + 29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,53,3,3, + 144, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,54,24,25,25,26,21,32,31,27,30, + 29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,55,3,3, + 143, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,56,24,25,25,26,20,32,31,27,30, + 29,28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,57,24,25,87,25,26,87,32,31,27, + 30,29,28,24,13,10,12,68,23,22, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,58,24,25,88,25,26,88,32,31,27, + 30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,59,3,3, + 140, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,60,24,25,89,33,25,26,33,32,31, + 27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,61,3,3, + 139, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,62,24,25,90,33,25,26,33,32,31, + 27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,63,3,3, + 138, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,64,24,25,91,33,25,26,33,32,31, + 27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,65,3,3, + 137, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,66,24,25,92,33,25,26,33,32,31, + 27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,67,3,3, + 136, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,68,24,25,93,34,33,25,26,33,32, + 31,27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,69,3,3, + 135, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,70,24,25,94,34,33,25,26,33,32, + 31,27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,71,3,3, + 134, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,72,24,25,95,35,34,33,25,26,33, + 32,31,27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,73,3,3, + 133, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,74,24,25,96,36,35,34,33,25,26, + 33,32,31,27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,75,3,3, + 132, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,76,24,25,97,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +70,77,98, +71,63, +71,64, +60,80,99, +60,81,100, +129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,3,3,1,2, + 129,82,3,3,148, +101,82,83,29,102, +82,84,28, +82,85,27, +82,86,26, +53,55,18,56,54, +53,55,17,56,54, +16,15,15,58,57, +16,15,14,58,57, +16,15,13,58,57, +16,15,12,58,57, +59,61,63,65,10,66,64,62,60, +59,61,63,65,9,66,64,62,60, +67,69,7,70,68, +71,5,72, +103,97,104, +71,65, +61,50, +61,49, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,101,3,3, + 154, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,102,24,25,105,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +129,129,129,129,129,129,129,129,129,129,129,129,3,129,129,129,3,1,2,103,3,3, + 131, +14,18,19,20,21,17,16,15,66,66,67,67,11,56,9,104,24,25,3,38,37,36,35,34,33, + 25,26,33,32,31,27,30,29,28,24,13,10,12,68,23,22, +82,105,30, + +}; + + +static const unsigned short ag_sbt[] = { + 0, 23, 50, 78, 84, 126, 150, 152, 177, 179, 182, 210, 217, 226, + 229, 252, 275, 298, 321, 330, 339, 348, 357, 383, 409, 442, 475, 508, + 549, 552, 555, 558, 561, 564, 569, 574, 583, 588, 591, 596, 598, 601, + 604, 613, 616, 618, 623, 626, 667, 708, 749, 790, 813, 847, 870, 904, + 927, 961, 996,1031,1054,1090,1113,1149,1172,1208,1231,1267,1290,1327, + 1350,1387,1410,1448,1471,1510,1533,1574,1577,1579,1581,1584,1587,1613, + 1618,1621,1624,1627,1632,1637,1642,1647,1652,1657,1666,1675,1680,1683, + 1686,1688,1690,1692,1715,1756,1779,1820,1823 +}; + + +static const unsigned short ag_sbe[] = { + 19, 47, 75, 82, 99, 149, 151, 176, 178, 180, 208, 214, 223, 228, + 248, 271, 294, 317, 326, 335, 344, 353, 379, 405, 424, 457, 490, 523, + 550, 553, 556, 559, 562, 566, 571, 578, 585, 589, 593, 597, 599, 602, + 610, 614, 617, 621, 624, 641, 682, 723, 764, 809, 828, 866, 885, 923, + 942, 976,1011,1050,1069,1109,1128,1168,1187,1227,1246,1286,1305,1346, + 1365,1406,1425,1467,1486,1529,1548,1575,1578,1580,1582,1585,1609,1615, + 1619,1622,1625,1629,1634,1639,1644,1649,1654,1661,1670,1677,1681,1684, + 1687,1689,1691,1711,1730,1775,1794,1821,1823 +}; + + +static const unsigned char ag_fl[] = { + 2,2,1,5,1,3,1,3,1,3,3,1,3,3,3,3,1,3,3,1,3,3,1,3,1,1,4,4,4,4,6,3,2,2,2, + 1,1,2,0,1,3,1,2,0,1,3,1,0,1,4,4,3,0,1,2,2,1,2,1,2,1,2,2,3,3,4,1,1,1,2, + 1,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,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 +}; + +static const unsigned char ag_ptt[] = { + 0, 4, 5, 5, 7, 7, 10, 10, 12, 12, 12, 14, 14, 14, 14, 14, 17, 17, + 17, 22, 22, 22, 25, 25, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 1, + 41, 41, 42, 42, 1, 46, 46, 47, 47, 1, 87, 51, 51, 87, 87, 49, 56, 56, + 49, 49, 53, 53, 55, 55, 52, 52, 88, 88, 88, 88, 61, 61, 58, 58, 59, 59, + 38, 38, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, + 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 50, 50, 62, 62, 63, + 63, 70, 70, 71, 71, 9, 8, 11, 13, 15, 16, 18, 19, 20, 21, 23, 24, 26, + 27, 29, 2, 3, 32, 31, 30, 33, 34, 35, 36, 37 +}; + + +static void ag_ra(void) +{ + switch(ag_rpx[(PCB).ag_ap]) { + case 1: ag_rp_1(); break; + case 2: ag_rp_2(); break; + case 3: ag_rp_3(); break; + case 4: ag_rp_4(V(0,(void *)), V(2,(void *))); break; + case 5: ag_rp_5(V(0,(void *)), V(2,(void *))); break; + case 6: ag_rp_6(); break; + case 7: ag_rp_7(); break; + case 8: ag_rp_8(); break; + case 9: ag_rp_9(); break; + case 10: ag_rp_10(); break; + case 11: ag_rp_11(); break; + case 12: ag_rp_12(V(0,(void *)), V(2,(void *))); break; + case 13: ag_rp_13(V(0,(void *)), V(2,(void *))); break; + case 14: ag_rp_14(); break; + case 15: ag_rp_15(V(0,(double *))); break; + case 16: ag_rp_16(V(0,(Locator *))); break; + case 17: ag_rp_17(); break; + case 18: ag_rp_18(); break; + case 19: ag_rp_19(); break; + case 20: ag_rp_20(); break; + case 21: ag_rp_21(); break; + case 22: ag_rp_22(); break; + case 23: ag_rp_23(); break; + case 24: V(0,(double *)) = ag_rp_24(V(0,(double *)), V(3,(int *))); break; + case 25: V(0,(double *)) = ag_rp_25(V(0,(double *)), V(3,(int *))); break; + case 26: V(0,(double *)) = ag_rp_26(V(0,(double *)), V(2,(double *))); break; + case 27: V(0,(double *)) = ag_rp_27(V(1,(double *))); break; + case 28: V(0,(double *)) = ag_rp_28(V(0,(int *))); break; + case 29: V(0,(double *)) = ag_rp_29(V(0,(double *)), V(1,(int *))); break; + case 30: V(0,(double *)) = ag_rp_30(V(0,(int *))); break; + case 31: V(0,(double *)) = ag_rp_31(V(0,(int *)), V(1,(double *))); break; + case 32: V(0,(int *)) = ag_rp_32(V(0,(int *))); break; + case 33: V(0,(int *)) = ag_rp_33(V(0,(int *)), V(1,(int *))); break; + case 34: V(0,(Locator *)) = ag_rp_34(V(0,(int *)), V(1,(int *))); break; + case 35: V(0,(Locator *)) = ag_rp_35(V(1,(int *)), V(2,(int *))); break; + case 36: V(0,(Locator *)) = ag_rp_36(V(0,(int *)), V(2,(int *))); break; + case 37: V(0,(Locator *)) = ag_rp_37(V(1,(int *)), V(3,(int *))); break; + case 38: V(0,(int *)) = ag_rp_38(V(0,(int *))); break; + case 39: V(0,(int *)) = ag_rp_39(V(0,(int *))); break; + case 40: V(0,(int *)) = ag_rp_40(V(0,(int *))); break; + case 41: V(0,(int *)) = ag_rp_41(V(0,(int *)), V(1,(int *))); break; + case 42: V(0,(int *)) = ag_rp_42(V(0,(int *))); break; + case 43: V(0,(int *)) = ag_rp_43(V(0,(int *)), V(1,(int *))); break; + } + (PCB).la_ptr = (PCB).pointer; +} + +#define TOKEN_NAMES parseKernel_token_names +const char *const parseKernel_token_names[97] = { + "input string", + "white space", + "real", + "cell name", + "input string", + "expression", + "eof", + "logical or expression", + "'\\?'", + "':'", + "logical and expression", + "'|'", + "equality expression", + "'&'", + "relational expression", + "\"==\"", + "\"!=\"", + "additive expression", + "'<'", + "\"<=\"", + "'>'", + "\">=\"", + "multiplicative expression", + "'+'", + "'-'", + "factor", + "'*'", + "'/'", + "primary", + "\"**\"", + "\"abs\"", + "'('", + "')'", + "\"sin\"", + "\"asin\"", + "\"atan\"", + "','", + "'!'", + "", + "\"/*\"", + "", + "", + "", + "\"*/\"", + "\"//\"", + "", + "", + "", + "'\\n'", + "simple real", + "", + "", + "exponent", + "integer part", + "'.'", + "fraction part", + "", + "digit", + "column", + "row", + "'$'", + "letter", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "':'", + "'\\?'", + "'|'", + "'&'", + "\"==\"", + "\"!=\"", + "'<'", + "\"<=\"", + "'>'", + "\">=\"", + "'+'", + "'-'", + "'*'", + "'/'", + "\"**\"", + "real", + "cell name", + "')'", + "'('", + "\"abs\"", + "\"sin\"", + "\"asin\"", + "\"atan\"", + "','", + "'!'", + +}; + +#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(void) { + 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(void); +static int ag_action_2_r_proc(void); +static int ag_action_3_r_proc(void); +static int ag_action_4_r_proc(void); +static int ag_action_1_s_proc(void); +static int ag_action_3_s_proc(void); +static int ag_action_1_proc(void); +static int ag_action_2_proc(void); +static int ag_action_3_proc(void); +static int ag_action_4_proc(void); +static int ag_action_5_proc(void); +static int ag_action_6_proc(void); +static int ag_action_7_proc(void); +static int ag_action_8_proc(void); +static int ag_action_9_proc(void); +static int ag_action_10_proc(void); +static int ag_action_11_proc(void); +static int ag_action_8_proc(void); + + +static int (*const ag_r_procs_scan[])(void) = { + 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[])(void) = { + 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[])(void) = { + 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(void) { + int ag_t = (PCB).token_number; + (PCB).btsx = 0, (PCB).drt = -1; + do { + ag_track(); + (PCB).token_number = (parseKernel_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(ag_k); + } + } + } while ((PCB).token_number == (parseKernel_token_type) ag_t); + (PCB).la_ptr = (PCB).pointer; + return 1; +} + +static int ag_action_11_proc(void) { + int ag_t = (PCB).token_number; + + (PCB).btsx = 0, (PCB).drt = -1; + do { + (*(int *) &(PCB).vs[(PCB).ssx]) = *(PCB).pointer; + (PCB).ssx--; + ag_track(); + ag_ra(); + if ((PCB).exit_flag != AG_RUNNING_CODE) return 0; + (PCB).ssx++; + (PCB).token_number = (parseKernel_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(ag_k); + } + } + } + while ((PCB).token_number == (parseKernel_token_type) ag_t); + (PCB).la_ptr = (PCB).pointer; + return 1; +} + +static int ag_action_3_r_proc(void) { + 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 = (parseKernel_token_type) ag_ptt[(PCB).ag_ap]; + ag_ra(); + return (PCB).exit_flag == AG_RUNNING_CODE; +} + +static int ag_action_3_s_proc(void) { + 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 = (parseKernel_token_type) ag_ptt[(PCB).ag_ap]; + ag_ra(); + return (PCB).exit_flag == AG_RUNNING_CODE; +} + +static int ag_action_4_r_proc(void) { + int ag_sd = ag_fl[(PCB).ag_ap] - 1; + if (ag_sd) (PCB).sn = (PCB).ss[(PCB).ssx -= ag_sd]; + (PCB).reduction_token = (parseKernel_token_type) ag_ptt[(PCB).ag_ap]; + return 1; +} + +static int ag_action_2_proc(void) { + (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; + (PCB).ss[(PCB).ssx] = (PCB).sn; + (PCB).ssx++; + (PCB).sn = (PCB).ag_ap; + ag_track(); + return 0; +} + +static int ag_action_9_proc(void) { + if ((PCB).drt == -1) { + (PCB).drt=(PCB).token_number; + (PCB).dssx=(PCB).ssx; + (PCB).dsn=(PCB).sn; + } + ag_prot(); + (PCB).vs[(PCB).ssx] = ag_null_value; + (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(void) { + (PCB).ssx++; + (PCB).sn = (PCB).ag_ap; + return 0; +} + +static int ag_action_7_proc(void) { + --(PCB).ssx; + (PCB).la_ptr = (PCB).pointer; + (PCB).exit_flag = AG_SUCCESS_CODE; + return 0; +} + +static int ag_action_1_proc(void) { + ag_track(); + (PCB).exit_flag = AG_SUCCESS_CODE; + return 0; +} + +static int ag_action_1_r_proc(void) { + (PCB).exit_flag = AG_SUCCESS_CODE; + return 0; +} + +static int ag_action_1_s_proc(void) { + (PCB).exit_flag = AG_SUCCESS_CODE; + return 0; +} + +static int ag_action_4_proc(void) { + int ag_sd = ag_fl[(PCB).ag_ap] - 1; + (PCB).reduction_token = (parseKernel_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 (PCB).ss[(PCB).ssx] = (PCB).sn; + ag_track(); + 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]])() == 0) break; + } + return 0; +} + +static int ag_action_3_proc(void) { + 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 (PCB).ss[(PCB).ssx] = (PCB).sn; + ag_track(); + (PCB).reduction_token = (parseKernel_token_type) ag_ptt[(PCB).ag_ap]; + ag_ra(); + 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]])() == 0) break; + } + return 0; +} + +static int ag_action_8_proc(void) { + ag_undo(); + (PCB).la_ptr = (PCB).pointer; + (PCB).exit_flag = AG_SYNTAX_ERROR_CODE; + ag_diagnose(); + SYNTAX_ERROR; + {(PCB).la_ptr = (PCB).pointer + 1; ag_track();} + return (PCB).exit_flag == AG_RUNNING_CODE; +} + +static int ag_action_5_proc(void) { + 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 { + (PCB).ss[(PCB).ssx] = (PCB).sn; + } + (PCB).la_ptr = (PCB).pointer; + (PCB).reduction_token = (parseKernel_token_type) ag_ptt[(PCB).ag_ap]; + ag_ra(); + 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]])() == 0) break; + } + return (PCB).exit_flag == AG_RUNNING_CODE; +} + +static int ag_action_6_proc(void) { + int ag_sd = ag_fl[(PCB).ag_ap]; + (PCB).reduction_token = (parseKernel_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).vs[(PCB).ssx] = ag_null_value; + (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]])() == 0) break; + } + return (PCB).exit_flag == AG_RUNNING_CODE; +} + + +void init_parseKernel(void) { + (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 parseKernel(void) { + init_parseKernel(); + (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 = (parseKernel_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(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]])(); + } +} + +