No empty .Rs/.Re
[netbsd-mini2440.git] / sys / netiso / xebec / llparse.h
blob8608d329b70deda80bb9dc6fcee3f8ac610c9c07
1 /* $NetBSD: llparse.h,v 1.5.22.1 2005/03/04 16:54:09 skrll Exp $ */
3 /************************************************************
4 attributes stack garbage
5 ************************************************************/
7 #define LLMAXATTR 512
8 #define LLMAXDESC 256
9 #define LLATTR /* build an attribute stack */
12 ** attribute stack
14 ** AttrStack = stack of record
15 ** values : array of values;
16 ** ptr : index;
17 ** end;
21 typedef union llattrib LLattrib;
23 extern LLattrib llattributes[LLMAXATTR];
24 extern int llattrtop;
26 extern struct llattr {
27 LLattrib *llabase; /* ptr into the attr stack (llattributes) */
28 int llaindex;/* # attrs on the stack so far for this prod */
29 int llacnt;/* total # ever to go on for this prod */
31 int lloldtop;/* when popping this prod, restore stack to here ;
32 one attr will remain on the stack (for the lhs) */
33 } llattrdesc[LLMAXDESC];
35 extern int lldescindex;
37 /************************************************************
38 attributes stack garbage
39 ************************************************************/
41 extern struct lltoken {
42 short llterm; /* token number */
43 short llstate; /* inserted deleted normal */
44 LLattrib llattrib;
45 } lltoken;
46 typedef struct lltoken LLtoken;
48 /************************************************************
49 constants used in llparse.c
50 ************************************************************/
52 #define STACKSIZE 500
53 #define MAXCORR 16
55 #define NORMAL 0
56 #define DELETE 1
57 #define INSERT 2
59 /************************************************************
60 datatypes used to communicate with the parser
61 ************************************************************/
63 struct llinsert {
64 short llinscost;
65 short llinslength;
66 short llinsert[MAXCORR];
68 typedef struct llinsert LLinsert;
70 extern short llparsestack[];
71 extern short llstackptr;
72 extern short llinfinite;
74 /************************************************************
75 variables used to pass information
76 specific to each grammer
77 ************************************************************/
79 extern short llnterms;
80 extern short llnsyms;
81 extern short llnprods;
83 extern char *llefile;
85 extern struct llparsetable {
86 short llterm;
87 short llprod;
88 } llparsetable[];
90 extern short llparseindex[];
92 extern short llepsilon[];
94 extern short llproductions[];
96 extern struct llprodindex {
97 short llprodstart;
98 short llprodlength;
99 short llprodtlen;
100 } llprodindex[];
102 extern struct llcosts {
103 short llinsert;
104 short lldelete;
105 } llcosts[];
107 extern struct llstable {
108 short llsstart;
109 short llslength;
110 } llstable[];
112 extern short llsspace[];
114 extern struct lletable {
115 short llecost;
116 short llelength;
117 short llestart;
118 } lletable[];
120 extern long lleindex[];
122 extern short llespace[];
124 extern char *llstrings[];
126 /************************************************************
127 routines defined in llparse.c
128 ************************************************************/
130 extern int llparse();
131 extern void llcopye();
132 extern void llcopys();
133 extern void llcorrector();
134 extern int llepsilonok();
135 extern void llexpand();
136 extern short llfindaction();
137 extern void llgetprefix();
138 extern void llgettoken();
139 extern void llinsert();
140 extern void llinsertsym();
141 extern void llinserttokens();
142 extern void llparsererror();
143 extern void llpushprod();
144 extern void llreadetab();
145 extern void llaction();
146 extern void llpushattr();
147 extern void llsetattr();
148 extern void llfinprod();
150 /************************************************************
151 routines defined in llscan.c
152 ************************************************************/
153 extern void llscan();
154 extern void dump_buffer();
155 extern void llaccept();