diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-21 16:04:56 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-21 17:28:19 +0200 |
commit | 0e3df321ab2fce795bdc6b9aeb92724733cf8ee0 (patch) | |
tree | 8370e465f2b16f46f623f3e77eef4b1be2219f92 /module/c/util.scm | |
parent | Merge call-with-tmpfile and diffs for testrunner. (diff) | |
download | calp-0e3df321ab2fce795bdc6b9aeb92724733cf8ee0.tar.gz calp-0e3df321ab2fce795bdc6b9aeb92724733cf8ee0.tar.xz |
Major work on parser.
Diffstat (limited to '')
-rw-r--r-- | module/c/util.scm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/module/c/util.scm b/module/c/util.scm new file mode 100644 index 00000000..f258d3e3 --- /dev/null +++ b/module/c/util.scm @@ -0,0 +1,20 @@ +(use-modules (c lex2) + (srfi srfi-1) + (srfi srfi-88) + (c to-token) + (c cpp-types)) + +(define (tok s) + (map preprocessing-token->token (remove whitespace-token? (lex s)))) + +(define* (parse tokens optional: (parser make-parser)) + ((parser) + (build-lexical-analyzer tokens) + error)) + + +(define (mm) + (lalr-parser + (x) + (y (x)) + )) |