31 lines
522 B
C
31 lines
522 B
C
#ifndef _ZIG1_PARSE_H__
|
|
#define _ZIG1_PARSE_H__
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "ast.h"
|
|
|
|
typedef struct {
|
|
uint32_t len;
|
|
uint32_t cap;
|
|
ast_node_index* arr;
|
|
} parser_node_index_slice;
|
|
|
|
typedef struct {
|
|
const char* source;
|
|
const uint32_t source_len;
|
|
|
|
tokenizer_tag* token_tags;
|
|
ast_index* token_starts;
|
|
uint32_t tokens_len;
|
|
|
|
ast_token_index tok_i;
|
|
|
|
ast_node_list nodes;
|
|
parser_node_index_slice extra_data;
|
|
parser_node_index_slice scratch;
|
|
} parser;
|
|
|
|
#endif
|