head	1.4;
access;
symbols;
locks
	gtoal:1.4; strict;
comment	@ * @;


1.4
date	2022.02.19.02.50.29;	author gtoal;	state Exp;
branches;
next	1.3;

1.3
date	2022.02.17.21.14.47;	author gtoal;	state Exp;
branches;
next	1.2;

1.2
date	2022.02.15.22.32.10;	author gtoal;	state Exp;
branches;
next	1.1;

1.1
date	2022.02.15.00.54.52;	author gtoal;	state Exp;
branches;
next	;


desc
@generated file
@


1.4
log
@*** empty log message ***
@
text
@#define WHITESPACE_PHRASE 1023
#define GUARD  (1<<30)
#define NEGATE (1<<29)
#define MAX_GRAMMAR 2067
#define PHRASES_START 512
#define PHRASE_BASE 518
int gram[MAX_GRAMMAR] = {
    2,     3, 10000,  1023|GUARD ,    58,     1, 10001,     1,     2,   527,   525,    26,     2,  1023|GUARD ,    65,     2, 
 1023|GUARD ,    66,     2,  1023|GUARD ,    67,     2,  1023|GUARD ,    68,     2,  1023|GUARD ,    69,     2,  1023|GUARD ,    70,     2,  1023|GUARD , 
   71,     2,  1023|GUARD ,    72,     2,  1023|GUARD ,    73,     2,  1023|GUARD ,    74,     2,  1023|GUARD ,    75,     2,  1023|GUARD ,    76, 
    2,  1023|GUARD ,    77,     2,  1023|GUARD ,    78,     2,  1023|GUARD ,    79,     2,  1023|GUARD ,    80,     2,  1023|GUARD ,    81,     2, 
 1023|GUARD ,    82,     2,  1023|GUARD ,    83,     2,  1023|GUARD ,    84,     2,  1023|GUARD ,    85,     2,  1023|GUARD ,    86,     2,  1023|GUARD , 
   87,     2,  1023|GUARD ,    88,     2,  1023|GUARD ,    89,     2,  1023|GUARD ,    90,    10,     2,  1023|GUARD ,    48,     2,  1023|GUARD , 
   49,     2,  1023|GUARD ,    50,     2,  1023|GUARD ,    51,     2,  1023|GUARD ,    52,     2,  1023|GUARD ,    53,     2,  1023|GUARD ,    54, 
    2,  1023|GUARD ,    55,     2,  1023|GUARD ,    56,     2,  1023|GUARD ,    57,     2,     1,   520,     1,   521,     3,     2, 
  520,   523,     2,   521,   523,     0,     2,     2,   564,   524,     0,     4,     8,  1023|GUARD ,   256,  1023|GUARD , 
  257,  1023|GUARD ,   258,   524,   517,     8,  1023|GUARD ,   256,  1023|GUARD ,   257,  1023|GUARD ,   259,   524,   517,     8,  1023|GUARD , 
  256,  1023|GUARD ,   257,  1023|GUARD ,   260,   524,   517,     2,   524,   517,     2,     2,  1023|GUARD ,   261,     2,  1023|GUARD , 
  262,     2,     2,   530,   527,     0,     2,     3,   536,   542,   528,     1,   536,     2,     5,  1023|GUARD , 
  256,  1023|GUARD ,   257,   526,     2,  1023|GUARD ,   256,    22,     6,  1023|GUARD ,   263,   564,   528,   529,   564,     7, 
  676,   644,   533,   584,   674,   639,   564,     9,   676,   644,   584,   674,   639,   564,   528,   529, 
  564,     7,   531,   676,   644,   584,   674,   639,   564,     1,   549,     6,  1023|GUARD ,   264,  1023|GUARD ,   265, 
  677,   564,    14,  1023|GUARD ,   266,   584,   633,  1023|GUARD ,    40,   608,  1023|GUARD ,    58,   608,  1023|GUARD ,    41,   632, 
  564,     3,  1023|GUARD ,   267,   572,     3,  1023|GUARD ,   268,   572,     7,  1023|GUARD ,   269,   584,  1023|GUARD ,   267,   584, 
  633,     7,  1023|GUARD ,   256,  1023|GUARD ,   257,  1023|GUARD ,   270,   564,     3,  1023|GUARD ,   270,   564,     7,  1023|GUARD ,   256, 
 1023|GUARD ,   257,  1023|GUARD ,   271,   564,     3,  1023|GUARD ,   271,   564,     5,  1023|GUARD ,   272,  1023|GUARD ,   262,   564,     6, 
 1023|GUARD ,   273,  1023|GUARD ,   274,   584,   564,     4,  1023|GUARD ,   275,   569,   564,     4,  1023|GUARD ,   276,   569,   564, 
    4,  1023|GUARD ,   277,  1023|GUARD ,   278,     4,  1023|GUARD ,   277,  1023|GUARD ,   279,     1,   565,     1,   564,     2,     3, 
 1023|GUARD ,    64,   532,     0,     5,     8,  1023|GUARD ,    45,   569,  1023|GUARD ,    40,   584,  1023|GUARD ,    41,     6,   569, 
 1023|GUARD ,    40,   584,  1023|GUARD ,    41,     4,   569,  1023|GUARD ,    45,   569,     1,   569,     3,  1023|GUARD ,    35,   584, 
    2,     2,  1023|GUARD ,   280,     3,  1023|GUARD ,   281,   534,     2,     5,  1023|GUARD ,    40,   569,  1023|GUARD ,    41,     0, 
    2,     1,   533,     0,     5,     8,   584,  1023|GUARD ,    40,   635,  1023|GUARD ,    41,   518,   536,     9,   584, 
 1023|GUARD ,    40,  1023|GUARD ,    42,  1023|GUARD ,    41,   518,   536,     3,   584,   518,   536,     3,   582,   518,   536, 
    0,     1,     5,  1023|GUARD ,   282,   540,   541,   564,     1,     2,   582,   539,     2,     4,  1023|GUARD ,    44, 
  582,   539,     0,     1,     6,   538,  1023|GUARD ,    45,  1023|GUARD ,    62,   547,     2,     4,  1023|GUARD ,    44,   540, 
  541,     0,     9,     1,   543,     2,   546,   698,     3,  1023|GUARD ,    42,   586,     1,   556,     1,   557, 
    1,   537,    12,  1023|GUARD ,   283,   638,   555,   634,  1023|GUARD ,   284,   564,   528,  1023|GUARD ,   285,   564,     5, 
 1023|GUARD ,   281,   584,   639,   564,     1,   530,     1,     7,  1023|GUARD ,   263,   564,   528,  1023|GUARD ,   256,   564, 
    2,     3,  1023|GUARD ,   286,   546,     0,     3,     5,  1023|GUARD ,    45,  1023|GUARD ,    62,   594,     2,   687,   608, 
    0,    14,     5,   584,   618,   619,   545,   544,     6,  1023|GUARD ,   287,  1023|GUARD ,   288,   513,   544,     5, 
 1023|GUARD ,    45,  1023|GUARD ,    62,   547,     2,  1023|GUARD ,   289,     2,  1023|GUARD ,   290,     2,  1023|GUARD ,   291,     4,  1023|GUARD , 
  292,   687,   608,     2,  1023|GUARD ,   293,     4,  1023|GUARD ,   294,   582,   544,     3,  1023|GUARD ,   294,   544,     2, 
 1023|GUARD ,   295,     5,  1023|GUARD ,   296,   638,   635,   694,     2,  1023|GUARD ,   297,     2,  1023|GUARD ,   298,     3,     6, 
  584,  1023|GUARD ,    40,   608,  1023|GUARD ,    41,     1,   584,     1,   582,     3,     2,  1023|GUARD ,   258,     2,  1023|GUARD , 
  260,     2,  1023|GUARD ,   259,     5,     5,   531,   703,   648,   679,   564,     4,   531,   648,   678,   564, 
    9,   531,   550,  1023|GUARD ,   264,  1023|GUARD ,   299,   551,   552,   564,     7,   531,   550,  1023|GUARD ,   264,   553, 
  554,   564,    21,  1023|GUARD ,   300,  1023|GUARD ,   301,   584,  1023|GUARD ,    61,  1023|GUARD ,    67,  1023|GUARD ,    72,  1023|GUARD ,    65, 
 1023|GUARD ,    82,  1023|GUARD ,    60,   569,  1023|GUARD ,    62,   564,     2,     1,   703,     0,     1,     8,   584,   633, 
  662,  1023|GUARD ,    40,   653,  1023|GUARD ,    41,     2,     3,  1023|GUARD ,    44,   551,     0,     1,     7,   584,   633, 
 1023|GUARD ,    40,   653,  1023|GUARD ,    41,     2,     4,  1023|GUARD ,    44,   553,   554,     0,     2,     2,  1023|GUARD ,    42, 
    1,   635,     4,     9,  1023|GUARD ,   302,   693,   564,   528,  1023|GUARD ,   303,   692,   564,     9,   690,  1023|GUARD , 
  302,   564,   528,  1023|GUARD ,   303,   692,   564,    11,   689,  1023|GUARD ,   304,  1023|GUARD ,   302,   564,   528,  1023|GUARD , 
  303,   692,   564,     4,   689,  1023|GUARD ,   304,   546,     1,     3,   631,   590,   561,     3,     8,  1023|GUARD , 
  305,   631,   590,   559,   564,   528,   558,     8,  1023|GUARD ,   305,   559,   564,   528,  1023|GUARD ,   285,   564, 
    3,  1023|GUARD ,   285,   560,     2,     2,  1023|GUARD ,   284,     0,     4,     9,  1023|GUARD ,   305,  1023|GUARD ,   284,   564, 
  528,  1023|GUARD ,   285,   564,     3,  1023|GUARD ,   305,   557,     4,  1023|GUARD ,   305,   546,   564,     1,   564,     2, 
    6,   562,  1023|GUARD ,   284,   564,   528,   558,     4,  1023|GUARD ,   304,   546,   560,     2,     2,  1023|GUARD ,   304, 
    0,     2,     2,  1023|GUARD ,   284,     0,     2,     1,   515,     2,  1023|GUARD ,    59,     2,     3,  1023|GUARD ,   306, 
  566,     3,  1023|GUARD ,    33,   566,     7,     2,   516,   566,     2,   514,   566,     2,   513,   566,     2, 
  520,   566,     2,   521,   566,     2,   512,   566,     1,   515,     2,     1,   515,     1,   568,     1, 
    2,  1023|GUARD ,    59,     3,     4,   582,  1023|GUARD ,    95,   570,     1,   582,     1,   576,     1,     2,   522, 
  571,     2,     2,   522,   571,     0,     2,     2,   573,   514,     1,   513,     2,     2,  1023|GUARD ,    69, 
    0,     2,     1,   569,     1,   577,     3,     1,   569,     1,   577,     1,   572,     1,     2,   520, 
  513,     2,     3,   582,   579,   581,     2,   578,   581,     1,     3,  1023|GUARD ,    46,   582,     2,     1, 
  578,     0,     3,     2,  1023|GUARD ,    43,     2,  1023|GUARD ,    45,     0,     2,     4,  1023|GUARD ,    64,   580,   582, 
    0,     1,     2,   521,   583,     2,     1,   582,     0,     1,     3,   520,   585|NEGATE,   523,     1,     1, 
  513,     5,     1,   567,     2,   516,   586,     2,   514,   586,     2,   513,   586,     2,   512,   586, 
    3,     4,  1023|GUARD ,   286,   591,   588,     4,  1023|GUARD ,   307,   591,   589,     0,     2,     4,  1023|GUARD ,   286, 
  591,   588,     0,     2,     4,  1023|GUARD ,   307,   591,   589,     0,     1,     2,   591,   587,     5,     1, 
  593,     4,   608,   603,   608,   592,     2,   584,   606,     5,  1023|GUARD ,    40,   590,  1023|GUARD ,    41,     3, 
 1023|GUARD ,   308,   591,     2,     2,   603,   608,     0,     1,     6,   597,  1023|GUARD ,    45,  1023|GUARD ,    62,   594, 
    2,     2,   599,   601,     2,   600,   602,     1,     3,   584,   618,   620,     2,     1,   595,     1, 
  572,     1,     2,   596,   598,     2,     4,  1023|GUARD ,    46,   596,   598,     0,     1,     5,  1023|GUARD ,    40, 
  597,  1023|GUARD ,    41,     1,     1,   595,     2,     4,  1023|GUARD ,    46,   600,   602,     0,     2,     4,  1023|GUARD , 
   46,   599,   601,     0,     8,     4,  1023|GUARD ,    61,  1023|GUARD ,    61,     2,  1023|GUARD ,    61,     1,   605,     1, 
  604,     4,  1023|GUARD ,    60,  1023|GUARD ,    61,     2,  1023|GUARD ,    60,     4,  1023|GUARD ,    62,  1023|GUARD ,    61,     2,  1023|GUARD , 
   62,     3,     2,  1023|GUARD ,    35,     4,  1023|GUARD ,    92,  1023|GUARD ,    61,     4,  1023|GUARD ,    60,  1023|GUARD ,    62,     2, 
    4,  1023|GUARD ,    35,  1023|GUARD ,    35,     6,  1023|GUARD ,    92,  1023|GUARD ,    61,  1023|GUARD ,    61,     2,     6,  1023|GUARD ,    40, 
  608,   607,  1023|GUARD ,    41,     0,     2,     4,  1023|GUARD ,    44,   608,   607,     0,     1,     2,   610,   609, 
    2,     3,   628,   610,   609,     0,     1,     2,   612,   611,     2,     3,   627,   612,   611,     0, 
    1,     2,   614,   613,     2,     3,   623,   614,   613,     0,     1,     2,   615,   617,     2,     2, 
  616,   615,     0,     1,     2,   617,   624,     1,     2,   629,   621,     4,     5,  1023|GUARD ,    91,   608, 
 1023|GUARD ,    93,     5,  1023|GUARD ,    43,  1023|GUARD ,    43,   608,     5,  1023|GUARD ,    45,  1023|GUARD ,    45,   608,     1,   606, 
    2,     5,  1023|GUARD ,    95,   584,   618,   619,     0,     2,     5,  1023|GUARD ,    95,   584,   618,   620,     0, 
    5,     3,   584,   618,   620,     1,   575,     5,  1023|GUARD ,    40,   608,  1023|GUARD ,    41,     5,  1023|GUARD ,   124, 
  608,  1023|GUARD ,   124,     5,  1023|GUARD ,    33,   608,  1023|GUARD ,    33,     4,     1,   623,     1,   624,     1,   627, 
    1,   628,     2,     4,  1023|GUARD ,    60,  1023|GUARD ,    60,     4,  1023|GUARD ,    62,  1023|GUARD ,    62,     2,     1,   625, 
    1,   626,     3,     8,  1023|GUARD ,    42,  1023|GUARD ,    42,  1023|GUARD ,    42,  1023|GUARD ,    42,     4,  1023|GUARD ,    92,  1023|GUARD , 
   92,     4,  1023|GUARD ,    94,  1023|GUARD ,    94,     3,     4,  1023|GUARD ,    42,  1023|GUARD ,    42,     2,  1023|GUARD ,    92,     2, 
 1023|GUARD ,    94,     4,     2,  1023|GUARD ,    42,     4,  1023|GUARD ,    47,  1023|GUARD ,    47,     2,  1023|GUARD ,    47,     2,  1023|GUARD , 
   38,     5,     2,  1023|GUARD ,    43,     2,  1023|GUARD ,    45,     4,  1023|GUARD ,    33,  1023|GUARD ,    33,     2,  1023|GUARD ,    33, 
    2,  1023|GUARD ,    46,     4,     2,  1023|GUARD ,    43,     2,  1023|GUARD ,    45,     1,   630,     0,     2,     2,  1023|GUARD , 
   92,     2,  1023|GUARD ,   126,     2,     2,  1023|GUARD ,   309,     2,  1023|GUARD ,   310,     2,    13,  1023|GUARD ,    44,   584, 
  633,  1023|GUARD ,    40,   608,  1023|GUARD ,    58,   608,  1023|GUARD ,    41,   632,     0,     2,     4,  1023|GUARD ,    44,   584, 
  633,     0,     2,     4,  1023|GUARD ,    44,   635,   634,     0,     1,     3,   629,   637,   636,     2,     3, 
  622,   637,   636,     0,     5,     1,   584,     1,   575,     5,  1023|GUARD ,    40,   635,  1023|GUARD ,    41,     5, 
 1023|GUARD ,   124,   635,  1023|GUARD ,   124,     5,  1023|GUARD ,    33,   635,  1023|GUARD ,    33,     2,     2,  1023|GUARD ,   311,     0, 
    2,     6,  1023|GUARD ,    40,   641,   640,  1023|GUARD ,    41,     0,     2,     3,   673,   641,   640,     0,     3, 
    5,   648,   666,   584,   682,   633,     5,   644,   643,   584,   633,   639,     5,  1023|GUARD ,   312,   642, 
  584,   633,     2,     5,  1023|GUARD ,    40,   584,  1023|GUARD ,    41,     0,     2,     2,  1023|GUARD ,   312,     0,     3, 
    2,  1023|GUARD ,   313,     2,  1023|GUARD ,   314,     2,   648,   645,     2,     1,   646,     2,  1023|GUARD ,   315,     2, 
    2,  1023|GUARD ,   316,     2,  1023|GUARD ,   317,    10,     2,  1023|GUARD ,   318,     2,  1023|GUARD ,   319,     2,  1023|GUARD ,   320, 
    3,  1023|GUARD ,   278,   672,     3,  1023|GUARD ,   321,   668,     3,  1023|GUARD ,   322,   668,     3,  1023|GUARD ,   323,   668, 
    3,  1023|GUARD ,   324,   668,     3,  1023|GUARD ,   325,   669,     3,  1023|GUARD ,   264,   652,     1,     3,   650,   647, 
  643,     4,     5,  1023|GUARD ,   326,  1023|GUARD ,   327,   649,     5,  1023|GUARD ,   328,  1023|GUARD ,   327,   649,     3,  1023|GUARD , 
  329,   649,     0,     3,     1,   651,     1,   649,     0,     1,     7,  1023|GUARD ,   330,  1023|GUARD ,    40,   584, 
 1023|GUARD ,    41,     3,     5,  1023|GUARD ,    40,   653,  1023|GUARD ,    41,     6,  1023|GUARD ,    40,  1023|GUARD ,    42,  1023|GUARD ,    41, 
    0,     2,     1,   584,     3,   656,   655,   654,     2,     5,  1023|GUARD ,   307,   656,   655,   654,     0, 
    2,     4,  1023|GUARD ,    44,   656,   655,     0,     2,     2,   648,   657,     7,  1023|GUARD ,    40,   656,   655, 
  654,  1023|GUARD ,    41,     2,     3,   666,   584,   633,     3,  1023|GUARD ,   299,   658,     1,     4,   584,   633, 
  662,   659,     2,     3,  1023|GUARD ,    44,   658,     0,     2,     1,   608,     2,   647,   584,     3,     2, 
 1023|GUARD ,    42,     1,   608,     2,   647,   584,     1,     9,  1023|GUARD ,    40,   660,  1023|GUARD ,    58,   661,   664, 
 1023|GUARD ,    41,     1,     9,  1023|GUARD ,    40,   660,  1023|GUARD ,    58,   661,   665,  1023|GUARD ,    41,     2,     7,  1023|GUARD , 
   44,   608,  1023|GUARD ,    58,   608,   664,     0,     2,     7,  1023|GUARD ,    44,   660,  1023|GUARD ,    58,   661,   665, 
    0,     3,     5,  1023|GUARD ,   299,   667,  1023|GUARD ,   312,     5,  1023|GUARD ,   299,   682,  1023|GUARD ,   312,     0,     2, 
    5,  1023|GUARD ,    40,   569,  1023|GUARD ,    41,     0,     2,     2,  1023|GUARD ,   318,     0,     2,     5,  1023|GUARD ,    40, 
  670,  1023|GUARD ,    41,     0,     2,     1,   671,     0,     2,     3,   629,   637,   636,     2,  1023|GUARD ,    42, 
    4,     2,  1023|GUARD ,   319,     2,  1023|GUARD ,   318,     4,  1023|GUARD ,   278,  1023|GUARD ,   319,     0,     2,     2,  1023|GUARD , 
   44,     0,     2,     3,  1023|GUARD ,   331,   675,     0,     1,     1,   514,     5,     2,  1023|GUARD ,   332,     2, 
 1023|GUARD ,   333,     2,  1023|GUARD ,   334,     2,  1023|GUARD ,   260,     0,     2,     3,  1023|GUARD ,   281,   584,     8,   584, 
 1023|GUARD ,    40,   656,   655,   654,  1023|GUARD ,    41,     3,     6,   666,   535,   684,   682,   686,   685,     8, 
 1023|GUARD ,   299,   535,   683,   584,   633,   662,   680,     8,  1023|GUARD ,   299,   662,   535,   683,   584,   633, 
  681,     3,     4,   666,   535,   700,   699,     7,  1023|GUARD ,   299,   683,   535,   662,   584,   688,     7, 
 1023|GUARD ,   299,   683,   535,   584,   662,   688,     2,     6,  1023|GUARD ,    44,   584,   633,   662,   680,     0, 
    2,     5,  1023|GUARD ,    44,   584,   633,   681,     0,     2,     1,   663,     0,     2,     2,  1023|GUARD ,   265, 
    0,     2,     2,  1023|GUARD ,    42,     1,   584,     3,     5,  1023|GUARD ,    44,  1023|GUARD ,    42,   685,     5,  1023|GUARD , 
   44,   584,   686,   685,     0,     2,     2,   687,   608,     0,     2,     4,  1023|GUARD ,    61,  1023|GUARD ,    61, 
    1,   691,     2,     7,   687,   702,   629,   637,   636,   669,   701,     0,     2,     3,  1023|GUARD ,   335, 
  590,     3,  1023|GUARD ,   336,   590,     3,     3,  1023|GUARD ,   335,   590,     3,  1023|GUARD ,   336,   590,    11,  1023|GUARD , 
  337,   584,   691,   608,  1023|GUARD ,    44,   608,  1023|GUARD ,    44,   608,     2,     2,  1023|GUARD ,    61,     4,  1023|GUARD , 
   60,  1023|GUARD ,    45,     2,     3,  1023|GUARD ,   336,   590,     0,     2,     9,   584,   691,   608,  1023|GUARD ,    44, 
  608,  1023|GUARD ,    44,   608,     0,     2,     4,  1023|GUARD ,    44,   695,   696,     0,     2,     1,   608,     0, 
    2,     4,  1023|GUARD ,    44,   695,   697,     0,     2,     3,  1023|GUARD ,    44,   597,     0,     4,     3,   631, 
  590,   564,     2,   690,   564,     1,   564,     0,     2,     4,  1023|GUARD ,    44,   700,   699,     0,     1, 
    3,   584,   674,   686,     2,     8,  1023|GUARD ,    44,   702,   629,   637,   636,   669,   701,     0,     2, 
    1,   565,     0,     5,     2,  1023|GUARD ,   338,     2,  1023|GUARD ,   333,     2,  1023|GUARD ,   339,     2,  1023|GUARD ,   340, 
    2,  1023|GUARD ,   300, 
};

