示例#1
0
BaseAST* aid(int id) {
  if (aidIgnore(id)) {
    printAidError("aid", id);
    return NULL;
  } else {
    return aid09(id);
  }
}
示例#2
0
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;
}
示例#3
0
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;
  }
}