diff options
| author | _ov4 <ov4@ov4.org> | 2026-09-05 15:13:01 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-09-05 15:13:01 +0000 |
| commit | 036e7efcb9f4e80c8d76b9d1486c122915b702a1 (patch) | |
| tree | d5379b5248a6b980922e663e9da61a75c3318c41 /ast.cc | |
| parent | 16a3288af9d214d11feb0c1c3bdb7ecaca2bfdd0 (diff) | |
parser working
Diffstat (limited to 'ast.cc')
| -rw-r--r-- | ast.cc | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -21,7 +21,7 @@ constexpr int MAXLINE = 1024; int main() { - int test_case = 3; + int test_case = 4; string s; switch (test_case) @@ -38,6 +38,9 @@ int main() case 3: s = "hi (hello || foo)"; break; + case 4: + s = "alpha || beta (gamma && (delta || epsilon & ) )"; + break; default: return 0; } @@ -45,7 +48,7 @@ int main() tokenizer(s); - cout << "----------" << endl; + cout << "---------- tokenizer ----------" << endl; for (auto c : token) { if (c.token_type == LOGIC_AND) @@ -63,5 +66,9 @@ int main() else if (c.token_type == TEXT) println("{} TEXT {}", c.bracket_depth, c.text); } + + cout << "---------- parse ----------" << endl; + + parse(0, token.size(), alloc_ast()); return 0; } |
