33 lines
530 B
C
33 lines
530 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 parseRoot(Parser*);
|
|
|
|
#endif
|