parser.h 855 B

1234567891011121314151617181920212223242526
  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. #define STDIN_MAX_SIZE (1024)
  10. /* Parser 创建与释放 */
  11. AFUN_CORE_EXPORT af_Parser *
  12. makeParser(FilePath file, DLC_SYMBOL(readerFunc) read_func, DLC_SYMBOL(destructReaderFunc) destruct_func,
  13. size_t data_size);
  14. AFUN_CORE_EXPORT void freeParser(af_Parser *parser);
  15. AFUN_CORE_EXPORT af_Parser *makeParserByString(FilePath name, char *str, bool free_str);
  16. AFUN_CORE_EXPORT af_Parser *makeParserByFile(FilePath path);
  17. AFUN_CORE_EXPORT af_Parser *makeParserByStdin(FilePath file);
  18. /* Parser 相关操作 */
  19. AFUN_CORE_EXPORT af_Code *parserCode(af_Parser *parser);
  20. AFUN_CORE_EXPORT void initParser(af_Parser *parser);
  21. #endif //AFUN_PARSER_H