#define MAX_KEYWORD 85
char *keyword[MAX_KEYWORD] = { // Keywords are based at 256
  "end", "of", "file", "perm", 
  "prim", "programme", "program", "begin", 
  "record", "format", "switch", "include", 
  "option", "from", "list", "mcode", 
  "trusted", "main", "ep", "control", 
  "diagnose", "reals", "long", "normal", 
  "specalias", "spec", "fault", "on", 
  "start", "finish", "and", "print", 
  "text", "return", "true", "false", 
  "result", "monitorstop", "monitor", "stop", 
  "signal", "exit", "continue", "array", 
  "const", "char", "cycle", "repeat", 
  "then", "else", "comment", "or", 
  "not", "if", "unless", "event", 
  "name", "routine", "predicate", "map", 
  "fn", "function", "integer", "real", 
  "label", "byte", "mite", "short", 
  "half", "string", "read", "only", 
  "write", "volatile", "register", "alias", 
  "system", "external", "dynamic", "while", 
  "until", "for", "own", "extrinsic", 
  "constant", 
};

// These are used in AST__KW records:
#define KW_end 0
#define KW_of 1
#define KW_file 2
#define KW_perm 3
#define KW_prim 4
#define KW_programme 5
#define KW_program 6
#define KW_begin 7
#define KW_record 8
#define KW_format 9
#define KW_switch 10
#define KW_include 11
#define KW_option 12
#define KW_from 13
#define KW_list 14
#define KW_mcode 15
#define KW_trusted 16
#define KW_main 17
#define KW_ep 18
#define KW_control 19
#define KW_diagnose 20
#define KW_reals 21
#define KW_long 22
#define KW_normal 23
#define KW_specalias 24
#define KW_spec 25
#define KW_fault 26
#define KW_on 27
#define KW_start 28
#define KW_finish 29
#define KW_and 30
#define KW_print 31
#define KW_text 32
#define KW_return 33
#define KW_true 34
#define KW_false 35
#define KW_result 36
#define KW_monitorstop 37
#define KW_monitor 38
#define KW_stop 39
#define KW_signal 40
#define KW_exit 41
#define KW_continue 42
#define KW_array 43
#define KW_const 44
#define KW_char 45
#define KW_cycle 46
#define KW_repeat 47
#define KW_then 48
#define KW_else 49
#define KW_comment 50
#define KW_or 51
#define KW_not 52
#define KW_if 53
#define KW_unless 54
#define KW_event 55
#define KW_name 56
#define KW_routine 57
#define KW_predicate 58
#define KW_map 59
#define KW_fn 60
#define KW_function 61
#define KW_integer 62
#define KW_real 63
#define KW_label 64
#define KW_byte 65
#define KW_mite 66
#define KW_short 67
#define KW_half 68
#define KW_string 69
#define KW_read 70
#define KW_only 71
#define KW_write 72
#define KW_volatile 73
#define KW_register 74
#define KW_alias 75
#define KW_system 76
#define KW_external 77
#define KW_dynamic 78
#define KW_while 79
#define KW_until 80
#define KW_for 81
#define KW_own 82
#define KW_extrinsic 83
#define KW_constant 84

#define MAX_BIP 6
int BIP[MAX_BIP] = { // BIPs precede PHRASEs at PHRASES_START upwards
 0,  1,  2,  3,  4,  5, 
};

#define MAX_PHRASE 192
#if defined(DEBUG_PARSER) || defined(EXTENDED_ERROR_REPORTING)
// FOR DEBUGGING ONLY
char *phrasename[MAX_PHRASE] = { // Based at PHRASES_START upwards
  "stropped", "sqstring", "dqstring", "NL", 
  "char", "EOF", "LABEL-COLON", "SS", 
  "letter", "digit", "alphanumeric", "opt-letter-or-digit-seq", 
  "BLANKS", "LAST-ITEMS-IN-FILE", "program", "EXTERNALS", 
  "INTERNALS", "outer-level-end", "EXTERNAL-OR-INTERNAL", "OPT-68K", 
  "68K-stuff", "spec", "Opt-68K-code-address", "OPT-spec", 
  "OPT-LABEL-DEFINITION", "FAULT-S", "FAULT-LIST", "MORE-NUMBERS", 
  "FAULT-ACTION", "MORE-FAULTS", "INTERNAL", "NESTED-BLOCK", 
  "AUI", "OPT-ASSIGN", "UI", "LABEL", 
  "FILE-END-TYPE", "DECLARATION-S", "OPT-XOWN", "RADEC", 
  "REST-OF-RADEC", "RDEC", "REST-OF-RDEC", "EVENT-LIST", 
  "CYCLE-S", "IF-S", "FINISH-S", "Opt-start", 
  "Opt-ELSE-S", "THEN-S", "OPT-then", "OPT-start", 
  "S", "COMMENT", "Parsed-OldStyle-Comment", "NL-or-SEMI", 
  "semi", "INT-CONST", "alphanumeric-SEQ", "Opt-alphanumeric-SEQ", 
  "STR-CONST", "OPT-DQ-LETTER", "NUMERIC-CONST", "CONST", 
  "OLDSTYLE-BASE", "REAL-CONST", "FRACPT", "OPT-FRACPT", 
  "OPT-Plus-Minus", "OPT-EXPONENT", "DIGIT-SEQ", "rest-of-number", 
  "NAME", "SQUO-STRING", "UCI", "REST-OF-COND", 
  "REST-OF-ANDC", "REST-OF-ORC", "CONDITION", "SC", 
  "OPT-DOUBLE-SIDED", "STRING-RESOLUTION", "STRING-RESOLUTION-EXPR", "STRING-LVALUE", 
  "STRING-RVALUE", "STRING-EXPR", "REST-OF-STRING-EXPR", "STR-MATCH", 
  "STR-ASSIGN", "OPT-STR-ASSIGN", "OPT-STR-MATCH", "COMP", 
  "NOT-EQUALS", "NOT-EQUALS-ADDRESS", "OPT-ACTUAL-PARAMETERS", "REST-OF-ACTUAL-PARAMETERS", 
  "EXPR", "REST-OF-EXPR", "MEDIUMPREC-EXPR", "REST-OF-MEDIUMPREC-EXPR", 
  "HIGHPREC-EXPR", "REST-OF-HIGHPREC-EXPR", "RIGHT-ASSOC-EXPR", "REST-OF-RIGHTASSOC-EXPR", 
  "RIGHTASSOC-EXPR-with-OP", "UNARY-EXPR", "Opt-PARAMETERS-OR-POINTERINDEX", "Opt-RECORDFIELD", 
  "Opt-RECORDFIELD-OR-POINTERINDEX", "OPERAND", "OP", "OP-HIGH-LEFTASSOC", 
  "OP-HIGH-RIGHTASSOC", "INTEGER-EXP", "REAL-EXP", "OP-MED", 
  "OP-LOW", "Opt-UNARY-OP", "UNARY-NOT", "Percent-IU", 
  "REST-OF-SWLIST", "Opt-NAME-LIST", "REST-OF-NAME-LIST", "CEXPR", 
  "REST-OF-CEXPR", "COPERAND", "OPT-event", "FPP", 
  "REST-OF-FORMAL-PARAMETER-LIST", "FORMAL-PARAMETER-DECLARATION", "Opt-68K-reg", "OPT-name", 
  "RT", "FN-MAP", "FN", "BASE-XTYPE", 
  "XTYPE", "68K-memptr", "OPT-68K-qualifier", "68K-register", 
  "Opt-RFREF", "RECFMT-REF", "ALT-RECFMT-DEC", "REST-OF-RECFMT-DEC", 
  "RECFMT-DEC", "RECFMT-ELMNT", "ADECLN-in-record", "REST-OF-ARLIST-in-record", 
  "LOWERBOUND", "UPPERBOUND", "BPAIR", "BPAIR68K", 
  "REST-OF-BPLIST", "REST-OF-BPLIST68K", "OPT-arrayname", "Opt-DIMENSIONS", 
  "Opt-INTEGER", "REPFACT", "Opt-STAROREXPR", "STAROREXPR", 
  "Opt-BTYPE", "Opt-Comma", "Opt-ALIAS", "TEXTTEXT", 
  "Percent-SEX", "RECFMT-spec-OR-BODY", "DECLN", "OWNDEC", 
  "REST-OF-ARLIST", "REST-OF-ARLIST-68K", "OPT-68K-Bounds", "OPT-format", 
  "NAME-or-STAR-68K", "Opt-Assign-NAME-LIST", "Opt-Init-assign", "ASSOP", 
  "Opt-Init-assign-array", "Percent-WU", "Percent-WUF", "SCALAR-ASSIGN", 
  "Opt-UNTIL", "Opt-CYCPARM", "OPEXPR2", "OPT-EXPR", 
  "OPEXPR", "OPSTRING", "REST-OF-SS1", "REST-OF-OWNDEC", 
  "SINGLE-OWNDEC", "ROCL", "stupid", "XOWN", 
  };
#endif /* DEBUG_PARSER */

int phrase_start[MAX_PHRASE-MAX_BIP] = {
    0,     7,    11,    90,   121,   126,   134,   139,   170,   177, 
  182,   189,   199,   334,   340,   368,   376,   384,   388,   417,   424,   428,   435,   443,   450,   487, 
  496,   502,   513,   574,   586,   596,   648,   652,   662,   668,   677,   684,   690,   728,   733,   756, 
  761,   783,   796,   801,   806,   812,   821,   842,   847,   851,   861,   865,   870,   876,   881,   886, 
  893,   897,   905,   910,   914,   922,   929,   933,   937,   942,   945,   960,   972,   979,   986,   990, 
 1011,  1016,  1024,  1031,  1036,  1041,  1045,  1052,  1059,  1062,  1069,  1076,  1105,  1119,  1132,  1141, 
 1148,  1152,  1158,  1162,  1168,  1172,  1178,  1182,  1187,  1191,  1195,  1216,  1224,  1232,  1257,  1266, 
 1277,  1282,  1302,  1314,  1329,  1347,  1357,  1364,  1371,  1387,  1394,  1401,  1406,  1412,  1435,  1440, 
 1449,  1455,  1474,  1482,  1487,  1497,  1503,  1510,  1548,  1553,  1571,  1577,  1586,  1601,  1608,  1616, 
 1623,  1635,  1644,  1650,  1656,  1662,  1671,  1682,  1693,  1703,  1713,  1727,  1735,  1740,  1748,  1752, 
 1760,  1773,  1778,  1784,  1787,  1801,  1815,  1841,  1863,  1872,  1880,  1884,  1889,  1895,  1909,  1914, 
 1922,  1932,  1941,  1962,  1971,  1977,  1989,  1996,  2000,  2007,  2013,  2024,  2031,  2036,  2047,  2051, 
};

#define P_stropped 512
#define B_stropped 0
#define AST_stropped 0

#define P_sqstring 513
#define B_sqstring 1
#define AST_sqstring 1

#define P_dqstring 514
#define B_dqstring 2
#define AST_dqstring 2

#define P_NL 515
#define B_NL 3
#define AST_NL 3

#define P_char 516
#define B_char 4
#define AST_char 4

#define P_EOF 517
#define B_EOF 5
#define AST_EOF 5

#define P_LABEL_COLON 518
#define AST_LABEL_COLON 6

#define P_SS 519
#define AST_SS 7

#define P_letter 520
#define AST_letter 8

#define P_digit 521
#define AST_digit 9

#define P_alphanumeric 522
#define AST_alphanumeric 10

#define P_opt_letter_or_digit_seq 523
#define AST_opt_letter_or_digit_seq 11

#define P_BLANKS 524
#define AST_BLANKS 12

#define P_LAST_ITEMS_IN_FILE 525
#define AST_LAST_ITEMS_IN_FILE 13

#define P_program 526
#define AST_program 14

#define P_EXTERNALS 527
#define AST_EXTERNALS 15

#define P_INTERNALS 528
#define AST_INTERNALS 16

#define P_outer_level_end 529
#define AST_outer_level_end 17

#define P_EXTERNAL_OR_INTERNAL 530
#define AST_EXTERNAL_OR_INTERNAL 18

#define P_OPT_68K 531
#define AST_OPT_68K 19

#define P_68K_stuff 532
#define AST_68K_stuff 20

#define P_spec 533
#define AST_spec 21

#define P_Opt_68K_code_address 534
#define AST_Opt_68K_code_address 22

#define P_OPT_spec 535
#define AST_OPT_spec 23

#define P_OPT_LABEL_DEFINITION 536
#define AST_OPT_LABEL_DEFINITION 24

#define P_FAULT_S 537
#define AST_FAULT_S 25

#define P_FAULT_LIST 538
#define AST_FAULT_LIST 26

#define P_MORE_NUMBERS 539
#define AST_MORE_NUMBERS 27

#define P_FAULT_ACTION 540
#define AST_FAULT_ACTION 28

#define P_MORE_FAULTS 541
#define AST_MORE_FAULTS 29

#define P_INTERNAL 542
#define AST_INTERNAL 30

#define P_NESTED_BLOCK 543
#define AST_NESTED_BLOCK 31

#define P_AUI 544
#define AST_AUI 32

#define P_OPT_ASSIGN 545
#define AST_OPT_ASSIGN 33

#define P_UI 546
#define AST_UI 34

#define P_LABEL 547
#define AST_LABEL 35

#define P_FILE_END_TYPE 548
#define AST_FILE_END_TYPE 36

#define P_DECLARATION_S 549
#define AST_DECLARATION_S 37

#define P_OPT_XOWN 550
#define AST_OPT_XOWN 38

#define P_RADEC 551
#define AST_RADEC 39

#define P_REST_OF_RADEC 552
#define AST_REST_OF_RADEC 40

#define P_RDEC 553
#define AST_RDEC 41

#define P_REST_OF_RDEC 554
#define AST_REST_OF_RDEC 42

#define P_EVENT_LIST 555
#define AST_EVENT_LIST 43

#define P_CYCLE_S 556
#define AST_CYCLE_S 44

#define P_IF_S 557
#define AST_IF_S 45

#define P_FINISH_S 558
#define AST_FINISH_S 46

#define P_Opt_start 559
#define AST_Opt_start 47

#define P_Opt_ELSE_S 560
#define AST_Opt_ELSE_S 48

#define P_THEN_S 561
#define AST_THEN_S 49

#define P_OPT_then 562
#define AST_OPT_then 50

#define P_OPT_start 563
#define AST_OPT_start 51

#define P_S 564
#define AST_S 52

#define P_COMMENT 565
#define AST_COMMENT 53

#define P_Parsed_OldStyle_Comment 566
#define AST_Parsed_OldStyle_Comment 54

#define P_NL_or_SEMI 567
#define AST_NL_or_SEMI 55

#define P_semi 568
#define AST_semi 56

#define P_INT_CONST 569
#define AST_INT_CONST 57

#define P_alphanumeric_SEQ 570
#define AST_alphanumeric_SEQ 58

#define P_Opt_alphanumeric_SEQ 571
#define AST_Opt_alphanumeric_SEQ 59

#define P_STR_CONST 572
#define AST_STR_CONST 60

#define P_OPT_DQ_LETTER 573
#define AST_OPT_DQ_LETTER 61

#define P_NUMERIC_CONST 574
#define AST_NUMERIC_CONST 62

#define P_CONST 575
#define AST_CONST 63

#define P_OLDSTYLE_BASE 576
#define AST_OLDSTYLE_BASE 64

#define P_REAL_CONST 577
#define AST_REAL_CONST 65

#define P_FRACPT 578
#define AST_FRACPT 66

#define P_OPT_FRACPT 579
#define AST_OPT_FRACPT 67

#define P_OPT_Plus_Minus 580
#define AST_OPT_Plus_Minus 68

#define P_OPT_EXPONENT 581
#define AST_OPT_EXPONENT 69

#define P_DIGIT_SEQ 582
#define AST_DIGIT_SEQ 70

#define P_rest_of_number 583
#define AST_rest_of_number 71

#define P_NAME 584
#define AST_NAME 72

#define P_SQUO_STRING 585
#define AST_SQUO_STRING 73

#define P_UCI 586
#define AST_UCI 74

#define P_REST_OF_COND 587
#define AST_REST_OF_COND 75

#define P_REST_OF_ANDC 588
#define AST_REST_OF_ANDC 76

#define P_REST_OF_ORC 589
#define AST_REST_OF_ORC 77

#define P_CONDITION 590
#define AST_CONDITION 78

#define P_SC 591
#define AST_SC 79

#define P_OPT_DOUBLE_SIDED 592
#define AST_OPT_DOUBLE_SIDED 80

#define P_STRING_RESOLUTION 593
#define AST_STRING_RESOLUTION 81

#define P_STRING_RESOLUTION_EXPR 594
#define AST_STRING_RESOLUTION_EXPR 82

#define P_STRING_LVALUE 595
#define AST_STRING_LVALUE 83

#define P_STRING_RVALUE 596
#define AST_STRING_RVALUE 84

#define P_STRING_EXPR 597
#define AST_STRING_EXPR 85

#define P_REST_OF_STRING_EXPR 598
#define AST_REST_OF_STRING_EXPR 86

#define P_STR_MATCH 599
#define AST_STR_MATCH 87

#define P_STR_ASSIGN 600
#define AST_STR_ASSIGN 88

#define P_OPT_STR_ASSIGN 601
#define AST_OPT_STR_ASSIGN 89

#define P_OPT_STR_MATCH 602
#define AST_OPT_STR_MATCH 90

#define P_COMP 603
#define AST_COMP 91

#define P_NOT_EQUALS 604
#define AST_NOT_EQUALS 92

#define P_NOT_EQUALS_ADDRESS 605
#define AST_NOT_EQUALS_ADDRESS 93

#define P_OPT_ACTUAL_PARAMETERS 606
#define AST_OPT_ACTUAL_PARAMETERS 94

#define P_REST_OF_ACTUAL_PARAMETERS 607
#define AST_REST_OF_ACTUAL_PARAMETERS 95

#define P_EXPR 608
#define AST_EXPR 96

#define P_REST_OF_EXPR 609
#define AST_REST_OF_EXPR 97

#define P_MEDIUMPREC_EXPR 610
#define AST_MEDIUMPREC_EXPR 98

#define P_REST_OF_MEDIUMPREC_EXPR 611
#define AST_REST_OF_MEDIUMPREC_EXPR 99

#define P_HIGHPREC_EXPR 612
#define AST_HIGHPREC_EXPR 100

#define P_REST_OF_HIGHPREC_EXPR 613
#define AST_REST_OF_HIGHPREC_EXPR 101

#define P_RIGHT_ASSOC_EXPR 614
#define AST_RIGHT_ASSOC_EXPR 102

#define P_REST_OF_RIGHTASSOC_EXPR 615
#define AST_REST_OF_RIGHTASSOC_EXPR 103

#define P_RIGHTASSOC_EXPR_with_OP 616
#define AST_RIGHTASSOC_EXPR_with_OP 104

#define P_UNARY_EXPR 617
#define AST_UNARY_EXPR 105

#define P_Opt_PARAMETERS_OR_POINTERINDEX 618
#define AST_Opt_PARAMETERS_OR_POINTERINDEX 106

#define P_Opt_RECORDFIELD 619
#define AST_Opt_RECORDFIELD 107

#define P_Opt_RECORDFIELD_OR_POINTERINDEX 620
#define AST_Opt_RECORDFIELD_OR_POINTERINDEX 108

#define P_OPERAND 621
#define AST_OPERAND 109

#define P_OP 622
#define AST_OP 110

#define P_OP_HIGH_LEFTASSOC 623
#define AST_OP_HIGH_LEFTASSOC 111

#define P_OP_HIGH_RIGHTASSOC 624
#define AST_OP_HIGH_RIGHTASSOC 112

#define P_INTEGER_EXP 625
#define AST_INTEGER_EXP 113

#define P_REAL_EXP 626
#define AST_REAL_EXP 114

#define P_OP_MED 627
#define AST_OP_MED 115

#define P_OP_LOW 628
#define AST_OP_LOW 116

#define P_Opt_UNARY_OP 629
#define AST_Opt_UNARY_OP 117

#define P_UNARY_NOT 630
#define AST_UNARY_NOT 118

#define P_Percent_IU 631
#define AST_Percent_IU 119

#define P_REST_OF_SWLIST 632
#define AST_REST_OF_SWLIST 120

#define P_Opt_NAME_LIST 633
#define AST_Opt_NAME_LIST 121

#define P_REST_OF_NAME_LIST 634
#define AST_REST_OF_NAME_LIST 122

#define P_CEXPR 635
#define AST_CEXPR 123

#define P_REST_OF_CEXPR 636
#define AST_REST_OF_CEXPR 124

#define P_COPERAND 637
#define AST_COPERAND 125

#define P_OPT_event 638
#define AST_OPT_event 126

#define P_FPP 639
#define AST_FPP 127

#define P_REST_OF_FORMAL_PARAMETER_LIST 640
#define AST_REST_OF_FORMAL_PARAMETER_LIST 128

#define P_FORMAL_PARAMETER_DECLARATION 641
#define AST_FORMAL_PARAMETER_DECLARATION 129

#define P_Opt_68K_reg 642
#define AST_Opt_68K_reg 130

#define P_OPT_name 643
#define AST_OPT_name 131

#define P_RT 644
#define AST_RT 132

#define P_FN_MAP 645
#define AST_FN_MAP 133

#define P_FN 646
#define AST_FN 134

#define P_BASE_XTYPE 647
#define AST_BASE_XTYPE 135

#define P_XTYPE 648
#define AST_XTYPE 136

#define P_68K_memptr 649
#define AST_68K_memptr 137

#define P_OPT_68K_qualifier 650
#define AST_OPT_68K_qualifier 138

#define P_68K_register 651
#define AST_68K_register 139

#define P_Opt_RFREF 652
#define AST_Opt_RFREF 140

#define P_RECFMT_REF 653
#define AST_RECFMT_REF 141

#define P_ALT_RECFMT_DEC 654
#define AST_ALT_RECFMT_DEC 142

#define P_REST_OF_RECFMT_DEC 655
#define AST_REST_OF_RECFMT_DEC 143

#define P_RECFMT_DEC 656
#define AST_RECFMT_DEC 144

#define P_RECFMT_ELMNT 657
#define AST_RECFMT_ELMNT 145

#define P_ADECLN_in_record 658
#define AST_ADECLN_in_record 146

#define P_REST_OF_ARLIST_in_record 659
#define AST_REST_OF_ARLIST_in_record 147

#define P_LOWERBOUND 660
#define AST_LOWERBOUND 148

#define P_UPPERBOUND 661
#define AST_UPPERBOUND 149

#define P_BPAIR 662
#define AST_BPAIR 150

#define P_BPAIR68K 663
#define AST_BPAIR68K 151

#define P_REST_OF_BPLIST 664
#define AST_REST_OF_BPLIST 152

#define P_REST_OF_BPLIST68K 665
#define AST_REST_OF_BPLIST68K 153

#define P_OPT_arrayname 666
#define AST_OPT_arrayname 154

#define P_Opt_DIMENSIONS 667
#define AST_Opt_DIMENSIONS 155

#define P_Opt_INTEGER 668
#define AST_Opt_INTEGER 156

#define P_REPFACT 669
#define AST_REPFACT 157

#define P_Opt_STAROREXPR 670
#define AST_Opt_STAROREXPR 158

#define P_STAROREXPR 671
#define AST_STAROREXPR 159

#define P_Opt_BTYPE 672
#define AST_Opt_BTYPE 160

#define P_Opt_Comma 673
#define AST_Opt_Comma 161

#define P_Opt_ALIAS 674
#define AST_Opt_ALIAS 162

