2015-11-25 04:00:38 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015 Andrew Kelley
|
|
|
|
*
|
|
|
|
* This file is part of zig, which is MIT licensed.
|
|
|
|
* See http://opensource.org/licenses/MIT
|
|
|
|
*/
|
|
|
|
|
2015-11-04 13:31:27 +08:00
|
|
|
#ifndef ZIG_PARSER_HPP
|
|
|
|
#define ZIG_PARSER_HPP
|
|
|
|
|
2016-01-11 06:13:39 +08:00
|
|
|
#include "all_types.hpp"
|
2015-11-04 13:31:27 +08:00
|
|
|
#include "tokenizer.hpp"
|
2015-12-01 16:06:10 +08:00
|
|
|
#include "errmsg.hpp"
|
2015-11-04 13:31:27 +08:00
|
|
|
|
2017-09-13 12:17:19 +08:00
|
|
|
ATTRIBUTE_PRINTF(2, 3)
|
2015-11-24 12:30:12 +08:00
|
|
|
void ast_token_error(Token *token, const char *format, ...);
|
2015-11-07 19:50:48 +08:00
|
|
|
|
2015-11-04 13:31:27 +08:00
|
|
|
|
2017-09-01 15:16:35 +08:00
|
|
|
AstNode * ast_parse(Buf *buf, ZigList<Token> *tokens, ImportTableEntry *owner, ErrColor err_color);
|
2015-11-04 13:31:27 +08:00
|
|
|
|
2015-11-05 08:15:46 +08:00
|
|
|
void ast_print(AstNode *node, int indent);
|
|
|
|
|
2016-04-07 02:38:12 +08:00
|
|
|
void ast_visit_node_children(AstNode *node, void (*visit)(AstNode **, void *context), void *context);
|
|
|
|
|
2018-03-07 17:39:32 +08:00
|
|
|
bool statement_terminates_without_semicolon(AstNode *node);
|
|
|
|
|
2015-11-04 13:31:27 +08:00
|
|
|
#endif
|