<< 21/89 >>
First Last

GCC's #include hack

tree.def

  DEFTREECODE (ERROR_MARK, "error_mark", tcc_exceptional, 0)
  DEFTREECODE (IDENTIFIER_NODE, "identifier_node", tcc_exceptional, 0)
  DEFTREECODE (TREE_LIST, "tree_list", tcc_exceptional, 0)
  DEFTREECODE (BLOCK, "block", tcc_exceptional, 0)
  DEFTREECODE (OFFSET_TYPE, "offset_type", tcc_type, 0)
  ...

tree.c

  #define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
  const char *const tree_code_name[] = {
  #include "all-tree.def"
  };
  #undef DEFTREECODE

tree-browser.c

  #define DEFTREECODE(SYM, STRING, TYPE, LEN) \
    { SYM, STRING, sizeof (STRING) - 1 },
  static const struct tb_tree_code tb_tree_codes[] =
  {
  #include "tree.def"
  };
  #undef DEFTREECODE