home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
pccts.zip
/
pccts
/
dlg
/
dlg_a.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-03-31
|
13KB
|
753 lines
/* parser.dlg -- DLG Description of scanner
*
* Generated from: dlg_p.g
*
* Terence Parr, Will Cohen, and Hank Dietz: 1989-1994
* Purdue University Electrical Engineering
* With AHPCRC, University of Minnesota
* ANTLR Version 1.20b6
*/
#include <stdio.h>
#define ANTLR_VERSION 120b6
#include <ctype.h>
#include "dlg.h"
#ifdef MEMCHK
#include "trax.h"
#endif
#include "antlr.h"
#include "tokens.h"
#include "dlgdef.h"
LOOKAHEAD
void zzerraction()
{
(*zzerr)("invalid token");
zzadvance();
zzskip();
}
/*
* D L G tables
*
* Generated from: parser.dlg
*
* 1989-1994 by Will Cohen, Terence Parr, and Hank Dietz
* Purdue University Electrical Engineering
* DLG Version 1.20
*/
#include "mode.h"
int func_action; /* should actions be turned into functions?*/
int lex_mode_counter = 0; /* keeps track of the number of %%names */
static void act1()
{
NLA = 1;
}
static void act2()
{
zzskip();
NLA = 2;
}
static void act3()
{
zzline++; zzskip();
NLA = 3;
}
static void act4()
{
NLA = L_EOF;
}
static void act5()
{
NLA = PER_PER;
}
static void act6()
{
p_mode_def(&zzlextext[2],lex_mode_counter++);
NLA = NAME_PER_PER;
}
static void act7()
{
if (func_action)
fprintf(OUT,"\n%s %sact%d()\n{ ",
gen_cpp?"TokenType":"static void",
gen_cpp?ClassName("::"):"", ++action_no);
zzmode(ACT); zzskip();
NLA = ACTION;
}
static void act8()
{
NLA = GREAT_GREAT;
}
static void act9()
{
NLA = L_BRACE;
}
static void act10()
{
NLA = R_BRACE;
}
static void act11()
{
NLA = L_PAR;
}
static void act12()
{
NLA = R_PAR;
}
static void act13()
{
NLA = L_BRACK;
}
static void act14()
{
NLA = R_BRACK;
}
static void act15()
{
NLA = ZERO_MORE;
}
static void act16()
{
NLA = ONE_MORE;
}
static void act17()
{
NLA = OR;
}
static void act18()
{
NLA = RANGE;
}
static void act19()
{
NLA = NOT;
}
static void act20()
{
{int t; sscanf(&zzlextext[1],"%o",&t); zzlextext[0] = t;}
NLA = OCTAL_VALUE;
}
static void act21()
{
{int t; sscanf(&zzlextext[3],"%x",&t); zzlextext[0] = t;}
NLA = HEX_VALUE;
}
static void act22()
{
{int t; sscanf(&zzlextext[1],"%d",&t); zzlextext[0] = t;}
NLA = DEC_VALUE;
}
static void act23()
{
zzlextext[0] = '\t';
NLA = TAB;
}
static void act24()
{
zzlextext[0] = '\n';
NLA = NL;
}
static void act25()
{
zzlextext[0] = '\r';
NLA = CR;
}
static void act26()
{
zzlextext[0] = '\b';
NLA = BS;
}
static void act27()
{
zzlextext[0] = zzlextext[1];
NLA = LIT;
}
static void act28()
{
NLA = REGCHAR;
}
static unsigned char shift0[257] = {
0, 29, 29, 29, 29, 29, 29, 29, 29, 29,
1, 2, 29, 29, 1, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 1, 29, 29, 29, 29, 4, 29,
29, 19, 20, 23, 24, 29, 26, 29, 29, 12,
13, 13, 13, 13, 13, 13, 13, 14, 14, 29,
29, 15, 29, 16, 29, 3, 7, 7, 7, 7,
7, 7, 11, 11, 11, 11, 11, 11, 11, 11,
11, 11, 11, 11, 11, 11, 11, 11, 11, 5,
11, 11, 21, 28, 22, 29, 11, 29, 7, 6,
7, 7, 7, 7, 11, 11, 11, 11, 11, 11,
11, 9, 11, 11, 11, 10, 11, 8, 11, 11,
11, 5, 11, 11, 17, 25, 18, 27, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
29, 29, 29, 29, 29, 29, 29
};
static void act29()
{
error("unterminated action", zzline); zzmode(START);
NLA = 1;
}
static void act30()
{
if (func_action) fprintf(OUT,"}\n\n");
zzmode(START);
NLA = ACTION;
}
static void act31()
{
putc(zzlextext[0], OUT); zzskip();
NLA = 29;
}
static void act32()
{
putc('>', OUT); zzskip();
NLA = 30;
}
static void act33()
{
putc('\\', OUT); zzskip();
NLA = 31;
}
static void act34()
{
putc(zzlextext[0], OUT); ++zzline; zzskip();
NLA = 32;
}
static void act35()
{
fprintf(OUT, "%s", &(zzlextext[0])); zzskip();
NLA = 33;
}
static unsigned char shift1[257] = {
0, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 3, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 1, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 2, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4
};
#define DfaStates 46
typedef unsigned char DfaState;
static DfaState st0[31] = {
1, 2, 3, 4, 5, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20, 6,
46
};
static DfaState st1[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st2[31] = {
46, 21, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st3[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st4[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st5[31] = {
46, 46, 46, 46, 22, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st6[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st7[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 23, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st8[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 24, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st9[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st10[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st11[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st12[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st13[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st14[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st15[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st16[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st17[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st18[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st19[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st20[31] = {
46, 25, 25, 25, 25, 25, 26, 25, 27, 28,
29, 25, 30, 31, 31, 25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
46
};
static DfaState st21[31] = {
46, 21, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st22[31] = {
46, 46, 46, 46, 46, 32, 32, 32, 32, 32,
32, 32, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st23[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st24[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st25[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st26[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st27[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st28[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st29[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st30[31] = {
46, 46, 46, 46, 46, 33, 46, 46, 46, 46,
46, 46, 34, 34, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st31[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 35, 35, 35, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st32[31] = {
46, 46, 46, 46, 46, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st33[31] = {
46, 46, 46, 46, 46, 46, 37, 37, 46, 46,
46, 46, 37, 37, 37, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st34[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 34, 34, 46, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st35[31] = {
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46, 46, 35, 35, 35, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st36[31] = {
46, 46, 46, 46, 46, 36, 36, 36, 36, 36,
36, 36, 36, 36, 36, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st37[31] = {
46, 46, 46, 46, 46, 46, 37, 37, 46, 46,
46, 46, 37, 37, 37, 46, 46, 46, 46, 46,
46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
46
};
static DfaState st38[6] = {
39, 40, 41, 42, 43, 46
};
static DfaState st39[6] = {
46, 46, 46, 46, 46, 46
};
static DfaState st40[6] = {
46, 44, 46, 46, 46, 46
};
static DfaState st41[6] = {
46, 45, 46, 46, 46, 46
};
static DfaState st42[6] = {
46, 46, 46, 46, 46, 46
};
static DfaState st43[6] = {
46, 46, 46, 46, 43, 46
};
static DfaState st44[6] = {
46, 46, 46, 46, 46, 46
};
static DfaState st45[6] = {
46, 46, 46, 46, 46, 46
};
DfaState *dfa[46] = {
st0,
st1,
st2,
st3,
st4,
st5,
st6,
st7,
st8,
st9,
st10,
st11,
st12,
st13,
st14,
st15,
st16,
st17,
st18,
st19,
st20,
st21,
st22,
st23,
st24,
st25,
st26,
st27,
st28,
st29,
st30,
st31,
st32,
st33,
st34,
st35,
st36,
st37,
st38,
st39,
st40,
st41,
st42,
st43,
st44,
st45
};
DfaState accepts[47] = {
0, 1, 2, 3, 4, 28, 28, 28, 28, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
0, 2, 5, 7, 8, 27, 26, 23, 24, 25,
20, 22, 6, 0, 20, 22, 6, 21, 0, 29,
31, 33, 34, 35, 30, 32, 0
};
void (*actions[36])() = {
zzerraction,
act1,
act2,
act3,
act4,
act5,
act6,
act7,
act8,
act9,
act10,
act11,
act12,
act13,
act14,
act15,
act16,
act17,
act18,
act19,
act20,
act21,
act22,
act23,
act24,
act25,
act26,
act27,
act28,
act29,
act30,
act31,
act32,
act33,
act34,
act35
};
static DfaState dfa_base[] = {
0,
38
};
static unsigned char *b_class_no[] = {
shift0,
shift1
};
#define ZZSHIFT(c) (b_class_no[zzauto][1+c])
#define MAX_MODE 2
#include "dlgauto.h"