33 lines
531 B
C
33 lines
531 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;
|
|
astNodeIndex* arr;
|
|
} parserNodeIndexSlice;
|
|
|
|
typedef struct {
|
|
const char* source;
|
|
const uint32_t source_len;
|
|
|
|
tokenizerTag* token_tags;
|
|
astIndex* token_starts;
|
|
uint32_t tokens_len;
|
|
|
|
astTokenIndex tok_i;
|
|
|
|
astNodeList nodes;
|
|
parserNodeIndexSlice extra_data;
|
|
parserNodeIndexSlice scratch;
|
|
} parser;
|
|
|
|
int parse_root(parser*);
|
|
|
|
#endif
|