BaseAST* aid(int id) { if (aidIgnore(id)) { printAidError("aid", id); return NULL; } else { return aid09(id); } }
static const char* aidError(const char* callerMsg, int id) { const int tmpBuffSize = 256; static char tmpBuff[tmpBuffSize]; snprintf(tmpBuff, tmpBuffSize, "<%s%s""the ID %d %s>", callerMsg ? callerMsg : "", callerMsg ? ": " : "", id, aidIgnore(id) ? " is small, use aid09(id) to examine it" : "does not correspond to an AST node"); return tmpBuff; }
static BaseAST* aidWithError(int id, const char* callerMsg) { if (aidIgnore(id)) { printf("%s\n", aidIgnoreError(callerMsg, id)); return NULL; } else { BaseAST* result = aid09(id); if (!result) printf("%s\n", aidNotFoundError(callerMsg, id)); return result; } }