#define P_TEXTTEXT 675
#define AST_TEXTTEXT 163

#define P_Percent_SEX 676
#define AST_Percent_SEX 164

#define P_RECFMT_spec_OR_BODY 677
#define AST_RECFMT_spec_OR_BODY 165

#define P_DECLN 678
#define AST_DECLN 166

#define P_OWNDEC 679
#define AST_OWNDEC 167

#define P_REST_OF_ARLIST 680
#define AST_REST_OF_ARLIST 168

#define P_REST_OF_ARLIST_68K 681
#define AST_REST_OF_ARLIST_68K 169

#define P_OPT_68K_Bounds 682
#define AST_OPT_68K_Bounds 170

#define P_OPT_format 683
#define AST_OPT_format 171

#define P_NAME_or_STAR_68K 684
#define AST_NAME_or_STAR_68K 172

#define P_Opt_Assign_NAME_LIST 685
#define AST_Opt_Assign_NAME_LIST 173

#define P_Opt_Init_assign 686
#define AST_Opt_Init_assign 174

#define P_ASSOP 687
#define AST_ASSOP 175

#define P_Opt_Init_assign_array 688
#define AST_Opt_Init_assign_array 176

#define P_Percent_WU 689
#define AST_Percent_WU 177

#define P_Percent_WUF 690
#define AST_Percent_WUF 178

#define P_SCALAR_ASSIGN 691
#define AST_SCALAR_ASSIGN 179

#define P_Opt_UNTIL 692
#define AST_Opt_UNTIL 180

#define P_Opt_CYCPARM 693
#define AST_Opt_CYCPARM 181

#define P_OPEXPR2 694
#define AST_OPEXPR2 182

#define P_OPT_EXPR 695
#define AST_OPT_EXPR 183

#define P_OPEXPR 696
#define AST_OPEXPR 184

#define P_OPSTRING 697
#define AST_OPSTRING 185

#define P_REST_OF_SS1 698
#define AST_REST_OF_SS1 186

#define P_REST_OF_OWNDEC 699
#define AST_REST_OF_OWNDEC 187

#define P_SINGLE_OWNDEC 700
#define AST_SINGLE_OWNDEC 188

#define P_ROCL 701
#define AST_ROCL 189

#define P_stupid 702
#define AST_stupid 190

#define P_XOWN 703
#define AST_XOWN 191

#define AST__LIT 192
#define AST__KW 193


#ifdef WANT_COMMENT
// These are only used to reconstitute the grammar file:
char *comment[/*MAX_PHRASE-MAX_BIP*/] = {
  " This is an extended grammar which now accepts constructs from multiple versions of Imp\n"
  " - it was primarily based on a correct Imp80 grammar, then modified to add Imp77 constructs\n"
  " followed by features from Pdp15 Imp, old Emas \"Imp9\", and Hamish's 68000 extensions, etc\n"
  " The original base grammar was:\n"
  "   https://history.dcs.ed.ac.uk/archive/os/emas/emas2/compilers/imp80/imp80ps04.txt\n"
  "\n"
  " Since this accepts multiple dialects, I'm tempted to call it \"PImp\", short for \"Polyglot Imp\"...\n"
  "\n"
  " There is good info re the phrase structure grammar to be found at\n"
  " http://www.ancientgeek.org.uk/EMAS/EMAS_Manuals/IMP/A_Syntactic_and_Semantic_Definition_of_the_IMP_Language.pdf\n"
  "\n"
  " Built-in Phrases used by the line reconstruction phase:\n"
  "\n"
  " stropped letter (%a %b etc)\n",
  "\n"
  " single-quoted string\n",
  "\n"
  " double-quoted string\n",
  "\n",
  "\n",
  "\n"
  " All parsers need an <EOF> phrase.\n"
  "\n",
  "\n"
  " We have one semantic phrase in this grammar:\n"
  "\n"
  " OK, this is slightly trickier than you might expect... you can't place the <COLON> immediate code after the ':'\n"
  " because the parser pre-fetches the next token in order to compare against <COLON> even though <COLON> doesn't\n"
  " actually examine any text.  So... we put the test *before* the ':', and *UNDO* its actions in the following\n"
  " alternative if the ':' was not matched.\n"
  "\n"
  " Anyway, the outcome is that if a <COLON> is followed by a '!' comment, that comment is handled by the\n"
  " line reconstruction code and is *not* passed back to the parser a character at a time as it was previously doing!\n"
  "\n"
  " This in turn solves the problem of line reconstruction finding a ' or a \" in the comment and gobbling up characters\n"
  " - possibly over multiple line - until it hits a matching quote.  PHEW.  It took a long time to get here!\n"
  "\n",
  "#P<LABEL-COLON> =\n"
  "#   ':';\n"
  " SS is the primary entry point.\n"
  "\n",
  "\n"
  " I'm taking the long way to handle alphanumerics and variable names, for now\n"
  " At some point (soon) I hope to add regular expression matching, to shorten\n"
  " these rules and speed up parsing.  But this works, quite reliably.\n"
  "\n"
  "# P<letter> = \"[A-Z]\";\n"
  "\n",
  "# P<digit> = \"[0-9]\";\n"
  "\n",
  NULL, NULL, 
  "More than one newline (or semicolon)\n",
  " The last items in a file.\n"
  " the final EOF below is only for begin/endofprogram which *can* be followed by code but shouldn't\n",
  NULL, 
  " I haven't specified any phrases to be external-only.  There might be some,\n"
  " but I'll leave it to compile() to reject them.\n",
  " I cleaned up label handling, we can afford the overhead of backtracking over one <NAME>...\n"
  " - this isn't the 70's any more.  Labels are not valid outside blocks.\n",
  " top-level begin/end block can either be %begin/%endofprogram,\n"
  " or %begin/%end/%endoffile.  However in some cases things can\n"
  " be placed between the %end and the %endoffile.\n"
  "\n"
  " I've also seen %routine xxx/%endofprogram in FMACS/BOOT.imp\n"
  "\n"
  " There's a %begin/%end without an %endoffile in FMACS/FIRST4.imp\n",
  " these are allowed at the external level and also inside procedures/main program.\n"
  " The phrases that are internal-only include these as the final alternative,\n"
  " hence why the empty statement can only occur as the last item in this list.\n"
  "\n"
  " If using this grammar as a 'SOAP' replacement, you'll want to allow syntactically\n"
  " incorrect statements also, and if so, those should be handled here after the <S> rule.\n"
  "\n",
  " These are all extensions used by 68000 Imp.\n"
  "\n"
  " %begin\n"
  " %recordformat f(%byte ldte,lsap,rdte,rsap)\n"
  " @@#ldte %record(f)cur\n"
  " ( I have no idea what \"@@#ldte \" means. )\n"
  "\n"
  " @@400(a5) %record(*)%namearray in(0:7)\n"
  " @@16_3F00-192 %routine         closeinput\n"
  " @@724(a5) %integername heapfront\n"
  "\n"
  " '@@' <68K-code-address> before a routine name is an external spec in 68000 Imp, and\n"
  " <Opt-68K-code-address> after an external %spec is a perm routine spec in 68000 Imp.\n"
  " as in: %integerfnspec(16_1124) REM(%integer a,b)  { found in APM-gdmr/I/GGPERM.imp }\n"
  "\n",
  NULL, 
  " this is for 68000 Imp:\n"
  "\n"
  " %externalrealfnspecalias READ %alias \"readreal\"\n"
  " %externalintegerfnspecalias READ\n"
  " I have no idea what a \"specalias\" is :-(\n"
  "\n"
  " %integerarrayspec(16_C00000) frame(0:32767)\n"
  " %integerfnspec(16_1124) REM(%integer a,b)\n"
  " %bytespec(16_7fffc)status\n"
  "\n"
  " I think these extensions are also covered with a *different* extension in the same compiler :-(\n"
  " i.e.\n"
  "   @@16_7fffc %byte status  ???\n"
  "\n",
  NULL, NULL, 
  " All labels come through here.  Because of an interaction with comments,\n"
  " we use some parse-time code in phrase <LABEL-COLON> to modify how line reconstruction\n"
  " handles the comments.  btw Numeric labels are a historical form...\n",
  " fault statements can only appear in the outer block of a program;\n"
  " they cannot appear in external routines.  This should be checked\n"
  " by the compile() procedure.\n",
  NULL, NULL, NULL, NULL, 
  " The \"spec\" form below is for old EMAS Imp procedure parameters:\n"
  "\n"
  " %routine integrate(%realname y, %real a,b, %integer n, %c\n"
  "                    %realfn f)\n"
  "   %spec f(%real x)\n"
  "\n"
  " the fully-qualified form (%realfnspec f(%real x)) is also valid but comes in via the <EXTERNAL> route.\n"
  "\n"
  " There are other types of %spec related to parameters to procedures as well -\n"
  " %recordspec for sure.  Not so sure if there is an arrayspec.\n"
  " They are only allowed in the body of a procedure.\n"
  "\n"
  " (Btw in the older compilers, all declarations in a block had to precede any code.)\n"
  "\n"
  " strictly speaking the <UI> <REST-OF-SS1> form, <UI> \"while\" <SC>, should only\n"
  " allow a single <UI>, not the <UI> <AUI> form. (EMAS Imp)\n"
  " (page 4.4 of https://history.dcs.ed.ac.uk/archive/docs/Edinburgh_IMP_Language_Manual.pdf )\n",
  " unlike with old-style parsers, the whole of the block content ends up in an AST item.\n"
  "\n"
  " Unfortunately there is a problem caused by 68000 Imp: some files contain only\n"
  " begin/end with no endoffile.  Some are begin/end;endoffile instead of begin/endofprogram\n"
  " A few are routine blah/endofprogram !\n"
  " One had begin/endofprogram followed by more routines.\n"
  " (and see elsewhere for 68000's external routine specs which are of the form\n"
  "   @@address %routine blah\n"
  "  - with no %spec keyword, but no routine body either..)\n"
  "\n",
  " compound statements - blah %and blah %and blah - a short form of startfinish block\n",
  NULL, 
  " the compound statement form ends in UIs which change control flow, ie\n"
  " you cannot say: %if whatever %then blah %and ->lab %and this will never happen\n"
  " tempted to add %caption here ;-)  But that may be a step too far.\n"
  " \"%monitor 9\" would be trapped by \"%fault 9 -> lab\"\n",
  NULL, 
  " prim and perm added by gt\n",
  " I added an old record declaration syntax for examples out of ai2logo.i\n"
  "\n"
  " %OWNRECORDARRAY INDEX42( 0:1022)           (PIC DIR)\n"
  "\n"
  " %SYSTEMROUTINESPEC FINFO(%STRING(15) S,%INTEGER LEV,%C\n"
  "    %RECORDNAME R, %INTEGERNAME FLAG)\n"
  "\n"
  " %RECORD R(F)\n"
  "\n"
  " I'm not sure where/if this is handled:\n"
  "\n"
  " %record(f)%array portinfo(1:31)\n"
  "\n"
  " I need to get the old Imp manuals out and check a couple of things, in particular\n"
  "   %recordformatspec and %arrayformatspec ...\n"
  "\n"
  " The grammar below allows some initialisations that the compilers don't support\n"
  " but it's cleaner to reject them in compile()\n"
  "\n"
  " I had to add initialisations with pointers for these examples from\n"
  " 68000 Imp: %bytename b == length(s)\n"
  " %ownrecord(i tc f)%namearray tc refs(1:maxtc) == nil(*)\n"
  "\n"
  " These are 68000 syntax which is rejected by Imp77:\n"
  " %conststring(1) %array(1:max params) parameters=\"B\",\"W\",\"L\"\n"
  " %string(255) %array(0:maxfiles) list\n"
  "\n"
  " The equivalent Imp77 syntax would be\n"
  "\n"
  " %conststring(1) %array parameters(1:max params)=\"B\",\"W\",\"L\"\n"
  " %string(255) %array list(0:maxfiles)\n"
  "\n"
  " Finally here's a one-off hack for a construct I've only seen *once*\n"
  " in APM-gdmr/I/PRIM22.imp ...\n"
  " %constchar                    snl=char<10>\n"
  "\n",
  NULL, 
  " old-style record array declaration\n",
  NULL, 
  " old-style record declaration\n",
  NULL, 
  " %on %event * %start or %on %event 1,2,3,etc %start\n",
  " Added old-style while/until for: %UNTIL NEXTINSYM=NL %THEN %CYCLE\n"
  " and %WHILE NEXTINSYM#NL %THEN SKIPINSYM\n",
  NULL, 
  " /home/gtoal/gtoal.com/athome/edinburgh/APM-gdmr/I/LIB.imp\n"
  " contains:\n"
  "          %elseif 'A'<=sym<='Z' %start\n"
  "\n"
  " which is a form of Hamish's that is equivalent to\n"
  "\n"
  "  %finish %else %if 'A'<=sym<='Z' %start\n"
  "\n"
  " or the more concise\n"
  "\n"
  "  %else %if 'A'<=sym<='Z'\n"
  "\n"
  " An identical issue is: %elsestart\n"
  " in APM-gdmr/ETHER/PROFILE.imp\n"
  "\n",
  NULL, 
  " see the comments on <FINISH-S> above.\n",
  NULL, NULL, NULL, NULL, 
  " Most comments are handled in the line reconstruction phase.\n"
  " Comments starting with %COMMENT are an exception.\n"
  " Some older compilers treated '!' comments like %COMMENT,\n"
  " with \"%c\" at the end of a comment causing continuation!\n"
  " This phrase does not allow ';' in a comment to terminate\n"
  " the comment, but some versions of Imp (I think PDP15)\n"
  " did, so that will have to be handled with a command-line\n"
  " option and a parse-time phrase if it ever is needed.\n"
  "\n",
  NULL, NULL, NULL, 
  " <DIGIT-SEQ> '_' <DIGIT-SEQ>, and  <DIGIT-SEQ> '_' <NAME>, added by gt\n"
  " <NAME> <sqstring> is really X'....' but type checking stops me matching 'X'\n"
  " VERY hacky stopgap just to get stuff to parse. Needs proper syntax\n"
  " which needs the ability to recognise individual digits and letters\n"
  " rather than the current typed 'alphanumeric' hack in line_reconstruction ...\n"
  " Doesn't handle %real well, and indeed not at all if containing an '@@' sign.\n"
  " E\"ebcdic\" etc also not handled.  Hamish's 40_XXX comes in here.\n"
  "\n"
  "# P<basedconst> =  \"[0-9][0-9]*_[0-9A-Z][0-9A-Z]*\"\n"
  "\n",
  NULL, NULL, NULL, 
  " current line reconstruction doesn't support this. Letters come through as part of <alphanumeric>s.\n",
  NULL, 
  " <CONST> is somewhat generic and should be replaced with the more specific version when possible\n",
  " <sqstring> has to be checked for length and content depending on prefix.\n"
  "\n"
  "# P<lettercharconst> = <squote> <schar> <squote> |\n"
  "#   \"[RHX]\" <squote> <hexchars> <squote> |\n"
  "#   \"B\" <squote> <binchars> <squote> |\n"
  "#   \"K\" <squote> <octchars> <squote> |\n"
  "#   \"[CMD]\" <squote> <mchars> <squote>;\n"
  "\n",
  " Note: a <DIGIT-SEQ> can be both an integer constant and a real constant.\n"
  " Imp77 supports constants like this: %constlongreal PI = 16_3.243F6A89\n"
  " which are not handled here yet.\n"
  "\n"
  "# P<realconst> = \"[0-9][0-9]*\\.[0-9][0-9]*E[0-9][0-9]*\" |\n"
  "#                \"[0-9][0-9]*\\.[0-9][0-9]*\" |\n"
  "#                \"[0-9][0-9]*@@[0-9][0-9]*\"\n"
  "\n",
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
  "# P<NAME> =\n"
  "#    <alphanumeric> <!SQUO-STRING> <rest-of-name>;\n"
  "# P<rest-of-name> =\n"
  "#    <NAME>,\n"
  "#   ;\n",
  " A UCI is a machine code instruction.\n"
  " (Hamish's PDP15 imp machine code syntax (which is not introduced by '*') is definitely not supported.)\n"
  "\n"
  " Machine-specific machine-code removed. May cause problems with ';' and quoted chars in machine code\n"
  "\n",
  " Imp does not let you mix and/or without explicit brackets. They do not have a precedence relationship\n",
  NULL, NULL, NULL, 
  " <NAME> <OPT-ACTUAL-PARAMETERS> added by gt for predicates\n"
  " RESTOFSC handles double-sided conditions such as '0' <= ch <= '9'\n",
  NULL, NULL, 
  " Current Imp77 restricts string resolution to -> a.(\"test\").b  with a and b being optional.\n"
  " Older Emas implementations allowed multiple parts I'm fairly sure, eg -> a.(\"match1\").b.(\"match2\").c\n"
  "\n"
  " Also, behaviour changed re initial (\"match\") with no assignment variable before it -\n"
  " used to be that \"match\" had to start the string, but now there can be text before\n"
  " it, and a null match has to be coded as -> a.(\"match\").b %and a = \"\"\n"
  "\n"
  " So if we need to distinguish between these variations, do it in compile()\n"
  "\n",
  NULL, NULL, 
  " No bracketed expressions, only '.' operator allowed, although once again,\n"
  " Hamish has an idiosyncratic extension where strings in a printstring are\n"
  " separated by semi-colons - I think it is some approximation to C's printf?\n"
  "\n",
  NULL, NULL, NULL, 
  " ping-pong.  Can't allow -> (a).b.c.(d) or -> a.(b).(c).d\n",
  NULL, 
  " Ordering is important, eg '##' must come before '#'\n"
  "\n"
  " I really pity people who use the sort of grammar that requires\n"
  " eliminating shift-reduce conflicts before they can parse anything :-)\n"
  "\n",
  " '<>' is a really obscure form but it definitely used to be used.  I'll\n"
  " post a reference as soon as I locate one.\n"
  "\n",
  NULL, 
  " Procedure application, i.e. actual parameters to routine or function call\n",
  NULL, 
  " handling precedence withh the grammar rather than Edinburgh-style in the AST. Tradeoff of speed for simplicity.\n"
  " CEXPR not handled yet\n",
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
  " These pointer arithmetic elements are for Hamish's PDP9/15 Imp (old): INDP == INDEX0++P\n"
  " and for Hamish's 68000 Imp:     %if tp[1]_mode # litmode %then lo = minint %else lo = tp[1]_val\n"
  " I hope this grammar definition causes the right precedence level...\n"
  "\n"
  " They can also be used in LVALUEs.\n",
  NULL, NULL, 
  " The old form of modulus (!X!) is for really ancient compilers such as Hamish's Pdp15 Imp.\n"
  " Unfortunately there are obscure cases where an ambiguous parse results:\n"
  "\n"
  "  putact(condop!!polarity!!1+polarity<<7,item,0)\n"
  "\n"
  " Does that mean\n"
  "   putact(condop !!  polarity   !!  1 + polarity<<7, item, 0)\n"
  " or\n"
  "   putact(condop !  !polarity!  !   1 + polarity<<7, item, 0)\n"
  "\n"
  " I need to check but I *hope* that the grammar here causes the first of the above to be selected.\n"
  " If not, we'll need a command-line option here to force the version of Imp being used.\n"
  "\n"
  " I just hope that there's no version of Imp that ever supported factorials with a postfix '!'\n"
  "\n",
  " <OP> is only used in <CEXPR>s now and will be removed entirely\n"
  " once CEXPRs are recoded to use the same grammar as EXPRs.\n"
  "\n"
  " *However* I am considering doing away with CEXPRs altogether,\n"
  " and just using <EXPR> everywhere, in conjunction with a parse-time\n"
  " test to check whether any of the terms were in fact *not* constants.\n"
  "\n"
  " Also... it's not obvious if we could in fact use EXPRs everywhere *without*\n"
  " the overhead of having to organise the code/name tables so that they\n"
  " can be checked for being constants at parse time, and merely reject\n"
  " them from the compile() procedure instead?  This would be possible\n"
  " as long as there are no parse ambiguities caused by checking after\n"
  " parsing. I know that's a problem in C but Imp's simpler syntax\n"
  " might let us get away with it!\n"
  "\n"
  " Note that none of these options eliminates the possibility of implementing\n"
  " conditional compilation the EMAS Imp80 way using\n"
  "\n"
  " %if <CEXPR> %start\n"
  "   ! conditional code\n"
  " %finish\n"
  "\n"
  " (Though I've always had questions about that on EMAS if there's a\n"
  "  label inside the block - the ability to use that construct for\n"
  "  conditional compilation depends on whether that label is ever\n"
  "  jumped to from code outside the block! - doing it properly requires\n"
  "  full flow control analysis and a transitive closure on the flow graph!)\n"
  "\n",
  " highest precedence, left-associative\n",
  " highest precedence, right-associative (only exponentiation)\n"
  "\n"
  " I found this expression the 68000 Imp compiler:\n"
  "\n"
  "           y = |r|+0.5/10.0\\{^}m;  !modulus, rounded\n"
  "\n"
  " which I parse as:\n"
  "\n"
  "           y = |r|+( 0.5 / (10.0\\{^}m));  !modulus, rounded\n"
  "\n"
  " I presume this is a clever way to round the last digit of a decimal,\n"
  " but damn, how it works is beyond me.\n"
  " Typical Hamish code! Brilliant (I presume) but obscure and uncommented.\n"
  "\n",
  NULL, NULL, 
  " middle-precedence operators.  All left-associative.\n",
  " lowest precedence operators.  All left-associative.\n",
  " You would think that unary operators always have the highest precedence,\n"
  " but not so - here's a tricky one...\n"
  "\n"
  " I = -1 >> 1\n"
  "\n"
  " This always has the value 0, regardless of integer size, because a unary minus\n"
  " in front of a constant is *NOT* interpreted as a negative constant, but rather\n"
  " the positive constant preceded by a unary negation operator.\n"
  "\n"
  " It gets worse... unary negation is implemented as binary subtraction with\n"
  " an inserted '0' left operand, i.e.\n"
  "\n"
  " 0 - 1 >> 1\n"
  "\n"
  " Shifts have higher precedence than subtraction, so this becomes:\n"
  "\n"
  " 0 - (1 >> 1)\n"
  "\n"
  " which evaluates to 0.\n"
  "\n"
  " The 68000 Imp compiler includes this statement which I hope is correct! dict(firstpos)_val = -cad>>1\n"
  "\n"
  " Some versions of Imp (I think Imp80) forbid a unary '+' before constants,\n"
  " so A + +3 would be illegal (although A + -3 would not)\n"
  "\n"
  " and none of this applies to binary-not (\\) so \\3 really is higher\n"
  " priority than '>>' and \\3 >> 1 does what you would expect.  I hope.\n"
  "\n",
  " fortunately unary backslash is unambiguous with ERCC style exponentiation binary operator\n",
  NULL, 
  " rest of %switch list\n"
  " This reminds me, isn't there an optional %label declaration in Imp?  Haven't seen an example yet,\n"
  " I need to check the manuals to make sure I'm not confusing this with C...\n",
  NULL, NULL, 
  " Still to handle operator precedence etc for <CEXPR>s the same way as for <EXPR>s.\n"
  " However it is such a major duplication of effort that it might be much easier to\n"
  " just use <EXPR>s and have a semantic test for constantcy.\n"
  " The problem is the ambiguity of <NAMES>.  And you don't want any of the decorated\n"
  " forms of a name (records, function calls, pointers, maybe even rejecting const\n"
  " array elements?) - just simple literals and const integer operands.\n",
  NULL, NULL, NULL, NULL, NULL, 
  " %routine y (%integer %name %array (1) %name b)\n"
  " %routine r10(%integer%array%name a(1:10),%integer k)\n",
  " More Hamish idiosyncracy!:\n"
  "\n"
  " @@16_1114%record(*)%map ZNEW(%name(d0) v)\n"
  "  - APM-gdmr/I/VPERM19.imp\n"
  "      d0 being a register\n"
  "\n",
  NULL, 
  " added predicate - gt\n",
  " note map is equivalent to \"name function\"\n",
  NULL, 
  " Confirmed that label is used.  Found one in 68000 code for labels used in embeddded machine code:\n"
  " %label f1,f2,f3,f4,f5,f6,f7,b0,b1,b2,b3,b4,b5,b6,b7,end\n"
  "\n"
  " \"long long\" would be added here if we supported 64 bit ints or 128bit reals...\n"
  " Okain \"long\" added here by making <BTYPE> optional.\n"
  " (BTYPE being integer/real/longreal)\n"
  "\n",
  " does %record(i tc f)%name match <XTYPE>?\n"
  "\n"
  " Courtesy of Hamish, two more language extensions:\n"
  "\n"
  " Two <OPT-68K-qualifier>s to allow one or both of %writeonly %volatile %byte %integer device\n"
  "\n",
  NULL, NULL, 
  " C-like register qualifiers (Hamish, again)\n"
  " %register(a2)%integer r1,r2\n"
  " %register(a2)%byte%name bn\n"
  " %register(a3)%short%name sn\n",
  " '*' added by gt for recordformat(*)\n"
  " () moved from point of call to here to support old style \"%recordname fred\" without format. (Uses a formatspec instead)\n",
  " RF in the rules below is short for Record Format\n",
  " Imp variant record. NOT the same as C's which is per field.  This is per record.\n"
  " Still to check: a ( ... %or ... ) subgroup in a record definition, where the ...\n"
  " represents several declarations, with the whole ( ... ) group being a part\n"
  " of an enclosing record.\n"
  "\n",
  NULL, NULL, 
  " Now \"name\" has been removed from <OPT-arrayname-or-name>, check at the point\n"
  " of invocation, that \"name\" still works, now it as been added to <XTYPE>...\n"
  "\n",
  " Array declaration\n",
  NULL, NULL, 
  " Another Hamishism... %integer %array %name fred(1:*)\n"
  " which in Imp77 would be %integer %array (1) fred\n"
  " (reject the '*' in other contexts)\n"
  "\n",
  " List of lower/upper bound pairs, for array declarations.\n",
  NULL, 
  " Multi-dimensional arrays\n",
  NULL, 
  " <Opt-DIMENSIONS> added to handle:\n"
  "\n"
  " %routine y (%integer %name %array (1) %name b)\n"
  "\n"
  " and <OPT-68K-Bounds> added to handle:\n"
  "\n"
  " %routine extract params(%string(255) %name in,out,\n"
  "    %integer %array(1:max params) %name params)\n"
  "\n",
  " for the example from 68000 Imp,\n"
  " %routine y (%integer %name %array (1) %name b)\n",
  NULL, 
  " \"42(2)\" is equivalent to \"42, 42\".  (*) means 'as many more are needed to fill the array' so must come last.\n"
  " However it looks like <REPFACT> is also used as the string length indicator?!\n",
  NULL, 
  " Used in switch label.  (*) marks a catch-all. (like default: in C)\n"
  " Or at least SHOULD be used in switch label.  Looks like it isn't... just used in <REPFACT>?\n",
  " Opt- added here to allow plain \"%long\" as a declaration at <XTYPE>\n",
  NULL, NULL, NULL, 
  " if we add a \"C\" type (to reverse the order of parameter evaluation) it would be done here.\n"
  " I don't think you would write %permroutine since they are built in to the compiler, but\n"
  " depending on how the compiler is implemented, you might, and if so they would be added here.\n"
  " I do have a vague recollection of perm routines being matched up with internal code using\n"
  " a file or declarations containing magic numbers, eg something like:\n"
  " %perm (5) %routine write(%integer n, sp)\n"
  " - but that may be a manufactured memory!\n"
  "\n",
  NULL, 
  " 68000 Imp has a non-standard syntax for some array declarations, eg\n"
  "\n"
  " %conststring(1) %array(1:max params) parameters=\"B\",\"W\",\"L\"\n"
  " %string(255) %array(0:maxfiles) list\n"
  "\n"
  " The equivalent Imp77 syntax would be\n"
  "\n"
  " %conststring(1) %array parameters(1:max params)=\"B\",\"W\",\"L\"\n"
  " %string(255) %array list(0:maxfiles)\n"
  "\n"
  " Putting bounds after a %name is also from the 68000:\n"
  "\n"
  "    %integer%array%name an10(1:10)\n"
  "\n"
  " which is likely the same as\n"
  "\n"
  "    %integer%array(1)%name an10\n"
  "\n"
  "  in Imp77.  We just haven't been told the lower bound...\n"
  "\n"
  " meanwhile this broke: %string (64) %array %format sform1(0 : 1022)\n"
  "\n"
  " I'm not sure if there is any significant difference nowadays between own declarations and non-own declarations...\n"
  " the used to be distinguished by allowing initialisations... maybe worth merging the definitions now?\n",
  NULL, NULL, NULL, NULL, NULL, 
  "\n"
  " This is the same ugly hack as <Opt-Assign-NAME-LIST> below\n"
  " The AST handling has to check for and reject the '*' in all contexts except for\n"
  " 68000-style declarations such as \"@@16_4000c0 %byte *,acia s,*,acia d\"\n"
  "\n"
  " Below is a note from inside the 68K compiler that may be relevant:\n"
  "\n"
  "! %record(*) or %string(*) needs %name (or @@)\n"
  "! %string alone allowed only for %const%string\n"
  "\n",
  " <Opt-Init-assign> added by gt\n"
  " This hideous hack with '*' for an anonymous entry is yet another of Hamish's idiosyncrasies:\n"
  "\n"
  " @@16_7fffc %byte status,data,*,control\n"
  "                            ^\n"
  "  \"/home/gtoal/gtoal.com/athome/edinburgh/APM-gdmr/ETHER/SPY.imp\"\n"
  "\n"
  " @@16_4000c0 %byte *,acia s,*,acia d\n"
  "\n"
  " and would appear to just be a lazy way to skip over an address when assigning multiple\n"
  " individual scalars to addresses...\n"
  "\n"
  " Obviously it should not be allowed in any other context - some semantic checking needed here...\n"
  "\n",
  " Need <EXPR> instead of <CEXPR> to catch = tostring(i) because cexpr only got tostring\n"
  " Need '== <EXPR>' instead of '== <LVALUE>' to catch '== length(s)', i.e. a %map although it looks like a fn call.\n"
  " - the latter being more of a failing of LVALUE that here.\n"
  " Removed:\n"
  "   '==' <LVALUE>,\n"
  "   '=' <CEXPR>,\n"
  " These will be improved once we have semantic checks...\n"
  "\n",
  " removed string resolution from assop - too much type checking\n",
  " An initialised array declaration does not need a %C following the '=' before the list of initial values.\n"
  " this is a stupid hack to get around comments in the middle of array declarations :-(\n"
  " note that it gobbles the newline\n"
  " This has to handle: \"== nil(*)\" from %ownrecord(i tc f)%namearray tc refs(1:maxtc) == nil(*)\n"
  " Turns out <SCALAR-ASSIGN> didn't include '==' so switched to <ASSOP> instead\n",
  " the version without \"for\" is to support an old-style statement, %WHILE <cond> %THEN <ui>\n",
  NULL, NULL, NULL, NULL, 
  " gt changed signal to allow 2 exprs.  Mouses Imp77 adds an optional string!\n"
  " 68000: %signal 5,,holeend,\"HEAPPUT: heap corrupt\" %if holeend>lhb_limit\n",
  NULL, 
  " single optional \", expr\" for use with %signal event (, subevent)?\n",
  " %signal 3,4,position,\"Set input fails\" %unless position=0\n",
  " reversed conditions and 1-line cycles\n",
  NULL, NULL, NULL, NULL, 
  " extrinsic is an old form meaning roughly \"external spec\"\n",
};
#endif

