parsing prefix version (binary operators) of msph

This commit is contained in:
Ellen Arvidsson 2025-04-22 21:08:03 +03:00
parent 7e5f080282
commit 17be15d7b5
12 changed files with 617 additions and 92 deletions

View file

@ -55,7 +55,8 @@
* Trait ({ ... }, creates scoping)
*/
#define MSPH_TREE_ROOT 0x0001
#define MSPH_TREE_ROOT 0x0000
#define MSPH_TREE_UNIT 0x0001
#define MSPH_TREE_BODY 0x0010
@ -83,11 +84,12 @@
struct msph_tree {
struct msph_tree *parent;
int type;
struct msph_tree *parent;
};
struct msph_tree_root;
struct msph_tree_text;
struct msph_tree_body;
struct msph_tree_dir;
struct msph_tree_tpdef;
@ -100,7 +102,21 @@ struct msph_tree_root {
struct msph_tree tr;
struct msph_ctx *ctx;
STAILQ_HEAD(msph_tree_unit_l, msph_tree_unit) head;
};
struct msph_tree_unit {
struct msph_tree tr;
char name[MSPH_NAME_LEN];
struct msph_tree_body *body;
STAILQ_ENTRY(msph_tree_unit) entries;
};
struct msph_tree_text {
struct msph_tree tr;
struct msph_text_pos pos;
};
struct msph_tree_body {
@ -236,4 +252,6 @@ struct msph_tree_root *msph_tree_makeroot(struct msph_ctx *);
int msph_tree_parse(struct msph_token_stream *, struct msph_tree_root *);
ssize_t msph_tree_fprint(FILE *, struct msph_tree *);
#endif