libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
src
frontend
parser
tstream_short.h
Go to the documentation of this file.
1
// Copyright (C) 2023 Ethan Uppal. All rights reserved.
2
3
#pragma once
4
5
#include "
def.h
"
6
#include "
tstream.h
"
7
17
void
ps_tstream_eof_error
(
struct
ps_tstream
* ts,
int
code,
STR
ctx,
STR
fix);
18
19
#define eof() ps_tstream_is_eof(ts)
20
21
#define adv() ps_tstream_advance(ts)
22
27
#define match(type, ctx) \
28
if (ps_tstream_match(ts, type, ctx)) { \
29
}
30
35
#define bindmatch(val, type, ctx) \
36
auto_t val = ps_tstream_match(ts, type, ctx); \
37
if (val) { \
38
}
39
43
#define bindmatch_any(val, types, ctx) \
44
auto_t val = ps_tstream_match_any(ts, types, lengthof(types), ctx); \
45
if (val) { \
46
}
47
48
#define tcur() ps_tstream_current(ts)
49
50
#define unwind() ps_tstream_advance_n(ts, -1)
def.h
Base definitions.
STR
#define STR
Definition
def.h:40
ps_tstream
Processes tokens in a stream.
Definition
tstream.h:16
tstream.h
Token stream processing.
ps_tstream_eof_error
void ps_tstream_eof_error(struct ps_tstream *ts, int code, STR ctx, STR fix)
Reports an end-of-file error with the given context ctx, using the last token in ts for location.
Definition
tstream.c:99
Generated by
1.9.8