GCC主要数据结构之cpp_callbacks

 

/* Call backs to cpplib client.  */ struct cpp_callbacks {   /* Called when a new line of preprocessed output is started.  */   void (*line_change) (cpp_reader *, const cpp_token *, int);

  /* Called when switching to/from a new file.      The line_map is for the new file.  It is NULL if there is no new file.      (In C this happens when done with <built-in>+<command line> and also      when done with a main file.)  This can be used for resource cleanup.  */   void (*file_change) (cpp_reader *, const line_map_ordinary *);

  void (*dir_change) (cpp_reader *, const char *);   void (*include) (cpp_reader *, source_location, const unsigned char *,      const char *, int, const cpp_token **);   void (*define) (cpp_reader *, source_location, cpp_hashnode *);   void (*undef) (cpp_reader *, source_location, cpp_hashnode *);   void (*ident) (cpp_reader *, source_location, const cpp_string *);   void (*def_pragma) (cpp_reader *, source_location);   int (*valid_pch) (cpp_reader *, const char *, int);   void (*read_pch) (cpp_reader *, const char *, int, const char *);   missing_header_cb missing_header;

  /* Context-sensitive macro support.  Returns macro (if any) that should      be expanded.  */   cpp_hashnode * (*macro_to_expand) (cpp_reader *, const cpp_token *);

  /* Called to emit a diagnostic.  This callback receives the      translated message.  */   bool (*error) (cpp_reader *, int, int, rich_location *,    const char *, va_list *)        ATTRIBUTE_FPTR_PRINTF(5,0);

  /* Callbacks for when a macro is expanded, or tested (whether      defined or not at the time) in #ifdef, #ifndef or "defined".  */   void (*used_define) (cpp_reader *, source_location, cpp_hashnode *);   void (*used_undef) (cpp_reader *, source_location, cpp_hashnode *);   /* Called before #define and #undef or other macro definition      changes are processed.  */   void (*before_define) (cpp_reader *);   /* Called whenever a macro is expanded or tested.      Second argument is the location of the start of the current expansion.  */   void (*used) (cpp_reader *, source_location, cpp_hashnode *);

  /* Callback to identify whether an attribute exists.  */   int (*has_attribute) (cpp_reader *);

  /* Callback that can change a user builtin into normal macro.  */   bool (*user_builtin_macro) (cpp_reader *, cpp_hashnode *); };

 
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值