Lines Matching refs:trp
44 dodefine(Tokenrow * trp) in dodefine() argument
52 tp = trp->tp + 1; in dodefine()
53 if (tp >= trp->lp || tp->type != NAME) in dodefine()
67 if (tp < trp->lp && tp->type == LP && tp->wslen == 0) in dodefine()
114 trp->tp = tp; in dodefine()
115 if (((trp->lp) - 1)->type == NL) in dodefine()
116 trp->lp -= 1; in dodefine()
117 def = normtokenrow(trp); in dodefine()
127 trp->bp + 2, np->loc); in dodefine()
131 trp->bp + 2, "commandline" ); in dodefine()
172 doadefine(Tokenrow * trp, int type) in doadefine() argument
179 trp->tp = trp->bp; in doadefine()
182 if (trp->lp - trp->tp != 2 || trp->tp->type != NAME) in doadefine()
184 if ((np = lookup(trp->tp, 0)) == NULL) in doadefine()
192 if (trp->tp >= trp->lp || trp->tp->type != NAME) in doadefine()
194 trp->tp->type = ARCHITECTURE; in doadefine()
195 np = lookup(trp->tp, 1); in doadefine()
197 trp->tp += 1; in doadefine()
198 if (trp->tp >= trp->lp || trp->tp->type == END) in doadefine()
204 error(FATAL, "Illegal -A argument %r", trp); in doadefine()
207 if (trp->tp >= trp->lp || trp->tp->type != NAME) in doadefine()
209 np = lookup(trp->tp, 1); in doadefine()
211 trp->tp += 1; in doadefine()
212 if (trp->tp >= trp->lp || trp->tp->type == END) in doadefine()
217 if (trp->tp->type != ASGN) in doadefine()
219 trp->tp += 1; in doadefine()
220 if ((trp->lp - 1)->type == END) in doadefine()
221 trp->lp -= 1; in doadefine()
222 np->vp = normtokenrow(trp); in doadefine()
225 error(FATAL, "Illegal -D or -U argument %r", trp); in doadefine()
235 expandrow(Tokenrow * trp, char *flag) in expandrow() argument
243 tokenrow_zeroTokenIdentifiers(trp); in expandrow()
247 for (tp = trp->tp; tp < trp->lp;) in expandrow()
260 trp->tp = tp; in expandrow()
264 if ((tp + 1) < trp->lp && (tp + 1)->type == NAME) in expandrow()
267 if ((tp + 3) < trp->lp && (tp + 1)->type == LP in expandrow()
278 if (((tp - 1) >= trp->bp) && ((tp - 1)->type == SHARP)) in expandrow()
281 if ((tp + 1) < trp->lp && (tp + 1)->type == NAME) in expandrow()
284 if ((tp + 3) < trp->lp && (tp + 1)->type == LP in expandrow()
295 builtin(trp, np->val); in expandrow()
297 expand(trp, np, &validators); in expandrow()
298 tp = trp->tp; in expandrow()
315 expand(Tokenrow * trp, Nlist * np, MacroValidatorList * pValidators) in expand() argument
325 error(INFO, "Macro expansion of %t with %s(%r)", trp->tp, np->name, np->ap); in expand()
327 error(INFO, "Macro expansion of %t with %s", trp->tp, np->name); in expand()
335 ntokc = gatherargs(trp, atr, &narg); in expand()
338 trp->tp++; in expand()
344 trp->tp += ntokc; in expand()
355 mvl_check(pValidators,trp->tp+i); in expand()
374 makespace(&ntr, trp->tp); in expand()
388 insertrow(trp, ntokc, &ntr); in expand()
396 if (trp->tp != trp->lp) in expand()
398 mvl_add(pValidators,np,trp->tp); in expand()
406 …trp->tp -= ntr.lp - ntr.bp; /* so the result will be tested for macros from the same position ag… in expand()
419 gatherargs(Tokenrow * trp, Tokenrow ** atr, int *narg) in gatherargs() argument
433 trp->tp++; in gatherargs()
435 if (trp->tp >= trp->lp) in gatherargs()
437 gettokens(trp, 0); in gatherargs()
438 if ((trp->lp - 1)->type == END) in gatherargs()
440 trp->lp -= 1; in gatherargs()
441 trp->tp -= ntok; in gatherargs()
445 if (trp->tp->type == LP) in gatherargs()
447 if (trp->tp->type != NL) in gatherargs()
453 trp->tp++; in gatherargs()
458 if (trp->tp >= trp->lp) in gatherargs()
459 gettokens(trp, 0); in gatherargs()
465 if (trp->tp->type == END) in gatherargs()
467 trp->lp -= 1; in gatherargs()
468 trp->tp -= ntok; in gatherargs()
472 if (trp->tp->type == NL) in gatherargs()
474 trp->tp += 1; in gatherargs()
475 adjustrow(trp, -1); in gatherargs()
476 trp->tp -= 1; in gatherargs()
481 if (trp->tp->type == LP) in gatherargs()
484 if (trp->tp->type == RP) in gatherargs()
486 trp->tp++; in gatherargs()
489 trp->tp -= ntok; in gatherargs()
491 lp = bp = trp->tp + ntokp; in gatherargs()
573 doconcat(Tokenrow * trp) in doconcat() argument
579 for (trp->tp = trp->bp; trp->tp < trp->lp; trp->tp++) in doconcat()
581 if (trp->tp->type == DSHARP1) in doconcat()
582 trp->tp->type = DSHARP; in doconcat()
584 if (trp->tp->type == DSHARP) in doconcat()
589 ltp = trp->tp - 1; in doconcat()
590 ntp = trp->tp + 1; in doconcat()
592 if (ltp < trp->bp || ntp >= trp->lp) in doconcat()
610 if (ntp != trp->tp + 1) in doconcat()
622 ntp = trp->tp + i; in doconcat()
625 while (ntp < trp->lp); in doconcat()
638 trp->tp = ltp; in doconcat()
640 insertrow(trp, ntp - ltp, &ntr); in doconcat()
642 trp->tp--; in doconcat()
715 builtin(Tokenrow * trp, int biname) in builtin() argument
721 tp = trp->tp; in builtin()
722 trp->tp++; in builtin()