64 ARRAYBOUNDSCHECKInstID,
99 for (
int i=1;
i <= 1; ++
i) cost[
i] = 0x7fff;
104 unsigned int burm_stm:5;
116 static short burm_nts_0[] = { 0 };
117 static short burm_nts_1[] = { burm_stm_NT, 0 };
118 static short burm_nts_2[] = { burm_stm_NT, burm_stm_NT, 0 };
120 static short *burm_nts[] = {
150 static const char *burm_templates[] = {
154 "ARRAYBOUNDSCHECKInstID",
175 "LOOKUPSWITCHInstID",
180 static char burm_isinstruction[] = {
210 static const char *burm_string[] = {
212 "stm: CHECKNULLInstID",
213 "stm: ARRAYLENGTHInstID(stm)",
214 "stm: ARRAYBOUNDSCHECKInstID(stm,stm)",
215 "stm: NEGInstID(stm)",
216 "stm: CASTInstID(stm)",
217 "stm: ADDInstID(stm,stm)",
218 "stm: SUBInstID(stm,stm)",
219 "stm: MULInstID(stm,stm)",
220 "stm: DIVInstID(stm,stm)",
221 "stm: REMInstID(stm,stm)",
224 "stm: ANDInstID(stm,stm)",
225 "stm: ORInstID(stm,stm)",
226 "stm: XORInstID(stm,stm)",
227 "stm: CMPInstID(stm,stm)",
229 "stm: AREFInstID(stm,stm)",
230 "stm: ASTOREInstID(stm,stm)",
231 "stm: ALOADInstID(stm)",
233 "stm: IFInstID(stm,stm)",
234 "stm: TABLESWITCHInstID(stm)",
235 "stm: LOOKUPSWITCHInstID(stm)",
236 "stm: RETURNInstID(stm)",
240 static short burm_decode_stm[] = {
276 int burm_rule(std::shared_ptr<STATE_TYPE> state,
int goalnt);
290 int Matcher::burm_rule(std::shared_ptr<STATE_TYPE> state,
int goalnt) {
291 if (goalnt < 1 || goalnt > 1)
292 ABORT_MSG(
"burm_rule",
"Bad goal nonterminal " << goalnt <<
nl);
296 case burm_stm_NT:
return burm_decode_stm[state->rule.burm_stm];
298 ABORT_MSG(
"burm_rule",
"Bad goal nonterminal " << goalnt <<
nl);
306 std::shared_ptr<STATE_TYPE> p;
314 if (1 + 0 < p->cost[burm_stm_NT]) {
315 p->cost[burm_stm_NT] = 1 + 0;
316 p->rule.burm_stm = 1;
324 if (c + 0 < p->cost[burm_stm_NT]) {
325 p->cost[burm_stm_NT] = c + 0;
326 p->rule.burm_stm = 2;
335 if (c + 0 < p->cost[burm_stm_NT]) {
336 p->cost[burm_stm_NT] = c + 0;
337 p->rule.burm_stm = 3;
345 if (c + 0 < p->cost[burm_stm_NT]) {
346 p->cost[burm_stm_NT] = c + 0;
347 p->rule.burm_stm = 4;
355 if (c + 0 < p->cost[burm_stm_NT]) {
356 p->cost[burm_stm_NT] = c + 0;
357 p->rule.burm_stm = 5;
366 if (c + 0 < p->cost[burm_stm_NT]) {
367 p->cost[burm_stm_NT] = c + 0;
368 p->rule.burm_stm = 6;
377 if (c + 0 < p->cost[burm_stm_NT]) {
378 p->cost[burm_stm_NT] = c + 0;
379 p->rule.burm_stm = 7;
388 if (c + 0 < p->cost[burm_stm_NT]) {
389 p->cost[burm_stm_NT] = c + 0;
390 p->rule.burm_stm = 8;
399 if (c + 0 < p->cost[burm_stm_NT]) {
400 p->cost[burm_stm_NT] = c + 0;
401 p->rule.burm_stm = 9;
410 if (c + 0 < p->cost[burm_stm_NT]) {
411 p->cost[burm_stm_NT] = c + 0;
412 p->rule.burm_stm = 10;
417 if (1 + 0 < p->cost[burm_stm_NT]) {
418 p->cost[burm_stm_NT] = 1 + 0;
419 p->rule.burm_stm = 11;
424 if (1 + 0 < p->cost[burm_stm_NT]) {
425 p->cost[burm_stm_NT] = 1 + 0;
426 p->rule.burm_stm = 12;
435 if (c + 0 < p->cost[burm_stm_NT]) {
436 p->cost[burm_stm_NT] = c + 0;
437 p->rule.burm_stm = 13;
446 if (c + 0 < p->cost[burm_stm_NT]) {
447 p->cost[burm_stm_NT] = c + 0;
448 p->rule.burm_stm = 14;
457 if (c + 0 < p->cost[burm_stm_NT]) {
458 p->cost[burm_stm_NT] = c + 0;
459 p->rule.burm_stm = 15;
468 if (c + 0 < p->cost[burm_stm_NT]) {
469 p->cost[burm_stm_NT] = c + 0;
470 p->rule.burm_stm = 16;
475 if (1 + 0 < p->cost[burm_stm_NT]) {
476 p->cost[burm_stm_NT] = 1 + 0;
477 p->rule.burm_stm = 17;
486 if (c + 0 < p->cost[burm_stm_NT]) {
487 p->cost[burm_stm_NT] = c + 0;
488 p->rule.burm_stm = 18;
497 if (c + 0 < p->cost[burm_stm_NT]) {
498 p->cost[burm_stm_NT] = c + 0;
499 p->rule.burm_stm = 19;
507 if (c + 0 < p->cost[burm_stm_NT]) {
508 p->cost[burm_stm_NT] = c + 0;
509 p->rule.burm_stm = 20;
514 if (1 + 0 < p->cost[burm_stm_NT]) {
515 p->cost[burm_stm_NT] = 1 + 0;
516 p->rule.burm_stm = 21;
525 if (c + 0 < p->cost[burm_stm_NT]) {
526 p->cost[burm_stm_NT] = c + 0;
527 p->rule.burm_stm = 22;
535 if (c + 0 < p->cost[burm_stm_NT]) {
536 p->cost[burm_stm_NT] = c + 0;
537 p->rule.burm_stm = 23;
545 if (c + 0 < p->cost[burm_stm_NT]) {
546 p->cost[burm_stm_NT] = c + 0;
547 p->rule.burm_stm = 24;
555 if (c + 0 < p->cost[burm_stm_NT]) {
556 p->cost[burm_stm_NT] = c + 0;
557 p->rule.burm_stm = 25;
562 if (1 + 0 < p->cost[burm_stm_NT]) {
563 p->cost[burm_stm_NT] = 1 + 0;
564 p->rule.burm_stm = 26;
611 ABORT_MSG(
"burm_kids",
"Bad rule number " << eruleno <<
nl);
Instruction * NODEPTR_TYPE
#define ABORT_MSG(EXPR_SHORT, EXPR_LONG)
struct burm_state STATE_TYPE