bool REL_matchS(REL_t rT, REL_t rM1) { bool match = false; if (rM1 == REL_any_ or /* any relation (short-circuit) */ rT == rM1) { /* a specific type of relation */ match = true; } else { switch (rM1) { case REL_TEXT: if (REL_is_TEXT(rT)) { match = true; } break; case REL_LETTER: if (REL_is_LETTER(rT)) { match = true; } break; case REL_LETTER_EOL: if (REL_is_LETTER_EOL(rT)) { match = true; } break; case REL_LETTER_WS: if (REL_is_LETTER_WS(rT)) { match = true; } break; case REL_PARENT: if (REL_is_PARENT(rT)) { match = true; } break; case REL_CHILD: if (REL_is_CHILD(rT)) { match = true; } break; case REL_MASTER: if (REL_is_MASTER(rT)) { match = true; } break; case REL_SLAVE: if (REL_is_SLAVE(rT)) { match = true; } break; case REL_SLAVE_AXTICK: if (REL_is_SLAVE_AXTICK(rT)) { match = true; } break; case REL_SLAVE_LAYHINT: if (REL_is_SLAVE_LAYHINT(rT)) { match = true; } break; case REL_SLAVE_LAYHINT_CADJ: if (REL_is_SLAVE_CADJ(rT)) { match = true; } break; case REL_SIBLING: if (REL_is_SIBLING(rT)) { match = true; } break; case REL_PRODUCER: if (REL_is_PRODUCER(rT)) { match = true; } break; case REL_CONSUMER: if (REL_is_CONSUMER(rT)) { match = true; } break; case REL_ALIGNER: if (REL_is_ALIGNER(rT)) { match = true; } break; case REL_ALIGNEE: if (REL_is_ALIGNEE(rT)) { match = true; } break; default: break; } } return match; }
/*! * Return non-zero if \p rel belongs to the LETTER-group. */ inline bool REL_is_LETTER(REL_t rel) { return (rel == REL_LETTER or rel == REL_LETTER_DIGIT or REL_is_LETTER_WS(rel) or REL_is_LETTER_EOL(rel) or rel == REL_LETTER_BOL or rel == REL_LETTER_BOT or rel == REL_LETTER_BOI_C or rel == REL_LETTER_EOI_C or rel == REL_LETTER_EOT or rel == REL_LETTER_ABBREV or rel == REL_LETTER_ABBREV_BEG or rel == REL_LETTER_ABBREV_END); }