making parser
This commit is contained in:
32
parser.h
Normal file
32
parser.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user