zig/src/parser.hpp

33 lines
807 B
C++
Raw Normal View History

/*
* 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
#include "all_types.hpp"
2015-11-04 13:31:27 +08:00
#include "tokenizer.hpp"
#include "errmsg.hpp"
2015-11-04 13:31:27 +08:00
__attribute__ ((format (printf, 2, 3)))
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
// This function is provided by generated code, generated by parsergen.cpp
AstNode * ast_parse(Buf *buf, ZigList<Token> *tokens, ImportTableEntry *owner, ErrColor err_color);
2015-11-04 13:31:27 +08:00
const char *node_type_str(NodeType node_type);
void ast_print(AstNode *node, int indent);
const char *num_lit_str(NumLit num_lit);
bool is_num_lit_unsigned(NumLit num_lit);
bool is_num_lit_float(NumLit num_lit);
uint64_t num_lit_bit_count(NumLit num_lit);
2015-11-04 13:31:27 +08:00
#endif