#ifdef WANT_SEMANTIC_CODE
/* header code from grammar */

// WARNING: currently parse-time phrases are not being handled properly
//          by compile(). Are they set to -1 or skipped completely?
#define INCLUDE_AST_DEBUG "show_imp_ast.c"
int kw(int AST_op, int idx, int ap)
{
  int data[4];

  int i;

  char *k = keyword(idx);

  data[1] =  idx;

  data[2] = A[ap+3]; // index of c[] array element
  data[3] = strlen(k);

  return mktuple(AST_op, 1, 3, data);

}
// variables used in line_reconstruction() moved here so they are available to semantic code in grammar.
#define STROPPED_KEYWORDS 1  /* alters behaviour of parse() */
int at_startofstatement = TRUE;

int saved = TRUE;

int at_startofline = TRUE;

int in_keyword = FALSE;

int in_alphanumeric = FALSE;

/* end of header code from grammar */
#endif


#ifdef WANT_SEMANTIC_TABLE
#define SEMANTIC_NAME "immediate"
#define SEMANTIC 10000
#define MAX_SEMANTIC 2
#define SEMANTIC_HEADER "\n" \
        "// WARNING: currently parse-time phrases are not being handled properly\n" \
        "//          by compile(). Are they set to -1 or skipped completely?\n" \
        "#define INCLUDE_AST_DEBUG \"show_imp_ast.c\"\n" \
        "int kw(int AST_op, int idx, int ap)\n" \
        "{\n" \
        "  int data[4];\n" \
        "\n" \
        "  int i;\n" \
        "\n" \
        "  char *k = keyword(idx);\n" \
        "\n" \
        "  data[1] =  idx;\n" \
        "\n" \
        "  data[2] = A[ap+3]; // index of c[] array element\n" \
        "  data[3] = strlen(k);\n" \
        "\n" \
        "  return mktuple(AST_op, 1, 3, data);\n" \
        "\n" \
        "}\n" \
        "// variables used in line_reconstruction() moved here so they are available to semantic code in grammar.\n" \
        "#define STROPPED_KEYWORDS 1  /* alters behaviour of parse() */\n" \
        "int at_startofstatement = TRUE;\n" \
        "\n" \
        "int saved = TRUE;\n" \
        "\n" \
        "int at_startofline = TRUE;\n" \
        "\n" \
        "int in_keyword = FALSE;\n" \
        "\n" \
        "int in_alphanumeric = FALSE;\n" \
        "\n" \
        ""
char *semantic_code[MAX_SEMANTIC] = {
  "saved = at_startofstatement; at_startofstatement = TRUE; return TRUE;",
  "at_startofstatement = saved; return FALSE;",
};
int semantic(int phrase) {
#ifdef WANT_SEMANTIC_CODE
  switch (phrase) {
  case 0: saved = at_startofstatement; at_startofstatement = TRUE; return TRUE;
  case 1: at_startofstatement = saved; return FALSE;
  default: break;
  }
  // put diagnostics on error here
#endif
};
#endif
@


1.3
log
@*** empty log message ***
@
text
@d4 1
a4 1
#define MAX_GRAMMAR 2066
d121 17
a137 17
 1023|GUARD ,    40,   656,   655,   654,  1023|GUARD ,    41,     3,     6,   666,   535,   684,   682,   686,   685,     7, 
 1023|GUARD ,   299,   535,   584,   633,   662,   680,     8,  1023|GUARD ,   299,   662,   535,   683,   584,   633,   681, 
    3,     4,   666,   535,   700,   699,     7,  1023|GUARD ,   299,   683,   535,   662,   584,   688,     7,  1023|GUARD , 
  299,   683,   535,   584,   662,   688,     2,     6,  1023|GUARD ,    44,   584,   633,   662,   680,     0,     2, 
    5,  1023|GUARD ,    44,   584,   633,   681,     0,     2,     1,   663,     0,     2,     2,  1023|GUARD ,   265,     0, 
    2,     2,  1023|GUARD ,    42,     1,   584,     3,     5,  1023|GUARD ,    44,  1023|GUARD ,    42,   685,     5,  1023|GUARD ,    44, 
  584,   686,   685,     0,     2,     2,   687,   608,     0,     2,     4,  1023|GUARD ,    61,  1023|GUARD ,    61,     1, 
  691,     2,     7,   687,   702,   629,   637,   636,   669,   701,     0,     2,     3,  1023|GUARD ,   335,   590, 
    3,  1023|GUARD ,   336,   590,     3,     3,  1023|GUARD ,   335,   590,     3,  1023|GUARD ,   336,   590,    11,  1023|GUARD ,   337, 
  584,   691,   608,  1023|GUARD ,    44,   608,  1023|GUARD ,    44,   608,     2,     2,  1023|GUARD ,    61,     4,  1023|GUARD ,    60, 
 1023|GUARD ,    45,     2,     3,  1023|GUARD ,   336,   590,     0,     2,     9,   584,   691,   608,  1023|GUARD ,    44,   608, 
 1023|GUARD ,    44,   608,     0,     2,     4,  1023|GUARD ,    44,   695,   696,     0,     2,     1,   608,     0,     2, 
    4,  1023|GUARD ,    44,   695,   697,     0,     2,     3,  1023|GUARD ,    44,   597,     0,     4,     3,   631,   590, 
  564,     2,   690,   564,     1,   564,     0,     2,     4,  1023|GUARD ,    44,   700,   699,     0,     1,     3, 
  584,   674,   686,     2,     8,  1023|GUARD ,    44,   702,   629,   637,   636,   669,   701,     0,     2,     1, 
  565,     0,     5,     2,  1023|GUARD ,   338,     2,  1023|GUARD ,   333,     2,  1023|GUARD ,   339,     2,  1023|GUARD ,   340,     2, 
 1023|GUARD ,   300, 
d324 2
a325 2
 1760,  1773,  1778,  1784,  1787,  1801,  1815,  1840,  1862,  1871,  1879,  1883,  1888,  1894,  1908,  1913, 
 1921,  1931,  1940,  1961,  1970,  1976,  1988,  1995,  1999,  2006,  2012,  2023,  2030,  2035,  2046,  2050, 
d954 2
d1022 1
a1022 1
  " we use some parse-time code in phrase <COLON> to modify how line reconstruction\n"
d1421 2
d1480 19
d1500 1
d1505 1
a1505 1
int at_startofline_____ = TRUE;
a1510 1

d1520 19
d1540 1
d1545 1
a1545 1
        "int at_startofline_____ = TRUE;\n" \
@


