From 56dd00148e59773742903ee71be791eaa49a8616 Mon Sep 17 00:00:00 2001 From: Terence Parr <> Date: Thu, 5 Oct 1995 19:40:14 -0500 Subject: [PATCH] auto commit for import --- antlr/antlr.c | 2534 +++++++++++++++++++++ antlr/mode.h | 12 + antlr/parser.dlg | 0 antlr/scan.c | 4343 ++++++++++++++++++++++++++++++++++++ support/genmk/genmk.c | 681 ++++++ support/genmk/watgenmk.mak | 54 + support/rexpr/makefile | 19 + support/rexpr/rexpr.c | 526 +++++ support/rexpr/rexpr.h | 30 + support/rexpr/test.c | 19 + support/set/set.c | 792 +++++++ support/set/set.h | 114 + support/sym/template.h | 41 + 13 files changed, 9165 insertions(+) create mode 100755 antlr/antlr.c create mode 100755 antlr/mode.h create mode 100755 antlr/parser.dlg create mode 100755 antlr/scan.c create mode 100755 support/genmk/genmk.c create mode 100755 support/genmk/watgenmk.mak create mode 100755 support/rexpr/makefile create mode 100755 support/rexpr/rexpr.c create mode 100755 support/rexpr/rexpr.h create mode 100755 support/rexpr/test.c create mode 100755 support/set/set.c create mode 100755 support/set/set.h create mode 100755 support/sym/template.h diff --git a/antlr/antlr.c b/antlr/antlr.c new file mode 100755 index 0000000..cb0dbfa --- /dev/null +++ b/antlr/antlr.c @@ -0,0 +1,2534 @@ +/* + * 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 +#define ANTLR_VERSION 132 + +#ifdef __cplusplus +#ifndef __STDC__ +#define __STDC__ +#endif +#endif +#include "set.h" +#include +#include "syn.h" +#include "hash.h" +#include "generic.h" +#define zzcr_attr(attr,tok,t) +#define zzSET_SIZE 20 +#include "antlr.h" +#include "tokens.h" +#include "dlgdef.h" +#include "mode.h" +#ifndef PURIFY +#define PURIFY(r,s) +#endif +ANTLR_INFO + +#ifdef __STDC__ +static void chkToken(char *, char *, char *, int); +#else +static void chkToken(); +#endif + +static int class_nest_level = 0; +extern int inAlt; +extern set attribsRefdFromAction; +extern int UsedOldStyleAttrib; +extern int UsedNewStyleLabel; + +void +#ifdef __STDC__ +grammar(void) +#else +grammar() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + Graph g; + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( 1 ) { + if ( !((setwd1[LA(1)]&0x1))) break; + if ( (LA(1)==88) ) { + zzmatch(88); zzCONSUME; + zzmatch(Action); + + if ( HdrAction==NULL ) { + HdrAction = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(HdrAction!=NULL, "rule grammar: cannot allocate header action"); + strcpy(HdrAction, LATEXT(1)); + } + else warn("additional #header statement ignored"); + zzCONSUME; + + } + else { + if ( (LA(1)==89) ) { + zzmatch(89); zzCONSUME; + zzmatch(QuotedTerm); + + if ( GenCC ) { + warn("#parser meta-op incompatible with -CC; ignored"); + } + else { + if ( strcmp(ParserName,"zzparser")==0 ) { + ParserName=StripQuotes(mystrdup(LATEXT(1))); + if ( RulePrefix[0]!='\0' ) + { + warn("#parser meta-op incompatible with '-gp prefix'; '-gp' ignored"); + RulePrefix[0]='\0'; + } + } + else warn("additional #parser statement ignored"); + } + zzCONSUME; + + } + else { + if ( (LA(1)==90) ) { + zzmatch(90); zzCONSUME; + zzmatch(QuotedTerm); + { + char *fname; + zzantlr_state st; FILE *f; struct zzdlg_state dst; + UserTokenDefsFile = mystrdup(LATEXT(1)); + zzsave_antlr_state(&st); + zzsave_dlg_state(&dst); + fname = mystrdup(LATEXT(1)); + f = fopen(StripQuotes(fname), "r"); + if ( f==NULL ) {warn(eMsg1("cannot open token defs file '%s'", fname+1));} + else { + ANTLRm(enum_file(fname+1), f, PARSE_ENUM_FILE); + UserDefdTokens = 1; + } + zzrestore_antlr_state(&st); + zzrestore_dlg_state(&dst); + } + zzCONSUME; + + } + } + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( 1 ) { + if ( !((setwd1[LA(1)]&0x2))) break; + if ( (LA(1)==Action) ) { + zzmatch(Action); + { + UserAction *ua = newUserAction(LATEXT(1)); + ua->file = action_file; ua->line = action_line; + if ( class_nest_level>0 ) list_add(&class_before_actions, ua); + else list_add(&BeforeActions, ua); + } + zzCONSUME; + + } + else { + if ( (LA(1)==101) ) { + laction(); + } + else { + if ( (LA(1)==102) ) { + aLexclass(); + } + else { + if ( (LA(1)==105) ) { + token(); + } + else { + if ( (LA(1)==103) ) { + error(); + } + else { + if ( (LA(1)==104) ) { + tclass(); + } + else { + if ( (LA(1)==122) ) { + default_exception_handler(); + } + else { + if ( (LA(1)==92) ) { + class_def(); + } + else { + if ( (LA(1)==91) ) { + zzmatch(91); + + if ( class_nest_level==0 ) + warn("missing class definition for trailing '}'"); + class_nest_level--; + zzCONSUME; + + } + } + } + } + } + } + } + } + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + rule(); + g=zzaArg(zztasp1,3); SynDiag = (Junction *) zzaArg(zztasp1,3 ).left; + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( 1 ) { + if ( !((setwd1[LA(1)]&0x4))) break; + if ( (LA(1)==NonTerminal) ) { + rule(); + if ( zzaArg(zztasp2,1 ).left!=NULL ) {g.right = NULL; g = Or(g, zzaArg(zztasp2,1));} + } + else { + if ( (LA(1)==102) ) { + aLexclass(); + } + else { + if ( (LA(1)==105) ) { + token(); + } + else { + if ( (LA(1)==103) ) { + error(); + } + else { + if ( (LA(1)==104) ) { + tclass(); + } + else { + if ( (LA(1)==92) ) { + class_def(); + } + else { + if ( (LA(1)==91) ) { + zzmatch(91); + + if ( class_nest_level==0 ) + warn("missing class definition for trailing '}'"); + class_nest_level--; + zzCONSUME; + + } + } + } + } + } + } + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( 1 ) { + if ( !((setwd1[LA(1)]&0x8))) break; + if ( (LA(1)==Action) ) { + zzmatch(Action); + { + UserAction *ua = newUserAction(LATEXT(1)); + ua->file = action_file; ua->line = action_line; + if ( class_nest_level>0 ) list_add(&class_after_actions, ua); + else list_add(&AfterActions, ua); + } + zzCONSUME; + + } + else { + if ( (LA(1)==101) ) { + laction(); + } + else { + if ( (LA(1)==103) ) { + error(); + } + else { + if ( (LA(1)==104) ) { + tclass(); + } + else { + if ( (LA(1)==92) ) { + class_def(); + } + else { + if ( (LA(1)==91) ) { + zzmatch(91); + + if ( class_nest_level==0 ) + warn("missing class definition for trailing '}'"); + class_nest_level--; + zzCONSUME; + + } + } + } + } + } + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + zzmatch(Eof); zzCONSUME; + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd1, 0x10); + } +} + +void +#ifdef __STDC__ +class_def(void) +#else +class_def() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + int go=1; char name[MaxRuleName+1]; + zzmatch(92); zzCONSUME; + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==NonTerminal) ) { + zzmatch(NonTerminal); + if(go) strncpy(name,LATEXT(1),MaxRuleName); + zzCONSUME; + + } + else { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + if(go) strncpy(name,LATEXT(1),MaxRuleName); + zzCONSUME; + + } + else {zzFAIL(1,zzerr1,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp2); + } + } + + if ( CurrentClassName[0]!='\0' && strcmp(CurrentClassName,name)!=0 + && GenCC ) { + err("only one grammar class allowed in this release"); + go = 0; + } + else strcpy(CurrentClassName, name); + if ( !GenCC ) { err("class meta-op used without C++ option"); } + zzmatch(95); + + no_classes_found = 0; + if ( class_nest_level>=1 ) {warn("cannot have nested classes");} + else class_nest_level++; + zzCONSUME; + + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd1, 0x20); + } +} + +void +#ifdef __STDC__ +rule(void) +#else +rule() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + + ListNode *ex_groups = NULL; + ExceptionGroup *eg; + RuleEntry *q; Junction *p; Graph r; int f, l; ECnode *e; + set toksrefd, rulesrefd; + char *pdecl=NULL, *ret=NULL, *a; CurRetDef = CurParmDef = NULL; + CurExGroups = NULL; + CurElementLabels = NULL; + /* We want a new element label hash table for each rule */ + if ( Elabel!=NULL ) killHashTable(Elabel); + Elabel = newHashTable(); + attribsRefdFromAction = empty; + zzmatch(NonTerminal); + q=NULL; + if ( hash_get(Rname, LATEXT(1))!=NULL ) { + err(eMsg1("duplicate rule definition: '%s'",LATEXT(1))); + CannotContinue=TRUE; + } + else + { + q = (RuleEntry *)hash_add(Rname, + LATEXT(1), + (Entry *)newRuleEntry(LATEXT(1))); + CurRule = q->str; + } + CurRuleNode = q; + f = CurFile; l = zzline; + NumRules++; + zzCONSUME; + + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==96) ) { + zzmatch(96); + if ( q!=NULL ) q->noAST = TRUE; + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + ; + if ( (setwd1[LA(1)]&0x40) ) { + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==97) ) { + zzmatch(97); zzCONSUME; + } + zzEXIT(zztasp3); + } + } + zzmatch(PassAction); + pdecl = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(pdecl!=NULL, "rule rule: cannot allocate param decl"); + strcpy(pdecl, LATEXT(1)); + CurParmDef = pdecl; + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==98) ) { + zzmatch(98); zzCONSUME; + zzmatch(PassAction); + ret = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(ret!=NULL, "rule rule: cannot allocate ret type"); + strcpy(ret, LATEXT(1)); + CurRetDef = ret; + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + if ( q!=NULL ) q->egroup=mystrdup(LATEXT(1)); + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + + if ( GenEClasseForRules && q!=NULL ) { + e = newECnode; + require(e!=NULL, "cannot allocate error class node"); + if ( q->egroup == NULL ) {a = q->str; a[0] = (char)toupper(a[0]);} + else a = q->egroup; + if ( Tnum( a ) == 0 ) + { + e->tok = addTname( a ); + list_add(&eclasses, (char *)e); + if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]); + /* refers to itself */ + list_add(&(e->elist), mystrdup(q->str)); + } + else { + warn(eMsg1("default errclass for '%s' would conflict with token/errclass/tokclass",a)); + if ( q->egroup == NULL ) a[0] = (char)tolower(a[0]); + free((char *)e); + } + } + BlkLevel++; + zzmatch(99); + inAlt=1; + zzCONSUME; + + block( &toksrefd, &rulesrefd ); + r = makeBlk(zzaArg(zztasp1,7),0); + CurRuleBlk = (Junction *)r.left; + CurRuleBlk->blockid = CurBlockID; + CurRuleBlk->jtype = RuleBlk; + if ( q!=NULL ) CurRuleBlk->rname = q->str; + CurRuleBlk->file = f; + CurRuleBlk->line = l; + CurRuleBlk->pdecl = pdecl; + CurRuleBlk->ret = ret; + CurRuleBlk->lock = makelocks(); + CurRuleBlk->pred_lock = makelocks(); + CurRuleBlk->tokrefs = toksrefd; + CurRuleBlk->rulerefs = rulesrefd; + p = newJunction(); /* add EndRule Node */ + ((Junction *)r.right)->p1 = (Node *)p; + r.right = (Node *) p; + p->jtype = EndRule; + p->lock = makelocks(); + p->pred_lock = makelocks(); + CurRuleBlk->end = p; + if ( q!=NULL ) q->rulenum = NumRules; + zzaArg(zztasp1,7) = r; + --BlkLevel; + zzmatch(100); + inAlt=0; + zzCONSUME; + + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==Action) ) { + zzmatch(Action); + a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(a!=NULL, "rule rule: cannot allocate error action"); + strcpy(a, LATEXT(1)); + CurRuleBlk->erraction = a; + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( (LA(1)==122) ) { + eg = exception_group(); + + if ( eg!=NULL ) { + list_add(&CurExGroups, (void *)eg); + if ( eg->label=='\0' ) q->has_rule_exception = 1; + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + if ( q==NULL ) zzaArg(zztasp1,0 ).left = NULL; else zzaArg(zztasp1,0) = zzaArg(zztasp1,7); + CurRuleNode = NULL; + CurRuleBlk->exceptions = CurExGroups; + CurRuleBlk->el_labels = CurElementLabels; + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd1, 0x80); + } +} + +void +#ifdef __STDC__ +laction(void) +#else +laction() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + char *a; + zzmatch(101); zzCONSUME; + zzmatch(Action); + + a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(a!=NULL, "rule laction: cannot allocate action"); + strcpy(a, LATEXT(1)); + list_add(&LexActions, a); + zzCONSUME; + + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd2, 0x1); + } +} + +void +#ifdef __STDC__ +aLexclass(void) +#else +aLexclass() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + zzmatch(102); zzCONSUME; + zzmatch(TokenTerm); + lexclass(mystrdup(LATEXT(1))); + zzCONSUME; + + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd2, 0x2); + } +} + +void +#ifdef __STDC__ +error(void) +#else +error() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + char *t=NULL; ECnode *e; int go=1; TermEntry *p; + zzmatch(103); zzCONSUME; + { + zzBLOCK(zztasp2); + zzMake0; + { + ; + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else {zzFAIL(1,zzerr2,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp2); + } + } + e = newECnode; + require(e!=NULL, "cannot allocate error class node"); + e->lexclass = CurrentLexClass; + if ( Tnum( (t=StripQuotes(t)) ) == 0 ) + { + if ( hash_get(Texpr, t) != NULL ) + warn(eMsg1("errclass name conflicts with regular expression '%s'",t)); + e->tok = addTname( t ); + set_orel(e->tok, &imag_tokens); + require((p=(TermEntry *)hash_get(Tname, t)) != NULL, + "hash table mechanism is broken"); + p->classname = 1; /* entry is errclass name, not token */ + list_add(&eclasses, (char *)e); + } + else + { + warn(eMsg1("redefinition of errclass or conflict w/token or tokclass '%s'; ignored",t)); + free( (char *)e ); + go=0; +} + zzmatch(95); zzCONSUME; + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==NonTerminal) ) { + zzmatch(NonTerminal); + if ( go ) t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + if ( go ) t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + if ( go ) t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else {zzFAIL(1,zzerr3,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + zzEXIT(zztasp2); + } + } + if ( go ) list_add(&(e->elist), t); + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( (setwd2[LA(1)]&0x4) ) { + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==NonTerminal) ) { + zzmatch(NonTerminal); + if ( go ) t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + if ( go ) t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + if ( go ) t=mystrdup(LATEXT(1)); + zzCONSUME; + + } + else {zzFAIL(1,zzerr4,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + zzEXIT(zztasp3); + } + } + if ( go ) list_add(&(e->elist), t); + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + zzmatch(91); zzCONSUME; + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd2, 0x8); + } +} + +void +#ifdef __STDC__ +tclass(void) +#else +tclass() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + char *t=NULL; TCnode *e; int go=1,tok; TermEntry *p, *term; + zzmatch(104); zzCONSUME; + zzmatch(TokenTerm); + t=mystrdup(LATEXT(1)); + zzCONSUME; + + e = newTCnode; + require(e!=NULL, "cannot allocate token class node"); + e->lexclass = CurrentLexClass; + if ( Tnum( t ) == 0 ) + { + e->tok = addTname( t ); + set_orel(e->tok, &imag_tokens); + set_orel(e->tok, &tokclasses); + require((p=(TermEntry *)hash_get(Tname, t)) != NULL, + "hash table mechanism is broken"); + p->classname = 1; /* entry is class name, not token */ + p->tclass = e; /* save ptr to this tclass def */ + list_add(&tclasses, (char *)e); + } + else + { + warn(eMsg1("redefinition of tokclass or conflict w/token '%s'; ignored",t)); + free( (char *)e ); + go=0; +} + zzmatch(95); zzCONSUME; + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( (setwd2[LA(1)]&0x10) ) { + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + if ( go ) { + term = (TermEntry *) hash_get(Tname, LATEXT(1)); + if ( term==NULL && UserDefdTokens ) { + err("implicit token definition not allowed with #tokdefs"); + go = 0; + } + else {t=mystrdup(LATEXT(1)); tok=addTname(LATEXT(1));} + } + zzCONSUME; + + } + else { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + if ( go ) { + term = (TermEntry *) hash_get(Texpr, LATEXT(1)); + if ( term==NULL && UserDefdTokens ) { + err("implicit token definition not allowed with #tokdefs"); + go = 0; + } + else {t=mystrdup(LATEXT(1)); tok=addTexpr(LATEXT(1));} + } + zzCONSUME; + + } + else {zzFAIL(1,zzerr5,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp3); + } + } + if ( go ) list_add(&(e->tlist), t); + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + zzmatch(91); zzCONSUME; + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd2, 0x20); + } +} + +void +#ifdef __STDC__ +token(void) +#else +token() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + char *t=NULL, *e=NULL, *a=NULL; int tnum=0; + zzmatch(105); zzCONSUME; + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + t=mystrdup(LATEXT(1)); + zzCONSUME; + + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==106) ) { + zzmatch(106); zzCONSUME; + zzmatch(107); + tnum = atoi(LATEXT(1)); + zzCONSUME; + + } + zzEXIT(zztasp3); + } + } + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + e=mystrdup(LATEXT(1)); + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==Action) ) { + zzmatch(Action); + + a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(a!=NULL, "rule token: cannot allocate action"); + strcpy(a, LATEXT(1)); + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + chkToken(t, e, a, tnum); + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd2, 0x40); + } +} + +void +#ifdef __STDC__ +block( set *toksrefd, set *rulesrefd ) +#else +block(toksrefd,rulesrefd) + set *toksrefd; +set *rulesrefd ; +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + + Graph g, b; + set saveblah; + int saveinalt = inAlt; + ExceptionGroup *eg; + * toksrefd = empty; + * rulesrefd = empty; + set_clr(AST_nodes_refd_in_actions); + CurBlockID++; + CurAltNum = 1; + saveblah = attribsRefdFromAction; + attribsRefdFromAction = empty; + alt( toksrefd,rulesrefd ); + b = g = zzaArg(zztasp1,1); + + if ( ((Junction *)g.left)->p1->ntype == nAction ) + { + if ( !((ActionNode *)(((Junction *)g.left)->p1))->is_predicate ) + { + ((ActionNode *)(((Junction *)g.left)->p1))->init_action = TRUE; + } + } + ((Junction *)g.left)->blockid = CurBlockID; + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( (LA(1)==122) ) { + eg = exception_group(); + + + if ( eg!=NULL ) { + eg->altID = makeAltID(CurBlockID,CurAltNum); + CurAltStart->exception_label = eg->altID; + list_add(&CurExGroups, (void *)eg); + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + CurAltNum++; + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( (LA(1)==108) ) { + zzmatch(108); + inAlt=1; + zzCONSUME; + + alt( toksrefd,rulesrefd ); + g = Or(g, zzaArg(zztasp2,2)); + + ((Junction *)g.left)->blockid = CurBlockID; + { + zzBLOCK(zztasp3); + zzMake0; + { + while ( (LA(1)==122) ) { + eg = exception_group(); + + + if ( eg!=NULL ) { + eg->altID = makeAltID(CurBlockID,CurAltNum); + CurAltStart->exception_label = eg->altID; + list_add(&CurExGroups, (void *)eg); + } + zzLOOP(zztasp3); + } + zzEXIT(zztasp3); + } + } + CurAltNum++; + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + zzaArg(zztasp1,0) = b; + attribsRefdFromAction = saveblah; inAlt = saveinalt; + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd2, 0x80); + } +} + +void +#ifdef __STDC__ +alt( set *toksrefd, set *rulesrefd ) +#else +alt(toksrefd,rulesrefd) + set *toksrefd; +set *rulesrefd ; +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + int n=0,ne=0; Graph g; int e_num=0, not=0; Node *node; set elems, dif; + int first_on_line = 1, use_def_MT_handler = 0; + g.left=NULL; g.right=NULL; + CurAltStart = NULL; + elems = empty; + inAlt = 1; + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==84) ) { + zzmatch(84); + use_def_MT_handler = 1; + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + int tok; + while ( (setwd3[LA(1)]&0x1) ) { + { + zzBLOCK(zztasp3); + zzMake0; + { + not=0; + if ( (LA(1)==109) ) { + zzmatch(109); + not=1; + zzCONSUME; + + } + zzEXIT(zztasp3); + } + } + node = element( not, first_on_line, use_def_MT_handler ); + + if ( node!=NULL && node->ntype!=nAction ) first_on_line = 0; + + if ( zzaArg(zztasp2,2 ).left!=NULL ) { + g = Cat(g, zzaArg(zztasp2,2)); + n++; + if ( node!=NULL ) { + if ( node->ntype!=nAction ) e_num++; + /* record record number of all rule and token refs */ + if ( node->ntype==nToken ) { + TokNode *tk = (TokNode *)((Junction *)zzaArg(zztasp2,2 ).left)->p1; + tk->elnum = e_num; + set_orel(e_num, &elems); + } + else if ( node->ntype==nRuleRef ) { + RuleRefNode *rn = (RuleRefNode *)((Junction *)zzaArg(zztasp2,2 ).left)->p1; + rn->elnum = e_num; + set_orel(e_num, rulesrefd); + } + } + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + if ( n == 0 ) g = emptyAlt(); + zzaArg(zztasp1,0) = g; + /* We want to reduce number of LT(i) calls and the number of + * local attribute variables in C++ mode (for moment, later we'll + * do for C also). However, if trees are being built, they + * require most of the attrib variables to create the tree nodes + * with; therefore, we gen a token ptr for each token ref in C++ + */ + if ( GenCC && !GenAST ) + { + /* This now free's the temp set -ATG 5/6/95 */ + set temp; + temp = set_and(elems, attribsRefdFromAction); + set_orin( toksrefd, temp); + set_free(temp); +} +else set_orin( toksrefd, elems); +if ( GenCC ) { + dif = set_dif(attribsRefdFromAction, elems); + if ( set_deg(dif)>0 ) + err("one or more $i in action(s) refer to non-token elements"); + set_free(dif); +} +set_free(elems); +set_free(attribsRefdFromAction); +inAlt = 0; + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd3, 0x2); + } +} + + LabelEntry * +#ifdef __STDC__ +element_label(void) +#else +element_label() +#endif +{ + LabelEntry * _retv; + PURIFY(_retv,sizeof( LabelEntry * )) + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + TermEntry *t=NULL; LabelEntry *l=NULL; RuleEntry *r=NULL; char *lab; + zzmatch(LABEL); + lab = mystrdup(LATEXT(1)); + zzCONSUME; + + + UsedNewStyleLabel = 1; + if ( UsedOldStyleAttrib ) err("cannot mix with new-style labels with old-style $i"); + t = (TermEntry *) hash_get(Tname, lab); + if ( t==NULL ) t = (TermEntry *) hash_get(Texpr, lab); + if ( t==NULL ) r = (RuleEntry *) hash_get(Rname, lab); + if ( t!=NULL ) { + err(eMsg1("label definition clashes with token/tokclass definition: '%s'", lab)); + _retv = NULL; + } + else if ( r!=NULL ) { + err(eMsg1("label definition clashes with rule definition: '%s'", lab)); + _retv = NULL; + } + else { + /* we don't clash with anybody else */ + l = (LabelEntry *) hash_get(Elabel, lab); + if ( l==NULL ) { /* ok to add new element label */ + l = (LabelEntry *)hash_add(Elabel, + lab, + (Entry *)newLabelEntry(lab)); + /* add to list of element labels for this rule */ + list_add(&CurElementLabels, (void *)lab); + _retv = l; + } + else { + err(eMsg1("label definitions must be unique per rule: '%s'", lab)); + _retv = NULL; +} +} + zzmatch(99); zzCONSUME; + zzEXIT(zztasp1); + return _retv; +fail: + zzEXIT(zztasp1); + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd3, 0x4); + return _retv; + } +} + + Node * +#ifdef __STDC__ +element( int not, int first_on_line, int use_def_MT_handler ) +#else +element(not,first_on_line,use_def_MT_handler) + int not; +int first_on_line; +int use_def_MT_handler ; +#endif +{ + Node * _retv; + PURIFY(_retv,sizeof( Node * )) + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + + Attrib blk; + Predicate *pred = NULL; + int local_use_def_MT_handler=0; + ActionNode *act; + RuleRefNode *rr; + set toksrefd, rulesrefd; + TermEntry *term; + TokNode *p=NULL; RuleRefNode *q; int approx=0; + LabelEntry *label=NULL; + _retv = NULL; + if ( (setwd3[LA(1)]&0x8) ) { + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==LABEL) ) { + label = element_label(); + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + + term = (TermEntry *) hash_get(Tname, LATEXT(1)); + if ( term==NULL && UserDefdTokens ) { + err("implicit token definition not allowed with #tokdefs"); + zzaRet.left = zzaRet.right = NULL; + } + else { + zzaRet = buildToken(LATEXT(1)); + p=((TokNode *)((Junction *)zzaRet.left)->p1); + term = (TermEntry *) hash_get(Tname, LATEXT(1)); + require( term!= NULL, "hash table mechanism is broken"); + p->tclass = term->tclass; + p->complement = not; + if ( label!=NULL ) { + p->el_label = label->str; + label->elem = (Node *)p; + } + } + zzCONSUME; + + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==110) ) { + zzmatch(110); zzCONSUME; + { + zzBLOCK(zztasp4); + zzMake0; + { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + if ( p!=NULL ) setUpperRange(p, LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + if ( p!=NULL ) setUpperRange(p, LATEXT(1)); + zzCONSUME; + + } + else {zzFAIL(1,zzerr6,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp4); + } + } + } + zzEXIT(zztasp3); + } + } + + if ( p!=NULL && (p->upper_range!=0 || p->tclass || not) ) + list_add(&MetaTokenNodes, (void *)p); + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==111) ) { + zzmatch(111); + if ( p!=NULL ) p->astnode=ASTroot; + zzCONSUME; + + } + else { + if ( (setwd3[LA(1)]&0x10) ) { + if ( p!=NULL ) p->astnode=ASTchild; + } + else { + if ( (LA(1)==96) ) { + zzmatch(96); + if ( p!=NULL ) p->astnode=ASTexclude; + zzCONSUME; + + } + else {zzFAIL(1,zzerr7,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + zzEXIT(zztasp3); + } + } + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==84) ) { + zzmatch(84); + local_use_def_MT_handler = 1; + zzCONSUME; + + } + zzEXIT(zztasp3); + } + } + + if ( p!=NULL && first_on_line ) { + CurAltStart = (Junction *)zzaRet.left; + p->altstart = CurAltStart; + } + if ( p!=NULL ) + p->use_def_MT_handler = use_def_MT_handler || local_use_def_MT_handler; + _retv = (Node *)p; + } + else { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + + term = (TermEntry *) hash_get(Texpr, LATEXT(1)); + if ( term==NULL && UserDefdTokens ) { + err("implicit token definition not allowed with #tokdefs"); + zzaRet.left = zzaRet.right = NULL; + } + else { + zzaRet = buildToken(LATEXT(1)); p=((TokNode *)((Junction *)zzaRet.left)->p1); + p->complement = not; + if ( label!=NULL ) { + p->el_label = label->str; + label->elem = (Node *)p; + } + } + zzCONSUME; + + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==110) ) { + zzmatch(110); zzCONSUME; + { + zzBLOCK(zztasp4); + zzMake0; + { + if ( (LA(1)==QuotedTerm) ) { + zzmatch(QuotedTerm); + if ( p!=NULL ) setUpperRange(p, LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + if ( p!=NULL ) setUpperRange(p, LATEXT(1)); + zzCONSUME; + + } + else {zzFAIL(1,zzerr8,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp4); + } + } + } + zzEXIT(zztasp3); + } + } + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==111) ) { + zzmatch(111); + if ( p!=NULL ) p->astnode=ASTroot; + zzCONSUME; + + } + else { + if ( (setwd3[LA(1)]&0x20) ) { + if ( p!=NULL ) p->astnode=ASTchild; + } + else { + if ( (LA(1)==96) ) { + zzmatch(96); + if ( p!=NULL ) p->astnode=ASTexclude; + zzCONSUME; + + } + else {zzFAIL(1,zzerr9,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + zzEXIT(zztasp3); + } + } + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==84) ) { + zzmatch(84); + local_use_def_MT_handler = 1; + zzCONSUME; + + } + zzEXIT(zztasp3); + } + } + + if ( p!=NULL && (p->upper_range!=0 || p->tclass || not) ) + list_add(&MetaTokenNodes, (void *)p); + + if ( first_on_line ) { + CurAltStart = (Junction *)zzaRet.left; + p->altstart = CurAltStart; + } + if ( p!=NULL ) + p->use_def_MT_handler = use_def_MT_handler || local_use_def_MT_handler; + _retv = (Node *)p; + } + else { + if ( (LA(1)==WildCard) ) { + if ( not ) warn("~ WILDCARD is an undefined operation (implies 'nothing')"); + zzmatch(WildCard); + zzaRet = buildWildCard(LATEXT(1)); p=((TokNode *)((Junction *)zzaRet.left)->p1); + zzCONSUME; + + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==111) ) { + zzmatch(111); + p->astnode=ASTroot; + zzCONSUME; + + } + else { + if ( (setwd3[LA(1)]&0x40) ) { + p->astnode=ASTchild; + } + else { + if ( (LA(1)==96) ) { + zzmatch(96); + p->astnode=ASTexclude; + zzCONSUME; + + } + else {zzFAIL(1,zzerr10,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + zzEXIT(zztasp3); + } + } + list_add(&MetaTokenNodes, (void *)p); + + if ( first_on_line ) { + CurAltStart = (Junction *)zzaRet.left; + p->altstart = CurAltStart; + if ( label!=NULL ) { + p->el_label = label->str; + label->elem = (Node *)p; + } + } + _retv = (Node *)p; + } + else { + if ( (LA(1)==NonTerminal) ) { + if ( not ) warn("~ NONTERMINAL is an undefined operation"); + zzmatch(NonTerminal); + zzaRet = buildRuleRef(LATEXT(1)); + zzCONSUME; + + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==96) ) { + zzmatch(96); + q = (RuleRefNode *) ((Junction *)zzaRet.left)->p1; + q->astnode=ASTexclude; + zzCONSUME; + + } + zzEXIT(zztasp3); + } + } + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (setwd3[LA(1)]&0x80) ) { + { + zzBLOCK(zztasp4); + zzMake0; + { + if ( (LA(1)==97) ) { + zzmatch(97); zzCONSUME; + } + zzEXIT(zztasp4); + } + } + zzmatch(PassAction); + addParm(((Junction *)zzaRet.left)->p1, LATEXT(1)); + zzCONSUME; + + } + zzEXIT(zztasp3); + } + } + rr=(RuleRefNode *) ((Junction *)zzaRet.left)->p1; + { + zzBLOCK(zztasp3); + zzMake0; + { + char *a; + if ( (LA(1)==98) ) { + zzmatch(98); zzCONSUME; + zzmatch(PassAction); + + a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(a!=NULL, "rule element: cannot allocate assignment"); + strcpy(a, LATEXT(1)); + rr->assign = a; + zzCONSUME; + + } + zzEXIT(zztasp3); + } + } + + if ( label!=NULL ) { + rr->el_label = label->str; + label->elem = (Node *)rr; + } + if ( first_on_line ) { + CurAltStart = (Junction *)zzaRet.left; + ((RuleRefNode *)((Junction *)zzaRet.left)->p1)->altstart = CurAltStart; + } + _retv = (Node *)rr; + } + else {zzFAIL(1,zzerr11,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + } + zzEXIT(zztasp2); + } + } + } + else { + if ( (LA(1)==Action) ) { + if ( not ) warn("~ ACTION is an undefined operation"); + zzmatch(Action); + zzaArg(zztasp1,0) = buildAction(LATEXT(1),action_file,action_line, 0); + zzCONSUME; + + if ( first_on_line ) CurAltStart = (Junction *)zzaArg(zztasp1,0 ).left; + _retv = (Node *) ((Junction *)zzaArg(zztasp1,0 ).left)->p1; + } + else { + if ( (LA(1)==Pred) ) { + if ( not ) warn("~ SEMANTIC-PREDICATE is an undefined operation"); + zzmatch(Pred); + zzaArg(zztasp1,0) = buildAction(LATEXT(1),action_file,action_line, 1); + zzCONSUME; + + act = (ActionNode *) ((Junction *)zzaArg(zztasp1,0 ).left)->p1; + { + zzBLOCK(zztasp2); + zzMake0; + { + char *a; + if ( (LA(1)==PassAction) ) { + zzmatch(PassAction); + + a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(a!=NULL, "rule element: cannot allocate predicate fail action"); + strcpy(a, LATEXT(1)); + act->pred_fail = a; + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + if ( first_on_line ) CurAltStart = (Junction *)zzaArg(zztasp1,0 ).left; + _retv = (Node *)act; + } + else { + if ( (setwd4[LA(1)]&0x1) ) { + if ( not ) warn("~ BLOCK is an undefined operation"); + BlkLevel++; + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==112) ) { + zzmatch(112); zzCONSUME; + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==113) ) { + zzmatch(113); + approx=LL_k; + zzCONSUME; + + } + else { + if ( (LA(1)==114) ) { + zzmatch(114); + approx = 1; + zzCONSUME; + + } + else { + if ( (LA(1)==115) ) { + zzmatch(115); + approx = 2; + zzCONSUME; + + } + else {zzFAIL(1,zzerr12,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + zzEXIT(zztasp3); + } + } + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==116) ) { + zzmatch(116); zzCONSUME; + block( &toksrefd,&rulesrefd ); + zzmatch(117); + blk = zzaRet = zzaArg(zztasp2,2); --BlkLevel; + zzCONSUME; + + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==118) ) { + zzmatch(118); + zzaRet = makeLoop(zzaRet,approx); + zzCONSUME; + + } + else { + if ( (LA(1)==119) ) { + zzmatch(119); + zzaRet = makePlus(zzaRet,approx); + zzCONSUME; + + } + else { + if ( (LA(1)==120) ) { + zzmatch(120); zzCONSUME; + { + zzBLOCK(zztasp4); + zzMake0; + { + if ( (LA(1)==121) ) { + zzmatch(121); zzCONSUME; + zzmatch(Pred); + zzaRet = buildAction(LATEXT(1),action_file,action_line,1); + zzCONSUME; + + act = (ActionNode *) ((Junction *)zzaRet.left)->p1; + { + zzBLOCK(zztasp5); + zzMake0; + { + char *a; + if ( (LA(1)==PassAction) ) { + zzmatch(PassAction); + + a = (char *)calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(a!=NULL, "rule element: cannot allocate predicate fail action"); + strcpy(a, LATEXT(1)); + act->pred_fail = a; + zzCONSUME; + + } + zzEXIT(zztasp5); + } + } + if ( first_on_line) CurAltStart=(Junction *)zzaRet.left; + _retv = (Node *)act; + + pred = computePredicateFromContextGuard(blk); + if ( pred==NULL ) + err("invalid or missing context guard"); + else { + pred->expr = act->action; + pred->source = act; + act->guardpred = pred; + } + } + else { + if ( (setwd4[LA(1)]&0x2) ) { + zzaRet = makeBlk(zzaRet,approx); + FoundGuessBlk = 1; + ((Junction *) ((Junction *)zzaRet.left)->p1)->guess=1; + if ( ! first_on_line ) { + err("(...)? predicate must be first element of production"); + } + } + else {zzFAIL(1,zzerr13,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp4); + } + } + } + else { + if ( (setwd4[LA(1)]&0x4) ) { + zzaRet = makeBlk(zzaRet,approx); + } + else {zzFAIL(1,zzerr14,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + } + zzEXIT(zztasp3); + } + } + + if ( pred==NULL ) { + ((Junction *)((Junction *)zzaRet.left)->p1)->blockid = CurBlockID; + ((Junction *)((Junction *)zzaRet.left)->p1)->tokrefs = toksrefd; + ((Junction *)((Junction *)zzaRet.left)->p1)->rulerefs = rulesrefd; + if ( first_on_line ) + CurAltStart = (Junction *)((Junction *)((Junction *)zzaRet.left)->p1); + _retv = (Node *) ((Junction *)zzaRet.left)->p1; + } + } + else { + if ( (LA(1)==95) ) { + zzmatch(95); zzCONSUME; + block( &toksrefd,&rulesrefd ); + zzaRet = makeOpt(zzaArg(zztasp2,2),approx); --BlkLevel; + zzmatch(91); + + ((Junction *)((Junction *)zzaRet.left)->p1)->blockid = CurBlockID; + ((Junction *)((Junction *)zzaRet.left)->p1)->tokrefs = toksrefd; + ((Junction *)((Junction *)zzaRet.left)->p1)->rulerefs = rulesrefd; + zzCONSUME; + + if ( first_on_line ) + CurAltStart = (Junction *) ((Junction *)((Junction *)zzaRet.left)->p1); + _retv = (Node *) ((Junction *)zzaRet.left)->p1; + } + else {zzFAIL(1,zzerr15,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp2); + } + } + } + else { + if ( (LA(1)==118) ) { + zzmatch(118); + warn("don't you want a ')' with that '*'?"); CannotContinue=TRUE; + zzCONSUME; + + } + else { + if ( (LA(1)==119) ) { + zzmatch(119); + warn("don't you want a ')' with that '+'?"); CannotContinue=TRUE; + zzCONSUME; + + } + else { + if ( (LA(1)==98) ) { + zzmatch(98); + warn("'>' can only appear after a nonterminal"); CannotContinue=TRUE; + zzCONSUME; + + } + else { + if ( (LA(1)==PassAction) ) { + zzmatch(PassAction); + warn("[...] out of context 'rule > [...]'"); + CannotContinue=TRUE; + zzCONSUME; + + } + else {zzFAIL(1,zzerr16,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + } + } + } + } + } + } + zzEXIT(zztasp1); + return _retv; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd4, 0x8); + return _retv; + } +} + +void +#ifdef __STDC__ +default_exception_handler(void) +#else +default_exception_handler() +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + DefaultExGroup = exception_group(); + + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd4, 0x10); + } +} + + ExceptionGroup * +#ifdef __STDC__ +exception_group(void) +#else +exception_group() +#endif +{ + ExceptionGroup * _retv; + PURIFY(_retv,sizeof( ExceptionGroup * )) + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + ExceptionHandler *h; LabelEntry *label=NULL; FoundException = 1; + zzmatch(122); + _retv = (ExceptionGroup *)calloc(1, sizeof(ExceptionGroup)); + zzCONSUME; + + { + zzBLOCK(zztasp2); + zzMake0; + { + char *p; + if ( (LA(1)==PassAction) ) { + zzmatch(PassAction); + + p = LATEXT(1)+1; + p[strlen(p)-1] = '\0'; /* kill trailing space */ + label = (LabelEntry *) hash_get(Elabel, LATEXT(1)+1); + if ( label==NULL ) + { + err(eMsg1("unknown label in exception handler: '%s'", LATEXT(1)+1)); + } + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( (LA(1)==124) ) { + h = exception_handler(); + + list_add(&(_retv->handlers), (void *)h); + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==123) ) { + zzmatch(123); zzCONSUME; + zzmatch(99); zzCONSUME; + zzmatch(Action); + { + ExceptionHandler *eh = (ExceptionHandler *) + calloc(1, sizeof(ExceptionHandler)); + char *a = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(eh!=NULL, "exception: cannot allocate handler"); + require(a!=NULL, "exception: cannot allocate action"); + strcpy(a, LATEXT(1)); + eh->action = a; + eh->signalname = (char *) calloc(strlen("default")+1, sizeof(char)); + require(eh->signalname!=NULL, "exception: cannot allocate sig name"); + strcpy(eh->signalname, "default"); + list_add(&(_retv->handlers), (void *)eh); + } + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + + if ( label!=NULL ) { + /* Record ex group in sym tab for this label */ + if ( label->ex_group!=NULL ) { + err(eMsg1("duplicate exception handler for label '%s'",label->str)); + } + else { + label->ex_group = _retv; + /* Label the exception group itself */ + _retv->label = label->str; + /* Make the labelled element pt to the exception also */ + switch ( label->elem->ntype ) { + case nRuleRef : + { + RuleRefNode *r = (RuleRefNode *)label->elem; + r->ex_group = _retv; + break; + } + case nToken : + { + TokNode *t = (TokNode *)label->elem; + t->ex_group = _retv; + break; + } + } + } + /* You may want to remove this exc from the rule list + * and handle at the labeled element site. + */ + _retv = NULL; + } + zzEXIT(zztasp1); + return _retv; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd4, 0x20); + return _retv; + } +} + + ExceptionHandler * +#ifdef __STDC__ +exception_handler(void) +#else +exception_handler() +#endif +{ + ExceptionHandler * _retv; + PURIFY(_retv,sizeof( ExceptionHandler * )) + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + char *a; + zzmatch(124); + + _retv = (ExceptionHandler *)calloc(1, sizeof(ExceptionHandler)); + require(_retv!=NULL, "exception: cannot allocate handler"); + zzCONSUME; + + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==NonTerminal) ) { + zzmatch(NonTerminal); + + _retv->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(_retv->signalname!=NULL, "exception: cannot allocate sig name"); + strcpy(_retv->signalname, LATEXT(1)); + zzCONSUME; + + } + else { + if ( (LA(1)==TokenTerm) ) { + zzmatch(TokenTerm); + + _retv->signalname = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(_retv->signalname!=NULL, "exception: cannot allocate sig name"); + strcpy(_retv->signalname, LATEXT(1)); + zzCONSUME; + + } + else {zzFAIL(1,zzerr17,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp2); + } + } + zzmatch(99); zzCONSUME; + { + zzBLOCK(zztasp2); + zzMake0; + { + _retv->action = NULL; + if ( (LA(1)==Action) ) { + zzmatch(Action); + + _retv->action = (char *) calloc(strlen(LATEXT(1))+1, sizeof(char)); + require(_retv->action!=NULL, "exception: cannot allocate action"); + strcpy(_retv->action, LATEXT(1)); + zzCONSUME; + + } + zzEXIT(zztasp2); + } + } + zzEXIT(zztasp1); + return _retv; +fail: + zzEXIT(zztasp1); + CannotContinue=TRUE; + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd4, 0x40); + return _retv; + } +} + +void +#ifdef __STDC__ +enum_file( char *fname ) +#else +enum_file(fname) + char *fname ; +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + if ( (setwd4[LA(1)]&0x80) ) { + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==132) ) { + zzmatch(132); zzCONSUME; + zzmatch(ID); zzCONSUME; + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==138) ) { + zzmatch(138); zzCONSUME; + zzmatch(ID); zzCONSUME; + } + zzEXIT(zztasp3); + } + } + } + zzEXIT(zztasp2); + } + } + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==140) ) { + { + zzBLOCK(zztasp3); + int zzcnt=1; + zzMake0; + { + do { + enum_def( fname ); + zzLOOP(zztasp3); + } while ( (LA(1)==140) ); + zzEXIT(zztasp3); + } + } + } + else { + if ( (LA(1)==138) ) { + defines( fname ); + } + else {zzFAIL(1,zzerr18,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp2); + } + } + } + else { + if ( (LA(1)==Eof) ) { + } + else {zzFAIL(1,zzerr19,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd5, 0x1); + } +} + +void +#ifdef __STDC__ +defines( char *fname ) +#else +defines(fname) + char *fname ; +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + int v,maxt= -1; char *t; + { + zzBLOCK(zztasp2); + int zzcnt=1; + zzMake0; + { + do { + zzmatch(138); zzCONSUME; + zzmatch(ID); + t = mystrdup(LATEXT(1)); + zzCONSUME; + + zzmatch(INT); + + v = atoi(LATEXT(1)); + /* fprintf(stderr, "#token %s=%d\n", t, v);*/ + TokenNum = v; + if ( v>maxt ) maxt=v; + if ( Tnum( t ) == 0 ) addForcedTname( t, v ); + else { + warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline); + } + zzCONSUME; + + zzLOOP(zztasp2); + } while ( (LA(1)==138) ); + zzEXIT(zztasp2); + } + } + TokenNum = maxt + 1; + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd5, 0x2); + } +} + +void +#ifdef __STDC__ +enum_def( char *fname ) +#else +enum_def(fname) + char *fname ; +#endif +{ + zzRULE; + zzBLOCK(zztasp1); + zzMake0; + { + int v= 0; char *t; + zzmatch(140); zzCONSUME; + zzmatch(ID); zzCONSUME; + zzmatch(141); zzCONSUME; + zzmatch(ID); + t = mystrdup(LATEXT(1)); + zzCONSUME; + + { + zzBLOCK(zztasp2); + zzMake0; + { + if ( (LA(1)==142) ) { + zzmatch(142); zzCONSUME; + zzmatch(INT); + v=atoi(LATEXT(1)); + zzCONSUME; + + } + else { + if ( (setwd5[LA(1)]&0x4) ) { + v++; + } + else {zzFAIL(1,zzerr20,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp2); + } + } + + /* fprintf(stderr, "#token %s=%d\n", t, v);*/ + TokenNum = v; + if ( Tnum( t ) == 0 ) addForcedTname( t, v ); + else { + warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline); + } + { + zzBLOCK(zztasp2); + zzMake0; + { + while ( (LA(1)==143) ) { + zzmatch(143); zzCONSUME; + { + zzBLOCK(zztasp3); + zzMake0; + { + if ( (LA(1)==ID) ) { + zzmatch(ID); + t = mystrdup(LATEXT(1)); + zzCONSUME; + + { + zzBLOCK(zztasp4); + zzMake0; + { + if ( (LA(1)==142) ) { + zzmatch(142); zzCONSUME; + zzmatch(INT); + v=atoi(LATEXT(1)); + zzCONSUME; + + } + else { + if ( (setwd5[LA(1)]&0x8) ) { + v++; + } + else {zzFAIL(1,zzerr21,&zzMissSet,&zzMissText,&zzBadTok,&zzBadText,&zzErrk); goto fail;} + } + zzEXIT(zztasp4); + } + } + + /* fprintf(stderr, "#token %s=%d\n", t, v);*/ + TokenNum = v; + if ( Tnum( t ) == 0 ) addForcedTname( t, v ); + else { + warnFL(eMsg1("redefinition of token %s; ignored",t), fname,zzline); + } + } + zzEXIT(zztasp3); + } + } + zzLOOP(zztasp2); + } + zzEXIT(zztasp2); + } + } + zzmatch(144); zzCONSUME; + zzmatch(145); + TokenNum++; + zzCONSUME; + + zzEXIT(zztasp1); + return; +fail: + zzEXIT(zztasp1); + zzsyn(zzMissText, zzBadTok, (ANTLRChar *)"", zzMissSet, zzMissTok, zzErrk, zzBadText); + zzresynch(setwd5, 0x10); + } +} + +/* semantics of #token */ +static void +#ifdef __STDC__ +chkToken(char *t, char *e, char *a, int tnum) +#else +chkToken(t,e,a,tnum) +char *t, *e, *a; +int tnum; +#endif +{ + TermEntry *p; + + /* check to see that they don't try to redefine a token as a token class */ + if ( t!=NULL ) { + p = (TermEntry *) hash_get(Tname, t); + if ( p!=NULL && p->classname ) { + err(eMsg1("redefinition of #tokclass '%s' to #token not allowed; ignored",t)); + if ( a!=NULL ) free((char *)a); + return; +} +} + + if ( t==NULL && e==NULL ) { /* none found */ +err("#token requires at least token name or rexpr"); +} +else if ( t!=NULL && e!=NULL ) { /* both found */ +if ( UserDefdTokens ) { /* if #tokdefs, must not define new */ +p = (TermEntry *) hash_get(Tname, t); +if ( p==NULL ) { +err(eMsg1("#token definition '%s' not allowed with #tokdefs; ignored",t)); +return; +} +} +Tklink(t, e); +if ( a!=NULL ) { +if ( hasAction(e) ) { +err(eMsg1("redefinition of action for %s; ignored",e)); +} +else setHasAction(e, a); +} +} +else if ( t!=NULL ) { /* only one found */ +if ( UserDefdTokens ) { +err(eMsg1("#token definition '%s' not allowed with #tokdefs; ignored",t)); +return; +} +if ( Tnum( t ) == 0 ) addTname( t ); +else { +err(eMsg1("redefinition of token %s; ignored",t)); +} +if ( a!=NULL ) { +err(eMsg1("action cannot be attached to a token name (%s); ignored",t)); +free((char *)a); +} +} +else if ( e!=NULL ) { +if ( Tnum( e ) == 0 ) addTexpr( e ); +else { +if ( hasAction(e) ) { +err(eMsg1("redefinition of action for expr %s; ignored",e)); +} +else if ( a==NULL ) { +err(eMsg1("redefinition of expr %s; ignored",e)); +} +} +if ( a!=NULL ) setHasAction(e, a); +} + + /* if a token type number was specified, then add the token ID and 'tnum' +* pair to the ForcedTokens list. (only applies if an id was given) +*/ +if ( t!=NULL && tnum>0 ) +{ +if ( set_el(tnum, reserved_positions) ) +{ +err(eMsgd("a token has already been forced to token number %d; ignored", tnum)); +} +else +{ +list_add(&ForcedTokens, newForcedToken(t,tnum)); +set_orel(tnum, &reserved_positions); +} +} +} + +static int +#ifdef __USE_PROTOS +match_token(char *s, char **nxt) +#else +match_token(s,nxt) +char *s; +char **nxt; +#endif +{ + if ( !(*s>='A' && *s<='Z') ) return 0; + s++; + while ( (*s>='a' && *s<='z') || + (*s>='A' && *s<='Z') || + (*s>='0' && *s<='9') || + *s=='_' ) + { + s++; + } + if ( *s!=' ' && *s!='}' ) return 0; + *nxt = s; + return 1; +} + +static int +#ifdef __USE_PROTOS +match_rexpr(char *s, char **nxt) +#else +match_rexpr(s,nxt) +char *s; +char **nxt; +#endif +{ + if ( *s!='"' ) return 0; + s++; + while ( *s!='"' ) + { + if ( *s=='\n' ) + warn("eoln found in regular expression"); + if ( *s=='\\' ) s++; + s++; + } + *nxt = s+1; + return 1; +} + +/* +* Walk a string "{ A .. Z }" where A..Z is a space separated list +* of token references (either labels or reg exprs). Return a +* string "inlineX_set" for some unique integer X. Basically, +* we pretend as if we had seen "#tokclass inlineX { A .. Z }" +* on the input stream outside of an action. +*/ +char * +#ifdef __USE_PROTOS +inline_set(char *s) +#else +inline_set(s) +char *s; +#endif +{ + char *nxt; + fprintf(stderr, "found consumeUntil( {...} )\n"); + while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} + if ( *s!='{' ) + { + err("malformed consumeUntil( {...} ); missing '{'"); + return "bad_set"; + } + s++; + while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} + while ( *s!='}' ) + { + if ( match_token(s,&nxt) ) fprintf(stderr, "found token %s\n", s); + else if ( match_rexpr(s,&nxt) ) fprintf(stderr, "found rexpr %s\n", s); + else { + err("invalid element in consumeUntil( {...} )"); + return "bad_set"; + } + s = nxt; + while ( *s==' ' || *s=='\t' || *s=='\n' || *s=='\r' ) {s++;} + } + return "inlineX_set"; +} + +/* ANTLR-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, FileStr[CurFile]!=NULL?FileStr[CurFile]:"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/antlr/mode.h b/antlr/mode.h new file mode 100755 index 0000000..592e811 --- /dev/null +++ b/antlr/mode.h @@ -0,0 +1,12 @@ +#define START 0 +#define STRINGS 1 +#define ACTION_STRINGS 2 +#define ACTION_CHARS 3 +#define ACTION_COMMENTS 4 +#define TOK_DEF_COMMENTS 5 +#define TOK_DEF_CPP_COMMENTS 6 +#define ACTION_CPP_COMMENTS 7 +#define CPP_COMMENTS 8 +#define COMMENTS 9 +#define ACTIONS 10 +#define PARSE_ENUM_FILE 11 diff --git a/antlr/parser.dlg b/antlr/parser.dlg new file mode 100755 index 0000000..e69de29 diff --git a/antlr/scan.c b/antlr/scan.c new file mode 100755 index 0000000..8d186c6 --- /dev/null +++ b/antlr/scan.c @@ -0,0 +1,4343 @@ + +/* parser.dlg -- DLG Description of scanner + * + * Generated from: antlr.g + * + * Terence Parr, Will Cohen, and Hank Dietz: 1989-1994 + * Purdue University Electrical Engineering + * With AHPCRC, University of Minnesota + * ANTLR Version 1.32 + */ + +#include +#define ANTLR_VERSION 132 + +#ifdef __cplusplus +#ifndef __STDC__ +#define __STDC__ +#endif +#endif +#include "set.h" +#include +#include "syn.h" +#include "hash.h" +#include "generic.h" +#define zzcr_attr(attr,tok,t) +#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.33 + */ + +#include "mode.h" + + + + +/* maintained, but not used for now */ +set AST_nodes_refd_in_actions = set_init; +int inAlt = 0; +set attribsRefdFromAction; +int UsedOldStyleAttrib = 0; +int UsedNewStyleLabel = 0; +#ifdef __USE_PROTOS +char *inline_set(char *); +#else +char *inline_set(); +#endif + +static void act1() +{ + NLA = Eof; + /* L o o k F o r A n o t h e r F i l e */ + { + FILE *new_input; + new_input = NextFile(); + if ( new_input == NULL ) { NLA=Eof; return; } + fclose( input ); + input = new_input; + zzrdstream( input ); + zzskip(); /* Skip the Eof (@) char i.e continue */ + } + } + + +static void act2() +{ + NLA = 74; + zzskip(); + } + + +static void act3() +{ + NLA = 75; + zzline++; zzskip(); + } + + +static void act4() +{ + NLA = 76; + zzmode(ACTIONS); zzmore(); + istackreset(); + pushint(']'); + } + + +static void act5() +{ + NLA = 77; + action_file=CurFile; action_line=zzline; + zzmode(ACTIONS); zzmore(); + istackreset(); + pushint('>'); + } + + +static void act6() +{ + NLA = 78; + zzmode(STRINGS); zzmore(); + } + + +static void act7() +{ + NLA = 79; + zzmode(COMMENTS); zzskip(); + } + + +static void act8() +{ + NLA = 80; + warn("Missing /*; found dangling */"); zzskip(); + } + + +static void act9() +{ + NLA = 81; + zzmode(CPP_COMMENTS); zzskip(); + } + + +static void act10() +{ + NLA = 82; + warn("Missing <<; found dangling \>\>"); zzskip(); + } + + +static void act11() +{ + NLA = WildCard; + } + + +static void act12() +{ + NLA = 84; + FoundException = 1; + } + + +static void act13() +{ + NLA = 88; + } + + +static void act14() +{ + NLA = 89; + } + + +static void act15() +{ + NLA = 90; + } + + +static void act16() +{ + NLA = 91; + } + + +static void act17() +{ + NLA = 92; + } + + +static void act18() +{ + NLA = 95; + } + + +static void act19() +{ + NLA = 96; + } + + +static void act20() +{ + NLA = 97; + } + + +static void act21() +{ + NLA = 98; + } + + +static void act22() +{ + NLA = 99; + } + + +static void act23() +{ + NLA = 100; + } + + +static void act24() +{ + NLA = 101; + } + + +static void act25() +{ + NLA = 102; + } + + +static void act26() +{ + NLA = 103; + } + + +static void act27() +{ + NLA = 104; + } + + +static void act28() +{ + NLA = 105; + } + + +static void act29() +{ + NLA = 106; + } + + +static void act30() +{ + NLA = 107; + } + + +static void act31() +{ + NLA = 108; + } + + +static void act32() +{ + NLA = 109; + } + + +static void act33() +{ + NLA = 110; + } + + +static void act34() +{ + NLA = 111; + } + + +static void act35() +{ + NLA = 112; + } + + +static void act36() +{ + NLA = 113; + } + + +static void act37() +{ + NLA = 114; + } + + +static void act38() +{ + NLA = 115; + } + + +static void act39() +{ + NLA = 116; + } + + +static void act40() +{ + NLA = 117; + } + + +static void act41() +{ + NLA = 118; + } + + +static void act42() +{ + NLA = 119; + } + + +static void act43() +{ + NLA = 120; + } + + +static void act44() +{ + NLA = 121; + } + + +static void act45() +{ + NLA = 122; + } + + +static void act46() +{ + NLA = 123; + } + + +static void act47() +{ + NLA = 124; + } + + +static void act48() +{ + NLA = NonTerminal; + + while ( zzchar==' ' || zzchar=='\t' ) { + zzadvance(); + } + if ( zzchar == ':' && inAlt ) NLA = LABEL; + } + + +static void act49() +{ + NLA = TokenTerm; + + while ( zzchar==' ' || zzchar=='\t' ) { + zzadvance(); + } + if ( zzchar == ':' && inAlt ) NLA = LABEL; + } + + +static void act50() +{ + NLA = 125; + warn(eMsg1("unknown meta-op: %s",LATEXT(1))); zzskip(); + } + +static unsigned char shift0[257] = { + 0, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 1, 2, 51, 51, 2, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 1, 27, 5, 11, 51, 51, 51, + 51, 43, 44, 7, 45, 51, 51, 9, 6, 36, + 34, 35, 36, 36, 36, 36, 36, 36, 36, 28, + 29, 4, 33, 8, 46, 10, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 42, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 3, 51, 51, 39, 50, 51, 14, 48, + 24, 15, 13, 22, 40, 12, 31, 48, 21, 25, + 41, 32, 20, 17, 48, 16, 18, 19, 47, 48, + 48, 30, 48, 48, 26, 37, 23, 38, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, + 51, 51, 51, 51, 51, 51, 51 +}; + + +static void act51() +{ + NLA = Eof; + } + + +static void act52() +{ + NLA = QuotedTerm; + zzmode(START); + } + + +static void act53() +{ + NLA = 3; + + zzline++; + warn("eoln found in string"); + zzskip(); + } + + +static void act54() +{ + NLA = 4; + zzline++; zzmore(); + } + + +static void act55() +{ + NLA = 5; + zzmore(); + } + + +static void act56() +{ + NLA = 6; + zzmore(); + } + +static unsigned char shift1[257] = { + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 2, 4, 4, 2, 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, 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, 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, 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 +}; + + +static void act57() +{ + NLA = Eof; + } + + +static void act58() +{ + NLA = 7; + zzmode(ACTIONS); zzmore(); + } + + +static void act59() +{ + NLA = 8; + + zzline++; + warn("eoln found in string (in user action)"); + zzskip(); + } + + +static void act60() +{ + NLA = 9; + zzline++; zzmore(); + } + + +static void act61() +{ + NLA = 10; + zzmore(); + } + + +static void act62() +{ + NLA = 11; + zzmore(); + } + +static unsigned char shift2[257] = { + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 2, 4, 4, 2, 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, 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, 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, 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 +}; + + +static void act63() +{ + NLA = Eof; + } + + +static void act64() +{ + NLA = 12; + zzmode(ACTIONS); zzmore(); + } + + +static void act65() +{ + NLA = 13; + + zzline++; + warn("eoln found in char literal (in user action)"); + zzskip(); + } + + +static void act66() +{ + NLA = 14; + zzmore(); + } + + +static void act67() +{ + NLA = 15; + zzmore(); + } + +static unsigned char shift3[257] = { + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 2, 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, + 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 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, 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 +}; + + +static void act68() +{ + NLA = Eof; + } + + +static void act69() +{ + NLA = 16; + zzmode(ACTIONS); zzmore(); + } + + +static void act70() +{ + NLA = 17; + zzmore(); + } + + +static void act71() +{ + NLA = 18; + zzline++; zzmore(); DAWDLE; + } + + +static void act72() +{ + NLA = 19; + zzmore(); + } + +static unsigned char shift4[257] = { + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 3, 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, 1, 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, 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 +}; + + +static void act73() +{ + NLA = Eof; + } + + +static void act74() +{ + NLA = 20; + zzmode(PARSE_ENUM_FILE); + zzmore(); + } + + +static void act75() +{ + NLA = 21; + zzmore(); + } + + +static void act76() +{ + NLA = 22; + zzline++; zzmore(); DAWDLE; + } + + +static void act77() +{ + NLA = 23; + zzmore(); + } + +static unsigned char shift5[257] = { + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 3, 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, 1, 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, 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 +}; + + +static void act78() +{ + NLA = Eof; + } + + +static void act79() +{ + NLA = 24; + zzline++; zzmode(PARSE_ENUM_FILE); zzskip(); DAWDLE; + } + + +static void act80() +{ + NLA = 25; + zzskip(); + } + +static unsigned char shift6[257] = { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2 +}; + + +static void act81() +{ + NLA = Eof; + } + + +static void act82() +{ + NLA = 26; + zzline++; zzmode(ACTIONS); zzmore(); DAWDLE; + } + + +static void act83() +{ + NLA = 27; + zzmore(); + } + +static unsigned char shift7[257] = { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2 +}; + + +static void act84() +{ + NLA = Eof; + } + + +static void act85() +{ + NLA = 28; + zzline++; zzmode(START); zzskip(); DAWDLE; + } + + +static void act86() +{ + NLA = 29; + zzskip(); + } + +static unsigned char shift8[257] = { + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2 +}; + + +static void act87() +{ + NLA = Eof; + } + + +static void act88() +{ + NLA = 30; + zzmode(START); zzskip(); + } + + +static void act89() +{ + NLA = 31; + zzskip(); + } + + +static void act90() +{ + NLA = 32; + zzline++; zzskip(); DAWDLE; + } + + +static void act91() +{ + NLA = 33; + zzskip(); + } + +static unsigned char shift9[257] = { + 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 3, 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, 1, 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, 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 +}; + + +static void act92() +{ + NLA = Eof; + } + + +static void act93() +{ + NLA = Action; + /* these do not nest */ + zzmode(START); + NLATEXT[0] = ' '; + NLATEXT[1] = ' '; + zzbegexpr[0] = ' '; + zzbegexpr[1] = ' '; + if ( zzbufovf ) { + err( eMsgd("action buffer overflow; size %d",ZZLEXBUFSIZE)); + } + } + + +static void act94() +{ + NLA = Pred; + /* these do not nest */ + zzmode(START); + NLATEXT[0] = ' '; + NLATEXT[1] = ' '; + zzbegexpr[0] = '\0'; + if ( zzbufovf ) { + err( eMsgd("predicate buffer overflow; size %d",ZZLEXBUFSIZE)); + } + } + + +static void act95() +{ + NLA = PassAction; + if ( topint() == ']' ) { + popint(); + if ( istackempty() ) /* terminate action */ + { + zzmode(START); + NLATEXT[0] = ' '; + zzbegexpr[0] = ' '; + if ( zzbufovf ) { + err( eMsgd("parameter buffer overflow; size %d",ZZLEXBUFSIZE)); + } + } + else { + /* terminate $[..] and #[..] */ + if ( GenCC ) zzreplstr("))"); + else zzreplstr(")"); + zzmore(); + } + } + else if ( topint() == '|' ) { /* end of simple [...] */ + popint(); + zzmore(); + } + else zzmore(); + } + + +static void act96() +{ + NLA = 37; + + zzmore(); + zzreplstr(inline_set(zzbegexpr+ + strlen("consumeUntil("))); + } + + +static void act97() +{ + NLA = 38; + zzmore(); + } + + +static void act98() +{ + NLA = 39; + zzline++; zzmore(); DAWDLE; + } + + +static void act99() +{ + NLA = 40; + zzmore(); + } + + +static void act100() +{ + NLA = 41; + zzmore(); + } + + +static void act101() +{ + NLA = 42; + if ( !GenCC ) {zzreplstr("zzaRet"); zzmore();} + else err("$$ use invalid in C++ mode"); + } + + +static void act102() +{ + NLA = 43; + if ( !GenCC ) {zzreplstr("zzempty_attr"); zzmore();} + else err("$[] use invalid in C++ mode"); + } + + +static void act103() +{ + NLA = 44; + + pushint(']'); + if ( !GenCC ) zzreplstr("zzconstr_attr("); + else err("$[..] use invalid in C++ mode"); + zzmore(); + } + + +static void act104() +{ + NLA = 45; + { + static char buf[100]; + if ( strlen(zzbegexpr)>(size_t)85 ) + fatal("$i attrib ref too big"); + set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); + if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s)", + BlkLevel-1,zzbegexpr+1); + else sprintf(buf,"_t%d%s", + BlkLevel-1,zzbegexpr+1); + zzreplstr(buf); + zzmore(); + UsedOldStyleAttrib = 1; + if ( UsedNewStyleLabel ) + err("cannot mix old-style $i with new-style labels"); + } + } + + +static void act105() +{ + NLA = 46; + { + static char buf[100]; + if ( strlen(zzbegexpr)>(size_t)85 ) + fatal("$i.field attrib ref too big"); + zzbegexpr[strlen(zzbegexpr)-1] = ' '; + set_orel(atoi(zzbegexpr+1), &attribsRefdFromAction); + if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%d,%s).", + BlkLevel-1,zzbegexpr+1); + else sprintf(buf,"_t%d%s.", + BlkLevel-1,zzbegexpr+1); + zzreplstr(buf); + zzmore(); + UsedOldStyleAttrib = 1; + if ( UsedNewStyleLabel ) + err("cannot mix old-style $i with new-style labels"); + } + } + + +static void act106() +{ + NLA = 47; + { + static char buf[100]; + static char i[20], j[20]; + char *p,*q; + if (strlen(zzbegexpr)>(size_t)85) fatal("$i.j attrib ref too big"); + for (p=zzbegexpr+1,q= &i[0]; *p!='.'; p++) { + if ( q == &i[20] ) + fatalFL("i of $i.j attrib ref too big", + FileStr[CurFile], zzline ); + *q++ = *p; + } + *q = '\0'; + for (p++, q= &j[0]; *p!='\0'; p++) { + if ( q == &j[20] ) + fatalFL("j of $i.j attrib ref too big", + FileStr[CurFile], zzline ); + *q++ = *p; + } + *q = '\0'; + if ( !GenCC ) sprintf(buf,"zzaArg(zztasp%s,%s)",i,j); + else sprintf(buf,"_t%s%s",i,j); + zzreplstr(buf); + zzmore(); + UsedOldStyleAttrib = 1; + if ( UsedNewStyleLabel ) + err("cannot mix old-style $i with new-style labels"); + } + } + + +static void act107() +{ + NLA = 48; + { static char buf[300]; LabelEntry *el; + zzbegexpr[0] = ' '; + if ( CurRule != NULL && + strcmp(CurRule, &zzbegexpr[1])==0 ) { + if ( !GenCC ) zzreplstr("zzaRet"); + } + else if ( CurRetDef != NULL && + strmember(CurRetDef, &zzbegexpr[1])) { + if ( HasComma( CurRetDef ) ) { + require (strlen(zzbegexpr)<=(size_t)285, + "$retval attrib ref too big"); + sprintf(buf,"_retv.%s",&zzbegexpr[1]); + zzreplstr(buf); + } + else zzreplstr("_retv"); + } + else if ( CurParmDef != NULL && + strmember(CurParmDef, &zzbegexpr[1])) { + ; + } + else if ( Elabel==NULL ) { + { err("$-variables in actions outside of rules are not allowed"); } + } else if ( (el=(LabelEntry *)hash_get(Elabel, &zzbegexpr[1]))!=NULL ) { + if ( GenCC && (el->elem==NULL || el->elem->ntype==nRuleRef) ) + { err(eMsg1("There are no token ptrs for rule references: '$%s'",&zzbegexpr[1])); } +} +else +warn(eMsg1("$%s not parameter, return value, or element label",&zzbegexpr[1])); +} +zzmore(); + } + + +static void act108() +{ + NLA = 49; + zzreplstr("(*_root)"); zzmore(); chkGTFlag(); + } + + +static void act109() +{ + NLA = 50; + if ( GenCC ) {zzreplstr("(new AST)");} + else {zzreplstr("zzastnew()");} zzmore(); + chkGTFlag(); + } + + +static void act110() +{ + NLA = 51; + zzreplstr("NULL"); zzmore(); chkGTFlag(); + } + + +static void act111() +{ + NLA = 52; + { + static char buf[100]; + if ( strlen(zzbegexpr)>(size_t)85 ) + fatal("#i AST ref too big"); + if ( GenCC ) sprintf(buf,"_ast%d%s",BlkLevel-1,zzbegexpr+1); + else sprintf(buf,"zzastArg(%s)",zzbegexpr+1); + zzreplstr(buf); + zzmore(); + set_orel(atoi(zzbegexpr+1), &AST_nodes_refd_in_actions); + chkGTFlag(); + } + } + + +static void act112() +{ + NLA = 53; + + if ( !(strcmp(zzbegexpr, "#ifdef")==0 || + strcmp(zzbegexpr, "#if")==0 || + strcmp(zzbegexpr, "#else")==0 || + strcmp(zzbegexpr, "#endif")==0 || + strcmp(zzbegexpr, "#ifndef")==0 || + strcmp(zzbegexpr, "#define")==0 || + strcmp(zzbegexpr, "#pragma")==0 || + strcmp(zzbegexpr, "#undef")==0 || + strcmp(zzbegexpr, "#import")==0 || + strcmp(zzbegexpr, "#line")==0 || + strcmp(zzbegexpr, "#include")==0 || + strcmp(zzbegexpr, "#error")==0) ) + { + static char buf[100]; + sprintf(buf, "%s_ast", zzbegexpr+1); + zzreplstr(buf); + chkGTFlag(); + } + zzmore(); + } + + +static void act113() +{ + NLA = 54; + + pushint(']'); + if ( GenCC ) zzreplstr("(new AST("); + else zzreplstr("zzmk_ast(zzastnew(),"); + zzmore(); + chkGTFlag(); + } + + +static void act114() +{ + NLA = 55; + + pushint('}'); + if ( GenCC ) zzreplstr("ASTBase::tmake("); + else zzreplstr("zztmake("); + zzmore(); + chkGTFlag(); + } + + +static void act115() +{ + NLA = 56; + zzmore(); + } + + +static void act116() +{ + NLA = 57; + + if ( istackempty() ) + zzmore(); + else if ( topint()==')' ) { + popint(); + } + else if ( topint()=='}' ) { + popint(); + /* terminate #(..) */ + zzreplstr(", NULL)"); + } + zzmore(); + } + + +static void act117() +{ + NLA = 58; + + pushint('|'); /* look for '|' to terminate simple [...] */ + zzmore(); + } + + +static void act118() +{ + NLA = 59; + + pushint(')'); + zzmore(); + } + + +static void act119() +{ + NLA = 60; + zzreplstr("]"); zzmore(); + } + + +static void act120() +{ + NLA = 61; + zzreplstr(")"); zzmore(); + } + + +static void act121() +{ + NLA = 62; + zzreplstr(">"); zzmore(); + } + + +static void act122() +{ + NLA = 63; + zzmode(ACTION_CHARS); zzmore(); + } + + +static void act123() +{ + NLA = 64; + zzmode(ACTION_STRINGS); zzmore(); + } + + +static void act124() +{ + NLA = 65; + zzreplstr("$"); zzmore(); + } + + +static void act125() +{ + NLA = 66; + zzreplstr("#"); zzmore(); + } + + +static void act126() +{ + NLA = 67; + zzline++; zzmore(); + } + + +static void act127() +{ + NLA = 68; + zzmore(); + } + + +static void act128() +{ + NLA = 69; + zzmore(); + } + + +static void act129() +{ + NLA = 70; + zzmode(ACTION_COMMENTS); zzmore(); + } + + +static void act130() +{ + NLA = 71; + warn("Missing /*; found dangling */ in action"); zzmore(); + } + + +static void act131() +{ + NLA = 72; + zzmode(ACTION_CPP_COMMENTS); zzmore(); + } + + +static void act132() +{ + NLA = 73; + zzmore(); + } + +static unsigned char shift10[257] = { + 0, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 16, 19, 32, 32, 19, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 16, 32, 29, 26, 20, 32, 32, + 28, 15, 18, 31, 32, 32, 32, 24, 30, 22, + 23, 23, 23, 23, 23, 23, 23, 23, 23, 32, + 32, 32, 32, 1, 2, 32, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 11, 25, 25, 25, + 25, 25, 21, 27, 3, 32, 25, 32, 25, 25, + 4, 25, 10, 25, 25, 25, 13, 25, 25, 14, + 9, 6, 5, 25, 25, 25, 7, 12, 8, 25, + 25, 25, 25, 25, 17, 32, 33, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 32, 32, 32, 32, 32, 32, 32 +}; + + +static void act133() +{ + NLA = Eof; + ; + } + + +static void act134() +{ + NLA = 126; + zzskip(); + } + + +static void act135() +{ + NLA = 127; + zzline++; zzskip(); + } + + +static void act136() +{ + NLA = 128; + zzmode(TOK_DEF_CPP_COMMENTS); zzmore(); + } + + +static void act137() +{ + NLA = 129; + zzmode(TOK_DEF_COMMENTS); zzskip(); + } + + +static void act138() +{ + NLA = 130; + zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); + } + + +static void act139() +{ + NLA = 131; + zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); + } + + +static void act140() +{ + NLA = 132; + ; + } + + +static void act141() +{ + NLA = 133; + zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); + } + + +static void act142() +{ + NLA = 134; + zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); + } + + +static void act143() +{ + NLA = 135; + zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); + } + + +static void act144() +{ + NLA = 136; + zzmode(TOK_DEF_CPP_COMMENTS); zzskip(); + } + + +static void act145() +{ + NLA = 138; + } + + +static void act146() +{ + NLA = 140; + } + + +static void act147() +{ + NLA = 141; + } + + +static void act148() +{ + NLA = 142; + } + + +static void act149() +{ + NLA = 143; + } + + +static void act150() +{ + NLA = 144; + } + + +static void act151() +{ + NLA = 145; + } + + +static void act152() +{ + NLA = INT; + } + + +static void act153() +{ + NLA = ID; + } + +static unsigned char shift11[257] = { + 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 1, 2, 26, 26, 2, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 1, 26, 26, 5, 26, 26, 26, + 26, 26, 26, 4, 26, 21, 26, 26, 3, 24, + 24, 24, 24, 24, 24, 24, 24, 24, 24, 26, + 23, 26, 20, 26, 26, 26, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, + 25, 25, 26, 26, 26, 26, 25, 26, 25, 25, + 25, 8, 9, 7, 25, 25, 6, 25, 25, 11, + 14, 10, 16, 15, 25, 17, 12, 18, 13, 25, + 25, 25, 25, 25, 19, 26, 22, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26 +}; + +#define DfaStates 303 +typedef unsigned short DfaState; + +static DfaState st0[52] = { + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 13, 13, 13, 13, + 13, 13, 13, 17, 18, 13, 19, 20, 21, 22, + 13, 13, 13, 23, 24, 24, 24, 25, 26, 27, + 13, 13, 28, 29, 30, 31, 32, 13, 13, 33, + 303, 303 +}; + +static DfaState st1[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st2[52] = { + 303, 2, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st3[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st4[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st5[52] = { + 303, 303, 303, 303, 34, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st6[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st7[52] = { + 303, 303, 303, 303, 303, 303, 35, 36, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st8[52] = { + 303, 303, 303, 303, 303, 303, 37, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st9[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 38, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st10[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 39, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st11[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st12[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 40, 41, 42, 42, 42, 43, 42, 44, + 42, 42, 42, 303, 42, 45, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st13[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st14[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 47, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st15[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 48, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st16[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 49, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st17[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st18[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 50, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 51, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st19[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st20[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st21[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st22[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st23[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 52, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st24[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 24, 24, 24, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st25[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st26[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st27[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st28[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 303, 53, 53, 303, 303, 303, 303, + 53, 53, 53, 303, 53, 53, 53, 303, 303, 303, + 53, 53, 54, 303, 303, 303, 303, 53, 53, 53, + 53, 303 +}; + +static DfaState st29[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st30[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st31[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st32[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st33[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 303, 53, 53, 303, 303, 303, 303, + 53, 53, 53, 303, 53, 53, 53, 303, 303, 303, + 53, 53, 53, 303, 303, 303, 303, 53, 53, 53, + 53, 303 +}; + +static DfaState st34[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st35[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st36[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st37[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st38[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st39[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st40[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 55, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st41[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 56, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st42[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st43[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 57, 42, 58, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st44[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 59, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st45[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 60, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st46[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st47[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 61, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st48[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 62, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st49[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 63, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st50[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 64, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st51[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 65, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st52[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303 +}; + +static DfaState st53[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 303, 53, 53, 303, 303, 303, 303, + 53, 53, 53, 303, 53, 53, 53, 303, 303, 303, + 53, 53, 53, 303, 303, 303, 303, 53, 53, 53, + 53, 303 +}; + +static DfaState st54[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 303, 53, 53, 303, 303, 303, 303, + 53, 53, 53, 303, 66, 67, 53, 303, 303, 303, + 53, 53, 53, 303, 303, 303, 303, 53, 53, 53, + 53, 303 +}; + +static DfaState st55[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 68, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st56[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 69, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st57[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 70, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st58[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 71, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st59[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 72, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st60[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 73, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st61[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 74, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st62[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 75, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st63[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 76, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st64[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 77, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st65[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 78, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st66[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 303, 53, 53, 303, 303, 303, 303, + 53, 53, 53, 303, 53, 53, 53, 303, 303, 303, + 53, 53, 53, 303, 303, 303, 303, 53, 53, 53, + 53, 303 +}; + +static DfaState st67[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 53, 53, 53, 53, 53, 53, 53, 53, + 53, 53, 53, 303, 53, 53, 303, 303, 303, 303, + 53, 53, 53, 303, 53, 53, 53, 303, 303, 303, + 53, 53, 53, 303, 303, 303, 303, 53, 53, 53, + 53, 303 +}; + +static DfaState st68[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 79, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st69[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 80, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st70[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 81, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st71[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 82, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st72[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 83, 42, 84, 42, 42, 42, 42, + 42, 42, 42, 303, 85, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st73[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 86, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 87, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st74[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 88, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st75[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 89, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st76[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 90, 46, 46, + 46, 303 +}; + +static DfaState st77[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 91, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st78[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 92, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st79[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 93, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st80[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 94, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st81[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 95, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st82[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 96, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st83[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 97, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st84[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 98, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st85[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 99, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st86[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 100, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st87[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 101, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st88[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 102, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st89[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 103, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st90[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 104, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st91[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st92[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st93[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 105, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st94[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 106, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st95[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 107, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st96[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 108, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st97[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st98[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 109, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st99[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 110, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st100[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 111, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st101[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 112, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st102[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 113, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st103[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st104[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 114, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st105[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st106[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 115, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st107[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st108[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st109[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 116, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st110[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 117, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st111[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 118, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st112[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 119, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st113[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 120, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st114[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st115[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 121, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st116[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st117[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 122, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st118[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 123, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st119[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 124, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st120[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 125, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st121[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st122[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st123[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 126, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st124[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st125[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 46, 46, 46, 46, 46, 46, 46, 46, + 46, 46, 46, 303, 46, 46, 303, 303, 303, 303, + 46, 46, 46, 303, 46, 46, 46, 303, 303, 303, + 46, 46, 46, 303, 303, 303, 303, 46, 46, 46, + 46, 303 +}; + +static DfaState st126[52] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 303, 42, 42, 303, 303, 303, 303, + 42, 42, 42, 303, 42, 42, 42, 303, 303, 303, + 42, 42, 42, 303, 303, 303, 303, 42, 42, 42, + 42, 303 +}; + +static DfaState st127[6] = { + 128, 129, 130, 131, 132, 303 +}; + +static DfaState st128[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st129[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st130[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st131[6] = { + 303, 133, 134, 133, 133, 303 +}; + +static DfaState st132[6] = { + 303, 303, 303, 303, 132, 303 +}; + +static DfaState st133[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st134[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st135[6] = { + 136, 137, 138, 139, 140, 303 +}; + +static DfaState st136[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st137[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st138[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st139[6] = { + 303, 141, 142, 141, 141, 303 +}; + +static DfaState st140[6] = { + 303, 303, 303, 303, 140, 303 +}; + +static DfaState st141[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st142[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st143[6] = { + 144, 145, 146, 147, 148, 303 +}; + +static DfaState st144[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st145[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st146[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st147[6] = { + 303, 149, 149, 149, 149, 303 +}; + +static DfaState st148[6] = { + 303, 303, 303, 303, 148, 303 +}; + +static DfaState st149[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st150[6] = { + 151, 152, 153, 154, 153, 303 +}; + +static DfaState st151[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st152[6] = { + 303, 303, 155, 303, 303, 303 +}; + +static DfaState st153[6] = { + 303, 303, 153, 303, 153, 303 +}; + +static DfaState st154[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st155[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st156[6] = { + 157, 158, 159, 160, 159, 303 +}; + +static DfaState st157[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st158[6] = { + 303, 303, 161, 303, 303, 303 +}; + +static DfaState st159[6] = { + 303, 303, 159, 303, 159, 303 +}; + +static DfaState st160[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st161[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st162[4] = { + 163, 164, 165, 303 +}; + +static DfaState st163[4] = { + 303, 303, 303, 303 +}; + +static DfaState st164[4] = { + 303, 303, 303, 303 +}; + +static DfaState st165[4] = { + 303, 303, 165, 303 +}; + +static DfaState st166[4] = { + 167, 168, 169, 303 +}; + +static DfaState st167[4] = { + 303, 303, 303, 303 +}; + +static DfaState st168[4] = { + 303, 303, 303, 303 +}; + +static DfaState st169[4] = { + 303, 303, 169, 303 +}; + +static DfaState st170[4] = { + 171, 172, 173, 303 +}; + +static DfaState st171[4] = { + 303, 303, 303, 303 +}; + +static DfaState st172[4] = { + 303, 303, 303, 303 +}; + +static DfaState st173[4] = { + 303, 303, 173, 303 +}; + +static DfaState st174[6] = { + 175, 176, 177, 178, 177, 303 +}; + +static DfaState st175[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st176[6] = { + 303, 303, 179, 303, 303, 303 +}; + +static DfaState st177[6] = { + 303, 303, 177, 303, 177, 303 +}; + +static DfaState st178[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st179[6] = { + 303, 303, 303, 303, 303, 303 +}; + +static DfaState st180[35] = { + 181, 182, 183, 184, 185, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 186, 183, 183, 187, 188, + 189, 190, 183, 183, 183, 183, 191, 192, 193, 194, + 195, 196, 183, 183, 303 +}; + +static DfaState st181[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st182[35] = { + 303, 197, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st183[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st184[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st185[35] = { + 303, 303, 183, 303, 183, 198, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st186[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st187[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st188[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st189[35] = { + 303, 303, 303, 303, 199, 199, 199, 199, 199, 199, + 199, 199, 199, 199, 199, 303, 303, 303, 303, 303, + 200, 201, 202, 202, 303, 199, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st190[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st191[35] = { + 303, 303, 303, 303, 203, 203, 203, 203, 203, 203, + 203, 203, 203, 203, 203, 204, 303, 303, 303, 303, + 303, 205, 206, 207, 303, 203, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st192[35] = { + 303, 208, 209, 210, 209, 209, 209, 209, 209, 209, + 209, 209, 209, 209, 209, 209, 209, 209, 211, 212, + 213, 209, 209, 209, 209, 209, 214, 209, 209, 209, + 209, 209, 209, 209, 303 +}; + +static DfaState st193[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st194[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st195[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 215, 216, 303, 303, 303 +}; + +static DfaState st196[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 217, 183, 183, 183, 303 +}; + +static DfaState st197[35] = { + 303, 303, 218, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st198[35] = { + 303, 303, 183, 303, 183, 183, 219, 183, 183, 183, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st199[35] = { + 303, 303, 303, 303, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 303, 303, 303, 303, 303, + 303, 303, 220, 220, 303, 220, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st200[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st201[35] = { + 303, 303, 303, 221, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st202[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 202, 202, 222, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st203[35] = { + 303, 303, 303, 303, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 303, 303, 303, 303, 303, + 303, 303, 223, 223, 303, 223, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st204[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 224, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st205[35] = { + 303, 303, 303, 225, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st206[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 207, 207, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st207[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 207, 207, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st208[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st209[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st210[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st211[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st212[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st213[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st214[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st215[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st216[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st217[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st218[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st219[35] = { + 303, 303, 183, 303, 183, 183, 183, 226, 183, 183, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st220[35] = { + 303, 303, 303, 303, 220, 220, 220, 220, 220, 220, + 220, 220, 220, 220, 220, 303, 303, 303, 303, 303, + 303, 303, 220, 220, 303, 220, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st221[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st222[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 227, 227, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st223[35] = { + 303, 303, 303, 303, 223, 223, 223, 223, 223, 223, + 223, 223, 223, 223, 223, 303, 303, 303, 303, 303, + 303, 303, 223, 223, 303, 223, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st224[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st225[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st226[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 228, 183, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st227[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 227, 227, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st228[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 229, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st229[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 230, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st230[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 183, 231, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st231[35] = { + 303, 303, 183, 303, 183, 183, 232, 183, 183, 183, + 183, 183, 183, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st232[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 183, 183, 233, 183, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st233[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 234, 183, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st234[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 235, 303, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st235[35] = { + 303, 303, 183, 303, 183, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 236, 183, 183, 303, 303, + 303, 303, 183, 183, 183, 183, 303, 303, 303, 303, + 303, 183, 183, 183, 303 +}; + +static DfaState st236[35] = { + 303, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 238, 239, 303, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 303 +}; + +static DfaState st237[35] = { + 303, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 240, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 303 +}; + +static DfaState st238[35] = { + 303, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 238, 239, 240, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 303 +}; + +static DfaState st239[35] = { + 303, 241, 241, 241, 241, 241, 241, 241, 241, 241, + 241, 241, 241, 241, 241, 241, 241, 241, 242, 241, + 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, + 241, 241, 241, 237, 303 +}; + +static DfaState st240[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st241[35] = { + 303, 241, 241, 241, 241, 241, 241, 241, 241, 241, + 241, 241, 241, 241, 241, 241, 241, 241, 242, 241, + 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, + 241, 241, 241, 243, 303 +}; + +static DfaState st242[35] = { + 303, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 245, 303 +}; + +static DfaState st243[35] = { + 303, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 246, 237, 247, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 303 +}; + +static DfaState st244[35] = { + 303, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, + 244, 244, 244, 245, 303 +}; + +static DfaState st245[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 248, 303, 249, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st246[35] = { + 303, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 237, 237, 246, 237, 247, 237, + 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, + 237, 237, 237, 237, 303 +}; + +static DfaState st247[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st248[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 248, 303, 249, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st249[35] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303 +}; + +static DfaState st250[27] = { + 251, 252, 253, 254, 303, 255, 256, 256, 256, 257, + 256, 256, 256, 256, 256, 256, 256, 256, 256, 258, + 259, 260, 261, 262, 263, 256, 303 +}; + +static DfaState st251[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st252[27] = { + 303, 252, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st253[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st254[27] = { + 303, 303, 303, 264, 265, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st255[27] = { + 303, 303, 303, 303, 303, 303, 266, 303, 267, 268, + 303, 303, 303, 269, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st256[27] = { + 303, 303, 303, 303, 303, 303, 270, 270, 270, 270, + 270, 270, 270, 270, 270, 270, 270, 270, 270, 303, + 303, 303, 303, 303, 270, 270, 303 +}; + +static DfaState st257[27] = { + 303, 303, 303, 303, 303, 303, 270, 270, 270, 270, + 271, 270, 270, 270, 270, 270, 270, 270, 270, 303, + 303, 303, 303, 303, 270, 270, 303 +}; + +static DfaState st258[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st259[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st260[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st261[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st262[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st263[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 263, 303, 303 +}; + +static DfaState st264[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st265[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st266[27] = { + 303, 303, 303, 303, 303, 303, 303, 272, 303, 303, + 303, 303, 303, 303, 273, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st267[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 274, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st268[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 275, 276, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st269[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 277, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st270[27] = { + 303, 303, 303, 303, 303, 303, 270, 270, 270, 270, + 270, 270, 270, 270, 270, 270, 270, 270, 270, 303, + 303, 303, 303, 303, 270, 270, 303 +}; + +static DfaState st271[27] = { + 303, 303, 303, 303, 303, 303, 270, 270, 270, 270, + 270, 270, 270, 278, 270, 270, 270, 270, 270, 303, + 303, 303, 303, 303, 270, 270, 303 +}; + +static DfaState st272[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 279, 303, + 280, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st273[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 281, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st274[27] = { + 303, 303, 303, 303, 303, 303, 303, 282, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st275[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 283, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st276[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 284, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st277[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 285, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st278[27] = { + 303, 303, 303, 303, 303, 303, 270, 270, 270, 270, + 270, 270, 270, 270, 286, 270, 270, 270, 270, 303, + 303, 303, 303, 303, 270, 270, 303 +}; + +static DfaState st279[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 287, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st280[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 288, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st281[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 289, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st282[27] = { + 303, 303, 303, 303, 303, 303, 290, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st283[27] = { + 303, 303, 303, 303, 303, 303, 291, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st284[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 292, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st285[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 293, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st286[27] = { + 303, 303, 303, 303, 303, 303, 270, 270, 270, 270, + 270, 270, 270, 270, 270, 270, 270, 270, 270, 303, + 303, 303, 303, 303, 270, 270, 303 +}; + +static DfaState st287[27] = { + 303, 303, 303, 303, 303, 303, 303, 294, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st288[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 295, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st289[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 296, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st290[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 297, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st291[27] = { + 303, 303, 303, 303, 303, 303, 303, 298, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st292[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st293[27] = { + 303, 303, 303, 303, 303, 303, 303, 299, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st294[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st295[27] = { + 303, 303, 303, 303, 303, 303, 303, 300, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st296[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 301, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st297[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 302, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st298[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st299[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st300[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st301[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + +static DfaState st302[27] = { + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 303, 303, 303 +}; + + +DfaState *dfa[303] = { + 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, + st46, + st47, + st48, + st49, + st50, + st51, + st52, + st53, + st54, + st55, + st56, + st57, + st58, + st59, + st60, + st61, + st62, + st63, + st64, + st65, + st66, + st67, + st68, + st69, + st70, + st71, + st72, + st73, + st74, + st75, + st76, + st77, + st78, + st79, + st80, + st81, + st82, + st83, + st84, + st85, + st86, + st87, + st88, + st89, + st90, + st91, + st92, + st93, + st94, + st95, + st96, + st97, + st98, + st99, + st100, + st101, + st102, + st103, + st104, + st105, + st106, + st107, + st108, + st109, + st110, + st111, + st112, + st113, + st114, + st115, + st116, + st117, + st118, + st119, + st120, + st121, + st122, + st123, + st124, + st125, + st126, + st127, + st128, + st129, + st130, + st131, + st132, + st133, + st134, + st135, + st136, + st137, + st138, + st139, + st140, + st141, + st142, + st143, + st144, + st145, + st146, + st147, + st148, + st149, + st150, + st151, + st152, + st153, + st154, + st155, + st156, + st157, + st158, + st159, + st160, + st161, + st162, + st163, + st164, + st165, + st166, + st167, + st168, + st169, + st170, + st171, + st172, + st173, + st174, + st175, + st176, + st177, + st178, + st179, + st180, + st181, + st182, + st183, + st184, + st185, + st186, + st187, + st188, + st189, + st190, + st191, + st192, + st193, + st194, + st195, + st196, + st197, + st198, + st199, + st200, + st201, + st202, + st203, + st204, + st205, + st206, + st207, + st208, + st209, + st210, + st211, + st212, + st213, + st214, + st215, + st216, + st217, + st218, + st219, + st220, + st221, + st222, + st223, + st224, + st225, + st226, + st227, + st228, + st229, + st230, + st231, + st232, + st233, + st234, + st235, + st236, + st237, + st238, + st239, + st240, + st241, + st242, + st243, + st244, + st245, + st246, + st247, + st248, + st249, + st250, + st251, + st252, + st253, + st254, + st255, + st256, + st257, + st258, + st259, + st260, + st261, + st262, + st263, + st264, + st265, + st266, + st267, + st268, + st269, + st270, + st271, + st272, + st273, + st274, + st275, + st276, + st277, + st278, + st279, + st280, + st281, + st282, + st283, + st284, + st285, + st286, + st287, + st288, + st289, + st290, + st291, + st292, + st293, + st294, + st295, + st296, + st297, + st298, + st299, + st300, + st301, + st302 +}; + + +DfaState accepts[304] = { + 0, 1, 2, 3, 4, 20, 6, 0, 41, 21, + 11, 12, 50, 48, 48, 48, 48, 16, 48, 18, + 19, 22, 23, 29, 30, 31, 32, 34, 49, 39, + 40, 42, 43, 49, 5, 9, 7, 8, 10, 33, + 50, 50, 50, 50, 50, 50, 48, 48, 48, 48, + 48, 48, 44, 49, 49, 50, 50, 50, 50, 50, + 50, 48, 48, 48, 48, 48, 37, 38, 50, 50, + 50, 50, 50, 50, 48, 48, 48, 48, 48, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 48, 48, + 48, 47, 17, 50, 50, 50, 50, 28, 50, 50, + 50, 50, 48, 36, 48, 13, 50, 14, 35, 50, + 50, 50, 50, 48, 46, 50, 15, 50, 50, 50, + 48, 26, 27, 50, 25, 45, 24, 0, 51, 52, + 53, 0, 56, 55, 54, 0, 57, 58, 59, 0, + 62, 61, 60, 0, 63, 64, 65, 0, 67, 66, + 0, 68, 70, 72, 71, 69, 0, 73, 75, 77, + 76, 74, 0, 78, 79, 80, 0, 81, 82, 83, + 0, 84, 85, 86, 0, 87, 89, 91, 90, 88, + 0, 92, 99, 132, 95, 132, 118, 116, 98, 100, + 117, 115, 0, 122, 123, 128, 132, 93, 132, 107, + 101, 103, 104, 112, 114, 113, 108, 111, 121, 127, + 119, 120, 126, 124, 125, 131, 129, 130, 94, 132, + 107, 102, 105, 112, 110, 109, 132, 106, 132, 132, + 132, 132, 132, 132, 132, 132, 0, 0, 0, 0, + 97, 0, 97, 0, 0, 0, 0, 96, 0, 96, + 0, 133, 134, 135, 0, 0, 153, 153, 147, 148, + 149, 150, 151, 152, 136, 137, 0, 0, 0, 0, + 153, 153, 139, 0, 0, 0, 0, 0, 153, 0, + 0, 0, 0, 0, 0, 0, 146, 0, 0, 0, + 0, 0, 141, 0, 138, 0, 0, 0, 142, 143, + 140, 144, 145, 0 +}; + +void (*actions[154])() = { + 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, + act36, + act37, + act38, + act39, + act40, + act41, + act42, + act43, + act44, + act45, + act46, + act47, + act48, + act49, + act50, + act51, + act52, + act53, + act54, + act55, + act56, + act57, + act58, + act59, + act60, + act61, + act62, + act63, + act64, + act65, + act66, + act67, + act68, + act69, + act70, + act71, + act72, + act73, + act74, + act75, + act76, + act77, + act78, + act79, + act80, + act81, + act82, + act83, + act84, + act85, + act86, + act87, + act88, + act89, + act90, + act91, + act92, + act93, + act94, + act95, + act96, + act97, + act98, + act99, + act100, + act101, + act102, + act103, + act104, + act105, + act106, + act107, + act108, + act109, + act110, + act111, + act112, + act113, + act114, + act115, + act116, + act117, + act118, + act119, + act120, + act121, + act122, + act123, + act124, + act125, + act126, + act127, + act128, + act129, + act130, + act131, + act132, + act133, + act134, + act135, + act136, + act137, + act138, + act139, + act140, + act141, + act142, + act143, + act144, + act145, + act146, + act147, + act148, + act149, + act150, + act151, + act152, + act153 +}; + +static DfaState dfa_base[] = { + 0, + 127, + 135, + 143, + 150, + 156, + 162, + 166, + 170, + 174, + 180, + 250 +}; + +static unsigned char *b_class_no[] = { + shift0, + shift1, + shift2, + shift3, + shift4, + shift5, + shift6, + shift7, + shift8, + shift9, + shift10, + shift11 +}; + + + +#define ZZSHIFT(c) (b_class_no[zzauto][1+c]) +#define MAX_MODE 12 +#include "dlgauto.h" diff --git a/support/genmk/genmk.c b/support/genmk/genmk.c new file mode 100755 index 0000000..71516a6 --- /dev/null +++ b/support/genmk/genmk.c @@ -0,0 +1,681 @@ +/* + * genmk -- a program to make makefiles for PCCTS + * + * ANTLR 1.32 + * Terence John Parr 1989 - 1994 + * Purdue University + * U of MN + */ +#include +#include "config.h" /* be sensitive to what ANTLR/DLG call the files */ + +#ifdef VAXC +#define DIE return 0; +#define DONE return 1; +#else +#define DIE return 1; +#define DONE return 0; +#endif + +#ifndef require +#define require(expr, err) {if ( !(expr) ) fatal(err);} +#endif + +#define MAX_FILES 50 +#define MAX_CLASSES 50 + +char *RENAME_OBJ_FLAG="-o", + *RENAME_EXE_FLAG="-o"; + +char *dlg = "parser.dlg"; +char *err = "err.c"; +char *hdr = "stdpccts.h"; +char *tok = "tokens.h"; +char *mode = "mode.h"; +char *scan = "scan"; + +char ATOKENBUFFER_O[100]; +char APARSER_O[100]; +char ASTBASE_O[100]; +char PCCTSAST_O[100]; +char LIST_O[100]; +char DLEXERBASE_O[100]; + +/* Option flags */ +static char *project="t", *files[MAX_FILES], *classes[MAX_CLASSES]; +static int num_files = 0; +static int num_classes = 0; +static int user_lexer = 0; +static char *user_token_types = NULL; +static int gen_CPP = 0; +static char *outdir="."; +static char *dlg_class = "DLGLexer"; +static int gen_trees = 0; + +typedef struct _Opt { + char *option; + int arg; +#ifdef __cplusplus + void (*process)(...); +#else + void (*process)(); +#endif + char *descr; + } Opt; + +#ifdef __STDC__ +static void ProcessArgs(int, char **, Opt *); +#else +static void ProcessArgs(); +#endif + +static void +pProj( s, t ) +char *s; +char *t; +{ + project = t; +} + +static void +pUL( s ) +char *s; +{ + user_lexer = 1; +} + +static void +pCPP( s ) +char *s; +{ + gen_CPP = 1; +} + +static void +pUT( s, t ) +char *s; +char *t; +{ + user_token_types = t; +} + +static void +pTrees( s ) +char *s; +{ + gen_trees = 1; +} + +static void +#ifdef __STDC__ +pFile( char *s ) +#else +pFile( s ) +char *s; +#endif +{ + if ( *s=='-' ) + { + fprintf(stderr, "invalid option: '%s'; ignored...",s); + return; + } + + require(num_files0 ) { + warn("can't define classes w/o C++ mode; turning on C++ mode...\n"); + gen_CPP=1; + } + if ( gen_CPP && num_classes==0 ) { + fatal("must define classes >0 grammar classes in C++ mode\n"); + } + + mk(project, files, num_files, argc, argv); + DONE; +} + +help() +{ + Opt *p = options; + static char buf[1000+1]; + + fprintf(stderr, "genmk [options] f1.g ... fn.g\n"); + while ( p->option!=NULL && *(p->option) != '*' ) + { + buf[0]='\0'; + if ( p->arg ) sprintf(buf, "%s ___", p->option); + else strcpy(buf, p->option); + fprintf(stderr, "\t%-16s %s\n", buf, p->descr); + p++; + } +} + +mk(project, files, n, argc, argv) +char *project; +char **files; +int n; +int argc; +char **argv; +{ + int i; + + printf("#\n"); + printf("# PCCTS makefile for: "); + pfiles(files, n, NULL); + printf("\n"); + printf("#\n"); + printf("# Created from:"); + for (i=0; i0 ) + { + char *p = &(*files)[strlen(*files)-1]; + if ( !first ) putchar(' '); + first=0; + while ( p > *files && *p != '.' ) --p; + if ( p == *files ) + { + fprintf(stderr, + "genmk: filenames must be file.suffix format: %s\n", + *files); + exit(-1); + } + if ( suffix == NULL ) printf("%s", *files); + else + { + *p = '\0'; + printf("%s", DIR()); + if ( strcmp(suffix, "o")==0 ) printf("%s%s", *files, OBJ_FILE_SUFFIX); + else printf("%s.%s", *files, suffix); + *p = '.'; + } + files++; + --n; + } +} + +pclasses(classes, n, suffix) +char **classes; +int n; +char *suffix; +{ + int first=1; + + while ( n>0 ) + { + if ( !first ) putchar(' '); + first=0; + if ( suffix == NULL ) printf("%s", *classes); + else { + printf("%s", DIR()); + if ( strcmp(suffix, "o")==0 ) printf("%s%s", *classes, OBJ_FILE_SUFFIX); + else printf("%s.%s", *classes, suffix); + } + classes++; + --n; + } +} + +static void +#ifdef __STDC__ +ProcessArgs( int argc, char **argv, Opt *options ) +#else +ProcessArgs( argc, argv, options ) +int argc; +char **argv; +Opt *options; +#endif +{ + Opt *p; + require(argv!=NULL, "ProcessArgs: command line NULL"); + + while ( argc-- > 0 ) + { + p = options; + while ( p->option != NULL ) + { + if ( strcmp(p->option, "*") == 0 || + strcmp(p->option, *argv) == 0 ) + { + if ( p->arg ) + { + (*p->process)( *argv, *(argv+1) ); + argv++; + argc--; + } + else + (*p->process)( *argv ); + break; + } + p++; + } + argv++; + } +} + +fatal( err_) +char *err_; +{ + fprintf(stderr, "genmk: %s\n", err_); + exit(1); +} + +warn( err_) +char *err_; +{ + fprintf(stderr, "genmk: %s\n", err_); +} + +char *DIR() +{ + static char buf[200+1]; + + if ( strcmp(outdir,TopDirectory)==0 ) return ""; + sprintf(buf, "%s%s", outdir, DirectorySymbol); + return buf; +} diff --git a/support/genmk/watgenmk.mak b/support/genmk/watgenmk.mak new file mode 100755 index 0000000..194a179 --- /dev/null +++ b/support/genmk/watgenmk.mak @@ -0,0 +1,54 @@ +SET=..\..\support\set +PCCTS_H=..\..\h + +# +# Watcom +# +CC=wcl386 +ANTLR=..\..\bin\antlr +DLG=..\..\bin\dlg +CFLAGS= -I. -I$(SET) -I$(PCCTS_H) -DUSER_ZZSYN -DPC +OUT_OBJ = -o +OBJ_EXT = obj +LINK = wcl386 + +.c.obj : + $(CC) -c $[* $(CFLAGS) + +genmk.exe: genmk.obj + $(LINK) -fe=genmk.exe *.obj -k14336 + copy *.exe ..\..\bin + +#clean up all the intermediate files +clean: + del *.obj + +#remove everything in clean plus the PCCTS files generated +scrub: + del *.$(OBJ_EXT) +EOF_watgenmk.mak +cat << \EOF_makefile | sed 's/^>//' > makefile +SRC=genmk.c +OBJ=genmk.o +# Define PC if you use a PC OS (changes directory symbol and object file extension) +# see pccts/h/config.h +#CFLAGS=-I../../h -DPC +CFLAGS=-I../../h +CC=cc +BAG=../../bin/bag + +genmk: $(OBJ) $(SRC) ../../h/config.h + $(CC) -o genmk $(OBJ) + +clean: + rm -rf core *.o + +scrub: + rm -rf genmk core *.o + +shar: + shar genmk.c makefile > genmk.shar + +archive: + $(BAG) genmk.c watgenmk.mak makefile > genmk.bag +EOF_makefile diff --git a/support/rexpr/makefile b/support/rexpr/makefile new file mode 100755 index 0000000..c0f343e --- /dev/null +++ b/support/rexpr/makefile @@ -0,0 +1,19 @@ +BAG=../../bin/bag +SRC=test.c rexpr.c +OBJ=test.o rexpr.o +CFLAGS = -g + +test: $(OBJ) $(SRC) + cc -g -o texpr $(OBJ) + +shar: + shar makefile test.c rexpr.c rexpr.h > rexpr.shar + +archive: + $(BAG) makefile test.c rexpr.c rexpr.h > rexpr.bag + +clean: + rm -rf *.o core texpr + +scrub: + rm -rf *.o core texpr diff --git a/support/rexpr/rexpr.c b/support/rexpr/rexpr.c new file mode 100755 index 0000000..4b7f95e --- /dev/null +++ b/support/rexpr/rexpr.c @@ -0,0 +1,526 @@ +/* + * This file contains code for + * + * int rexpr(char *expr, char *s); + * + * which answers + * + * 1 if 's' is in the language described by the regular expression 'expr' + * 0 if it is not + * -1 if the regular expression is invalid + * + * Language membership is determined by constructing a non-deterministic + * finite automata (NFA) from the regular expression. A depth- + * first-search is performed on the NFA (graph) to check for a match of 's'. + * Each non-epsilon arc consumes one character from 's'. Backtracking is + * performed to check all possible paths through the NFA. + * + * Regular expressions follow the meta-language: + * + * ::= ( '|' )* + * + * ::= ( )* + * + * ::= {'~'} '[' ']' + * | '(' ')' + * | '{' '}' + * | + * + * ::= { '*' | '+' } + * + * ::= ( )* + * | { } '-' { } + * + * ::= Token[Atom] + * + * Notes: + * ~ means complement the set in [..]. i.e. all characters not listed + * * means match 0 or more times (can be on expression or atom) + * + means match 1 or more times (can be on expression or atom) + * {} optional + * () grouping + * [] set of atoms + * x-y all characters from x to y (found only in [..]) + * \xx the character with value xx + * + * Examples: + * [a-z]+ + * match 1 or more lower-case letters (e.g. variable) + * + * 0x[0-9A-Fa-f]+ + * match a hex number with 0x on front (e.g. 0xA1FF) + * + * [0-9]+.[0-9]+{e[0-9]+} + * match a floating point number (e.g. 3.14e21) + * + * Code example: + * if ( rexpr("[a-zA-Z][a-zA-Z0-9]+", str) ) then str is keyword + * + * Terence Parr + * Purdue University + * April 1991 + */ + +#include +#include +#ifdef __STDC__ +#include +#else +#include +#endif +#include "rexpr.h" + +#ifdef __STDC__ +static int regExpr( GraphPtr g ); +static int andExpr( GraphPtr g ); +static int expr( GraphPtr g ); +static int repeatSymbol( GraphPtr g ); +static int atomList( char *p, int complement ); +static int next( void ); +static ArcPtr newGraphArc( void ); +static NodePtr newNode( void ); +static int ArcBetweenGraphNode( NodePtr i, NodePtr j, int label ); +static Graph BuildNFA_atom( int label ); +static Graph BuildNFA_AB( Graph A, Graph B ); +static Graph BuildNFA_AorB( Graph A, Graph B ); +static Graph BuildNFA_set( char *s ); +static Graph BuildNFA_Astar( Graph A ); +static Graph BuildNFA_Aplus( Graph A ); +static Graph BuildNFA_Aoptional( Graph A ); +#else +static int regExpr(); +static int andExpr(); +static int expr(); +static int repeatSymbol(); +static int atomList(); +static int next(); +static ArcPtr newGraphArc(); +static NodePtr newNode(); +static int ArcBetweenGraphNode(); +static Graph BuildNFA_atom(); +static Graph BuildNFA_AB(); +static Graph BuildNFA_AorB(); +static Graph BuildNFA_set(); +static Graph BuildNFA_Astar(); +static Graph BuildNFA_Aplus(); +static Graph BuildNFA_Aoptional(); +#endif + +static char *_c; +static int token, tokchar; +static NodePtr accept; +static NodePtr freelist = NULL; + +/* + * return 1 if s in language described by expr + * 0 if s is not + * -1 if expr is an invalid regular expression + */ +rexpr(expr, s) +char *expr, *s; +{ + NodePtr p,q; + Graph nfa; + int result; + + fprintf(stderr, "rexpr(%s,%s);\n", expr,s); + freelist = NULL; + _c = expr; + next(); + if ( regExpr(&nfa) == -1 ) return -1; + accept = nfa.right; + result = match(nfa.left, s); + /* free all your memory */ + p = q = freelist; + while ( p!=NULL ) { q = p->track; free(p); p = q; } + return result; +} + +/* + * do a depth-first-search on the NFA looking for a path from start to + * accept state labelled with the characters of 's'. + */ +match(automaton, s) +NodePtr automaton; +char *s; +{ + ArcPtr p; + + if ( automaton == accept && *s == '\0' ) return 1; /* match */ + + for (p=automaton->arcs; p!=NULL; p=p->next) /* try all arcs */ + { + if ( p->label == Epsilon ) + { + if ( match(p->target, s) ) return 1; + } + else if ( p->label == *s ) + if ( match(p->target, s+1) ) return 1; + } + return 0; +} + +/* + * ::= ( '|' {} )* + * + * Return -1 if syntax error + * Return 0 if none found + * Return 1 if a regExrp was found + */ +static +regExpr(g) +GraphPtr g; +{ + Graph g1, g2; + + if ( andExpr(&g1) == -1 ) + { + return -1; + } + + while ( token == '|' ) + { + int a; + next(); + a = andExpr(&g2); + if ( a == -1 ) return -1; /* syntax error below */ + else if ( !a ) return 1; /* empty alternative */ + g1 = BuildNFA_AorB(g1, g2); + } + + if ( token!='\0' ) return -1; + + *g = g1; + return 1; +} + +/* + * ::= ( )* + */ +static +andExpr(g) +GraphPtr g; +{ + Graph g1, g2; + + if ( expr(&g1) == -1 ) + { + return -1; + } + + while ( token==Atom || token=='{' || token=='(' || token=='~' || token=='[' ) + { + if (expr(&g2) == -1) return -1; + g1 = BuildNFA_AB(g1, g2); + } + + *g = g1; + return 1; +} + +/* + * ::= {'~'} '[' ']' + * | '(' ')' + * | '{' '}' + * | + */ +static +expr(g) +GraphPtr g; +{ + int complement = 0; + char s[257]; /* alloc space for string of char in [] */ + + if ( token == '~' || token == '[' ) + { + if ( token == '~' ) {complement = 1; next();} + if ( token != '[' ) return -1; + next(); + if ( atomList( s, complement ) == -1 ) return -1; + *g = BuildNFA_set( s ); + if ( token != ']' ) return -1; + next(); + repeatSymbol( g ); + return 1; + } + if ( token == '(' ) + { + next(); + if ( regExpr( g ) == -1 ) return -1; + if ( token != ')' ) return -1; + next(); + repeatSymbol( g ); + return 1; + } + if ( token == '{' ) + { + next(); + if ( regExpr( g ) == -1 ) return -1; + if ( token != '}' ) return -1; + next(); + /* S p e c i a l C a s e O p t i o n a l { } */ + if ( token != '*' && token != '+' ) + { + *g = BuildNFA_Aoptional( *g ); + } + repeatSymbol( g ); + return 1; + } + if ( token == Atom ) + { + *g = BuildNFA_atom( tokchar ); + next(); + repeatSymbol( g ); + return 1; + } + + return -1; +} + +/* + * ::= { '*' | '+' } + */ +static +repeatSymbol(g) +GraphPtr g; +{ + switch ( token ) + { + case '*' : *g = BuildNFA_Astar( *g ); next(); break; + case '+' : *g = BuildNFA_Aplus( *g ); next(); break; + } + return 1; +} + +/* + * ::= { }* + * { } '-' { } + * + * a-b is same as ab + * q-a is same as q + */ +static +atomList(p, complement) +char *p; +int complement; +{ + static unsigned char set[256]; /* no duplicates */ + int first, last, i; + char *s = p; + + if ( token != Atom ) return -1; + + for (i=0; i<256; i++) set[i] = 0; + while ( token == Atom ) + { + if ( !set[tokchar] ) *s++ = tokchar; + set[tokchar] = 1; /* Add atom to set */ + next(); + if ( token == '-' ) /* have we found '-' */ + { + first = *(s-1); /* Get last char */ + next(); + if ( token != Atom ) return -1; + else + { + last = tokchar; + } + for (i = first+1; i <= last; i++) + { + if ( !set[tokchar] ) *s++ = i; + set[i] = 1; /* Add atom to set */ + } + next(); + } + } + *s = '\0'; + if ( complement ) + { + for (i=0; i<256; i++) set[i] = !set[i]; + for (i=1,s=p; i<256; i++) if ( set[i] ) *s++ = i; + *s = '\0'; + } + return 1; +} + +/* a somewhat stupid lexical analyzer */ +static +next() +{ + while ( *_c==' ' || *_c=='\t' || *_c=='\n' ) _c++; + if ( *_c=='\\' ) + { + _c++; + if ( isdigit(*_c) ) + { + int n=0; + while ( isdigit(*_c) ) + { + n = n*10 + (*_c++ - '0'); + } + if ( n>255 ) n=255; + tokchar = n; + } + else + { + switch (*_c) + { + case 'n' : tokchar = '\n'; break; + case 't' : tokchar = '\t'; break; + case 'r' : tokchar = '\r'; break; + default : tokchar = *_c; + } + _c++; + } + token = Atom; + } + else if ( isgraph(*_c) && *_c!='[' && *_c!='(' && *_c!='{' && + *_c!='-' && *_c!='}' && *_c!=')' && *_c!=']' && + *_c!='+' && *_c!='*' && *_c!='~' && *_c!='|' ) + { + token = Atom; + tokchar = *_c++; + } + else + { + token = tokchar = *_c++; + } +} + +/* N F A B u i l d i n g R o u t i n e s */ + +static +ArcPtr +newGraphArc() +{ + ArcPtr p; + p = (ArcPtr) calloc(1, sizeof(Arc)); + if ( p==NULL ) {fprintf(stderr,"rexpr: out of memory\n"); exit(-1);} + if ( freelist != NULL ) p->track = (ArcPtr) freelist; + freelist = (NodePtr) p; + return p; +} + +static +NodePtr +newNode() +{ + NodePtr p; + p = (NodePtr) calloc(1, sizeof(Node)); + if ( p==NULL ) {fprintf(stderr,"rexpr: out of memory\n"); exit(-1);} + if ( freelist != NULL ) p->track = freelist; + freelist = p; + return p; +} + +static +ArcBetweenGraphNodes(i, j, label) +NodePtr i, j; +int label; +{ + ArcPtr a; + + a = newGraphArc(); + if ( i->arcs == NULL ) i->arctail = i->arcs = a; + else {(i->arctail)->next = a; i->arctail = a;} + a->label = label; + a->target = j; +} + +static Graph +BuildNFA_atom(label) +int label; +{ + Graph g; + + g.left = newNode(); + g.right = newNode(); + ArcBetweenGraphNodes(g.left, g.right, label); + return( g ); +} + +static Graph +BuildNFA_AB(A, B) +Graph A, B; +{ + Graph g; + + ArcBetweenGraphNodes(A.right, B.left, Epsilon); + g.left = A.left; + g.right = B.right; + return( g ); +} + +static Graph +BuildNFA_AorB(A, B) +Graph A, B; +{ + Graph g; + + g.left = newNode(); + ArcBetweenGraphNodes(g.left, A.left, Epsilon); + ArcBetweenGraphNodes(g.left, B.left, Epsilon); + g.right = newNode(); + ArcBetweenGraphNodes(A.right, g.right, Epsilon); + ArcBetweenGraphNodes(B.right, g.right, Epsilon); + return( g ); +} + +static Graph +BuildNFA_set( s ) +char *s; +{ + Graph g; + + if ( s == NULL ) return g; + + g.left = newNode(); + g.right = newNode(); + while ( *s != '\0' ) + { + ArcBetweenGraphNodes(g.left, g.right, *s++); + } + return g; +} + +static Graph +BuildNFA_Astar( A ) +Graph A; +{ + Graph g; + + g.left = newNode(); + g.right = newNode(); + + ArcBetweenGraphNodes(g.left, A.left, Epsilon); + ArcBetweenGraphNodes(g.left, g.right, Epsilon); + ArcBetweenGraphNodes(A.right, g.right, Epsilon); + ArcBetweenGraphNodes(A.right, A.left, Epsilon); + + return( g ); +} + +static Graph +BuildNFA_Aplus( A ) +Graph A; +{ + ArcBetweenGraphNodes(A.right, A.left, Epsilon); + + return( A ); +} + +static Graph +BuildNFA_Aoptional( A ) +Graph A; +{ + Graph g; + + g.left = newNode(); + g.right = newNode(); + + ArcBetweenGraphNodes(g.left, A.left, Epsilon); + ArcBetweenGraphNodes(g.left, g.right, Epsilon); + ArcBetweenGraphNodes(A.right, g.right, Epsilon); + + return( g ); +} diff --git a/support/rexpr/rexpr.h b/support/rexpr/rexpr.h new file mode 100755 index 0000000..336be2e --- /dev/null +++ b/support/rexpr/rexpr.h @@ -0,0 +1,30 @@ +#define Atom 256 /* token Atom (an impossible char value) */ +#define Epsilon 257 /* epsilon arc (an impossible char value) */ + +/* track field must be same for all node types */ +typedef struct _a { + struct _a *track; /* track mem allocation */ + int label; + struct _a *next; + struct _n *target; + } Arc, *ArcPtr; + +typedef struct _n { + struct _n *track; + ArcPtr arcs, arctail; + } Node, *NodePtr; + +typedef struct { + NodePtr left, + right; + } Graph, *GraphPtr; + +#ifdef __STDC__ +int rexpr( char *expr, char *s ); +int match( NodePtr automaton, char *s ); +#else +int rexpr(); +int match(); +#endif + + diff --git a/support/rexpr/test.c b/support/rexpr/test.c new file mode 100755 index 0000000..e159cc4 --- /dev/null +++ b/support/rexpr/test.c @@ -0,0 +1,19 @@ +#include +#include "rexpr.h" + +/* + * test for rexpr(). + * To make this test: + * cc -o rexpr test.c rexpr.c + * Then from command line type: + * rexpr r string + * where r is the regular expression that decribes a language + * and string is the string to verify. + */ +main(argc,argv) +int argc; +char *argv[]; +{ + if ( argc!=3 ) fprintf(stderr,"rexpr: expr s\n"); + else printf("%d\n", rexpr(argv[1], argv[2])); +} diff --git a/support/set/set.c b/support/set/set.c new file mode 100755 index 0000000..cc49e87 --- /dev/null +++ b/support/set/set.c @@ -0,0 +1,792 @@ +/* set.c + + The following is a general-purpose set library originally developed + by Hank Dietz and enhanced by Terence Parr to allow dynamic sets. + + Sets are now structs containing the #words in the set and + a pointer to the actual set words. + + Generally, sets need not be explicitly allocated. They are + created/extended/shrunk when appropriate (e.g. in set_of()). + HOWEVER, sets need to be destroyed (free()ed) when they go out of scope + or are otherwise no longer needed. A routine is provided to + free a set. + + Sets can be explicitly created with set_new(s, max_elem). + + Sets can be declared to have minimum size to reduce realloc traffic. + Default minimum size = 1. + + Sets can be explicitly initialized to have no elements (set.n == 0) + by using the 'empty' initializer: + + Examples: + set a = empty; -- set_deg(a) == 0 + + return( empty ); + + Example set creation and destruction: + + set + set_of2(e,g) + unsigned e,g; + { + set a,b,c; + + b = set_of(e); -- Creates space for b and sticks in e + set_new(c, g); -- set_new(); set_orel() ==> set_of() + set_orel(g, &c); + a = set_or(b, c); + . + . + . + set_free(b); + set_free(c); + return( a ); + } + + 1987 by Hank Dietz + + Modified by: + Terence Parr + Purdue University + October 1989 + + Made it smell less bad to C++ 7/31/93 -- TJP +*/ + +#include +#ifdef __cplusplus +#ifndef __STDC__ +#define __STDC__ +#endif +#endif +#ifdef __STDC__ +#include +#else +#include +#endif +#include + +#include "set.h" + +/* elems can be a maximum of 32 bits */ +static unsigned bitmask[] = { + 0x00000001, 0x00000002, 0x00000004, 0x00000008, + 0x00000010, 0x00000020, 0x00000040, 0x00000080, + 0x00000100, 0x00000200, 0x00000400, 0x00000800, + 0x00001000, 0x00002000, 0x00004000, 0x00008000, +#if !defined(PC) || defined(PC32) + 0x00010000, 0x00020000, 0x00040000, 0x00080000, + 0x00100000, 0x00200000, 0x00400000, 0x00800000, + 0x01000000, 0x02000000, 0x04000000, 0x08000000, + 0x10000000, 0x20000000, 0x40000000, 0x80000000 +#endif +}; + +set empty = set_init; +static unsigned min=1; + +#define StrSize 200 + +#ifdef MEMCHK +#define CHK(a) \ + if ( a.setword != NULL ) \ + if ( !valid(a.setword) ) \ + {fprintf(stderr, "%s(%d): invalid set\n",__FILE__,__LINE__); exit(-1);} +#else +#define CHK(a) +#endif + +/* + * Set the minimum size (in words) of a set to reduce realloc calls + */ +void +#ifdef __STDC__ +set_size( unsigned n ) +#else +set_size( n ) +unsigned n; +#endif +{ + min = n; +} + +unsigned int +#ifdef __STDC__ +set_deg( set a ) +#else +set_deg( a ) +set a; +#endif +{ + /* Fast compute degree of a set... the number + of elements present in the set. Assumes + that all word bits are used in the set + and that SETSIZE(a) is a multiple of WORDSIZE. + */ + register unsigned *p = &(a.setword[0]); + register unsigned *endp = &(a.setword[a.n]); + register unsigned degree = 0; + + CHK(a); + if ( a.n == 0 ) return(0); + while ( p < endp ) + { + register unsigned t = *p; + register unsigned *b = &(bitmask[0]); + do { + if (t & *b) ++degree; + } while (++b < &(bitmask[WORDSIZE])); + p++; + } + + return(degree); +} + +set +#ifdef __STDC__ +set_or( set b, set c ) +#else +set_or( b, c ) +set b; +set c; +#endif +{ + /* Fast set union operation */ + /* resultant set size is max(b, c); */ + set *big; + set t; + unsigned int m,n; + register unsigned *r, *p, *q, *endp; + + CHK(b); CHK(c); + t = empty; + if (b.n > c.n) {big= &b; m=b.n; n=c.n;} else {big= &c; m=c.n; n=b.n;} + set_ext(&t, m); + r = t.setword; + + /* Or b,c until max of smaller set */ + q = c.setword; + p = b.setword; + endp = &(b.setword[n]); + while ( p < endp ) *r++ = *p++ | *q++; + + /* Copy rest of bigger set into result */ + p = &(big->setword[n]); + endp = &(big->setword[m]); + while ( p < endp ) *r++ = *p++; + + return(t); +} + +set +#ifdef __STDC__ +set_and( set b, set c ) +#else +set_and( b, c ) +set b; +set c; +#endif +{ + /* Fast set intersection operation */ + /* resultant set size is min(b, c); */ + set t; + unsigned int n; + register unsigned *r, *p, *q, *endp; + + CHK(b); CHK(c); + t = empty; + n = (b.n > c.n) ? c.n : b.n; + if ( n == 0 ) return t; /* TJP 4-27-92 fixed for empty set */ + set_ext(&t, n); + r = t.setword; + + /* & b,c until max of smaller set */ + q = c.setword; + p = b.setword; + endp = &(b.setword[n]); + while ( p < endp ) *r++ = *p++ & *q++; + + return(t); +} + +set +#ifdef __STDC__ +set_dif( set b, set c ) +#else +set_dif( b, c ) +set b; +set c; +#endif +{ + /* Fast set difference operation b - c */ + /* resultant set size is size(b) */ + set t; + unsigned int n; + register unsigned *r, *p, *q, *endp; + + CHK(b); CHK(c); + t = empty; + n = (b.n <= c.n) ? b.n : c.n ; + if ( b.n == 0 ) return t; /* TJP 4-27-92 fixed for empty set */ + /* WEC 12-1-92 fixed for c.n = 0 */ + set_ext(&t, b.n); + r = t.setword; + + /* Dif b,c until smaller set size */ + q = c.setword; + p = b.setword; + endp = &(b.setword[n]); + while ( p < endp ) *r++ = *p++ & (~ *q++); + + /* Copy rest of b into result if size(b) > c */ + if ( b.n > n ) + { + p = &(b.setword[n]); + endp = &(b.setword[b.n]); + while ( p < endp ) *r++ = *p++; + } + + return(t); +} + +set +#ifdef __STDC__ +set_of( unsigned b ) +#else +set_of( b ) +unsigned b; +#endif +{ + /* Fast singleton set constructor operation */ + static set a; + + if ( b == nil ) return( empty ); + set_new(a, b); + a.setword[DIVWORD(b)] = bitmask[MODWORD(b)]; + + return(a); +} + +/* + * Extend (or shrink) the set passed in to have n words. + * + * if n is smaller than the minimum, boost n to have the minimum. + * if the new set size is the same as the old one, do nothing. + * + * TJP 4-27-92 Fixed so won't try to alloc 0 bytes + */ +void +#ifdef __STDC__ +set_ext( set *a, unsigned int n ) +#else +set_ext( a, n ) +set *a; +unsigned int n; +#endif +{ + register unsigned *p; + register unsigned *endp; + unsigned int size; + + CHK((*a)); + if ( a->n == 0 ) + { + if ( n == 0 ) return; + a->setword = (unsigned *) calloc(n, BytesPerWord); + if ( a->setword == NULL ) + { + fprintf(stderr, "set_ext(%d words): cannot allocate set\n", n); + exit(-1); + } + a->n = n; + return; + } + if ( n < min ) n = min; + if ( a->n == n || n == 0 ) return; + size = a->n; + a->n = n; + a->setword = (unsigned *) realloc( (char *)a->setword, (n*BytesPerWord) ); + if ( a->setword == NULL ) + { + fprintf(stderr, "set_ext(%d words): cannot allocate set\n", n); + exit(-1); + } + + p = &(a->setword[size]); /* clear from old size to new size */ + endp = &(a->setword[a->n]); + do { + *p++ = 0; + } while ( p < endp ); +} + +set +#ifdef __STDC__ +set_not( set a ) +#else +set_not( a ) +set a; +#endif +{ + /* Fast not of set a (assumes all bits used) */ + /* size of resultant set is size(a) */ + /* ~empty = empty cause we don't know how bit to make set */ + set t; + register unsigned *r; + register unsigned *p = a.setword; + register unsigned *endp = &(a.setword[a.n]); + + CHK(a); + t = empty; + if ( a.n == 0 ) return( empty ); + set_ext(&t, a.n); + r = t.setword; + + do { + *r++ = (~ *p++); + } while ( p < endp ); + + return(t); +} + +int +#ifdef __STDC__ +set_equ( set a, set b ) +#else +set_equ( a, b ) +set a; +set b; +#endif +{ + /* Fast set equality comparison operation */ + register unsigned *p = a.setword; + register unsigned *q = b.setword; + register unsigned *endp = &(a.setword[a.n]); + + CHK(a); CHK(b); +/* if ( a.n != b.n ) return(0);*/ + if ( set_deg(a) != set_deg(b) ) return(0); + else if ( a.n==0 ) return(1); /* empty == empty */ + + do { + if (*p != *q) return(0); + ++q; + } while ( ++p < endp ); + + return(1); +} + +int +#ifdef __STDC__ +set_sub( set a, set b ) +#else +set_sub( a, b ) +set a; +set b; +#endif +{ + /* Fast check for a is a proper subset of b (alias a < b) */ + register unsigned *p = a.setword; + register unsigned *q = b.setword; + register unsigned *endp = &(a.setword[a.n]); + register int asubset = 0; + + CHK(a); CHK(b); + if ( set_deg(a) > set_deg(b) ) return(0); + if ( set_deg(a)==0 && set_deg(b)==0) return(1);/* empty prop sub of empty */ + if ( set_deg(a) == 0 ) return(1); /* empty is sub of everything */ +#ifdef DUH +/* Was: */ + if ( a.n > b.n ) return(0); + if (a.n==0 && b.n==0) return(1);/* empty prop sub of empty */ + if ( a.n == 0 ) return(1); /* empty is sub of everything */ +#endif + + do { + /* Prune tests based on guess that most set words + will match, particularly if a is a subset of b. + */ + if (*p != *q) { + if (*p & ~(*q)) { + /* Fail -- a contains something b does not */ + return(0); + } + /* At least this word was a proper subset, hence + even if all other words are equal, a is a + proper subset of b. + */ + asubset = 1; + } + ++q; + } while (++p < endp); + + /* at this point, a,b are equ or a subset */ + if ( asubset || b.n == a.n ) return(asubset); + + /* if !asubset, size(b) > size(a), then a=b and must check rest of b */ + p = q; + endp = &(b.setword[b.n]); + do + { + if ( *p++ ) return(1); + } while ( p < endp ); + + return(0); +} + +unsigned +#ifdef __STDC__ +set_int( set b ) +#else +set_int( b ) +set b; +#endif +{ + /* Fast pick any element of the set b */ + register unsigned *p = b.setword; + register unsigned *endp = &(b.setword[b.n]); + + CHK(b); + if ( b.n == 0 ) return( nil ); + + do { + if (*p) { + /* Found a non-empty word of the set */ + register unsigned i = ((p - b.setword) << LogWordSize); + register unsigned t = *p; + p = &(bitmask[0]); + while (!(*p & t)) { + ++i; ++p; + } + return(i); + } + } while (++p < endp); + + /* Empty -- only element it contains is nil */ + return(nil); +} + +int +#ifdef __STDC__ +set_el( unsigned b, set a ) +#else +set_el( b, a ) +unsigned b; +set a; +#endif +{ + CHK(a); + /* nil is an element of every set */ + if (b == nil) return(1); + if ( a.n == 0 || NumWords(b) > a.n ) return(0); + + /* Otherwise, we have to check */ + return( a.setword[DIVWORD(b)] & bitmask[MODWORD(b)] ); +} + +int +#ifdef __STDC__ +set_nil( set a ) +#else +set_nil( a ) +set a; +#endif +{ + /* Fast check for nil set */ + register unsigned *p = a.setword; + register unsigned *endp = &(a.setword[a.n]); + + CHK(a); + if ( a.n == 0 ) return(1); + /* The set is not empty if any word used to store + the set is non-zero. This means one must be a + bit careful about doing things like negation. + */ + do { + if (*p) return(0); + } while (++p < endp); + + return(1); +} + +char * +#ifdef __STDC__ +set_str( set a ) +#else +set_str( a ) +set a; +#endif +{ + /* Fast convert set a into ASCII char string... + assumes that all word bits are used in the set + and that SETSIZE is a multiple of WORDSIZE. + Trailing 0 bits are removed from the string. + if no bits are on or set is empty, "" is returned. + */ + register unsigned *p = a.setword; + register unsigned *endp = &(a.setword[a.n]); + static char str_tmp[StrSize+1]; + register char *q = &(str_tmp[0]); + + CHK(a); + if ( a.n==0 ) {*q=0; return( &(str_tmp[0]) );} + do { + register unsigned t = *p; + register unsigned *b = &(bitmask[0]); + do { + *(q++) = (char) ((t & *b) ? '1' : '0'); + } while (++b < &(bitmask[WORDSIZE])); + } while (++p < endp); + + /* Trim trailing 0s & NULL terminate the string */ + while ((q > &(str_tmp[0])) && (*(q-1) != '1')) --q; + *q = 0; + + return(&(str_tmp[0])); +} + +set +#ifdef __STDC__ +set_val( register char *s ) +#else +set_val( s ) +register char *s; +#endif +{ + /* Fast convert set ASCII char string into a set. + If the string ends early, the remaining set bits + are all made zero. + The resulting set size is just big enough to hold all elements. + */ + static set a; + register unsigned *p, *endp; + + set_new(a, strlen(s)); + p = a.setword; + endp = &(a.setword[a.n]); + do { + register unsigned *b = &(bitmask[0]); + /* Start with a word with no bits on */ + *p = 0; + do { + if (*s) { + if (*s == '1') { + /* Turn-on this bit */ + *p |= *b; + } + ++s; + } + } while (++b < &(bitmask[WORDSIZE])); + } while (++p < endp); + + return(a); +} + +/* + * Or element e into set a. a can be empty. + */ +void +#ifdef __STDC__ +set_orel( unsigned e, set *a ) +#else +set_orel( e, a ) +unsigned e; +set *a; +#endif +{ + CHK((*a)); + if ( e == nil ) return; + if ( NumWords(e) > a->n ) set_ext(a, NumWords(e)); + a->setword[DIVWORD(e)] |= bitmask[MODWORD(e)]; +} + +/* + * Or set b into set a. a can be empty. does nothing if b empty. + */ +void +#ifdef __STDC__ +set_orin( set *a, set b ) +#else +set_orin( a, b ) +set *a; +set b; +#endif +{ + /* Fast set union operation */ + /* size(a) is max(a, b); */ + unsigned int m; + register unsigned *p, + *q = b.setword, + *endq = &(b.setword[b.n]); + + CHK((*a)); CHK(b); + if ( b.n == 0 ) return; + m = (a->n > b.n) ? a->n : b.n; + set_ext(a, m); + p = a->setword; + do { + *p++ |= *q++; + } while ( q < endq ); +} + +void +#ifdef __STDC__ +set_rm( unsigned e, set a ) +#else +set_rm( e, a ) +unsigned e; +set a; +#endif +{ + /* Does not effect size of set */ + CHK(a); + if ( (e == nil) || (NumWords(e) > a.n) ) return; + a.setword[DIVWORD(e)] ^= (a.setword[DIVWORD(e)]&bitmask[MODWORD(e)]); +} + +void +#ifdef __STDC__ +set_clr( set a ) +#else +set_clr( a ) +set a; +#endif +{ + /* Does not effect size of set */ + register unsigned *p = a.setword; + register unsigned *endp = &(a.setword[a.n]); + + CHK(a); + if ( a.n == 0 ) return; + do { + *p++ = 0; + } while ( p < endp ); +} + +set +#ifdef __STDC__ +set_dup( set a ) +#else +set_dup( a ) +set a; +#endif +{ + set b; + register unsigned *p, + *q = a.setword, + *endq = &(a.setword[a.n]); + + CHK(a); + b = empty; + if ( a.n == 0 ) return( empty ); + set_ext(&b, a.n); + p = b.setword; + do { + *p++ = *q++; + } while ( q < endq ); + + return(b); +} + +/* + * Return a nil terminated list of unsigned ints that represents all + * "on" bits in the bit set. + * + * e.g. {011011} --> {1, 2, 4, 5, nil} + * + * _set_pdq and set_pdq are useful when an operation is required on each element + * of a set. Normally, the sequence is: + * + * while ( set_deg(a) > 0 ) { + * e = set_int(a); + * set_rm(e, a); + * ...process e... + * } + * Now, + * + * t = e = set_pdq(a); + * while ( *e != nil ) { + * ...process *e... + * e++; + * } + * free( t ); + * + * We have saved many set calls and have not destroyed set a. + */ +void +#ifdef __STDC__ +_set_pdq( set a, register unsigned *q ) +#else +_set_pdq( a, q ) +set a; +register unsigned *q; +#endif +{ + register unsigned *p = a.setword, + *endp = &(a.setword[a.n]); + register unsigned e=0; + + CHK(a); + /* are there any space (possibility of elements)? */ + if ( a.n == 0 ) return; + do { + register unsigned t = *p; + register unsigned *b = &(bitmask[0]); + do { + if ( t & *b ) *q++ = e; + ++e; + } while (++b < &(bitmask[WORDSIZE])); + } while (++p < endp); + *q = nil; +} + +/* + * Same as _set_pdq except allocate memory. set_pdq is the natural function + * to use. + */ +unsigned * +#ifdef __STDC__ +set_pdq( set a ) +#else +set_pdq( a ) +set a; +#endif +{ + unsigned *q; + int max_deg; + + CHK(a); + max_deg = WORDSIZE*a.n; + /* assume a.n!=0 & no elements is rare, but still ok */ + if ( a.n == 0 ) return(NULL); + q = (unsigned *) malloc((max_deg+1)*BytesPerWord); + if ( q == NULL ) return( NULL ); + _set_pdq(a, q); + return( q ); +} + +/* a function that produces a hash number for the set + */ +unsigned int +#ifdef __STDC__ +set_hash( set a, register unsigned int mod ) +#else +set_hash( a, mod ) +set a; +register unsigned int mod; +#endif +{ + /* Fast hash of set a (assumes all bits used) */ + register unsigned *p = &(a.setword[0]); + register unsigned *endp = &(a.setword[a.n]); + register unsigned i = 0; + + CHK(a); + while (p> LogWordSize) /* x / WORDSIZE */ +#define nil (~((unsigned) 0)) /* An impossible set member all bits on (big!) */ + +typedef struct _set { + unsigned int n; /* Number of words in set */ + unsigned *setword; + } set; + +#define set_init {0, NULL} +#define set_null(a) ((a).setword==NULL) + +#define NumBytes(x) (((x)>>3)+1) /* Num bytes to hold x */ +#define NumWords(x) ((((unsigned)(x))>>LogWordSize)+1) /* Num words to hold x */ + + +/* M a c r o s */ + +/* make arg1 a set big enough to hold max elem # of arg2 */ +#define set_new(a,_max) \ +if (((a).setword=(unsigned *)calloc(NumWords(_max),BytesPerWord))==NULL) \ + fprintf(stderr, "set_new: Cannot allocate set with max of %d\n", _max); \ + (a).n = NumWords(_max); + +#define set_free(a) \ + {if ( (a).setword != NULL ) free((char *)((a).setword)); \ + (a) = empty;} + +#ifdef __STDC__ +extern void set_size( unsigned ); +extern unsigned int set_deg( set ); +extern set set_or( set, set ); +extern set set_and( set, set ); +extern set set_dif( set, set ); +extern set set_of( unsigned ); +extern void set_ext( set *, unsigned int ); +extern set set_not( set ); +extern int set_equ( set, set ); +extern int set_sub( set, set ); +extern unsigned set_int( set ); +extern int set_el( unsigned, set ); +extern int set_nil( set ); +extern char * set_str( set ); +extern set set_val( register char * ); +extern void set_orel( unsigned, set * ); +extern void set_orin( set *, set ); +extern void set_rm( unsigned, set ); +extern void set_clr( set ); +extern set set_dup( set ); +extern void set_PDQ( set, register unsigned * ); +extern unsigned *set_pdq( set ); +extern void _set_pdq( set a, register unsigned *q ); +extern unsigned int set_hash( set, register unsigned int ); +#else +extern void set_size(); +extern unsigned int set_deg(); +extern set set_or(); +extern set set_and(); +extern set set_dif(); +extern set set_of(); +extern void set_ext(); +extern set set_not(); +extern int set_equ(); +extern int set_sub(); +extern unsigned set_int(); +extern int set_el(); +extern int set_nil(); +extern char * set_str(); +extern set set_val(); +extern void set_orel(); +extern void set_orin(); +extern void set_rm(); +extern void set_clr(); +extern set set_dup(); +extern void set_PDQ(); +extern unsigned *set_pdq(); +extern void _set_pdq(); +extern unsigned int set_hash(); +#endif + +extern set empty; diff --git a/support/sym/template.h b/support/sym/template.h new file mode 100755 index 0000000..3839223 --- /dev/null +++ b/support/sym/template.h @@ -0,0 +1,41 @@ +/* T e m p l a t e F o r S y m b o l T a b l e M a n a g e r */ + +/* define some hash function */ +#ifndef HASH +#define HASH(p, h) while ( *p != '\0' ) h = (h<<1) + *p++; +#endif + +/* minimum symbol table record */ +typedef struct _sym { + char *symbol; + struct _sym *next, *prev, **head, *scope; + unsigned int hash; + } Sym, *SymPtr; + +#ifdef __STDC__ +void zzs_init(int, int); +void zzs_done(void); +void zzs_add(char *, Sym *); +Sym *zzs_get(char *); +void zzs_del(Sym *); +void zzs_keydel(char *); +Sym **zzs_scope(Sym **); +Sym *zzs_rmscope(Sym **); +void zzs_stat(void); +Sym *zzs_new(char *); +Sym *zzs_newadd(char *); +char *zzs_strdup(char *); +#else +void zzs_init(); +void zzs_done(); +void zzs_add(); +Sym *zzs_get(); +void zzs_del(); +void zzs_keydel(); +Sym **zzs_scope(); +Sym *zzs_rmscope(); +void zzs_stat(); +Sym *zzs_new(); +Sym *zzs_newadd(); +char *zzs_strdup(); +#endif -- 2.40.0