parser.h 627 B

1234567891011121314151617181920
  1. #ifndef AFUN_PARSER_H
  2. #define AFUN_PARSER_H
  3. #include "macro.h"
  4. #include "token.h"
  5. #include "reader.h"
  6. typedef struct af_Parser af_Parser;
  7. /* Parser 创建与释放 */
  8. af_Parser *makeParser(DLC_SYMBOL(readerFunc) read_func, DLC_SYMBOL(destructReaderFunc) destruct_func, size_t data_size,
  9. FILE *error);
  10. void freeParser(af_Parser *parser);
  11. af_Parser *makeParserByString(char *str, bool free_str, FILE *error);
  12. /* Parser 操作函数 */
  13. af_TokenType getTokenFromLexical(char **text, af_Parser *parser);
  14. void *getParserData(af_Parser *parser);
  15. void initParser(af_Parser *parser);
  16. #endif //AFUN_PARSER_H