1.2
log
@*** empty log message ***
@
text
@d4 1
a4 1
#define MAX_GRAMMAR 1893
d8 130
a137 119
   26,     2,  1023|GUARD ,    65,     2,  1023|GUARD ,    66,     2,  1023|GUARD ,    67,     2,  1023|GUARD ,    68,     2,  1023|GUARD ,    69, 
    2,  1023|GUARD ,    70,     2,  1023|GUARD ,    71,     2,  1023|GUARD ,    72,     2,  1023|GUARD ,    73,     2,  1023|GUARD ,    74,     2, 
 1023|GUARD ,    75,     2,  1023|GUARD ,    76,     2,  1023|GUARD ,    77,     2,  1023|GUARD ,    78,     2,  1023|GUARD ,    79,     2,  1023|GUARD , 
   80,     2,  1023|GUARD ,    81,     2,  1023|GUARD ,    82,     2,  1023|GUARD ,    83,     2,  1023|GUARD ,    84,     2,  1023|GUARD ,    85, 
    2,  1023|GUARD ,    86,     2,  1023|GUARD ,    87,     2,  1023|GUARD ,    88,     2,  1023|GUARD ,    89,     2,  1023|GUARD ,    90,    10, 
    2,  1023|GUARD ,    48,     2,  1023|GUARD ,    49,     2,  1023|GUARD ,    50,     2,  1023|GUARD ,    51,     2,  1023|GUARD ,    52,     2, 
 1023|GUARD ,    53,     2,  1023|GUARD ,    54,     2,  1023|GUARD ,    55,     2,  1023|GUARD ,    56,     2,  1023|GUARD ,    57,     2,     1, 
  518,     1,   519,     3,     2,   518,   521,     2,   519,   521,     0,     1,     2,   526,   524,     2, 
    2,   559,   523,     0,     4,     8,  1023|GUARD ,   256,  1023|GUARD ,   257,  1023|GUARD ,   258,   523,   517,     8,  1023|GUARD , 
  256,  1023|GUARD ,   257,  1023|GUARD ,   259,   523,   517,     8,  1023|GUARD ,   256,  1023|GUARD ,   257,  1023|GUARD ,   260,   523,   517, 
    2,   523,   517,     2,     2,  1023|GUARD ,   261,     2,  1023|GUARD ,   262,     2,     2,   529,   526,     0,     2, 
    3,   533,   539,   527,     1,   533,     2,     5,  1023|GUARD ,   256,  1023|GUARD ,   257,   525,     2,  1023|GUARD ,   256, 
   18,     6,  1023|GUARD ,   263,   559,   527,   528,   559,     8,   662,   638,  1023|GUARD ,   264,   579,   660,   634, 
  559,     9,  1023|GUARD ,    64,   565,   662,   638,   579,   660,   634,   559,     9,   662,   638,   579,   660, 
  634,   559,   527,   530,   559,     1,   546,     3,  1023|GUARD ,   265,   566,     3,  1023|GUARD ,   266,   566,     7, 
 1023|GUARD ,   267,   579,  1023|GUARD ,   265,   579,   628,     7,  1023|GUARD ,   256,  1023|GUARD ,   257,  1023|GUARD ,   268,   559,     3, 
 1023|GUARD ,   268,   559,     5,  1023|GUARD ,   269,  1023|GUARD ,   262,   559,     6,  1023|GUARD ,   270,  1023|GUARD ,   271,   579,   559, 
    4,  1023|GUARD ,   272,   565,   559,     4,  1023|GUARD ,   273,   565,   559,     4,  1023|GUARD ,   274,  1023|GUARD ,   275,     4, 
 1023|GUARD ,   274,  1023|GUARD ,   276,     1,   560,     1,   559,     2,     2,  1023|GUARD ,   277,     2,  1023|GUARD ,   256,     3, 
    4,  1023|GUARD ,    64,   565,   532,     5,  1023|GUARD ,    64,  1023|GUARD ,    35,   579,     0,     2,     5,  1023|GUARD ,    40, 
  579,  1023|GUARD ,    41,     0,     5,     9,   579,  1023|GUARD ,    40,   630,  1023|GUARD ,    41,  1023|GUARD ,    58,   533,    10, 
  579,  1023|GUARD ,    40,  1023|GUARD ,    42,  1023|GUARD ,    41,  1023|GUARD ,    58,   533,     4,   579,  1023|GUARD ,    58,   533,     4, 
  577,  1023|GUARD ,    58,   533,     0,     1,     5,  1023|GUARD ,   278,   537,   538,   559,     1,     2,   577,   536, 
    2,     4,  1023|GUARD ,    44,   577,   536,     0,     1,     6,   535,  1023|GUARD ,    45,  1023|GUARD ,    62,   544,     2, 
    4,  1023|GUARD ,    44,   537,   538,     0,     9,     1,   540,     2,   543,   677,     3,  1023|GUARD ,    42,   581, 
    1,   552,     1,   553,     1,   534,    12,  1023|GUARD ,   279,   633,   551,   629,  1023|GUARD ,   280,   559,   527, 
 1023|GUARD ,   281,   559,     6,  1023|GUARD ,   264,   579,   660,   634,   559,     1,   529,     1,     7,  1023|GUARD ,   263, 
  559,   527,  1023|GUARD ,   256,   559,     2,     3,  1023|GUARD ,   282,   543,     0,     3,     5,  1023|GUARD ,    45,  1023|GUARD , 
   62,   589,     2,   676,   603,     0,    14,     5,   579,   613,   614,   542,   541,     6,  1023|GUARD ,   283, 
 1023|GUARD ,   284,   513,   541,     5,  1023|GUARD ,    45,  1023|GUARD ,    62,   544,     2,  1023|GUARD ,   285,     2,  1023|GUARD ,   286, 
    2,  1023|GUARD ,   287,     4,  1023|GUARD ,   288,   676,   603,     2,  1023|GUARD ,   289,     4,  1023|GUARD ,   290,   577,   541, 
    3,  1023|GUARD ,   290,   541,     2,  1023|GUARD ,   291,     5,  1023|GUARD ,   292,   633,   630,   672,     2,  1023|GUARD ,   293, 
    2,  1023|GUARD ,   294,     3,     6,   579,  1023|GUARD ,    40,   603,  1023|GUARD ,    41,     1,   579,     1,   577,     3, 
    2,  1023|GUARD ,   258,     2,  1023|GUARD ,   260,     2,  1023|GUARD ,   259,     8,     5,   531,   685,   642,   678,   559, 
    9,   531,   685,  1023|GUARD ,   295,  1023|GUARD ,   296,   547,   548,   559,     7,   531,   685,  1023|GUARD ,   295,   549, 
  550,   559,     4,   531,   642,   664,   559,     8,   531,  1023|GUARD ,   295,  1023|GUARD ,   296,   547,   548,   559, 
    6,   531,  1023|GUARD ,   295,   549,   550,   559,     6,  1023|GUARD ,   295,  1023|GUARD ,   297,   663,   559,    14,  1023|GUARD , 
  298,   579,   628,  1023|GUARD ,    40,   603,  1023|GUARD ,    58,   603,  1023|GUARD ,    41,   627,   559,     1,     8,   579, 
  628,   651,  1023|GUARD ,    40,   644,  1023|GUARD ,    41,     2,     3,  1023|GUARD ,    44,   547,     0,     1,     7,   579, 
  628,  1023|GUARD ,    40,   644,  1023|GUARD ,    41,     2,     4,  1023|GUARD ,    44,   549,   550,     0,     2,     2,  1023|GUARD , 
   42,     1,   630,     4,     9,  1023|GUARD ,   299,   671,   559,   527,  1023|GUARD ,   300,   670,   559,     9,   669, 
 1023|GUARD ,   299,   559,   527,  1023|GUARD ,   300,   670,   559,    11,   668,  1023|GUARD ,   301,  1023|GUARD ,   299,   559,   527, 
 1023|GUARD ,   300,   670,   559,     4,   668,  1023|GUARD ,   301,   543,     1,     3,   626,   585,   556,     3,     7, 
 1023|GUARD ,   302,   626,   585,   559,   527,   554,     7,  1023|GUARD ,   302,   559,   527,  1023|GUARD ,   281,   559,     3, 
 1023|GUARD ,   281,   555,     4,     9,  1023|GUARD ,   302,  1023|GUARD ,   280,   559,   527,  1023|GUARD ,   281,   559,     3,  1023|GUARD , 
  302,   553,     4,  1023|GUARD ,   302,   543,   559,     1,   559,     2,     6,   557,  1023|GUARD ,   280,   559,   527, 
  554,     4,  1023|GUARD ,   301,   543,   555,     2,     2,  1023|GUARD ,   301,     0,     2,     2,  1023|GUARD ,   280,     0, 
    2,     1,   515,     2,  1023|GUARD ,    59,     2,     3,  1023|GUARD ,   303,   561,     3,  1023|GUARD ,    33,   561,     7, 
    2,   516,   561,     2,   514,   561,     2,   513,   561,     2,   518,   561,     2,   519,   561,     2, 
  512,   561,     1,   515,     7,     3,   564|NEGATE,   516,   562,     2,   514,   562,     2,   513,   562,     2, 
  518,   562,     2,   519,   562,     2,   512,   562,     1,   563,     2,     1,   515,     1,   564,     1, 
    2,  1023|GUARD ,    59,     5,     5,   577,  1023|GUARD ,    95,   577,   579,     4,   577,  1023|GUARD ,    95,   577,     4, 
  577,  1023|GUARD ,    95,   579,     1,   577,     1,   570,     2,     2,   567,   514,     1,   513,     2,     2, 
 1023|GUARD ,    69,     0,     2,     1,   565,     1,   572,     3,     1,   565,     1,   572,     1,   566,     1, 
    2,   571,   513,     4,     2,  1023|GUARD ,    77,     2,  1023|GUARD ,    88,     2,  1023|GUARD ,    66,     0,     2,     3, 
  577,   574,   576,     2,   573,   576,     1,     3,  1023|GUARD ,    46,   577,     2,     1,   573,     0,     3, 
    2,  1023|GUARD ,    43,     2,  1023|GUARD ,    45,     0,     2,     4,  1023|GUARD ,    64,   575,   577,     0,     1,     2, 
  519,   578,     2,     1,   577,     0,     1,     3,   518,   580|NEGATE,   521,     1,     1,   513,     1,     1, 
  562,     3,     4,  1023|GUARD ,   282,   586,   583,     4,  1023|GUARD ,   304,   586,   584,     0,     2,     4,  1023|GUARD , 
  282,   586,   583,     0,     2,     4,  1023|GUARD ,   304,   586,   584,     0,     1,     2,   586,   582,     5, 
    1,   588,     4,   603,   598,   603,   587,     2,   579,   601,     5,  1023|GUARD ,    40,   585,  1023|GUARD ,    41, 
    3,  1023|GUARD ,   305,   586,     2,     2,   598,   603,     0,     1,     6,   592,  1023|GUARD ,    45,  1023|GUARD ,    62, 
  589,     2,     2,   594,   596,     2,   595,   597,     1,     3,   579,   613,   615,     2,     1,   590, 
    1,   566,     1,     2,   591,   593,     2,     4,  1023|GUARD ,    46,   591,   593,     0,     1,     5,  1023|GUARD , 
   40,   591,  1023|GUARD ,    41,     1,     1,   590,     2,     4,  1023|GUARD ,    46,   595,   597,     0,     2,     4, 
 1023|GUARD ,    46,   594,   596,     0,     8,     4,  1023|GUARD ,    61,  1023|GUARD ,    61,     2,  1023|GUARD ,    61,     1,   600, 
    1,   599,     4,  1023|GUARD ,    60,  1023|GUARD ,    61,     2,  1023|GUARD ,    60,     4,  1023|GUARD ,    62,  1023|GUARD ,    61,     2, 
 1023|GUARD ,    62,     3,     2,  1023|GUARD ,    35,     4,  1023|GUARD ,    92,  1023|GUARD ,    61,     4,  1023|GUARD ,    60,  1023|GUARD ,    62, 
    2,     4,  1023|GUARD ,    35,  1023|GUARD ,    35,     6,  1023|GUARD ,    92,  1023|GUARD ,    61,  1023|GUARD ,    61,     2,     6,  1023|GUARD , 
   40,   603,   602,  1023|GUARD ,    41,     0,     2,     4,  1023|GUARD ,    44,   603,   602,     0,     1,     2,   605, 
  604,     2,     3,   623,   605,   604,     0,     1,     2,   607,   606,     2,     3,   622,   607,   606, 
    0,     1,     2,   609,   608,     2,     3,   618,   609,   608,     0,     1,     2,   610,   612,     2, 
    2,   611,   610,     0,     1,     2,   612,   619,     1,     2,   624,   616,     4,     5,  1023|GUARD ,    91, 
  603,  1023|GUARD ,    93,     5,  1023|GUARD ,    43,  1023|GUARD ,    43,   603,     5,  1023|GUARD ,    45,  1023|GUARD ,    45,   603,     1, 
  601,     2,     5,  1023|GUARD ,    95,   579,   613,   614,     0,     2,     5,  1023|GUARD ,    95,   579,   613,   615, 
    0,     5,     3,   579,   613,   615,     1,   569,     5,  1023|GUARD ,    40,   603,  1023|GUARD ,    41,     5,  1023|GUARD , 
  124,   603,  1023|GUARD ,   124,     5,  1023|GUARD ,    33,   603,  1023|GUARD ,    33,     4,     1,   618,     1,   619,     1, 
  622,     1,   623,     2,     4,  1023|GUARD ,    60,  1023|GUARD ,    60,     4,  1023|GUARD ,    62,  1023|GUARD ,    62,     2,     1, 
  620,     1,   621,     3,     8,  1023|GUARD ,    42,  1023|GUARD ,    42,  1023|GUARD ,    42,  1023|GUARD ,    42,     4,  1023|GUARD ,    92, 
 1023|GUARD ,    92,     4,  1023|GUARD ,    94,  1023|GUARD ,    94,     3,     4,  1023|GUARD ,    42,  1023|GUARD ,    42,     2,  1023|GUARD ,    92, 
    2,  1023|GUARD ,    94,     4,     2,  1023|GUARD ,    42,     4,  1023|GUARD ,    47,  1023|GUARD ,    47,     2,  1023|GUARD ,    47,     2, 
 1023|GUARD ,    38,     5,     2,  1023|GUARD ,    43,     2,  1023|GUARD ,    45,     4,  1023|GUARD ,    33,  1023|GUARD ,    33,     2,  1023|GUARD , 
   33,     2,  1023|GUARD ,    46,     4,     2,  1023|GUARD ,    43,     2,  1023|GUARD ,    45,     1,   625,     0,     2,     2, 
 1023|GUARD ,    92,     2,  1023|GUARD ,   126,     2,     2,  1023|GUARD ,   306,     2,  1023|GUARD ,   307,     2,    13,  1023|GUARD ,    44, 
  579,   628,  1023|GUARD ,    40,   603,  1023|GUARD ,    58,   603,  1023|GUARD ,    41,   627,     0,     2,     4,  1023|GUARD ,    44, 
  579,   628,     0,     2,     4,  1023|GUARD ,    44,   630,   629,     0,     1,     3,   624,   632,   631,     2, 
    3,   617,   632,   631,     0,     5,     1,   579,     1,   569,     5,  1023|GUARD ,    40,   630,  1023|GUARD ,    41, 
    5,  1023|GUARD ,   124,   630,  1023|GUARD ,   124,     5,  1023|GUARD ,    33,   630,  1023|GUARD ,    33,     2,     2,  1023|GUARD ,   308, 
    0,     2,     6,  1023|GUARD ,    40,   636,   635,  1023|GUARD ,    41,     0,     2,     3,   659,   636,   635,     0, 
    3,     4,   642,   653,   579,   628,     5,   638,   637,   579,   628,   634,     4,  1023|GUARD ,   309,   579, 
  628,     2,     2,  1023|GUARD ,   309,     0,     3,     2,  1023|GUARD ,   310,     2,  1023|GUARD ,   311,     2,   642,   639, 
    2,     1,   640,     2,  1023|GUARD ,   312,     2,     2,  1023|GUARD ,   313,     2,  1023|GUARD ,   314,     9,     2,  1023|GUARD , 
  315,     2,  1023|GUARD ,   316,     2,  1023|GUARD ,   317,     3,  1023|GUARD ,   275,   658,     3,  1023|GUARD ,   318,   654,     3, 
 1023|GUARD ,   319,   654,     3,  1023|GUARD ,   320,   654,     3,  1023|GUARD ,   321,   655,     3,  1023|GUARD ,   295,   643,     1, 
    2,   641,   637,     3,     5,  1023|GUARD ,    40,   644,  1023|GUARD ,    41,     6,  1023|GUARD ,    40,  1023|GUARD ,    42,  1023|GUARD , 
   41,     0,     2,     1,   579,     3,   647,   646,   645,     2,     5,  1023|GUARD ,   304,   647,   646,   645, 
    0,     2,     4,  1023|GUARD ,    44,   647,   646,     0,     2,     2,   642,   648,     7,  1023|GUARD ,    40,   647, 
  646,   645,  1023|GUARD ,    41,     2,     3,   653,   579,   628,     3,  1023|GUARD ,   296,   649,     1,     4,   579, 
  628,   651,   650,     2,     3,  1023|GUARD ,    44,   649,     0,     1,     9,  1023|GUARD ,    40,   603,  1023|GUARD ,    58, 
  603,   652,  1023|GUARD ,    41,     2,     7,  1023|GUARD ,    44,   603,  1023|GUARD ,    58,   603,   652,     0,     2,     4, 
 1023|GUARD ,   296,  1023|GUARD ,   309,     0,     2,     2,  1023|GUARD ,   315,     0,     2,     5,  1023|GUARD ,    40,   656,  1023|GUARD , 
   41,     0,     2,     1,   657,     0,     2,     3,   624,   632,   631,     2,  1023|GUARD ,    42,     4,     2, 
 1023|GUARD ,   316,     2,  1023|GUARD ,   315,     4,  1023|GUARD ,   275,  1023|GUARD ,   316,     0,     2,     2,  1023|GUARD ,    44,     0, 
    2,     3,  1023|GUARD ,   322,   661,     0,     1,     1,   514,     5,     2,  1023|GUARD ,   323,     2,  1023|GUARD ,   324, 
    2,  1023|GUARD ,   325,     2,  1023|GUARD ,   260,     0,     2,     3,  1023|GUARD ,   264,   579,     8,   579,  1023|GUARD ,    40, 
  647,   646,   645,  1023|GUARD ,    41,     2,     4,   653,   579,   667,   666,     4,  1023|GUARD ,   296,   665,   649, 
    2,     2,  1023|GUARD ,   297,     0,     2,     5,  1023|GUARD ,    44,   579,   667,   666,     0,     3,     5,  1023|GUARD , 
   61,  1023|GUARD ,    61,   603,     3,  1023|GUARD ,    61,   603,     0,     2,     3,  1023|GUARD ,   326,   585,     3,  1023|GUARD , 
  327,   585,     3,     3,  1023|GUARD ,   326,   585,     3,  1023|GUARD ,   327,   585,    12,  1023|GUARD ,   328,   579,  1023|GUARD , 
   61,   603,  1023|GUARD ,    44,   603,  1023|GUARD ,    44,   603,     2,     3,  1023|GUARD ,   327,   585,     0,     2,    10, 
  579,  1023|GUARD ,    61,   603,  1023|GUARD ,    44,   603,  1023|GUARD ,    44,   603,     0,     2,     4,  1023|GUARD ,    44,   673, 
  674,     0,     2,     1,   603,     0,     2,     4,  1023|GUARD ,    44,   673,   675,     0,     2,     3,  1023|GUARD , 
   44,   592,     0,     3,     4,  1023|GUARD ,    61,  1023|GUARD ,    61,     2,  1023|GUARD ,    61,     4,  1023|GUARD ,    60,  1023|GUARD , 
   45,     4,     3,   626,   585,   559,     2,   669,   559,     1,   559,     0,     2,     4,   653,   684, 
  680,   679,     7,  1023|GUARD ,   296,   665,   684,   579,   651,   681,     2,     4,  1023|GUARD ,    44,   680,   679, 
    0,     1,     3,   579,   660,   667,     2,     8,  1023|GUARD ,    61,   683,   624,   632,   631,   655,   682, 
    0,     2,     8,  1023|GUARD ,    44,   683,   624,   632,   631,   655,   682,     0,     2,     1,   560,     0, 
    2,     2,  1023|GUARD ,   264,     0,     5,     2,  1023|GUARD ,   329,     2,  1023|GUARD ,   324,     2,  1023|GUARD ,   330,     2, 
 1023|GUARD ,   331,     2,  1023|GUARD ,   332, 
d140 1
a140 1
#define MAX_KEYWORD 77
d144 5
a148 4
  "spec", "include", "option", "from", 
  "list", "trusted", "main", "ep", 
  "control", "diagnose", "reals", "long", 
  "normal", "endofprogram", "fault", "on", 
d152 12
a163 11
  "signal", "exit", "continue", "record", 
  "array", "format", "switch", "cycle", 
  "repeat", "then", "else", "comment", 
  "or", "not", "if", "unless", 
  "event", "name", "routine", "predicate", 
  "map", "fn", "function", "integer", 
  "real", "label", "byte", "half", 
  "short", "string", "alias", "system", 
  "external", "dynamic", "while", "until", 
  "for", "own", "extrinsic", "constant", 
  "const", 
d175 77
a251 69
#define KW_spec 8
#define KW_include 9
#define KW_option 10
#define KW_from 11
#define KW_list 12
#define KW_trusted 13
#define KW_main 14
#define KW_ep 15
#define KW_control 16
#define KW_diagnose 17
#define KW_reals 18
#define KW_long 19
#define KW_normal 20
#define KW_endofprogram 21
#define KW_fault 22
#define KW_on 23
#define KW_start 24
#define KW_finish 25
#define KW_and 26
#define KW_print 27
#define KW_text 28
#define KW_return 29
#define KW_true 30
#define KW_false 31
#define KW_result 32
#define KW_monitorstop 33
#define KW_monitor 34
#define KW_stop 35
#define KW_signal 36
#define KW_exit 37
#define KW_continue 38
#define KW_record 39
#define KW_array 40
#define KW_format 41
#define KW_switch 42
#define KW_cycle 43
#define KW_repeat 44
#define KW_then 45
#define KW_else 46
#define KW_comment 47
#define KW_or 48
#define KW_not 49
#define KW_if 50
#define KW_unless 51
#define KW_event 52
#define KW_name 53
#define KW_routine 54
#define KW_predicate 55
#define KW_map 56
#define KW_fn 57
#define KW_function 58
#define KW_integer 59
#define KW_real 60
#define KW_label 61
#define KW_byte 62
#define KW_half 63
#define KW_short 64
#define KW_string 65
#define KW_alias 66
#define KW_system 67
#define KW_external 68
#define KW_dynamic 69
#define KW_while 70
#define KW_until 71
#define KW_for 72
#define KW_own 73
#define KW_extrinsic 74
#define KW_constant 75
#define KW_const 76
d258 1
a258 1
#define MAX_PHRASE 174
d263 9
a271 8
  "char", "EOF", "letter", "digit", 
  "alphanumeric", "opt-letter-or-digit-seq", "SS", "BLANKS", 
  "LAST-ITEMS-IN-FILE", "program", "EXTERNALS", "INTERNALS", 
  "outer-level-end", "EXTERNAL-OR-INTERNAL", "end68K", "Opt-address", 
  "Opt-register", "OPT-LABEL", "FAULT-S", "FAULT-LIST", 
  "MORE-NUMBERS", "FAULT-ACTION", "MORE-FAULTS", "INTERNAL", 
  "NESTED-BLOCK", "AUI", "OPT-ASSIGN", "UI", 
  "GOTO-DESTINATION", "FILE-END-TYPE", "DECLARATION-S", "RADEC", 
d273 38
a310 35
  "CYCLE-S", "IF-S", "FINISH-S", "Opt-ELSE-S", 
  "THEN-S", "OPT-then", "OPT-start", "S", 
  "COMMENT", "Rest-of-line", "Rest-of-statement", "NL-or-SEMI", 
  "semi", "INT-CONST", "STR-CONST", "OPT-DQ-LETTER", 
  "NUMERIC-CONST", "CONST", "OLDHEX", "OPT-SQ-LETTER", 
  "REAL-CONST", "FRACPT", "OPT-FRACPT", "OPT-PM", 
  "OPT-EXPONENT", "DIGIT-SEQ", "rest-of-number", "NAME", 
  "SQUO-STRING", "UCI", "REST-OF-COND", "REST-OF-ANDC", 
  "REST-OF-ORC", "CONDITION", "SC", "OPT-DOUBLE-SIDED", 
  "STRING-RESOLUTION", "STRING-RESOLUTION-EXPR", "STRING-LVALUE", "STRING-RVALUE", 
  "STRING-EXPR", "REST-OF-STRING-EXPR", "STR-MATCH", "STR-ASSIGN", 
  "OPT-STR-ASSIGN", "OPT-STR-MATCH", "COMP", "NOT-EQUALS", 
  "NOT-EQUALS-ADDRESS", "Opt-PARAMETERS", "REST-OF-PARAMETERS", "EXPR", 
  "REST-OF-EXPR", "MEDIUMPREC-EXPR", "REST-OF-MEDIUMPREC-EXPR", "HIGHPREC-EXPR", 
  "REST-OF-HIGHPREC-EXPR", "RIGHT-ASSOC-EXPR", "REST-OF-RIGHTASSOC-EXPR", "RIGHTASSOC-EXPR-with-OP", 
  "UNARY-EXPR", "Opt-PARAMETERS-OR-POINTERINDEX", "Opt-RECORDFIELD", "Opt-RECORDFIELD-OR-POINTERINDEX", 
  "OPERAND", "OP", "OP-HIGH-LEFTASSOC", "OP-HIGH-RIGHTASSOC", 
  "INTEGER-EXP", "REAL-EXP", "OP-MED", "OP-LOW", 
  "Opt-UNARY-OP", "UNARY-NOT", "Percent-IU", "REST-OF-SWLIST", 
  "Opt-NAME-LIST", "REST-OF-NAME-LIST", "CEXPR", "REST-OF-CEXPR", 
  "COPERAND", "OPT-event", "FPP", "REST-OF-FORMAL-PARAMETER-LIST", 
  "FORMAL-PARAMETER-DECLARATION", "OPT-name", "RT", "FN-MAP", 
  "FN", "BASE-XTYPE", "XTYPE", "Opt-RFREF", 
  "RECFMT-REF", "ALT-RECFMT-DEC", "REST-OF-RECFMT-DEC", "RECFMT-DEC", 
  "RECFMT-ELMNT", "ADECLN", "REST-OF-ARLIST", "BPAIR", 
  "REST-OF-BPLIST", "OPT-arrayname", "Opt-INTEGER", "REPFACT", 
  "Opt-STAROREXPR", "STAROREXPR", "Opt-BTYPE", "Opt-Comma", 
  "Opt-ALIAS", "TEXTTEXT", "Percent-SEX", "RECFMT-spec-OR-BODY", 
  "DECLN", "OPT-format", "Opt-Assign-NAME-LIST", "Opt-Init-assign", 
  "Percent-WU", "Percent-WUF", "Opt-UNTIL", "Opt-CYCPARM", 
  "OPEXPR2", "OPT-EXPR", "OPEXPR", "OPSTRING", 
  "ASSOP", "REST-OF-SS1", "OWNDEC", "REST-OF-OWNDEC", 
  "SINGLE-OWNDEC", "CONSTLIST", "ROCL", "stupid", 
  "OPT-spec", "XOWN", 
};
d314 12
a325 11
    0,    79,   110,   115,   123,   127,   132,   163,   170,   175, 
  182,   192,   296,   303,   316,   324,   357,   364,   368,   375,   383,   390,   428,   437,   443,   454, 
  515,   527,   537,   605,   615,   621,   630,   637,   643,   681,   686,   707,   729,   742,   747,   752, 
  758,   767,   788,   810,   815,   819,   840,   846,   851,   856,   863,   867,   878,   886,   891,   895, 
  903,   910,   914,   918,   923,   926,   929,   941,   948,   955,   959,   980,   985,   993,  1000,  1005, 
 1010,  1014,  1021,  1028,  1031,  1038,  1045,  1074,  1088,  1101,  1110,  1117,  1121,  1127,  1131,  1137, 
 1141,  1147,  1151,  1156,  1160,  1164,  1185,  1193,  1201,  1226,  1235,  1246,  1251,  1271,  1283,  1298, 
 1316,  1326,  1333,  1340,  1356,  1363,  1370,  1375,  1381,  1404,  1409,  1418,  1424,  1441,  1446,  1456, 
 1462,  1469,  1503,  1507,  1522,  1529,  1537,  1544,  1556,  1565,  1571,  1577,  1588,  1598,  1605,  1610, 
 1618,  1622,  1630,  1643,  1648,  1654,  1657,  1671,  1685,  1696,  1701,  1709,  1721,  1730,  1752,  1758, 
 1771,  1778,  1782,  1789,  1795,  1809,  1820,  1834,  1841,  1846,  1857,  1868,  1872,  1877, 
