Boron 2.1.0
i_parse_blk.h
1#ifndef I_PARSE_BLK_H
2#define I_PARSE_BLK_H
3/*
4 Bytecode interpreter for parsing blocks
5 Copyright 2016, 2019 Karl Robillard
6*/
7
8
9#include "urlan.h"
10
11
12enum ParseBlockInstruction
13{
14 PB_End,
15 PB_Flag, // rflag bitmask (limit 8 bits)
16 PB_Report, // report id
17 PB_ReportEnd, // report id
18 PB_Next, // Number of bytes to skip to next alternate rule
19 //PB_Repeat,
20 //PB_RepeatV,
21 PB_Skip,
22 PB_LitWord, // atoms index
23 PB_Rule, // rules offset to instructions
24 PB_Type, // Datatype
25 PB_Typeset, // rules offset of 64-bit mask
26 PB_OptR, // rules offset to instructions
27 PB_OptT, // Datatype
28 PB_OptTs, // rules offset of 64-bit mask
29 PB_AnyR, // rules offset to instructions
30 PB_AnyT, // Datatype
31 PB_AnyTs, // rules offset of 64-bit mask
32 PB_SomeR, // rules offset to instructions
33 PB_SomeT, // Datatype
34 PB_SomeTs, // rules offset of 64-bit mask
35 PB_ToT, // Datatype
36 PB_ToTs, // rules offset of 64-bit mask
37 PB_ToLitWord, // atoms index
38 PB_ThruT, // Datatype
39 PB_ThruTs // rules offset of 64-bit mask
40};
41
42
43typedef struct UBlockParser UBlockParser;
44
45struct UBlockParser
46{
47 UThread* ut;
48 const UAtom* atoms;
49 const uint8_t* rules;
50 const UCell* it;
51 const UCell* end;
52 void (*report)(UBlockParser*, int, const UCell*, const UCell*);
53 int rflag;
54};
55
56
57#ifdef __cplusplus
58extern "C" {
59#endif
60
61int ur_parseBlockI( UBlockParser* par, const uint8_t* pc, const UCell* it );
62
63#ifdef __cplusplus
64}
65#endif
66
67
68#endif /* I_PARSE_BLK_H */
A cell holds a single value of a simple type or a reference (often to a UBuffer) for a complex type.
Definition urlan.h:248
The Urlan programmer interface.