]> pd.if.org Git - pccts/commitdiff
auto commit for import
authorTerence Parr <>
Fri, 6 Oct 1995 00:40:16 +0000 (19:40 -0500)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 26 Feb 2017 02:16:53 +0000 (20:16 -0600)
dlg/dlg_a.c [new file with mode: 0755]
dlg/dlg_p.c [new file with mode: 0755]
dlg/mode.h [new file with mode: 0755]
dlg/parser.dlg [new file with mode: 0755]

diff --git a/dlg/dlg_a.c b/dlg/dlg_a.c
new file mode 100755 (executable)
index 0000000..1f984ef
--- /dev/null
@@ -0,0 +1,752 @@
+
+/* parser.dlg -- DLG Description of scanner
+ *
+ * Generated from: dlg_p.g
+ *
+ * Terence Parr, Will Cohen, and Hank Dietz: 1989-1994
+ * Purdue University Electrical Engineering
+ * With AHPCRC, University of Minnesota
+ * ANTLR Version 1.32
+ */
+
+#include <stdio.h>
+#define ANTLR_VERSION  132
+
+#include <ctype.h>
+#include "dlg.h"
+#ifdef MEMCHK
+#include "trax.h"
+#endif
+#include "antlr.h"
+#include "tokens.h"
+#include "dlgdef.h"
+LOOKAHEAD
+void zzerraction()
+{
+       (*zzerr)("invalid token");
+       zzadvance();
+       zzskip();
+}
+/*
+ * D L G tables
+ *
+ * Generated from: parser.dlg
+ *
+ * 1989-1994 by  Will Cohen, Terence Parr, and Hank Dietz
+ * Purdue University Electrical Engineering
+ * DLG Version 1.32
+ */
+
+#include "mode.h"
+
+
+
+
+int    func_action;            /* should actions be turned into functions?*/
+int    lex_mode_counter = 0;   /* keeps track of the number of %%names */
+
+static void act1()
+{ 
+               NLA = 1;
+       }
+
+
+static void act2()
+{ 
+               NLA = 2;
+               zzskip();   
+       }
+
+
+static void act3()
+{ 
+               NLA = 3;
+               zzline++; zzskip(); DAWDLE;   
+       }
+
+
+static void act4()
+{ 
+               NLA = L_EOF;
+       }
+
+
+static void act5()
+{ 
+               NLA = PER_PER;
+       }
+
+
+static void act6()
+{ 
+               NLA = NAME_PER_PER;
+               p_mode_def(&zzlextext[2],lex_mode_counter++);   
+       }
+
+
+static void act7()
+{ 
+               NLA = ACTION;
+               if (func_action)
+               fprintf(OUT,"\n%s %sact%d()\n{ ",
+               gen_cpp?"ANTLRTokenType":"static void",
+               gen_cpp?ClassName("::"):"", ++action_no);
+               zzmode(ACT); zzskip();
+       }
+
+
+static void act8()
+{ 
+               NLA = GREAT_GREAT;
+       }
+
+
+static void act9()
+{ 
+               NLA = L_BRACE;
+       }
+
+
+static void act10()
+{ 
+               NLA = R_BRACE;
+       }
+
+
+static void act11()
+{ 
+               NLA = L_PAR;
+       }
+
+
+static void act12()
+{ 
+               NLA = R_PAR;
+       }
+
+
+static void act13()
+{ 
+               NLA = L_BRACK;
+       }
+
+
+static void act14()
+{ 
+               NLA = R_BRACK;
+       }
+
+
+static void act15()
+{ 
+               NLA = ZERO_MORE;
+       }
+
+
+static void act16()
+{ 
+               NLA = ONE_MORE;
+       }
+
+
+static void act17()
+{ 
+               NLA = OR;
+       }
+
+
+static void act18()
+{ 
+               NLA = RANGE;
+       }
+
+
+static void act19()
+{ 
+               NLA = NOT;
+       }
+
+
+static void act20()
+{ 
+               NLA = OCTAL_VALUE;
+               {int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;}  
+       }
+
+
+static void act21()
+{ 
+               NLA = HEX_VALUE;
+               {int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;}  
+       }
+
+
+static void act22()
+{ 
+               NLA = DEC_VALUE;
+               {int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;}  
+       }
+
+
+static void act23()
+{ 
+               NLA = TAB;
+               zzlextext[0] = '\t';  
+       }
+
+
+static void act24()
+{ 
+               NLA = NL;
+               zzlextext[0] = '\n';  
+       }
+
+
+static void act25()
+{ 
+               NLA = CR;
+               zzlextext[0] = '\r';  
+       }
+
+
+static void act26()
+{ 
+               NLA = BS;
+               zzlextext[0] = '\b';  
+       }
+
+
+static void act27()
+{ 
+               NLA = LIT;
+               zzlextext[0] = zzlextext[1];  
+       }
+
+
+static void act28()
+{ 
+               NLA = REGCHAR;
+       }
+
+static unsigned char shift0[257] = {
+  0, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  1, 2, 29, 29, 1, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 1, 29, 29, 29, 29, 4, 29, 
+  29, 19, 20, 23, 24, 29, 26, 29, 29, 12, 
+  13, 13, 13, 13, 13, 13, 13, 14, 14, 29, 
+  29, 15, 29, 16, 29, 3, 7, 7, 7, 7, 
+  7, 7, 11, 11, 11, 11, 11, 11, 11, 11, 
+  11, 11, 11, 11, 11, 11, 11, 11, 11, 5, 
+  11, 11, 21, 28, 22, 29, 11, 29, 7, 6, 
+  7, 7, 7, 7, 11, 11, 11, 11, 11, 11, 
+  11, 9, 11, 11, 11, 10, 11, 8, 11, 11, 
+  11, 5, 11, 11, 17, 25, 18, 27, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 
+  29, 29, 29, 29, 29, 29, 29
+};
+
+
+static void act29()
+{ 
+               NLA = 1;
+               error("unterminated action", zzline); zzmode(START);   
+       }
+
+
+static void act30()
+{ 
+               NLA = ACTION;
+               if (func_action) fprintf(OUT,"}\n\n");
+               zzmode(START);
+       }
+
+
+static void act31()
+{ 
+               NLA = 29;
+               putc(zzlextext[0], OUT); zzskip();   
+       }
+
+
+static void act32()
+{ 
+               NLA = 30;
+               putc('>', OUT); zzskip();   
+       }
+
+
+static void act33()
+{ 
+               NLA = 31;
+               putc('\\', OUT); zzskip();   
+       }
+
+
+static void act34()
+{ 
+               NLA = 32;
+               putc(zzlextext[0], OUT); ++zzline; zzskip();   
+       }
+
+
+static void act35()
+{ 
+               NLA = 33;
+               fprintf(OUT, "%s", &(zzlextext[0])); zzskip();   
+       }
+
+static unsigned char shift1[257] = {
+  0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 1, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 
+  4, 4, 4, 4, 4, 4, 4
+};
+
+#define DfaStates      46
+typedef unsigned char DfaState;
+
+static DfaState st0[31] = {
+  1, 2, 3, 4, 5, 6, 6, 6, 6, 6, 
+  6, 6, 6, 6, 6, 7, 8, 9, 10, 11, 
+  12, 13, 14, 15, 16, 17, 18, 19, 20, 6, 
+  46
+};
+
+static DfaState st1[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st2[31] = {
+  46, 21, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st3[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st4[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st5[31] = {
+  46, 46, 46, 46, 22, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st6[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st7[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 23, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st8[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 24, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st9[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st10[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st11[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st12[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st13[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st14[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st15[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st16[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st17[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st18[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st19[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st20[31] = {
+  46, 25, 25, 25, 25, 25, 26, 25, 27, 28, 
+  29, 25, 30, 31, 31, 25, 25, 25, 25, 25, 
+  25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 
+  46
+};
+
+static DfaState st21[31] = {
+  46, 21, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st22[31] = {
+  46, 46, 46, 46, 46, 32, 32, 32, 32, 32, 
+  32, 32, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st23[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st24[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st25[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st26[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st27[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st28[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st29[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st30[31] = {
+  46, 46, 46, 46, 46, 33, 46, 46, 46, 46, 
+  46, 46, 34, 34, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st31[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 35, 35, 35, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st32[31] = {
+  46, 46, 46, 46, 46, 36, 36, 36, 36, 36, 
+  36, 36, 36, 36, 36, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st33[31] = {
+  46, 46, 46, 46, 46, 46, 37, 37, 46, 46, 
+  46, 46, 37, 37, 37, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st34[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 34, 34, 46, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st35[31] = {
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46, 46, 35, 35, 35, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st36[31] = {
+  46, 46, 46, 46, 46, 36, 36, 36, 36, 36, 
+  36, 36, 36, 36, 36, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st37[31] = {
+  46, 46, 46, 46, 46, 46, 37, 37, 46, 46, 
+  46, 46, 37, 37, 37, 46, 46, 46, 46, 46, 
+  46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 
+  46
+};
+
+static DfaState st38[6] = {
+  39, 40, 41, 42, 43, 46
+};
+
+static DfaState st39[6] = {
+  46, 46, 46, 46, 46, 46
+};
+
+static DfaState st40[6] = {
+  46, 44, 46, 46, 46, 46
+};
+
+static DfaState st41[6] = {
+  46, 45, 46, 46, 46, 46
+};
+
+static DfaState st42[6] = {
+  46, 46, 46, 46, 46, 46
+};
+
+static DfaState st43[6] = {
+  46, 46, 46, 46, 43, 46
+};
+
+static DfaState st44[6] = {
+  46, 46, 46, 46, 46, 46
+};
+
+static DfaState st45[6] = {
+  46, 46, 46, 46, 46, 46
+};
+
+
+DfaState *dfa[46] = {
+       st0,
+       st1,
+       st2,
+       st3,
+       st4,
+       st5,
+       st6,
+       st7,
+       st8,
+       st9,
+       st10,
+       st11,
+       st12,
+       st13,
+       st14,
+       st15,
+       st16,
+       st17,
+       st18,
+       st19,
+       st20,
+       st21,
+       st22,
+       st23,
+       st24,
+       st25,
+       st26,
+       st27,
+       st28,
+       st29,
+       st30,
+       st31,
+       st32,
+       st33,
+       st34,
+       st35,
+       st36,
+       st37,
+       st38,
+       st39,
+       st40,
+       st41,
+       st42,
+       st43,
+       st44,
+       st45
+};
+
+
+DfaState accepts[47] = {
+  0, 1, 2, 3, 4, 28, 28, 28, 28, 9, 
+  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
+  0, 2, 5, 7, 8, 27, 26, 23, 24, 25, 
+  20, 22, 6, 0, 20, 22, 6, 21, 0, 29, 
+  31, 33, 34, 35, 30, 32, 0
+};
+
+void (*actions[36])() = {
+       zzerraction,
+       act1,
+       act2,
+       act3,
+       act4,
+       act5,
+       act6,
+       act7,
+       act8,
+       act9,
+       act10,
+       act11,
+       act12,
+       act13,
+       act14,
+       act15,
+       act16,
+       act17,
+       act18,
+       act19,
+       act20,
+       act21,
+       act22,
+       act23,
+       act24,
+       act25,
+       act26,
+       act27,
+       act28,
+       act29,
+       act30,
+       act31,
+       act32,
+       act33,
+       act34,
+       act35
+};
+
+static DfaState dfa_base[] = {
+       0,
+       38
+};
+
+static unsigned char *b_class_no[] = {
+       shift0,
+       shift1
+};
+
+
+
+#define ZZSHIFT(c) (b_class_no[zzauto][1+c])
+#define MAX_MODE 2
+#include "dlgauto.h"
diff --git a/dlg/dlg_p.c b/dlg/dlg_p.c
new file mode 100755 (executable)
index 0000000..33f80fc
--- /dev/null
@@ -0,0 +1,849 @@
+/*
+ * A n t l r  T r a n s l a t i o n  H e a d e r
+ *
+ * Terence Parr, Will Cohen, and Hank Dietz: 1989-1994
+ * Purdue University Electrical Engineering
+ * With AHPCRC, University of Minnesota
+ * ANTLR Version 1.32
+ */
+#include <stdio.h>
+#define ANTLR_VERSION  132
+
+#include <ctype.h>
+#include "dlg.h"
+#ifdef MEMCHK
+#include "trax.h"
+#endif
+#define zzSET_SIZE 8
+#include "antlr.h"
+#include "tokens.h"
+#include "dlgdef.h"
+#include "mode.h"
+#ifndef PURIFY
+#define PURIFY(r,s)
+#endif
+ANTLR_INFO
+
+int    action_no = 0;     /* keep track of actions outputed */
+int    nfa_allocated = 0; /* keeps track of number of nfa nodes */
+nfa_node **nfa_array = NULL;/* root of binary tree that stores nfa array */
+nfa_node nfa_model_node;   /* model to initialize new nodes */
+set    used_chars;        /* used to label trans. arcs */
+set    used_classes;      /* classes or chars used to label trans. arcs */
+set    normal_chars;      /* mask to get rid elements that aren't used
+in set */
+int    flag_paren = FALSE;
+int    flag_brace = FALSE;
+int    mode_counter = 0;  /* keep track of number of %%names */
+
+  
+
+void
+#ifdef __STDC__
+grammar(void)
+#else
+grammar()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       p_head(); p_class_hdr(); func_action = FALSE;  
+       {
+               zzBLOCK(zztasp2);
+               zzMake0;
+               {
+               while ( (LA(1)==ACTION) ) {
+                       zzmatch(ACTION); zzCONSUME;
+                       zzLOOP(zztasp2);
+               }
+               zzEXIT(zztasp2);
+               }
+       }
+       if ( gen_cpp ) p_includes();  
+       start_states();
+       func_action = FALSE; p_tables(); p_tail();   
+       {
+               zzBLOCK(zztasp2);
+               zzMake0;
+               {
+               while ( (LA(1)==ACTION) ) {
+                       zzmatch(ACTION); zzCONSUME;
+                       zzLOOP(zztasp2);
+               }
+               zzEXIT(zztasp2);
+               }
+       }
+       zzmatch(1); zzCONSUME;
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd1, 0x1);
+       }
+}
+
+void
+#ifdef __STDC__
+start_states(void)
+#else
+start_states()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       {
+               zzBLOCK(zztasp2);
+               zzMake0;
+               {
+               if ( (LA(1)==PER_PER) ) {
+                       zzmatch(PER_PER); zzCONSUME;
+                       do_conversion();
+               }
+               else {
+                       if ( (LA(1)==NAME_PER_PER) ) {
+                               zzmatch(NAME_PER_PER); zzCONSUME;
+                               do_conversion();
+                               {
+                                       zzBLOCK(zztasp3);
+                                       zzMake0;
+                                       {
+                                       while ( (LA(1)==NAME_PER_PER) ) {
+                                               zzmatch(NAME_PER_PER); zzCONSUME;
+                                               do_conversion();
+                                               zzLOOP(zztasp3);
+                                       }
+                                       zzEXIT(zztasp3);
+                                       }
+                               }
+                       }
+                       else {zzFAIL(1,zzerr1,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
+               }
+               zzEXIT(zztasp2);
+               }
+       }
+       zzmatch(PER_PER); zzCONSUME;
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd1, 0x2);
+       }
+}
+
+void
+#ifdef __STDC__
+do_conversion(void)
+#else
+do_conversion()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       new_automaton_mode(); func_action = TRUE;  
+       rule_list();
+       
+       dfa_class_nop[mode_counter] =
+       relabel(zzaArg(zztasp1,1 ).l,comp_level);
+       if (comp_level)
+       p_shift_table(mode_counter);
+       dfa_basep[mode_counter] = dfa_allocated+1;
+       make_dfa_model_node(dfa_class_nop[mode_counter]);
+       nfa_to_dfa(zzaArg(zztasp1,1 ).l);
+       ++mode_counter;
+       func_action = FALSE;
+#ifdef HASH_STAT
+       fprint_hash_stats(stderr);
+#endif
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd1, 0x4);
+       }
+}
+
+void
+#ifdef __STDC__
+rule_list(void)
+#else
+rule_list()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       if ( (setwd1[LA(1)]&0x8) ) {
+               rule();
+               zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;  
+               {
+                       zzBLOCK(zztasp2);
+                       zzMake0;
+                       {
+                       while ( (setwd1[LA(1)]&0x10) ) {
+                               rule();
+                               {nfa_node *t1;
+                                       t1 = new_nfa_node();
+                                       (t1)->trans[0]=zzaRet.l;
+                                       (t1)->trans[1]=zzaArg(zztasp2,1 ).l;
+                                       /* all accept nodes "dead ends" */
+                                       zzaRet.l=t1; zzaRet.r=NULL;
+                               }
+                               zzLOOP(zztasp2);
+                       }
+                       zzEXIT(zztasp2);
+                       }
+               }
+       }
+       else {
+               if ( (setwd1[LA(1)]&0x20) ) {
+                       zzaRet.l = new_nfa_node(); zzaRet.r = NULL;
+                       warning("no regular expressions", zzline);
+               }
+               else {zzFAIL(1,zzerr2,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd1, 0x40);
+       }
+}
+
+void
+#ifdef __STDC__
+rule(void)
+#else
+rule()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       if ( (setwd1[LA(1)]&0x80) ) {
+               reg_expr();
+               zzmatch(ACTION);
+               zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r; (zzaArg(zztasp1,1 ).r)->accept=action_no;  
+ zzCONSUME;
+
+       }
+       else {
+               if ( (LA(1)==ACTION) ) {
+                       zzmatch(ACTION);
+                       zzaRet.l = NULL; zzaRet.r = NULL;
+                       error("no expression for action  ", zzline);
+ zzCONSUME;
+
+               }
+               else {zzFAIL(1,zzerr3,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd2, 0x1);
+       }
+}
+
+void
+#ifdef __STDC__
+reg_expr(void)
+#else
+reg_expr()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       and_expr();
+       zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;  
+       {
+               zzBLOCK(zztasp2);
+               zzMake0;
+               {
+               while ( (LA(1)==OR) ) {
+                       zzmatch(OR); zzCONSUME;
+                       and_expr();
+                       {nfa_node *t1, *t2;
+                               t1 = new_nfa_node(); t2 = new_nfa_node();
+                               (t1)->trans[0]=zzaRet.l;
+                               (t1)->trans[1]=zzaArg(zztasp2,2 ).l;
+                               (zzaRet.r)->trans[1]=t2;
+                               (zzaArg(zztasp2,2 ).r)->trans[1]=t2;
+                               zzaRet.l=t1; zzaRet.r=t2;
+                       }
+                       zzLOOP(zztasp2);
+               }
+               zzEXIT(zztasp2);
+               }
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd2, 0x2);
+       }
+}
+
+void
+#ifdef __STDC__
+and_expr(void)
+#else
+and_expr()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       repeat_expr();
+       zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;  
+       {
+               zzBLOCK(zztasp2);
+               zzMake0;
+               {
+               while ( (setwd2[LA(1)]&0x4) ) {
+                       repeat_expr();
+                       (zzaRet.r)->trans[1]=zzaArg(zztasp2,1 ).l; zzaRet.r=zzaArg(zztasp2,1 ).r;  
+                       zzLOOP(zztasp2);
+               }
+               zzEXIT(zztasp2);
+               }
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd2, 0x8);
+       }
+}
+
+void
+#ifdef __STDC__
+repeat_expr(void)
+#else
+repeat_expr()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       if ( (setwd2[LA(1)]&0x10) ) {
+               expr();
+               zzaRet.l=zzaArg(zztasp1,1 ).l; zzaRet.r=zzaArg(zztasp1,1 ).r;  
+               {
+                       zzBLOCK(zztasp2);
+                       zzMake0;
+                       {
+                       if ( (LA(1)==ZERO_MORE) ) {
+                               zzmatch(ZERO_MORE);
+                               {       nfa_node *t1,*t2;
+                                       (zzaRet.r)->trans[0] = zzaRet.l;
+                                       t1 = new_nfa_node(); t2 = new_nfa_node();
+                                       t1->trans[0]=zzaRet.l;
+                                       t1->trans[1]=t2;
+                                       (zzaRet.r)->trans[1]=t2;
+                                       zzaRet.l=t1;zzaRet.r=t2;
+                               }
+ zzCONSUME;
+
+                       }
+                       else {
+                               if ( (LA(1)==ONE_MORE) ) {
+                                       zzmatch(ONE_MORE);
+                                       (zzaRet.r)->trans[0] = zzaRet.l;  
+ zzCONSUME;
+
+                               }
+                       }
+                       zzEXIT(zztasp2);
+                       }
+               }
+       }
+       else {
+               if ( (LA(1)==ZERO_MORE) ) {
+                       zzmatch(ZERO_MORE);
+                       error("no expression for *", zzline);  
+ zzCONSUME;
+
+               }
+               else {
+                       if ( (LA(1)==ONE_MORE) ) {
+                               zzmatch(ONE_MORE);
+                               error("no expression for +", zzline);  
+ zzCONSUME;
+
+                       }
+                       else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
+               }
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd2, 0x20);
+       }
+}
+
+void
+#ifdef __STDC__
+expr(void)
+#else
+expr()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       zzaRet.l = new_nfa_node(); zzaRet.r = new_nfa_node();   
+       if ( (LA(1)==L_BRACK) ) {
+               zzmatch(L_BRACK); zzCONSUME;
+               atom_list();
+               zzmatch(R_BRACK);
+               
+               (zzaRet.l)->trans[0] = zzaRet.r;
+               (zzaRet.l)->label = set_dup(zzaArg(zztasp1,2 ).label);
+               set_orin(&used_chars,(zzaRet.l)->label);
+ zzCONSUME;
+
+       }
+       else {
+               if ( (LA(1)==NOT) ) {
+                       zzmatch(NOT); zzCONSUME;
+                       zzmatch(L_BRACK); zzCONSUME;
+                       atom_list();
+                       zzmatch(R_BRACK);
+                       
+                       (zzaRet.l)->trans[0] = zzaRet.r;
+                       (zzaRet.l)->label = set_dif(normal_chars,zzaArg(zztasp1,3 ).label);
+                       set_orin(&used_chars,(zzaRet.l)->label);
+ zzCONSUME;
+
+               }
+               else {
+                       if ( (LA(1)==L_PAR) ) {
+                               zzmatch(L_PAR); zzCONSUME;
+                               reg_expr();
+                               zzmatch(R_PAR);
+                               
+                               (zzaRet.l)->trans[0] = zzaArg(zztasp1,2 ).l;
+                               (zzaArg(zztasp1,2 ).r)->trans[1] = zzaRet.r;
+ zzCONSUME;
+
+                       }
+                       else {
+                               if ( (LA(1)==L_BRACE) ) {
+                                       zzmatch(L_BRACE); zzCONSUME;
+                                       reg_expr();
+                                       zzmatch(R_BRACE);
+                                       
+                                       (zzaRet.l)->trans[0] = zzaArg(zztasp1,2 ).l;
+                                       (zzaRet.l)->trans[1] = zzaRet.r;
+                                       (zzaArg(zztasp1,2 ).r)->trans[1] = zzaRet.r;
+ zzCONSUME;
+
+                               }
+                               else {
+                                       if ( (setwd2[LA(1)]&0x40) ) {
+                                               atom();
+                                               
+                                               (zzaRet.l)->trans[0] = zzaRet.r;
+                                               (zzaRet.l)->label = set_dup(zzaArg(zztasp1,1 ).label);
+                                               set_orin(&used_chars,(zzaRet.l)->label);
+                                       }
+                                       else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
+                               }
+                       }
+               }
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd2, 0x80);
+       }
+}
+
+void
+#ifdef __STDC__
+atom_list(void)
+#else
+atom_list()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       set_free(zzaRet.label);   
+       {
+               zzBLOCK(zztasp2);
+               zzMake0;
+               {
+               while ( (setwd3[LA(1)]&0x1) ) {
+                       near_atom();
+                       set_orin(&(zzaRet.label),zzaArg(zztasp2,1 ).label);  
+                       zzLOOP(zztasp2);
+               }
+               zzEXIT(zztasp2);
+               }
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd3, 0x2);
+       }
+}
+
+void
+#ifdef __STDC__
+near_atom(void)
+#else
+near_atom()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       register int i;
+       register int i_prime;
+       anychar();
+       zzaRet.letter=zzaArg(zztasp1,1 ).letter; zzaRet.label=set_of(zzaArg(zztasp1,1 ).letter);
+       i_prime = zzaArg(zztasp1,1 ).letter + MIN_CHAR;
+       if (case_insensitive && islower(i_prime))
+       set_orel(toupper(i_prime)-MIN_CHAR,
+       &(zzaRet.label));
+       if (case_insensitive && isupper(i_prime))
+       set_orel(tolower(i_prime)-MIN_CHAR,
+       &(zzaRet.label));
+       {
+               zzBLOCK(zztasp2);
+               zzMake0;
+               {
+               if ( (LA(1)==RANGE) ) {
+                       zzmatch(RANGE); zzCONSUME;
+                       anychar();
+                       if (case_insensitive){
+                               i_prime = zzaRet.letter+MIN_CHAR;
+                               zzaRet.letter = (islower(i_prime) ?
+                               toupper(i_prime) : i_prime)-MIN_CHAR;
+                               i_prime = zzaArg(zztasp2,2 ).letter+MIN_CHAR;
+                               zzaArg(zztasp2,2 ).letter = (islower(i_prime) ?
+                               toupper(i_prime) : i_prime)-MIN_CHAR;
+                       }
+                       /* check to see if range okay */
+                       if (zzaRet.letter > zzaArg(zztasp2,2 ).letter){
+                               error("invalid range  ", zzline);
+                       }
+                       for (i=zzaRet.letter; i<= (int)zzaArg(zztasp2,2 ).letter; ++i){
+                               set_orel(i,&(zzaRet.label));
+                               i_prime = i+MIN_CHAR;
+                               if (case_insensitive && islower(i_prime))
+                               set_orel(toupper(i_prime)-MIN_CHAR,
+                               &(zzaRet.label));
+                               if (case_insensitive && isupper(i_prime))
+                               set_orel(tolower(i_prime)-MIN_CHAR,
+                               &(zzaRet.label));
+                       }
+               }
+               zzEXIT(zztasp2);
+               }
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd3, 0x4);
+       }
+}
+
+void
+#ifdef __STDC__
+atom(void)
+#else
+atom()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       register int i_prime;  
+       anychar();
+       zzaRet.label = set_of(zzaArg(zztasp1,1 ).letter);
+       i_prime = zzaArg(zztasp1,1 ).letter + MIN_CHAR;
+       if (case_insensitive && islower(i_prime))
+       set_orel(toupper(i_prime)-MIN_CHAR,
+       &(zzaRet.label));
+       if (case_insensitive && isupper(i_prime))
+       set_orel(tolower(i_prime)-MIN_CHAR,
+       &(zzaRet.label));
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd3, 0x8);
+       }
+}
+
+void
+#ifdef __STDC__
+anychar(void)
+#else
+anychar()
+#endif
+{
+       zzRULE;
+       zzBLOCK(zztasp1);
+       zzMake0;
+       {
+       if ( (LA(1)==REGCHAR) ) {
+               zzmatch(REGCHAR);
+               zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+       }
+       else {
+               if ( (LA(1)==OCTAL_VALUE) ) {
+                       zzmatch(OCTAL_VALUE);
+                       zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+               }
+               else {
+                       if ( (LA(1)==HEX_VALUE) ) {
+                               zzmatch(HEX_VALUE);
+                               zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+                       }
+                       else {
+                               if ( (LA(1)==DEC_VALUE) ) {
+                                       zzmatch(DEC_VALUE);
+                                       zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+                               }
+                               else {
+                                       if ( (LA(1)==TAB) ) {
+                                               zzmatch(TAB);
+                                               zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+                                       }
+                                       else {
+                                               if ( (LA(1)==NL) ) {
+                                                       zzmatch(NL);
+                                                       zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+                                               }
+                                               else {
+                                                       if ( (LA(1)==CR) ) {
+                                                               zzmatch(CR);
+                                                               zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+                                                       }
+                                                       else {
+                                                               if ( (LA(1)==BS) ) {
+                                                                       zzmatch(BS);
+                                                                       zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+                                                               }
+                                                               else {
+                                                                       if ( (LA(1)==LIT) ) {
+                                                                               zzmatch(LIT);
+                                                                               zzaRet.letter = zzaArg(zztasp1,1 ).letter - MIN_CHAR;  
+ zzCONSUME;
+
+                                                                       }
+                                                                       else {
+                                                                               if ( (LA(1)==L_EOF) ) {
+                                                                                       zzmatch(L_EOF);
+                                                                                       zzaRet.letter = 0;  
+ zzCONSUME;
+
+                                                                               }
+                                                                               else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;}
+                                                                       }
+                                                               }
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
+       }
+       zzEXIT(zztasp1);
+       return;
+fail:
+       zzEXIT(zztasp1);
+       /* empty action */  
+       zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText);
+       zzresynch(setwd3, 0x10);
+       }
+}
+
+/* adds a new nfa to the binary tree and returns a pointer to it */
+nfa_node *new_nfa_node()
+{
+       register nfa_node *t;
+       static int nfa_size=0;  /* elements nfa_array[] can hold */
+       
+       ++nfa_allocated;
+       if (nfa_size<=nfa_allocated){
+               /* need to redo array */
+               if (!nfa_array){
+                       /* need some to do inital allocation */
+                       nfa_size=nfa_allocated+NFA_MIN;
+                       nfa_array=(nfa_node **) malloc(sizeof(nfa_node*)*
+                       nfa_size);
+               }else{
+                       /* need more space */
+                       nfa_size=2*(nfa_allocated+1);
+                       nfa_array=(nfa_node **) realloc(nfa_array, 
+                       sizeof(nfa_node*)*nfa_size);
+               }
+       }
+       /* fill out entry in array */
+       t = (nfa_node*) malloc(sizeof(nfa_node));
+       nfa_array[nfa_allocated] = t;
+       *t = nfa_model_node;
+       t->node_no = nfa_allocated;
+       return t;
+}
+
+
+/* initialize the model node used to fill in newly made nfa_nodes */
+void
+make_nfa_model_node()
+{
+       nfa_model_node.node_no = -1; /* impossible value for real nfa node */
+       nfa_model_node.nfa_set = 0;
+       nfa_model_node.accept = 0;   /* error state default*/
+       nfa_model_node.trans[0] = NULL;
+       nfa_model_node.trans[1] = NULL;
+       nfa_model_node.label = empty;
+}
+
+#ifdef DEBUG
+
+/* print out the pointer value and the node_number */
+fprint_dfa_pair(f, p)
+FILE *f;
+nfa_node *p;
+{
+       if (p){
+               fprintf(f, "%x (%d)", p, p->node_no);
+       }else{
+               fprintf(f, "(nil)");
+       }
+}
+
+/* print out interest information on a set */
+fprint_set(f,s)
+FILE *f;
+set s;
+{
+       unsigned int *x;
+       
+       fprintf(f, "n = %d,", s.n);
+       if (s.setword){
+               fprintf(f, "setword = %x,   ", s.setword);
+               /* print out all the elements in the set */
+               x = set_pdq(s);
+               while (*x!=nil){
+                       fprintf(f, "%d ", *x);
+                       ++x;
+               }
+       }else{
+               fprintf(f, "setword = (nil)");
+       }
+}
+
+/* code to be able to dump out the nfas
+return 0 if okay dump
+return 1 if screwed up
+*/
+int dump_nfas(first_node, last_node)
+int first_node;
+int last_node;
+{
+       register int i;
+       nfa_node *t;
+       
+       for (i=first_node; i<=last_node; ++i){
+               t = NFA(i);
+               if (!t) break;
+               fprintf(stderr, "nfa_node %d {\n", t->node_no);
+               fprintf(stderr, "\n\tnfa_set = %d\n", t->nfa_set);
+               fprintf(stderr, "\taccept\t=\t%d\n", t->accept);
+               fprintf(stderr, "\ttrans\t=\t(");
+               fprint_dfa_pair(stderr, t->trans[0]);
+               fprintf(stderr, ",");
+               fprint_dfa_pair(stderr, t->trans[1]);
+               fprintf(stderr, ")\n");
+               fprintf(stderr, "\tlabel\t=\t{ ");
+               fprint_set(stderr, t->label);
+               fprintf(stderr, "\t}\n");
+               fprintf(stderr, "}\n\n");
+       }
+       return 0;
+}
+#endif
+
+/* DLG-specific syntax error message generator 
+* (define USER_ZZSYN when compiling so don't get 2 definitions)
+*/
+void
+#ifdef __STDC__
+zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, char *bad_text)
+#else
+zzsyn(text, tok, egroup, eset, etok, k, bad_text)
+char *text, *egroup, *bad_text;
+int tok;
+int etok;
+int k;
+SetWordType *eset;
+#endif
+{
+fprintf(stderr, ErrHdr, file_str[0]!=NULL?file_str[0]:"stdin", zzline);
+fprintf(stderr, " syntax error at \"%s\"", (tok==zzEOF_TOKEN)?"EOF":text);
+if ( !etok && !eset ) {fprintf(stderr, "\n"); return;}
+if ( k==1 ) fprintf(stderr, " missing");
+else
+{
+fprintf(stderr, "; \"%s\" not", bad_text);
+if ( zzset_deg(eset)>1 ) fprintf(stderr, " in");
+}
+if ( zzset_deg(eset)>0 ) zzedecode(eset);
+else fprintf(stderr, " %s", zztokens[etok]);
+if ( strlen(egroup) > (size_t)0 ) fprintf(stderr, " in %s", egroup);
+fprintf(stderr, "\n");
+}
diff --git a/dlg/mode.h b/dlg/mode.h
new file mode 100755 (executable)
index 0000000..db1b851
--- /dev/null
@@ -0,0 +1,2 @@
+#define START 0
+#define ACT 1
diff --git a/dlg/parser.dlg b/dlg/parser.dlg
new file mode 100755 (executable)
index 0000000..e69de29