parser.h 841 B

1234567891011121314151617181920212223
  1. #ifndef AFUN_PARSER_H
  2. #define AFUN_PARSER_H
  3. #include "aFunCoreExport.h"
  4. #include "tool.h"
  5. #include "token.h"
  6. #include "reader.h"
  7. #define SYNTACTIC_MAX_DEEP (1000)
  8. typedef struct af_Parser af_Parser;
  9. /* Parser 创建与释放 */
  10. AFUN_CORE_EXPORT af_Parser *makeParser(DLC_SYMBOL(readerFunc) read_func, DLC_SYMBOL(destructReaderFunc) destruct_func, size_t data_size,
  11. FILE *error);
  12. AFUN_CORE_EXPORT void freeParser(af_Parser *parser);
  13. AFUN_CORE_EXPORT af_Parser *makeParserByString(char *str, bool free_str, FILE *error);
  14. AFUN_CORE_EXPORT af_Parser *makeParserByFile(FilePath path, FILE *error);
  15. AFUN_CORE_EXPORT af_Parser *makeParserByStdin(FILE *error);
  16. /* Parser 相关操作 */
  17. AFUN_CORE_EXPORT af_Code *parserCode(af_Parser *parser);
  18. AFUN_CORE_EXPORT void initParser(af_Parser *parser);
  19. #endif //AFUN_PARSER_H