aboutsummaryrefslogtreecommitdiff
path: root/src/stage1/parser.hpp
blob: 065f951e91f629d01391c23758f116ebf62ccb3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (c) 2015 Andrew Kelley
 *
 * This file is part of zig, which is MIT licensed.
 * See http://opensource.org/licenses/MIT
 */

#ifndef ZIG_PARSER_HPP
#define ZIG_PARSER_HPP

#include "all_types.hpp"
#include "tokenizer.hpp"
#include "errmsg.hpp"

AstNode * ast_parse(Buf *buf, ZigType *owner, ErrColor err_color);

void ast_visit_node_children(AstNode *node, void (*visit)(AstNode **, void *context), void *context);

Buf *node_identifier_buf(AstNode *node);
Buf *node_identifier_buf2(AstNode *node, bool *is_at_syntax);

Buf *token_identifier_buf(RootStruct *root_struct, TokenIndex token);

void token_number_literal_bigint(RootStruct *root_struct, BigInt *result, TokenIndex token);

Error source_string_literal_buf(const char *source, Buf *out, size_t *bad_index);
Error source_char_literal(const char *source, uint32_t *out, size_t *bad_index);

#endif