d352 35
a386 2
#define P_letter 518
#define AST_letter 6
d388 2
a389 2
#define P_digit 519
#define AST_digit 7
d391 2
a392 2
#define P_alphanumeric 520
#define AST_alphanumeric 8
d394 2
a395 2
#define P_opt_letter_or_digit_seq 521
#define AST_opt_letter_or_digit_seq 9
d397 2
a398 2
#define P_SS 522
#define AST_SS 10
d400 2
a401 2
#define P_BLANKS 523
#define AST_BLANKS 11
d403 2
a404 2
#define P_LAST_ITEMS_IN_FILE 524
#define AST_LAST_ITEMS_IN_FILE 12
d406 2
a407 2
#define P_program 525
#define AST_program 13
d409 2
a410 2
#define P_EXTERNALS 526
#define AST_EXTERNALS 14
d412 2
a413 2
#define P_INTERNALS 527
#define AST_INTERNALS 15
d415 2
a416 2
#define P_outer_level_end 528
#define AST_outer_level_end 16
d418 2
a419 2
#define P_EXTERNAL_OR_INTERNAL 529
#define AST_EXTERNAL_OR_INTERNAL 17
d421 2
a422 2
#define P_end68K 530
#define AST_end68K 18
d424 2
a425 2
#define P_Opt_address 531
#define AST_Opt_address 19
d427 2
a428 2
#define P_Opt_register 532
#define AST_Opt_register 20
d430 2
a431 2
#define P_OPT_LABEL 533
#define AST_OPT_LABEL 21
d433 2
a434 2
#define P_FAULT_S 534
#define AST_FAULT_S 22
d436 2
a437 2
#define P_FAULT_LIST 535
#define AST_FAULT_LIST 23
d439 2
a440 2
#define P_MORE_NUMBERS 536
#define AST_MORE_NUMBERS 24
d442 2
a443 2
#define P_FAULT_ACTION 537
#define AST_FAULT_ACTION 25
d445 2
a446 2
#define P_MORE_FAULTS 538
#define AST_MORE_FAULTS 26
d448 2
a449 2
#define P_INTERNAL 539
#define AST_INTERNAL 27
d451 2
a452 2
#define P_NESTED_BLOCK 540
#define AST_NESTED_BLOCK 28
d454 2
a455 2
#define P_AUI 541
#define AST_AUI 29
d457 2
a458 2
#define P_OPT_ASSIGN 542
#define AST_OPT_ASSIGN 30
d460 2
a461 2
#define P_UI 543
#define AST_UI 31
d463 2
a464 2
#define P_GOTO_DESTINATION 544
#define AST_GOTO_DESTINATION 32
d466 2
a467 2
#define P_FILE_END_TYPE 545
#define AST_FILE_END_TYPE 33
d469 2
a470 2
#define P_DECLARATION_S 546
#define AST_DECLARATION_S 34
d472 2
a473 2
#define P_RADEC 547
#define AST_RADEC 35
d475 2
a476 2
#define P_REST_OF_RADEC 548
#define AST_REST_OF_RADEC 36
d478 2
a479 2
#define P_RDEC 549
#define AST_RDEC 37
d481 2
a482 2
#define P_REST_OF_RDEC 550
#define AST_REST_OF_RDEC 38
d484 2
a485 2
#define P_EVENT_LIST 551
#define AST_EVENT_LIST 39
d487 2
a488 2
#define P_CYCLE_S 552
#define AST_CYCLE_S 40
d490 2
a491 2
#define P_IF_S 553
#define AST_IF_S 41
d493 2
a494 2
#define P_FINISH_S 554
#define AST_FINISH_S 42
d496 2
a497 2
#define P_Opt_ELSE_S 555
#define AST_Opt_ELSE_S 43
d499 2
a500 2
#define P_THEN_S 556
#define AST_THEN_S 44
d502 2
a503 2
#define P_OPT_then 557
#define AST_OPT_then 45
d505 2
a506 2
#define P_OPT_start 558
#define AST_OPT_start 46
d508 2
a509 2
#define P_S 559
#define AST_S 47
d511 2
a512 2
#define P_COMMENT 560
#define AST_COMMENT 48
d514 2
a515 2
#define P_Rest_of_line 561
#define AST_Rest_of_line 49
d517 2
a518 2
#define P_Rest_of_statement 562
#define AST_Rest_of_statement 50
d520 2
a521 2
#define P_NL_or_SEMI 563
#define AST_NL_or_SEMI 51
d523 2
a524 2
#define P_semi 564
#define AST_semi 52
d526 2
a527 2
#define P_INT_CONST 565
#define AST_INT_CONST 53
d529 2
a530 2
#define P_STR_CONST 566
#define AST_STR_CONST 54
d532 2
a533 2
#define P_OPT_DQ_LETTER 567
#define AST_OPT_DQ_LETTER 55
d535 2
a536 2
#define P_NUMERIC_CONST 568
#define AST_NUMERIC_CONST 56
d538 2
a539 2
#define P_CONST 569
#define AST_CONST 57
d541 2
a542 2
#define P_OLDHEX 570
#define AST_OLDHEX 58
d544 2
a545 2
#define P_OPT_SQ_LETTER 571
#define AST_OPT_SQ_LETTER 59
d547 2
a548 2
#define P_REAL_CONST 572
#define AST_REAL_CONST 60
d550 2
a551 2
#define P_FRACPT 573
#define AST_FRACPT 61
d553 2
a554 2
#define P_OPT_FRACPT 574
#define AST_OPT_FRACPT 62
d556 2
a557 2
#define P_OPT_PM 575
#define AST_OPT_PM 63
d559 2
a560 2
#define P_OPT_EXPONENT 576
#define AST_OPT_EXPONENT 64
d562 2
a563 2
#define P_DIGIT_SEQ 577
#define AST_DIGIT_SEQ 65
d565 2
a566 2
#define P_rest_of_number 578
#define AST_rest_of_number 66
d568 2
a569 2
#define P_NAME 579
#define AST_NAME 67
d571 2
a572 2
#define P_SQUO_STRING 580
#define AST_SQUO_STRING 68
d574 2
a575 2
#define P_UCI 581
#define AST_UCI 69
d577 2
a578 2
#define P_REST_OF_COND 582
#define AST_REST_OF_COND 70
d580 2
a581 2
#define P_REST_OF_ANDC 583
#define AST_REST_OF_ANDC 71
d583 2
a584 2
#define P_REST_OF_ORC 584
#define AST_REST_OF_ORC 72
d586 2
a587 2
#define P_CONDITION 585
#define AST_CONDITION 73
d589 2
a590 2
#define P_SC 586
#define AST_SC 74
d592 2
a593 2
#define P_OPT_DOUBLE_SIDED 587
#define AST_OPT_DOUBLE_SIDED 75
d595 2
a596 2
#define P_STRING_RESOLUTION 588
#define AST_STRING_RESOLUTION 76
d598 2
a599 2
#define P_STRING_RESOLUTION_EXPR 589
#define AST_STRING_RESOLUTION_EXPR 77
d601 2
a602 2
#define P_STRING_LVALUE 590
#define AST_STRING_LVALUE 78
d604 2
a605 2
#define P_STRING_RVALUE 591
#define AST_STRING_RVALUE 79
d607 2
a608 2
#define P_STRING_EXPR 592
#define AST_STRING_EXPR 80
d610 2
a611 2
#define P_REST_OF_STRING_EXPR 593
#define AST_REST_OF_STRING_EXPR 81
d613 2
a614 2
#define P_STR_MATCH 594
#define AST_STR_MATCH 82
d616 2
a617 2
#define P_STR_ASSIGN 595
#define AST_STR_ASSIGN 83
d619 2
a620 2
#define P_OPT_STR_ASSIGN 596
#define AST_OPT_STR_ASSIGN 84
d622 2
a623 2
#define P_OPT_STR_MATCH 597
#define AST_OPT_STR_MATCH 85
d625 2
a626 2
#define P_COMP 598
#define AST_COMP 86
d628 2
a629 2
#define P_NOT_EQUALS 599
#define AST_NOT_EQUALS 87
d631 2
a632 2
#define P_NOT_EQUALS_ADDRESS 600
#define AST_NOT_EQUALS_ADDRESS 88
d634 2
a635 2
#define P_Opt_PARAMETERS 601
#define AST_Opt_PARAMETERS 89
d637 2
a638 2
#define P_REST_OF_PARAMETERS 602
#define AST_REST_OF_PARAMETERS 90
d640 2
a641 2
#define P_EXPR 603
#define AST_EXPR 91
d643 2
a644 2
#define P_REST_OF_EXPR 604
#define AST_REST_OF_EXPR 92
d646 2
a647 2
#define P_MEDIUMPREC_EXPR 605
#define AST_MEDIUMPREC_EXPR 93
d649 2
a650 2
#define P_REST_OF_MEDIUMPREC_EXPR 606
#define AST_REST_OF_MEDIUMPREC_EXPR 94
d652 2
a653 2
#define P_HIGHPREC_EXPR 607
#define AST_HIGHPREC_EXPR 95
d655 2
a656 2
#define P_REST_OF_HIGHPREC_EXPR 608
#define AST_REST_OF_HIGHPREC_EXPR 96
d658 2
a659 2
#define P_RIGHT_ASSOC_EXPR 609
#define AST_RIGHT_ASSOC_EXPR 97
d661 2
a662 2
#define P_REST_OF_RIGHTASSOC_EXPR 610
#define AST_REST_OF_RIGHTASSOC_EXPR 98
d664 2
a665 2
#define P_RIGHTASSOC_EXPR_with_OP 611
#define AST_RIGHTASSOC_EXPR_with_OP 99
d667 2
a668 2
#define P_UNARY_EXPR 612
#define AST_UNARY_EXPR 100
d670 2
a671 2
#define P_Opt_PARAMETERS_OR_POINTERINDEX 613
#define AST_Opt_PARAMETERS_OR_POINTERINDEX 101
d673 2
a674 2
#define P_Opt_RECORDFIELD 614
#define AST_Opt_RECORDFIELD 102
d676 2
a677 2
#define P_Opt_RECORDFIELD_OR_POINTERINDEX 615
#define AST_Opt_RECORDFIELD_OR_POINTERINDEX 103
d679 2
a680 2
#define P_OPERAND 616
#define AST_OPERAND 104
d682 2
a683 2
#define P_OP 617
#define AST_OP 105
d685 2
a686 2
#define P_OP_HIGH_LEFTASSOC 618
#define AST_OP_HIGH_LEFTASSOC 106
d688 2
a689 2
#define P_OP_HIGH_RIGHTASSOC 619
#define AST_OP_HIGH_RIGHTASSOC 107
d691 2
a692 2
#define P_INTEGER_EXP 620
#define AST_INTEGER_EXP 108
d694 2
a695 2
#define P_REAL_EXP 621
#define AST_REAL_EXP 109
d697 2
a698 2
#define P_OP_MED 622
#define AST_OP_MED 110
d700 2
a701 2
#define P_OP_LOW 623
#define AST_OP_LOW 111
d703 2
a704 2
#define P_Opt_UNARY_OP 624
#define AST_Opt_UNARY_OP 112
d706 2
a707 2
#define P_UNARY_NOT 625
#define AST_UNARY_NOT 113
d709 2
a710 2
#define P_Percent_IU 626
#define AST_Percent_IU 114
d712 2
a713 2
#define P_REST_OF_SWLIST 627
#define AST_REST_OF_SWLIST 115
d715 2
a716 2
#define P_Opt_NAME_LIST 628
#define AST_Opt_NAME_LIST 116
d718 2
a719 2
#define P_REST_OF_NAME_LIST 629
#define AST_REST_OF_NAME_LIST 117
d721 2
a722 2
#define P_CEXPR 630
#define AST_CEXPR 118
d724 2
a725 2
#define P_REST_OF_CEXPR 631
#define AST_REST_OF_CEXPR 119
d727 2
a728 2
#define P_COPERAND 632
#define AST_COPERAND 120
d730 2
a731 2
#define P_OPT_event 633
#define AST_OPT_event 121
d733 2
a734 2
#define P_FPP 634
#define AST_FPP 122
d736 2
a737 2
#define P_REST_OF_FORMAL_PARAMETER_LIST 635
#define AST_REST_OF_FORMAL_PARAMETER_LIST 123
d739 2
a740 2
#define P_FORMAL_PARAMETER_DECLARATION 636
#define AST_FORMAL_PARAMETER_DECLARATION 124
d742 2
a743 2
#define P_OPT_name 637
#define AST_OPT_name 125
d745 2
a746 2
#define P_RT 638
#define AST_RT 126
d748 2
a749 2
#define P_FN_MAP 639
#define AST_FN_MAP 127
d751 2
a752 2
#define P_FN 640
#define AST_FN 128
d754 2
a755 2
#define P_BASE_XTYPE 641
#define AST_BASE_XTYPE 129
d757 2
a758 2
#define P_XTYPE 642
#define AST_XTYPE 130
d760 2
a761 2
#define P_Opt_RFREF 643
#define AST_Opt_RFREF 131
d763 2
a764 2
#define P_RECFMT_REF 644
#define AST_RECFMT_REF 132
d766 2
a767 2
#define P_ALT_RECFMT_DEC 645
#define AST_ALT_RECFMT_DEC 133
d769 2
a770 2
#define P_REST_OF_RECFMT_DEC 646
#define AST_REST_OF_RECFMT_DEC 134
d772 2
a773 2
#define P_RECFMT_DEC 647
#define AST_RECFMT_DEC 135
d775 2
a776 2
#define P_RECFMT_ELMNT 648
#define AST_RECFMT_ELMNT 136
d778 2
a779 2
#define P_ADECLN 649
#define AST_ADECLN 137
d781 2
a782 2
#define P_REST_OF_ARLIST 650
#define AST_REST_OF_ARLIST 138
d784 2
a785 2
#define P_BPAIR 651
#define AST_BPAIR 139
d787 2
a788 2
#define P_REST_OF_BPLIST 652
#define AST_REST_OF_BPLIST 140
d790 2
a791 2
#define P_OPT_arrayname 653
#define AST_OPT_arrayname 141
d793 2
a794 2
#define P_Opt_INTEGER 654
#define AST_Opt_INTEGER 142
d796 2
a797 2
#define P_REPFACT 655
#define AST_REPFACT 143
d799 2
a800 2
#define P_Opt_STAROREXPR 656
#define AST_Opt_STAROREXPR 144
d802 2
a803 2
#define P_STAROREXPR 657
#define AST_STAROREXPR 145
d805 2
a806 2
#define P_Opt_BTYPE 658
#define AST_Opt_BTYPE 146
d808 2
a809 2
#define P_Opt_Comma 659
#define AST_Opt_Comma 147
d811 2
a812 2
#define P_Opt_ALIAS 660
#define AST_Opt_ALIAS 148
d814 2
a815 2
#define P_TEXTTEXT 661
#define AST_TEXTTEXT 149
d817 2
a818 2
#define P_Percent_SEX 662
#define AST_Percent_SEX 150
d820 2
a821 2
#define P_RECFMT_spec_OR_BODY 663
#define AST_RECFMT_spec_OR_BODY 151
d823 2
a824 2
#define P_DECLN 664
#define AST_DECLN 152
d826 2
a827 2
#define P_OPT_format 665
#define AST_OPT_format 153
d829 2
a830 2
#define P_Opt_Assign_NAME_LIST 666
#define AST_Opt_Assign_NAME_LIST 154
d832 2
a833 2
#define P_Opt_Init_assign 667
#define AST_Opt_Init_assign 155
d835 2
a836 2
#define P_Percent_WU 668
#define AST_Percent_WU 156
d838 2
a839 2
#define P_Percent_WUF 669
#define AST_Percent_WUF 157
d841 2
a842 2
#define P_Opt_UNTIL 670
#define AST_Opt_UNTIL 158
d844 2
a845 2
#define P_Opt_CYCPARM 671
#define AST_Opt_CYCPARM 159
d847 2
a848 2
#define P_OPEXPR2 672
#define AST_OPEXPR2 160
d850 2
a851 2
#define P_OPT_EXPR 673
#define AST_OPT_EXPR 161
d853 2
a854 2
#define P_OPEXPR 674
#define AST_OPEXPR 162
d856 2
a857 2
#define P_OPSTRING 675
#define AST_OPSTRING 163
d859 2
a860 2
#define P_ASSOP 676
#define AST_ASSOP 164
d862 2
a863 2
#define P_REST_OF_SS1 677
#define AST_REST_OF_SS1 165
d865 2
a866 2
#define P_OWNDEC 678
#define AST_OWNDEC 166
d868 2
a869 2
#define P_REST_OF_OWNDEC 679
#define AST_REST_OF_OWNDEC 167
d871 2
a872 2
#define P_SINGLE_OWNDEC 680
#define AST_SINGLE_OWNDEC 168
d874 2
a875 2
#define P_CONSTLIST 681
#define AST_CONSTLIST 169
d877 2
a878 2
#define P_ROCL 682
#define AST_ROCL 170
d880 2
a881 2
#define P_stupid 683
#define AST_stupid 171
d883 2
a884 2
#define P_OPT_spec 684
#define AST_OPT_spec 172
d886 2
a887 2
#define P_XOWN 685
#define AST_XOWN 173
d889 23
a911 2
#define AST__LIT 174
#define AST__KW 175
d917 13
d931 1
d933 1
d935 26
a960 1
  NULL, NULL, NULL, 
a965 7
  " This is an extended grammar which now accepts constructs from multiple versions of Imp\n"
  " - it was primarily based on a correct Imp80 grammar, then modified to add Imp77 constructs\n"
  " followed by features from Pdp15 Imp, old Emas \"Imp9\", and Hamish's 68000 extensions, etc\n"
  " The original base grammar was:\n"
  "   https://history.dcs.ed.ac.uk/archive/os/emas/emas2/compilers/imp80/imp80ps04.txt\n"
  "\n"
  " Since this accepts multiple dialects, I'm tempted to call it \"PImp\", short for \"Polyglot Imp\"...\n",
d967 17
a983 13
  " The last items in a file. Main program has to be last, whether %begin/%endofprogram,\n"
  " or %begin/%end/%endoffile\n"
  " prim and perm files are effectively all externals followed by %endofprim or %endofperm\n"
  " a file of just externals has to end in %endoffile\n"
  "\n"
  " And to throw a spanner in the works, some old Pdp15 programs *appear* to omit the %begin\n"
  " from the begin/endofprogram, because they allow '!' comments to terminate with a ';'\n"
  " which later Imp versions doesn't allow.  For example in edit15.i15 we find:\n"
  "\n"
  " !!CS,N/CS,==1;%BEGIN; !EDIT15: COMPATIBLE CONTEXT EDITOR FOR PDP9/15\n"
  " This isn't really a problem with block structure, it's a problem with\n"
  " incompatible comment conventions which will likely require a command-line\n"
  " option to fix.\n"
d985 4
a988 9
  " the final EOF below is only for begin/endofprogram\n",
  NULL, NULL, 
  " I cleaned up label handling, we can afford the overhead of backtracking over one <NAME>...\n"
  " - this isn't the 70's any more.\n",
  NULL, 
  " these are allowed at the external level and also inside procedures/main program.\n",
  " nasty special case for some 68000 sources which are routine BLAH/endofprogram\n",
  " 68000.  Note there is a %routine blah/%endofprogram in FMACS/BOOT.imp needs to be handled.\n"
  "         And a %begin/%end without an %endoffile in FMACS/FIRST4.imp\n"
a989 1
  " I have no idea what \"@@#ldte \" means below.\n"
d993 24
a1016 1
  " %record(f)%array portinfo(1:31)\n"
d1018 4
a1021 2
  " @@400(a5) %record(*)%namearray in(0:7)\n",
  " numeric labels are a historical form...\n",
d1023 2
a1024 1
  " they cannot appear in external routines.\n",
d1027 1
d1030 3
a1032 2
  "   %realfn %spec f(%real x)\n"
  " the fully-qualified form is also valid but comes in via the <EXTERNAL> route.\n"
d1036 1
a1036 2
  " They are only allowed in the body of a procedure, and in the older compilers,\n"
  " all declarations in a block had to precede any code.\n"
d1038 1
a1038 2
  " There is good info re the phrase structure grammar to be found at\n"
  " http://www.ancientgeek.org.uk/EMAS/EMAS_Manuals/IMP/A_Syntactic_and_Semantic_Definition_of_the_IMP_Language.pdf\n"
d1061 1
a1061 1
  " added an old record declaration syntax for examples out of ai2logo.i\n"
d1070 3
a1072 5
  "    <XOWN> <XTYPE>         (\"array name\" | \"name\")?  (\"spec\")?  <SINGLE-OWNDEC>            <REST-OF-OWNDEC>,\n"
  "    <XOWN> <XTYPE> \"array\" (\"format\")?               (\"spec\")?  <NAME> <BPAIR> <CONSTLIST>;\n"
  "           <XTYPE>         (\"array name\" | \"name\")?  <NAME> <Opt-Init-assign> <Opt-Assign-NAME-LIST>,\n"
  "           <XTYPE> \"array\" (\"format\")?               <NAME>                    <Opt-NAME-LIST> <BPAIR> <REST-OF-ARLIST>;\n"
  "   <XOWN> \"record\" \"array\" <NAME> <BPAIR> '(' <RECFMT-REF> ')' <S> <XTYPE> <DECLN> <S>,\n"
d1077 2
a1078 7
  " To do: handle %OWNSTRING(1) STERMIN=TOSTRING(10); which is currently rejected.\n"
  " - initialisation with the result of a procedure call (or any non-const expression) should\n"
  " be OK inside a block but not at the external level.\n"
  " Though if the initialisation method is by copying from the GLAP to the GLA, maybe there\n"
  " was a reason why any %owns could not be initialised this way.  It may be that tostring\n"
  " was an exception because it was a prim function and could be treated like a constant\n"
  " by the compiler...\n"
d1080 3
a1082 2
  " 68000: what does this mean?  @@724(a5) %integername heapfront\n"
  " also on 68000: %bytename b == length(s)\n"
d1084 3
d1088 8
a1095 1
  " The first four \"record\" items below are old format (EMAS Imp, pre-Imp80)\n"
d1097 1
d1106 26
a1131 9
  " \"else if ...\" or \"else\" or \"finish {else ...}\"\n"
  " there's an ugly form of \"else if ... start\" that I haven't found an\n"
  " example of yet, which I'm not going to add unless I do.  If I remember\n"
  " right, it did not balance starts and finished correctly.\n",
  NULL, NULL, NULL, NULL, NULL, NULL, 
  " This is a hack that needs to be better integrated with comments and whitespace and machine code instructions...\n"
  " must end in <NL>, not <S> ...\n",
  " A tweaked version for unparsed machine-code statements.\n"
  " With luck the assembly code format doesn't allow unbalanced quotes such as:  LDA #'x\n"
d1133 1
a1133 1
  NULL, NULL, 
d1144 1
a1144 1
  NULL, 
d1148 1
a1148 5
  " expensive hacky test to temporarily handle X'...'\n"
  " ... and it's broken :-(  <!...> currently not working properly.\n"
  " both being reported wrongly, and not generating correct code below:\n"
  " a negated phrase should not create an AST entry. Or rather, it should create a null one.\n"
  " - I think the problem is only phrases can be negated, not BIPs ... so ...\n"
a1149 2
  " <sqstring> has to be checked for length and content depending on prefix.\n"
  "\n",
a1155 3
  "P<OPT-SQ-LETTER> =\n"
  "   <alphanumeric>,\n"
  "  ;\n"
d1170 3
d1174 1
a1174 1
  " Hamish's PDP15 imp machine code syntax definitely not supported.\n",
d1177 1
a1177 1
  " <NAME> <Opt-PARAMETERS> added by gt for predicates\n"
d1180 2
a1181 2
  " Current Imp77 restricted to -> a.(\"test\").b  with a and b being optional.\n"
  " Older Emas implementation allowed multiple parts I'm fairly sure, eg -> a.(\"match1\").b.(\"match2\").c\n"
d1186 2
d1190 4
a1193 1
  " No bracketed expressions, only '.' operator allowed.\n",
d1197 10
a1206 3
  " Ordering is important, eg ## must come before #\n",
  NULL, NULL, 
  " 'Application' i.e. parameters to routine or function call\n",
d1211 1
a1211 3
  "P<EXPR> =\n"
  "   <Opt-UNARY-OP> <OPERAND> <REST-OF-EXPR>;\n"
  " for Hamish's PDP9/15 Imp (old): INDP == INDEX0++P\n"
d1213 1
d1215 1
a1215 2
  " Need lvalue fix for:  b[3] = nl\n"
  "\n",
d1218 42
a1259 3
  " Unfortunately there may be obscure cases where an ambiguous parse might result.\n",
  " operators all together for now until we use the grammar to handle precedence.\n"
  " regular exprs converted, cexprs not done yet.\n",
d1261 14
a1274 1
  " highest precedence, right-associative (only exponentiation)\n",
d1278 28
a1305 1
  " unary operators.  Highest precedence.\n",
d1318 9
a1327 9
  " compare re <OPERAND> =\n"
  "   <NAME> <Opt-PARAMETERS-OR-POINTERINDEX> <Opt-RECORDFIELD-OR-POINTERINDEX>,\n"
  "   <CONST>,\n"
  "   '(' <EXPR> ')',\n"
  "   '|' <EXPR> '|',\n"
  "   '!' <EXPR> '!';\n"
  " - so I'll add || to COPERAND as well...\n"
  " needs a semantic test that <NAME> is a defined const...\n",
  NULL, NULL, NULL, NULL, NULL, 
d1338 11
a1348 1
  NULL, 
d1352 5
a1356 1
  " Imp variant record. NOT the same as C's which is per field.  This is per record.\n",
d1362 6
a1368 1
  " List of lower/upper bound pairs, for array declarations.\n",
d1370 12
a1381 2
  " WAS P<OPT-arrayname-OR-name> = \"array\" \"name\", \"name\", ;\n"
  " but \"name\" removed because it fits better with <XTYPE>\n",
d1399 33
a1431 1
  " Scalar declaration\n"
d1433 12
a1444 1
  " \"name\" has been removed from <OPT-array-OR-name> and moved to <XTYPE> which precedes <DECLN>\n"
