diff options
author | kartofen <mladenovnasko0@gmail.com> | 2025-07-06 17:35:06 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2025-07-06 17:35:06 +0300 |
commit | b65dd53885eabb8f39a3115039563edc08efb2b4 (patch) | |
tree | 75ec27e5cda989316b2498c913e0283c9ed08841 /demos/sample-files/defs.c | |
parent | 0e0c0e0f26fcd669e45604fd5d9bcc2891a932a2 (diff) |
quick and easy semantic actions
Diffstat (limited to 'demos/sample-files/defs.c')
-rw-r--r-- | demos/sample-files/defs.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/demos/sample-files/defs.c b/demos/sample-files/defs.c index 92d6837..76a0534 100644 --- a/demos/sample-files/defs.c +++ b/demos/sample-files/defs.c @@ -35,3 +35,15 @@ static struct production _grammar[] = { struct production *grammar = _grammar; size_t total_productions = sizeof(_grammar)/sizeof(*_grammar); + +// #include "???.h" +char **semantic_action_str = (char *([])){ + "v = A(0);", + "v = A(0) + A(2);", + "v = A(0) - A(2);", + "v = A(0);", + "v = A(1);", + "v = A(0);", + "v = 0;", + "v = 1;", +}; |