diff options
author | kartofen <mladenovnasko0@gmail.com> | 2025-07-02 22:55:08 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2025-07-02 22:55:08 +0300 |
commit | 5064a7ebce75a26d0405c92040f1a40187fcc7e3 (patch) | |
tree | 7a41182cf329e77ebb760969e3f220f60079c187 /demos/sample-files/defs.c | |
parent | a67266ff72280b85fed7ec498967a855a5735639 (diff) |
turn clr into lalr and first steps for generating a parser
Diffstat (limited to 'demos/sample-files/defs.c')
-rw-r--r-- | demos/sample-files/defs.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/demos/sample-files/defs.c b/demos/sample-files/defs.c new file mode 100644 index 0000000..797c86d --- /dev/null +++ b/demos/sample-files/defs.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <stddef.h> + +#include <parts/table.h> + +struct action **table = (struct action *([])){ + (struct action[]){{0, 0},{0, 0},{1, 1},{0, 0},{1, 2},{1, 3},{0, 0},{0, 0},{2, 12},{2, 11},{2, 7},}, + (struct action[]){{0, 0},{0, 0},{1, 1},{0, 0},{1, 2},{1, 3},{0, 0},{0, 0},{2, 4},{2, 11},{2, 7},}, + (struct action[]){{3, 6},{3, 6},{0, 0},{3, 6},{0, 0},{0, 0},{3, 6},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{3, 7},{3, 7},{0, 0},{3, 7},{0, 0},{0, 0},{3, 7},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{1, 5},{1, 8},{0, 0},{1, 10},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{0, 0},{0, 0},{1, 1},{0, 0},{1, 2},{1, 3},{0, 0},{0, 0},{0, 0},{2, 6},{2, 7},}, + (struct action[]){{3, 1},{3, 1},{0, 0},{3, 1},{0, 0},{0, 0},{3, 1},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{3, 5},{3, 5},{0, 0},{3, 5},{0, 0},{0, 0},{3, 5},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{0, 0},{0, 0},{1, 1},{0, 0},{1, 2},{1, 3},{0, 0},{0, 0},{0, 0},{2, 9},{2, 7},}, + (struct action[]){{3, 2},{3, 2},{0, 0},{3, 2},{0, 0},{0, 0},{3, 2},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{3, 4},{3, 4},{0, 0},{3, 4},{0, 0},{0, 0},{3, 4},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{3, 3},{3, 3},{0, 0},{3, 3},{0, 0},{0, 0},{3, 3},{0, 0},{0, 0},{0, 0},{0, 0},}, + (struct action[]){{1, 5},{1, 8},{0, 0},{0, 0},{0, 0},{0, 0},{4, 0},{0, 0},{0, 0},{0, 0},{0, 0},}, +}; + +size_t total_symbols = 10; +size_t table_states = 13; |