a1445 2
  NULL, 
  " <Opt-Init-assign> added by gt\n",
d1454 6
d1461 1
a1461 1
  NULL, NULL, NULL, 
a1466 1
  " removed string resolution from assop - too much type checking\n",
d1468 1
a1468 7
  " Again \"name\" has been moved from <OPT-arrayname-OR-name> to <XTYPE> which precedes <OWNDEC>\n"
  "\n",
  NULL, NULL, 
  " An initialised array declaration does not need a %C following the '=' before the list of initial values.\n"
  " this is a stupid hack to get around comments in the middle of array declarations :-(\n"
  " note that it gobbles the newline\n",
  NULL, NULL, NULL, 
d1473 51
@


1.1
log
@Initial revision
@
text
@d4 1
a4 1
#define MAX_GRAMMAR 1662
d6 1
a6 1
#define PHRASE_BASE 520
d8 119
a126 104
    1,     2,   524,   522,     2,     2,   554,   521,     0,     4,     7,  1023|GUARD ,   256,   554,   525,   523, 
  521,   519,     4,  1023|GUARD ,   257,   521,   519,     4,  1023|GUARD ,   258,   521,   519,     4,  1023|GUARD ,   259,   521, 
  519,     2,     2,  1023|GUARD ,   260,     5,  1023|GUARD ,   261,   521,  1023|GUARD ,   257,     2,     2,   526,   524,     0, 
    2,     3,   527,   533,   525,     1,   527,    12,     8,   654,   631,  1023|GUARD ,   262,   571,   652,   627, 
  554,    10,   654,   631,   571,   652,   627,   554,   525,  1023|GUARD ,   261,   554,     1,   541,     3,  1023|GUARD , 
  263,   558,     7,  1023|GUARD ,   264,   571,  1023|GUARD ,   263,   571,   621,     7,  1023|GUARD ,   261,  1023|GUARD ,   265,  1023|GUARD , 
  266,   554,     3,  1023|GUARD ,   266,   554,     5,  1023|GUARD ,   267,  1023|GUARD ,   268,   554,     6,  1023|GUARD ,   269,  1023|GUARD , 
  270,   571,   554,     4,  1023|GUARD ,   271,   557,   554,     1,   555,     1,   554,     5,     9,   571,  1023|GUARD , 
   40,   623,  1023|GUARD ,    41,  1023|GUARD ,    58,   527,    10,   571,  1023|GUARD ,    40,  1023|GUARD ,    42,  1023|GUARD ,    41,  1023|GUARD , 
   58,   527,     4,   571,  1023|GUARD ,    58,   527,     4,   569,  1023|GUARD ,    58,   527,     0,     1,     5,  1023|GUARD , 
  272,   531,   532,   554,     1,     2,   569,   530,     2,     4,  1023|GUARD ,    44,   569,   530,     0,     1, 
    6,   529,  1023|GUARD ,    45,  1023|GUARD ,    62,   539,     2,     4,  1023|GUARD ,    44,   531,   532,     0,     9,     1, 
  534,     2,   538,   667,     3,  1023|GUARD ,    42,   574,     1,   547,     1,   548,     1,   528,    12,  1023|GUARD , 
  273,   626,   546,   622,  1023|GUARD ,   274,   554,   525,  1023|GUARD ,   275,   554,     6,  1023|GUARD ,   262,   571,   652, 
  627,   554,     1,   526,     1,     7,  1023|GUARD ,   256,   554,   525,  1023|GUARD ,   261,   554,     2,     6,  1023|GUARD , 
  265,  1023|GUARD ,   268,   521,   519,     1,   554,     2,     3,  1023|GUARD ,   276,   538,     0,     3,     5,  1023|GUARD , 
   45,  1023|GUARD ,    62,   582,     2,   666,   596,     0,    14,     5,   571,   594,   607,   537,   536,     6, 
 1023|GUARD ,   277,  1023|GUARD ,   278,   515,   536,     5,  1023|GUARD ,    45,  1023|GUARD ,    62,   539,     2,  1023|GUARD ,   279,     2, 
 1023|GUARD ,   280,     2,  1023|GUARD ,   281,     4,  1023|GUARD ,   282,   666,   596,     2,  1023|GUARD ,   283,     4,  1023|GUARD ,   284, 
  569,   536,     3,  1023|GUARD ,   284,   536,     2,  1023|GUARD ,   285,     5,  1023|GUARD ,   286,   626,   623,   664,     2, 
 1023|GUARD ,   287,     2,  1023|GUARD ,   288,     3,     6,   571,  1023|GUARD ,    40,   596,  1023|GUARD ,    41,     1,   571,     1, 
  569,     3,     2,  1023|GUARD ,   289,     2,  1023|GUARD ,   290,     2,  1023|GUARD ,   291,     8,     4,   676,   634,   668, 
  554,     8,   676,  1023|GUARD ,   292,  1023|GUARD ,   293,   542,   543,   554,     6,   676,  1023|GUARD ,   292,   544,   545, 
  554,     3,   634,   656,   554,     7,  1023|GUARD ,   292,  1023|GUARD ,   293,   542,   543,   554,     5,  1023|GUARD ,   292, 
  544,   545,   554,     6,  1023|GUARD ,   292,  1023|GUARD ,   294,   655,   554,    14,  1023|GUARD ,   295,   571,   621,  1023|GUARD , 
   40,   596,  1023|GUARD ,    58,   596,  1023|GUARD ,    41,   620,   554,     1,     8,   571,   621,   643,  1023|GUARD ,    40, 
  636,  1023|GUARD ,    41,     2,     3,  1023|GUARD ,    44,   542,     0,     1,     7,   571,   621,  1023|GUARD ,    40,   636, 
 1023|GUARD ,    41,     2,     4,  1023|GUARD ,    44,   544,   545,     0,     2,     2,  1023|GUARD ,    42,     1,   623,     4, 
    9,  1023|GUARD ,   296,   663,   554,   525,  1023|GUARD ,   297,   662,   554,     9,   661,  1023|GUARD ,   296,   554,   525, 
 1023|GUARD ,   297,   662,   554,    11,   660,  1023|GUARD ,   298,  1023|GUARD ,   296,   554,   525,  1023|GUARD ,   297,   662,   554, 
    4,   660,  1023|GUARD ,   298,   538,     1,     3,   619,   578,   551,     3,     7,  1023|GUARD ,   299,   619,   578, 
  554,   525,   549,     7,  1023|GUARD ,   299,   554,   525,  1023|GUARD ,   275,   554,     3,  1023|GUARD ,   275,   550,     4, 
    9,  1023|GUARD ,   299,  1023|GUARD ,   274,   554,   525,  1023|GUARD ,   275,   554,     3,  1023|GUARD ,   299,   548,     4,  1023|GUARD , 
  299,   538,   554,     1,   554,     2,     6,   552,  1023|GUARD ,   274,   554,   525,   549,     4,  1023|GUARD ,   298, 
  538,   550,     2,     2,  1023|GUARD ,   298,     0,     2,     2,  1023|GUARD ,   274,     0,     2,     1,   517,     2, 
 1023|GUARD ,    59,     2,     3,  1023|GUARD ,   300,   556,     3,  1023|GUARD ,    33,   556,     7,     2,   518,   556,     2, 
  516,   556,     2,   515,   556,     2,   513,   556,     2,   514,   556,     2,   512,   556,     1,   517, 
    5,     5,   569,  1023|GUARD ,    95,   569,   571,     4,   569,  1023|GUARD ,    95,   569,     4,   569,  1023|GUARD ,    95, 
  571,     1,   569,     1,   562,     2,     2,   559,   516,     1,   515,     2,     2,  1023|GUARD ,    69,     0, 
    2,     1,   557,     1,   564,     3,     1,   557,     1,   564,     1,   558,     1,     2,   563,   515, 
    2,     1,   513,     0,     2,     3,   569,   566,   568,     2,   565,   568,     1,     3,  1023|GUARD ,    46, 
  569,     2,     1,   565,     0,     3,     2,  1023|GUARD ,    43,     2,  1023|GUARD ,    45,     0,     2,     4,  1023|GUARD , 
   64,   567,   569,     0,     1,     2,   514,   570,     2,     1,   569,     0,     1,     3,   513,   573|NEGATE, 
  572,     2,     1,   571,     0,     1,     1,   515,     1,     1,   556,     3,     4,  1023|GUARD ,   276,   579, 
  576,     4,  1023|GUARD ,   301,   579,   577,     0,     2,     4,  1023|GUARD ,   276,   579,   576,     0,     2,     4, 
 1023|GUARD ,   301,   579,   577,     0,     1,     2,   579,   575,     5,     1,   581,     4,   596,   591,   596, 
  580,     2,   571,   594,     5,  1023|GUARD ,    40,   578,  1023|GUARD ,    41,     3,  1023|GUARD ,   302,   579,     2,     2, 
  591,   596,     0,     1,     6,   585,  1023|GUARD ,    45,  1023|GUARD ,    62,   582,     2,     2,   587,   589,     2, 
  588,   590,     1,     3,   571,   606,   608,     2,     1,   583,     1,   558,     1,     2,   584,   586, 
    2,     4,  1023|GUARD ,    46,   584,   586,     0,     1,     5,  1023|GUARD ,    40,   584,  1023|GUARD ,    41,     1,     1, 
  583,     2,     4,  1023|GUARD ,    46,   588,   590,     0,     2,     4,  1023|GUARD ,    46,   587,   589,     0,     8, 
    2,  1023|GUARD ,    61,     1,   592,     4,  1023|GUARD ,    61,  1023|GUARD ,    61,     1,   593,     4,  1023|GUARD ,    60,  1023|GUARD , 
   61,     2,  1023|GUARD ,    60,     4,  1023|GUARD ,    62,  1023|GUARD ,    61,     2,  1023|GUARD ,    62,     3,     2,  1023|GUARD ,    35, 
    4,  1023|GUARD ,    92,  1023|GUARD ,    61,     4,  1023|GUARD ,    60,  1023|GUARD ,    62,     2,     4,  1023|GUARD ,    35,  1023|GUARD ,    35, 
    6,  1023|GUARD ,    92,  1023|GUARD ,    61,  1023|GUARD ,    61,     2,     6,  1023|GUARD ,    40,   596,   595,  1023|GUARD ,    41,     0, 
    2,     4,  1023|GUARD ,    44,   596,   595,     0,     1,     2,   598,   597,     2,     3,   616,   598,   597, 
    0,     1,     2,   600,   599,     2,     3,   615,   600,   599,     0,     1,     2,   602,   601,     2, 
    3,   611,   602,   601,     0,     1,     2,   603,   605,     2,     2,   604,   603,     0,     1,     2, 
  605,   612,     1,     2,   617,   609,     4,     5,  1023|GUARD ,    91,   596,  1023|GUARD ,    93,     5,  1023|GUARD ,    43, 
 1023|GUARD ,    43,   596,     5,  1023|GUARD ,    45,  1023|GUARD ,    45,   596,     1,   594,     2,     5,  1023|GUARD ,    95,   571, 
  594,   607,     0,     2,     5,  1023|GUARD ,    95,   571,   606,   608,     0,     5,     3,   571,   606,   608, 
    1,   561,     5,  1023|GUARD ,    40,   596,  1023|GUARD ,    41,     5,  1023|GUARD ,   124,   596,  1023|GUARD ,   124,     5,  1023|GUARD , 
   33,   596,  1023|GUARD ,    33,     4,     1,   611,     1,   612,     1,   615,     1,   616,     2,     4,  1023|GUARD , 
   60,  1023|GUARD ,    60,     4,  1023|GUARD ,    62,  1023|GUARD ,    62,     2,     1,   613,     1,   614,     3,     8,  1023|GUARD , 
   42,  1023|GUARD ,    42,  1023|GUARD ,    42,  1023|GUARD ,    42,     4,  1023|GUARD ,    92,  1023|GUARD ,    92,     4,  1023|GUARD ,    94,  1023|GUARD , 
   94,     3,     4,  1023|GUARD ,    42,  1023|GUARD ,    42,     2,  1023|GUARD ,    92,     2,  1023|GUARD ,    94,     4,     2,  1023|GUARD , 
   42,     4,  1023|GUARD ,    47,  1023|GUARD ,    47,     2,  1023|GUARD ,    47,     2,  1023|GUARD ,    38,     5,     2,  1023|GUARD ,    43, 
    2,  1023|GUARD ,    45,     4,  1023|GUARD ,    33,  1023|GUARD ,    33,     2,  1023|GUARD ,    33,     2,  1023|GUARD ,    46,     4,     2, 
 1023|GUARD ,    43,     2,  1023|GUARD ,    45,     1,   618,     0,     2,     2,  1023|GUARD ,    92,     2,  1023|GUARD ,   126,     2, 
    2,  1023|GUARD ,   303,     2,  1023|GUARD ,   304,     2,    13,  1023|GUARD ,    44,   571,   621,  1023|GUARD ,    40,   596,  1023|GUARD , 
   58,   596,  1023|GUARD ,    41,   620,     0,     2,     4,  1023|GUARD ,    44,   571,   621,     0,     2,     4,  1023|GUARD , 
   44,   623,   622,     0,     1,     3,   617,   625,   624,     2,     3,   610,   625,   624,     0,     5, 
    1,   571,     1,   561,     5,  1023|GUARD ,    40,   623,  1023|GUARD ,    41,     5,  1023|GUARD ,   124,   623,  1023|GUARD ,   124, 
    5,  1023|GUARD ,    33,   623,  1023|GUARD ,    33,     2,     2,  1023|GUARD ,   305,     0,     2,     6,  1023|GUARD ,    40,   629, 
  628,  1023|GUARD ,    41,     0,     2,     3,   651,   629,   628,     0,     3,     4,   634,   645,   571,   621, 
    5,   631,   630,   571,   621,   627,     4,  1023|GUARD ,   306,   571,   621,     2,     2,  1023|GUARD ,   306,     0, 
    3,     2,  1023|GUARD ,   307,     2,  1023|GUARD ,   308,     2,   634,   632,     2,     1,   633,     2,  1023|GUARD ,   309, 
    2,     2,  1023|GUARD ,   310,     2,  1023|GUARD ,   311,     9,     2,  1023|GUARD ,   312,     2,  1023|GUARD ,   313,     2,  1023|GUARD , 
  314,     3,  1023|GUARD ,   315,   650,     3,  1023|GUARD ,   316,   646,     3,  1023|GUARD ,   317,   647,     3,  1023|GUARD ,   318, 
  646,     3,  1023|GUARD ,   319,   646,     3,  1023|GUARD ,   292,   635,     3,     5,  1023|GUARD ,    40,   636,  1023|GUARD ,    41, 
    6,  1023|GUARD ,    40,  1023|GUARD ,    42,  1023|GUARD ,    41,     0,     2,     1,   571,     3,   639,   638,   637,     2, 
    5,  1023|GUARD ,   301,   639,   638,   637,     0,     2,     4,  1023|GUARD ,    44,   639,   638,     0,     2,     2, 
  634,   640,     7,  1023|GUARD ,    40,   639,   638,   637,  1023|GUARD ,    41,     2,     3,   645,   571,   621,     3, 
 1023|GUARD ,   293,   641,     1,     4,   571,   621,   643,   642,     2,     3,  1023|GUARD ,    44,   641,     0,     1, 
    9,  1023|GUARD ,    40,   596,  1023|GUARD ,    58,   596,   644,  1023|GUARD ,    41,     2,     7,  1023|GUARD ,    44,   596,  1023|GUARD , 
   58,   596,   644,     0,     3,     4,  1023|GUARD ,   293,  1023|GUARD ,   306,     2,  1023|GUARD ,   306,     0,     2,     2, 
 1023|GUARD ,   312,     0,     2,     5,  1023|GUARD ,    40,   648,  1023|GUARD ,    41,     0,     2,     1,   649,     0,     2, 
    3,   617,   625,   624,     2,  1023|GUARD ,    42,     3,     2,  1023|GUARD ,   313,     2,  1023|GUARD ,   312,     4,  1023|GUARD , 
  315,  1023|GUARD ,   313,     2,     2,  1023|GUARD ,    44,     0,     2,     3,  1023|GUARD ,   320,   653,     0,     1,     1, 
  516,     5,     2,  1023|GUARD ,   321,     2,  1023|GUARD ,   322,     2,  1023|GUARD ,   323,     2,  1023|GUARD ,   290,     0,     2, 
    3,  1023|GUARD ,   262,   571,     8,   571,  1023|GUARD ,    40,   639,   638,   637,  1023|GUARD ,    41,     2,     4,   645, 
  571,   659,   658,     4,  1023|GUARD ,   293,   657,   641,     2,     2,  1023|GUARD ,   294,     0,     2,     5,  1023|GUARD , 
   44,   571,   659,   658,     0,     3,     3,  1023|GUARD ,    61,   596,     3,  1023|GUARD ,    61,   623,     0,     2, 
    3,  1023|GUARD ,   324,   578,     3,  1023|GUARD ,   325,   578,     3,     3,  1023|GUARD ,   324,   578,     3,  1023|GUARD ,   325, 
  578,    12,  1023|GUARD ,   326,   571,  1023|GUARD ,    61,   596,  1023|GUARD ,    44,   596,  1023|GUARD ,    44,   596,     2,     3, 
 1023|GUARD ,   325,   578,     0,     2,    10,   571,  1023|GUARD ,    61,   596,  1023|GUARD ,    44,   596,  1023|GUARD ,    44,   596, 
    0,     2,     4,  1023|GUARD ,    44,   596,   665,     0,     2,     3,  1023|GUARD ,    44,   596,     0,     3,     4, 
 1023|GUARD ,    61,  1023|GUARD ,    61,     2,  1023|GUARD ,    61,     4,  1023|GUARD ,    60,  1023|GUARD ,    45,     4,     3,   619,   578, 
  554,     2,   661,   554,     1,   554,     0,     2,     4,   645,   674,   670,   669,     7,  1023|GUARD ,   293, 
  657,   674,   571,   643,   671,     2,     4,  1023|GUARD ,    44,   670,   669,     0,     1,     3,   571,   652, 
  675,     2,     8,  1023|GUARD ,    61,   673,   617,   625,   624,   647,   672,     0,     2,     8,  1023|GUARD ,    44, 
  673,   617,   625,   624,   647,   672,     0,     2,     1,   555,     0,     2,     2,  1023|GUARD ,   262,     0, 
    3,     5,  1023|GUARD ,    61,   617,   625,   624,     5,  1023|GUARD ,    61,  1023|GUARD ,    61,   569,     0,     5,     2, 
 1023|GUARD ,   327,     2,  1023|GUARD ,   322,     2,  1023|GUARD ,   328,     2,  1023|GUARD ,   329,     2,  1023|GUARD ,   330, 
d129 1
a129 1
#define MAX_KEYWORD 75
d131 20
a150 19
  "begin", "endoffile", "endofperm", "endofprim", 
  "endofprogram", "end", "spec", "include", 
  "from", "of", "list", "trusted", 
  "program", "main", "ep", "control", 
  "fault", "on", "start", "finish", 
  "and", "print", "text", "return", 
  "true", "false", "result", "monitorstop", 
  "monitor", "stop", "signal", "exit", 
  "continue", "file", "prim", "perm", 
  "record", "array", "format", "switch", 
  "cycle", "repeat", "then", "else", 
  "comment", "or", "not", "if", 
  "unless", "event", "name", "routine", 
  "predicate", "map", "fn", "function", 
  "integer", "real", "label", "long", 
  "byte", "string", "half", "short", 
  "alias", "system", "external", "dynamic", 
  "while", "until", "for", "own", 
  "extrinsic", "constant", "const", 
d154 77
a230 75
#define KW_begin 0
#define KW_endoffile 1
#define KW_endofperm 2
#define KW_endofprim 3
#define KW_endofprogram 4
#define KW_end 5
#define KW_spec 6
#define KW_include 7
#define KW_from 8
#define KW_of 9
#define KW_list 10
#define KW_trusted 11
#define KW_program 12
#define KW_main 13
#define KW_ep 14
#define KW_control 15
#define KW_fault 16
#define KW_on 17
#define KW_start 18
#define KW_finish 19
#define KW_and 20
#define KW_print 21
#define KW_text 22
#define KW_return 23
#define KW_true 24
#define KW_false 25
#define KW_result 26
#define KW_monitorstop 27
#define KW_monitor 28
#define KW_stop 29
#define KW_signal 30
#define KW_exit 31
#define KW_continue 32
#define KW_file 33
#define KW_prim 34
#define KW_perm 35
#define KW_record 36
#define KW_array 37
#define KW_format 38
#define KW_switch 39
#define KW_cycle 40
#define KW_repeat 41
#define KW_then 42
#define KW_else 43
#define KW_comment 44
#define KW_or 45
#define KW_not 46
#define KW_if 47
#define KW_unless 48
#define KW_event 49
#define KW_name 50
#define KW_routine 51
#define KW_predicate 52
#define KW_map 53
#define KW_fn 54
#define KW_function 55
#define KW_integer 56
#define KW_real 57
#define KW_label 58
#define KW_long 59
#define KW_byte 60
#define KW_string 61
#define KW_half 62
#define KW_short 63
#define KW_alias 64
#define KW_system 65
#define KW_external 66
#define KW_dynamic 67
#define KW_while 68
#define KW_until 69
#define KW_for 70
#define KW_own 71
#define KW_extrinsic 72
#define KW_constant 73
#define KW_const 74
d232 1
a232 1
#define MAX_BIP 8
d234 1
a234 1
 0,  1,  2,  3,  4,  5,  6,  7, 
d237 1
a237 1
#define MAX_PHRASE 165
d241 14
a254 12
  "stropped", "alphanumeric", "digit", "sqstring", 
  "dqstring", "NL", "char", "EOF", 
  "SS", "BLANKS", "LAST-ITEMS-IN-FILE", "ENDPROGRAM", 
  "EXTERNALS", "INTERNALS", "EXTERNAL-OR-INTERNAL", "OPT-LABEL", 
  "FAULT-S", "FAULT-LIST", "MORE-NUMBERS", "FAULT-ACTION", 
  "MORE-FAULTS", "INTERNAL", "NESTED-BLOCK", "Opt-OFPROGRAM", 
  "AUI", "OPT-ASSIGN", "UI", "GOTO-DESTINATION", 
  "FILE-END-TYPE", "DECLARATION-S", "RADEC", "REST-OF-RADEC", 
  "RDEC", "REST-OF-RDEC", "EVENT-LIST", "CYCLE-S", 
  "IF-S", "FINISH-S", "Opt-ELSE-S", "THEN-S", 
  "OPT-then", "OPT-start", "S", "COMMENT", 
  "Rest-of-line", "INT-CONST", "STR-CONST", "OPT-DQ-LETTER", 
