Lines Matching refs:x

351   } x;  member
525 rc = ap1->x.rp->index - ap2->x.rp->index; in actioncmp()
556 newaction->x.stp = (struct state *)arg; in Action_add()
558 newaction->x.rp = (struct rule *)arg; in Action_add()
981 struct config *x, *y; in getstate() local
982 for(x=bp, y=stp->bp; x && y; x=x->bp, y=y->bp){ in getstate()
983 Plink_copy(&y->bplp,x->bplp); in getstate()
984 Plink_delete(x->fplp); in getstate()
985 x->fplp = x->bplp = 0; in getstate()
1217 if( ap->type==REDUCE ) ap->x.rp->canReduce = LEMON_TRUE; in FindActions()
1253 spy = apy->x.rp->precsym; in resolve_conflict()
1271 spx = apx->x.rp->precsym; in resolve_conflict()
1272 spy = apy->x.rp->precsym; in resolve_conflict()
1595 struct rule *x[32]; in Rule_sort() local
1596 memset(x, 0, sizeof(x)); in Rule_sort()
1600 for(i=0; i<sizeof(x)/sizeof(x[0])-1 && x[i]; i++){ in Rule_sort()
1601 rp = Rule_merge(x[i], rp); in Rule_sort()
1602 x[i] = 0; in Rule_sort()
1604 x[i] = rp; in Rule_sort()
1608 for(i=0; i<sizeof(x)/sizeof(x[0]); i++){ in Rule_sort()
1609 rp = Rule_merge(x[i], rp); in Rule_sort()
2260 const char *x; in parseonetoken() local
2261 x = Strsafe(psp->tokenstart); /* Save the token permanently */ in parseonetoken()
2264 x,psp->state); in parseonetoken()
2274 if( x[0]=='%' ){ in parseonetoken()
2276 }else if( ISLOWER(x[0]) ){ in parseonetoken()
2277 psp->lhs = Symbol_new(x); in parseonetoken()
2281 }else if( x[0]=='{' ){ in parseonetoken()
2292 }else if( strcmp(x, "{NEVER-REDUCE")==0 ){ in parseonetoken()
2296 psp->prevrule->code = &x[1]; in parseonetoken()
2299 }else if( x[0]=='[' ){ in parseonetoken()
2304 x); in parseonetoken()
2309 if( !ISUPPER(x[0]) ){ in parseonetoken()
2315 "There is no prior rule to assign precedence \"[%s]\".",x); in parseonetoken()
2323 psp->prevrule->precsym = Symbol_new(x); in parseonetoken()
2328 if( x[0]!=']' ){ in parseonetoken()
2336 if( x[0]==':' && x[1]==':' && x[2]=='=' ){ in parseonetoken()
2338 }else if( x[0]=='(' ){ in parseonetoken()
2349 if( ISALPHA(x[0]) ){ in parseonetoken()
2350 psp->lhsalias = x; in parseonetoken()
2355 x,psp->lhs->name); in parseonetoken()
2361 if( x[0]==')' ){ in parseonetoken()
2371 if( x[0]==':' && x[1]==':' && x[2]=='=' ){ in parseonetoken()
2382 if( x[0]=='.' ){ in parseonetoken()
2420 }else if( ISALPHA(x[0]) ){ in parseonetoken()
2424 x); in parseonetoken()
2428 psp->rhs[psp->nrhs] = Symbol_new(x); in parseonetoken()
2432 }else if( (x[0]=='|' || x[0]=='/') && psp->nrhs>0 && ISUPPER(x[1]) ){ in parseonetoken()
2448 msp->subsym[msp->nsubsym-1] = Symbol_new(&x[1]); in parseonetoken()
2449 if( ISLOWER(x[1]) || ISLOWER(msp->subsym[0]->name[0]) ){ in parseonetoken()
2454 }else if( x[0]=='(' && psp->nrhs>0 ){ in parseonetoken()
2458 "Illegal character on RHS of rule: \"%s\".",x); in parseonetoken()
2464 if( ISALPHA(x[0]) ){ in parseonetoken()
2465 psp->alias[psp->nrhs-1] = x; in parseonetoken()
2470 x,psp->rhs[psp->nrhs-1]->name); in parseonetoken()
2476 if( x[0]==')' ){ in parseonetoken()
2486 if( ISALPHA(x[0]) ){ in parseonetoken()
2487 psp->declkeyword = x; in parseonetoken()
2492 if( strcmp(x,"name")==0 ){ in parseonetoken()
2495 }else if( strcmp(x,"include")==0 ){ in parseonetoken()
2497 }else if( strcmp(x,"code")==0 ){ in parseonetoken()
2499 }else if( strcmp(x,"token_destructor")==0 ){ in parseonetoken()
2501 }else if( strcmp(x,"default_destructor")==0 ){ in parseonetoken()
2503 }else if( strcmp(x,"token_prefix")==0 ){ in parseonetoken()
2506 }else if( strcmp(x,"syntax_error")==0 ){ in parseonetoken()
2508 }else if( strcmp(x,"parse_accept")==0 ){ in parseonetoken()
2510 }else if( strcmp(x,"parse_failure")==0 ){ in parseonetoken()
2512 }else if( strcmp(x,"stack_overflow")==0 ){ in parseonetoken()
2514 }else if( strcmp(x,"extra_argument")==0 ){ in parseonetoken()
2517 }else if( strcmp(x,"extra_context")==0 ){ in parseonetoken()
2520 }else if( strcmp(x,"token_type")==0 ){ in parseonetoken()
2523 }else if( strcmp(x,"default_type")==0 ){ in parseonetoken()
2526 }else if( strcmp(x,"stack_size")==0 ){ in parseonetoken()
2529 }else if( strcmp(x,"start_symbol")==0 ){ in parseonetoken()
2532 }else if( strcmp(x,"left")==0 ){ in parseonetoken()
2536 }else if( strcmp(x,"right")==0 ){ in parseonetoken()
2540 }else if( strcmp(x,"nonassoc")==0 ){ in parseonetoken()
2544 }else if( strcmp(x,"destructor")==0 ){ in parseonetoken()
2546 }else if( strcmp(x,"type")==0 ){ in parseonetoken()
2548 }else if( strcmp(x,"fallback")==0 ){ in parseonetoken()
2551 }else if( strcmp(x,"token")==0 ){ in parseonetoken()
2553 }else if( strcmp(x,"wildcard")==0 ){ in parseonetoken()
2555 }else if( strcmp(x,"token_class")==0 ){ in parseonetoken()
2559 "Unknown declaration keyword: \"%%%s\".",x); in parseonetoken()
2565 "Illegal declaration keyword: \"%s\".",x); in parseonetoken()
2571 if( !ISALPHA(x[0]) ){ in parseonetoken()
2577 struct symbol *sp = Symbol_new(x); in parseonetoken()
2585 if( !ISALPHA(x[0]) ){ in parseonetoken()
2591 struct symbol *sp = Symbol_find(x); in parseonetoken()
2594 "Symbol %%type \"%s\" already defined", x); in parseonetoken()
2599 sp = Symbol_new(x); in parseonetoken()
2608 if( x[0]=='.' ){ in parseonetoken()
2610 }else if( ISUPPER(x[0]) ){ in parseonetoken()
2612 sp = Symbol_new(x); in parseonetoken()
2615 "Symbol \"%s\" has already be given a precedence.",x); in parseonetoken()
2623 "Can't assign a precedence to \"%s\".",x); in parseonetoken()
2628 if( x[0]=='{' || x[0]=='\"' || ISALNUM(x[0]) ){ in parseonetoken()
2634 zNew = x; in parseonetoken()
2683 "Illegal argument to %%%s: %s",psp->declkeyword,x); in parseonetoken()
2689 if( x[0]=='.' ){ in parseonetoken()
2691 }else if( !ISUPPER(x[0]) ){ in parseonetoken()
2693 "%%fallback argument \"%s\" should be a token", x); in parseonetoken()
2696 struct symbol *sp = Symbol_new(x); in parseonetoken()
2701 "More than one fallback assigned to token %s", x); in parseonetoken()
2719 if( x[0]=='.' ){ in parseonetoken()
2721 }else if( !ISUPPER(x[0]) ){ in parseonetoken()
2723 "%%token argument \"%s\" should be a token", x); in parseonetoken()
2726 (void)Symbol_new(x); in parseonetoken()
2730 if( x[0]=='.' ){ in parseonetoken()
2732 }else if( !ISUPPER(x[0]) ){ in parseonetoken()
2734 "%%wildcard argument \"%s\" should be a token", x); in parseonetoken()
2737 struct symbol *sp = Symbol_new(x); in parseonetoken()
2742 "Extra wildcard to token: %s", x); in parseonetoken()
2748 if( !ISLOWER(x[0]) ){ in parseonetoken()
2750 "%%token_class must be followed by an identifier: %s", x); in parseonetoken()
2753 }else if( Symbol_find(x) ){ in parseonetoken()
2755 "Symbol \"%s\" already used", x); in parseonetoken()
2759 psp->tkclass = Symbol_new(x); in parseonetoken()
2765 if( x[0]=='.' ){ in parseonetoken()
2767 }else if( ISUPPER(x[0]) || ((x[0]=='|' || x[0]=='/') && ISUPPER(x[1])) ){ in parseonetoken()
2772 if( !ISUPPER(x[0]) ) x++; in parseonetoken()
2773 msp->subsym[msp->nsubsym-1] = Symbol_new(x); in parseonetoken()
2776 "%%token_class argument \"%s\" should be a token", x); in parseonetoken()
2785 if( x[0]=='.' ) psp->state = WAITING_FOR_DECL_OR_RULE; in parseonetoken()
2786 if( x[0]=='%' ) psp->state = WAITING_FOR_DECL_KEYWORD; in parseonetoken()
3362 struct state *stp = ap->x.stp; in PrintAction()
3367 struct rule *rp = ap->x.rp; in PrintAction()
3373 struct rule *rp = ap->x.rp; in PrintAction()
3387 indent,ap->sp->name,ap->x.rp->iRule); in PrintAction()
3391 indent,ap->sp->name,ap->x.stp->statenum); in PrintAction()
3396 indent,ap->sp->name,ap->x.stp->statenum); in PrintAction()
3404 indent,ap->sp->name,ap->x.rp->iRule); in PrintAction()
3572 case SHIFT: act = ap->x.stp->statenum; break; in compute_action()
3580 act = lemp->minReduce + ap->x.rp->iRule; in compute_action()
3582 act = lemp->minShiftReduce + ap->x.rp->iRule; in compute_action()
3586 case REDUCE: act = lemp->minReduce + ap->x.rp->iRule; break; in compute_action()
4581 ap->x.rp->doesReduce = 1; in ReportTable()
5008 rp = ap->x.rp; in CompressTables()
5014 rp2 = ap2->x.rp; in CompressTables()
5033 if( ap->type==REDUCE && ap->x.rp==rbest ) break; in CompressTables()
5038 if( ap->type==REDUCE && ap->x.rp==rbest ) ap->type = NOT_USED; in CompressTables()
5044 if( ap->type==REDUCE && ap->x.rp!=rbest ) break; in CompressTables()
5061 pNextState = ap->x.stp; in CompressTables()
5064 ap->x.rp = pNextState->pDfltReduce; in CompressTables()
5080 rp = ap->x.rp; in CompressTables()
5095 ap->x = ap2->x; in CompressTables()
5148 assert( stp->autoReduce==0 || stp->pDfltReduce==ap->x.rp ); in ResortStates()
5233 PRIVATE unsigned strhash(const char *x) in strhash() argument
5236 while( *x ) h = h*13 + *(x++); in strhash()
5378 struct symbol *Symbol_new(const char *x) in Symbol_new() argument
5382 sp = Symbol_find(x); in Symbol_new()
5386 sp->name = Strsafe(x); in Symbol_new()
5387 sp->type = ISUPPER(*x) ? TERMINAL : NONTERMINAL; in Symbol_new()
5585 int x; in Configcmp() local
5586 x = a->rp->index - b->rp->index; in Configcmp()
5587 if( x==0 ) x = a->dot - b->dot; in Configcmp()
5588 return x; in Configcmp()