d258 16
a273 16
  "rest-of-name", "SQUO-STRING", "UCI", "REST-OF-COND", 
  "REST-OF-ANDC", "REST-OF-ORC", "CONDITION", "SC", 
  "OPT-DOUBLE-SIDED", "STRING-RESOLUTION", "STRING-RESOLUTION-EXPR", "STRING-LVALUE", 
  "STRING-RVALUE", "STRING-EXPR", "REST-OF-STRING-EXPR", "STR-MATCH", 
  "STR-ASSIGN", "OPT-STR-ASSIGN", "OPT-STR-MATCH", "COMP", 
  "NOT-EQUALS", "NOT-EQUALS-ADDRESS", "Opt-PARAMETERS", "REST-OF-PARAMETERS", 
  "EXPR", "REST-OF-EXPR", "MEDIUMPREC-EXPR", "REST-OF-MEDIUMPREC-EXPR", 
  "HIGHPREC-EXPR", "REST-OF-HIGHPREC-EXPR", "RIGHT-ASSOC-EXPR", "REST-OF-RIGHTASSOC-EXPR", 
  "RIGHTASSOC-EXPR-with-OP", "UNARY-EXPR", "Opt-PARAMETERS-OR-POINTERINDEX", "Opt-RECORDFIELD", 
  "Opt-RECORDFIELD-OR-POINTERINDEX", "OPERAND", "OP", "OP-HIGH-LEFTASSOC", 
  "OP-HIGH-RIGHTASSOC", "INTEGER-EXP", "REAL-EXP", "OP-MED", 
  "OP-LOW", "Opt-UNARY-OP", "UNARY-NOT", "Percent-IU", 
  "REST-OF-SWLIST", "Opt-NAME-LIST", "REST-OF-NAME-LIST", "CEXPR", 
  "REST-OF-CEXPR", "COPERAND", "OPT-event", "FPP", 
  "REST-OF-FORMAL-PARAMETER-LIST", "FORMAL-PARAMETER-DECLARATION", "OPT-name", "RT", 
  "FN-MAP", "FN", "XTYPE", "Opt-RFREF", 
d276 2
a277 2
  "REST-OF-BPLIST", "OPT-arrayname-OR-name", "FULLTYPE", "REPFACT", 
  "Opt-STAROREXPR", "STAROREXPR", "BTYPE", "Opt-Comma", 
d279 1
a279 1
  "DECLN", "OPT-format", "Opt-Assign-NAME-LIST", "Opt-Const-assign", 
d281 4
a284 4
  "OPEXPR2", "OPEXPR", "ASSOP", "REST-OF-SS1", 
  "OWNDEC", "REST-OF-OWNDEC", "SINGLE-OWNDEC", "CONSTLIST", 
  "ROCL", "stupid", "OPT-spec", "Opt-Assign-CONST", 
  "XOWN", 
d289 11
a299 11
    0,     4,     9,    33,    43,    48,    55,   124, 
  157,   164,   168,   175,   183,   190,   228,   237,   247,   253,   264,   325,   337,   347,   409,   419, 
  425,   434,   441,   447,   485,   490,   511,   533,   546,   551,   556,   562,   571,   592,   613,   619, 
  624,   629,   636,   640,   644,   652,   657,   661,   669,   676,   680,   684,   689,   693,   696,   699, 
  711,   718,   725,   729,   750,   755,   763,   770,   775,   780,   784,   791,   798,   801,   808,   815, 
  844,   858,   871,   880,   887,   891,   897,   901,   907,   911,   917,   921,   926,   930,   934,   955, 
  963,   971,   996,  1005,  1016,  1021,  1041,  1053,  1068,  1086,  1096,  1103,  1110,  1126,  1133,  1140, 
 1145,  1151,  1174,  1179,  1188,  1194,  1211,  1216,  1226,  1232,  1239,  1273,  1288,  1295,  1303,  1310, 
 1322,  1331,  1337,  1343,  1354,  1364,  1374,  1379,  1387,  1391,  1399,  1411,  1416,  1422,  1425,  1439, 
 1453,  1464,  1469,  1477,  1487,  1496,  1518,  1524,  1537,  1544,  1550,  1564,  1575,  1589,  1596,  1601, 
 1612,  1623,  1627,  1632,  1646, 
d306 3
a308 3
#define P_alphanumeric 513
#define B_alphanumeric 1
#define AST_alphanumeric 1
d310 3
a312 3
#define P_digit 514
#define B_digit 2
#define AST_digit 2
d314 3
a316 3
#define P_sqstring 515
#define B_sqstring 3
#define AST_sqstring 3
d318 3
a320 3
#define P_dqstring 516
#define B_dqstring 4
#define AST_dqstring 4
d322 3
a324 3
#define P_NL 517
#define B_NL 5
#define AST_NL 5
d326 2
a327 3
#define P_char 518
#define B_char 6
#define AST_char 6
d329 2
a330 3
#define P_EOF 519
#define B_EOF 7
#define AST_EOF 7
d332 2
a333 2
#define P_SS 520
#define AST_SS 8
d335 2
a336 2
#define P_BLANKS 521
#define AST_BLANKS 9
d338 2
a339 2
#define P_LAST_ITEMS_IN_FILE 522
#define AST_LAST_ITEMS_IN_FILE 10
d341 2
a342 2
#define P_ENDPROGRAM 523
#define AST_ENDPROGRAM 11
d344 2
a345 2
#define P_EXTERNALS 524
#define AST_EXTERNALS 12
d347 2
a348 2
#define P_INTERNALS 525
#define AST_INTERNALS 13
d350 2
a351 2
#define P_EXTERNAL_OR_INTERNAL 526
#define AST_EXTERNAL_OR_INTERNAL 14
d353 2
a354 2
#define P_OPT_LABEL 527
#define AST_OPT_LABEL 15
d356 2
a357 2
#define P_FAULT_S 528
#define AST_FAULT_S 16
d359 2
a360 2
#define P_FAULT_LIST 529
#define AST_FAULT_LIST 17
d362 2
a363 2
#define P_MORE_NUMBERS 530
#define AST_MORE_NUMBERS 18
d365 2
a366 2
#define P_FAULT_ACTION 531
#define AST_FAULT_ACTION 19
d368 2
a369 2
#define P_MORE_FAULTS 532
#define AST_MORE_FAULTS 20
d371 2
a372 2
#define P_INTERNAL 533
#define AST_INTERNAL 21
d374 2
a375 2
#define P_NESTED_BLOCK 534
#define AST_NESTED_BLOCK 22
d377 2
a378 2
#define P_Opt_OFPROGRAM 535
#define AST_Opt_OFPROGRAM 23
d380 2
a381 2
#define P_AUI 536
#define AST_AUI 24
d383 2
a384 2
#define P_OPT_ASSIGN 537
#define AST_OPT_ASSIGN 25
d386 2
a387 2
#define P_UI 538
#define AST_UI 26
d389 2
a390 2
#define P_GOTO_DESTINATION 539
#define AST_GOTO_DESTINATION 27
d392 2
a393 2
#define P_FILE_END_TYPE 540
#define AST_FILE_END_TYPE 28
d395 2
a396 2
#define P_DECLARATION_S 541
#define AST_DECLARATION_S 29
d398 2
a399 2
#define P_RADEC 542
#define AST_RADEC 30
d401 2
a402 2
#define P_REST_OF_RADEC 543
#define AST_REST_OF_RADEC 31
d404 2
a405 2
#define P_RDEC 544
#define AST_RDEC 32
d407 2
a408 2
#define P_REST_OF_RDEC 545
#define AST_REST_OF_RDEC 33
d410 2
a411 2
#define P_EVENT_LIST 546
#define AST_EVENT_LIST 34
d413 2
a414 2
#define P_CYCLE_S 547
#define AST_CYCLE_S 35
d416 2
a417 2
#define P_IF_S 548
#define AST_IF_S 36
d419 2
a420 2
#define P_FINISH_S 549
#define AST_FINISH_S 37
d422 2
a423 2
#define P_Opt_ELSE_S 550
#define AST_Opt_ELSE_S 38
d425 2
a426 2
#define P_THEN_S 551
#define AST_THEN_S 39
d428 2
a429 2
#define P_OPT_then 552
#define AST_OPT_then 40
d431 2
a432 2
#define P_OPT_start 553
#define AST_OPT_start 41
d434 2
a435 2
#define P_S 554
#define AST_S 42
d437 2
a438 2
#define P_COMMENT 555
#define AST_COMMENT 43
d440 2
a441 2
#define P_Rest_of_line 556
#define AST_Rest_of_line 44
d443 2
a444 2
#define P_INT_CONST 557
#define AST_INT_CONST 45
d446 2
a447 2
#define P_STR_CONST 558
#define AST_STR_CONST 46
d449 2
a450 2
#define P_OPT_DQ_LETTER 559
#define AST_OPT_DQ_LETTER 47
d452 2
a453 2
#define P_NUMERIC_CONST 560
#define AST_NUMERIC_CONST 48
d455 2
a456 2
#define P_CONST 561
#define AST_CONST 49
d458 2
a459 2
#define P_OLDHEX 562
#define AST_OLDHEX 50
d461 2
a462 2
#define P_OPT_SQ_LETTER 563
#define AST_OPT_SQ_LETTER 51
d464 2
a465 2
#define P_REAL_CONST 564
#define AST_REAL_CONST 52
d467 2
a468 2
#define P_FRACPT 565
#define AST_FRACPT 53
d470 2
a471 2
#define P_OPT_FRACPT 566
#define AST_OPT_FRACPT 54
d473 2
a474 2
#define P_OPT_PM 567
#define AST_OPT_PM 55
d476 2
a477 2
#define P_OPT_EXPONENT 568
#define AST_OPT_EXPONENT 56
d479 2
a480 2
#define P_DIGIT_SEQ 569
#define AST_DIGIT_SEQ 57
d482 2
a483 2
#define P_rest_of_number 570
#define AST_rest_of_number 58
d485 2
a486 2
#define P_NAME 571
#define AST_NAME 59
d488 2
a489 2
#define P_rest_of_name 572
#define AST_rest_of_name 60
d491 2
a492 2
#define P_SQUO_STRING 573
#define AST_SQUO_STRING 61
d494 2
a495 2
#define P_UCI 574
#define AST_UCI 62
d497 2
a498 2
#define P_REST_OF_COND 575
#define AST_REST_OF_COND 63
d500 2
a501 2
#define P_REST_OF_ANDC 576
#define AST_REST_OF_ANDC 64
d503 2
a504 2
#define P_REST_OF_ORC 577
#define AST_REST_OF_ORC 65
d506 2
a507 2
#define P_CONDITION 578
#define AST_CONDITION 66
d509 2
a510 2
#define P_SC 579
#define AST_SC 67
d512 2
a513 2
#define P_OPT_DOUBLE_SIDED 580
#define AST_OPT_DOUBLE_SIDED 68
d515 2
a516 2
#define P_STRING_RESOLUTION 581
#define AST_STRING_RESOLUTION 69
d518 2
a519 2
#define P_STRING_RESOLUTION_EXPR 582
#define AST_STRING_RESOLUTION_EXPR 70
d521 2
a522 2
#define P_STRING_LVALUE 583
#define AST_STRING_LVALUE 71
d524 2
a525 2
#define P_STRING_RVALUE 584
#define AST_STRING_RVALUE 72
d527 2
a528 2
#define P_STRING_EXPR 585
#define AST_STRING_EXPR 73
d530 2
a531 2
#define P_REST_OF_STRING_EXPR 586
#define AST_REST_OF_STRING_EXPR 74
d533 2
a534 2
#define P_STR_MATCH 587
#define AST_STR_MATCH 75
d536 2
a537 2
#define P_STR_ASSIGN 588
#define AST_STR_ASSIGN 76
d539 2
a540 2
#define P_OPT_STR_ASSIGN 589
#define AST_OPT_STR_ASSIGN 77
d542 2
a543 2
#define P_OPT_STR_MATCH 590
#define AST_OPT_STR_MATCH 78
d545 2
a546 2
#define P_COMP 591
#define AST_COMP 79
d548 2
a549 2
#define P_NOT_EQUALS 592
#define AST_NOT_EQUALS 80
d551 2
a552 2
#define P_NOT_EQUALS_ADDRESS 593
#define AST_NOT_EQUALS_ADDRESS 81
d554 2
a555 2
#define P_Opt_PARAMETERS 594
#define AST_Opt_PARAMETERS 82
d557 2
a558 2
#define P_REST_OF_PARAMETERS 595
#define AST_REST_OF_PARAMETERS 83
d560 2
a561 2
#define P_EXPR 596
#define AST_EXPR 84
d563 2
a564 2
#define P_REST_OF_EXPR 597
#define AST_REST_OF_EXPR 85
d566 2
a567 2
#define P_MEDIUMPREC_EXPR 598
#define AST_MEDIUMPREC_EXPR 86
d569 2
a570 2
#define P_REST_OF_MEDIUMPREC_EXPR 599
#define AST_REST_OF_MEDIUMPREC_EXPR 87
d572 2
a573 2
#define P_HIGHPREC_EXPR 600
#define AST_HIGHPREC_EXPR 88
d575 2
a576 2
#define P_REST_OF_HIGHPREC_EXPR 601
#define AST_REST_OF_HIGHPREC_EXPR 89
d578 2
a579 2
#define P_RIGHT_ASSOC_EXPR 602
#define AST_RIGHT_ASSOC_EXPR 90
d581 2
a582 2
#define P_REST_OF_RIGHTASSOC_EXPR 603
#define AST_REST_OF_RIGHTASSOC_EXPR 91
d584 2
a585 2
#define P_RIGHTASSOC_EXPR_with_OP 604
#define AST_RIGHTASSOC_EXPR_with_OP 92
d587 2
a588 2
#define P_UNARY_EXPR 605
#define AST_UNARY_EXPR 93
d590 2
a591 2
#define P_Opt_PARAMETERS_OR_POINTERINDEX 606
#define AST_Opt_PARAMETERS_OR_POINTERINDEX 94
d593 2
a594 2
#define P_Opt_RECORDFIELD 607
#define AST_Opt_RECORDFIELD 95
d596 2
a597 2
#define P_Opt_RECORDFIELD_OR_POINTERINDEX 608
#define AST_Opt_RECORDFIELD_OR_POINTERINDEX 96
d599 2
a600 2
#define P_OPERAND 609
#define AST_OPERAND 97
d602 2
a603 2
#define P_OP 610
#define AST_OP 98
d605 2
a606 2
#define P_OP_HIGH_LEFTASSOC 611
#define AST_OP_HIGH_LEFTASSOC 99
d608 2
a609 2
#define P_OP_HIGH_RIGHTASSOC 612
#define AST_OP_HIGH_RIGHTASSOC 100
d611 2
a612 2
#define P_INTEGER_EXP 613
#define AST_INTEGER_EXP 101
d614 2
a615 2
#define P_REAL_EXP 614
#define AST_REAL_EXP 102
d617 2
a618 2
#define P_OP_MED 615
#define AST_OP_MED 103
d620 2
a621 2
#define P_OP_LOW 616
#define AST_OP_LOW 104
d623 2
a624 2
#define P_Opt_UNARY_OP 617
#define AST_Opt_UNARY_OP 105
d626 2
a627 2
#define P_UNARY_NOT 618
#define AST_UNARY_NOT 106
d629 2
a630 2
#define P_Percent_IU 619
#define AST_Percent_IU 107
d632 2
a633 2
#define P_REST_OF_SWLIST 620
#define AST_REST_OF_SWLIST 108
d635 2
a636 2
#define P_Opt_NAME_LIST 621
#define AST_Opt_NAME_LIST 109
d638 2
a639 2
#define P_REST_OF_NAME_LIST 622
#define AST_REST_OF_NAME_LIST 110
d641 2
a642 2
#define P_CEXPR 623
#define AST_CEXPR 111
d644 2
a645 2
#define P_REST_OF_CEXPR 624
#define AST_REST_OF_CEXPR 112
d647 2
a648 2
#define P_COPERAND 625
#define AST_COPERAND 113
d650 2
a651 2
#define P_OPT_event 626
#define AST_OPT_event 114
d653 2
a654 2
#define P_FPP 627
#define AST_FPP 115
d656 2
a657 2
#define P_REST_OF_FORMAL_PARAMETER_LIST 628
#define AST_REST_OF_FORMAL_PARAMETER_LIST 116
d659 2
a660 2
#define P_FORMAL_PARAMETER_DECLARATION 629
#define AST_FORMAL_PARAMETER_DECLARATION 117
d662 2
a663 2
#define P_OPT_name 630
#define AST_OPT_name 118
d665 2
a666 2
#define P_RT 631
#define AST_RT 119
d668 2
a669 2
#define P_FN_MAP 632
#define AST_FN_MAP 120
d671 2
a672 2
#define P_FN 633
#define AST_FN 121
d674 2
a675 2
#define P_XTYPE 634
#define AST_XTYPE 122
d677 2
a678 2
#define P_Opt_RFREF 635
#define AST_Opt_RFREF 123
d680 2
a681 2
#define P_RECFMT_REF 636
#define AST_RECFMT_REF 124
d683 2
a684 2
#define P_ALT_RECFMT_DEC 637
#define AST_ALT_RECFMT_DEC 125
d686 2
a687 2
#define P_REST_OF_RECFMT_DEC 638
#define AST_REST_OF_RECFMT_DEC 126
d689 2
a690 2
#define P_RECFMT_DEC 639
#define AST_RECFMT_DEC 127
d692 2
a693 2
#define P_RECFMT_ELMNT 640
#define AST_RECFMT_ELMNT 128
d695 2
a696 2
#define P_ADECLN 641
#define AST_ADECLN 129
d698 2
a699 2
#define P_REST_OF_ARLIST 642
#define AST_REST_OF_ARLIST 130
d701 2
a702 2
#define P_BPAIR 643
#define AST_BPAIR 131
d704 2
a705 2
#define P_REST_OF_BPLIST 644
#define AST_REST_OF_BPLIST 132
d707 2
a708 2
#define P_OPT_arrayname_OR_name 645
#define AST_OPT_arrayname_OR_name 133
d710 2
a711 2
#define P_FULLTYPE 646
#define AST_FULLTYPE 134
d713 2
a714 2
#define P_REPFACT 647
#define AST_REPFACT 135
d716 2
a717 2
#define P_Opt_STAROREXPR 648
#define AST_Opt_STAROREXPR 136
d719 2
a720 2
#define P_STAROREXPR 649
#define AST_STAROREXPR 137
d722 2
a723 2
#define P_BTYPE 650
#define AST_BTYPE 138
d725 2
a726 2
#define P_Opt_Comma 651
#define AST_Opt_Comma 139
d728 2
a729 2
#define P_Opt_ALIAS 652
#define AST_Opt_ALIAS 140
d731 2
a732 2
#define P_TEXTTEXT 653
#define AST_TEXTTEXT 141
d734 2
a735 2
#define P_Percent_SEX 654
#define AST_Percent_SEX 142
d737 2
a738 2
#define P_RECFMT_spec_OR_BODY 655
#define AST_RECFMT_spec_OR_BODY 143
d740 2
a741 2
#define P_DECLN 656
#define AST_DECLN 144
d743 2
a744 2
#define P_OPT_format 657
#define AST_OPT_format 145
d746 2
a747 2
#define P_Opt_Assign_NAME_LIST 658
#define AST_Opt_Assign_NAME_LIST 146
d749 2
a750 2
#define P_Opt_Const_assign 659
#define AST_Opt_Const_assign 147
d752 2
a753 2
#define P_Percent_WU 660
#define AST_Percent_WU 148
d755 2
a756 2
#define P_Percent_WUF 661
#define AST_Percent_WUF 149
d758 2
a759 2
#define P_Opt_UNTIL 662
#define AST_Opt_UNTIL 150
d761 2
a762 2
#define P_Opt_CYCPARM 663
#define AST_Opt_CYCPARM 151
d764 2
a765 2
#define P_OPEXPR2 664
#define AST_OPEXPR2 152
d767 2
a768 2
#define P_OPEXPR 665
#define AST_OPEXPR 153
d770 2
a771 2
#define P_ASSOP 666
#define AST_ASSOP 154
d773 2
a774 2
#define P_REST_OF_SS1 667
#define AST_REST_OF_SS1 155
d776 2
a777 2
#define P_OWNDEC 668
#define AST_OWNDEC 156
d779 2
a780 2
#define P_REST_OF_OWNDEC 669
#define AST_REST_OF_OWNDEC 157
d782 2
a783 2
#define P_SINGLE_OWNDEC 670
#define AST_SINGLE_OWNDEC 158
d785 2
a786 2
#define P_CONSTLIST 671
#define AST_CONSTLIST 159
d788 2
a789 2
#define P_ROCL 672
#define AST_ROCL 160
d791 2
a792 2
#define P_stupid 673
#define AST_stupid 161
d794 2
a795 2
#define P_OPT_spec 674
#define AST_OPT_spec 162
d797 2
a798 2
#define P_Opt_Assign_CONST 675
#define AST_Opt_Assign_CONST 163
d800 2
a801 2
#define P_XOWN 676
#define AST_XOWN 164
d803 29
a831 2
#define AST__LIT 165
#define AST__KW 166
a836 6
  " I am considering removing <alphanumeric> and <digit> from the BIPs\n"
  " and just handling them via graamar rules (or regexps, once support is added)\n"
  " because a quick pass over the AST can consolidate a string of alphanumerics\n"
  " into a <NAME> relatively easily.  We really just need stropped letters,\n"
  " both types of string, NL, and EOF.  Everything else can be done with individual\n"
  " characters...\n"
a837 2
  " upper or lower case letter or a digit, but only if the digit is following a letter\n",
  " digit\n",
d841 5
d866 3
a868 1
  " option to fix.\n",
d872 1
d874 11
d906 10
a915 2
  " unlike with old-style parsers, the whole of the block content ends up in an AST item.\n",
  " from \"begin\" \"end\" blocks\n",
d935 1
a935 1
  "           <XTYPE>         (\"array name\" | \"name\")?  <NAME> <Opt-Const-assign> <Opt-Assign-NAME-LIST>,\n"
d948 8
a955 1
  " by the compiler...\n",
d971 4
d981 4
a984 1
  " E\"ebcdic\" etc also not handled.  Hamish's 40_XXX comes in here.\n",
d997 6
a1002 1
  " current line reconstruction doesn't support this. Letters come through as part of <alphanumeric>s.\n"
d1004 2
a1005 4
  "   'M',\n"
  "   'X',\n"
  "   'B',\n"
  "  ;\n",
d1009 4
d1014 6
a1019 1
  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
d1023 1
a1023 1
  NULL, NULL, 
d1026 1
a1026 1
  NULL, NULL, NULL, 
d1038 3
a1040 1
  NULL, NULL, NULL, NULL, 
d1049 4
a1052 1
  " and for Hamish's 68000 Imp:     %if tp[1]_mode # litmode %then lo = minint %else lo = tp[1]_val\n",
d1089 3
a1091 1
  " label and short added by gt as a quick hack\n"
d1093 4
a1096 1
  " Why is it record (<rfref?>) rather than record (<rfref>) - is record () ever an option?\n",
d1101 4
a1104 1
  NULL, NULL, NULL, 
d1109 3
a1111 1
  NULL, NULL, 
d1117 10
a1126 2
  NULL, NULL, NULL, NULL, 
  " if we add a \"C\" type (to reverse the order of parameter evaluation) it would be done here.\n",
d1129 3
a1131 1
  " <Opt-Const-assign> added by gt\n",
d1133 9
a1141 2
  " <Opt-Const-assign> added by gt\n",
  " The <CEXPR> one may be redundant.  Had to put expr first to catch = tostring(i) because cexpr only got tostring\n",
d1144 3
a1146 1
  " gt changed signal to allow 2 exprs.  Mouses Imp77 adds an optional string!\n",
d1148 1
d1151 3
a1153 1
  NULL, NULL, NULL, 
a1157 1
  " '== 0' needed for %const %record(*) %name nil == 0 - gt  Only 0 allowed.\n",
@
