diff options
| author | Your Name <agrawalshagun07@gmail.com> | 2025-03-16 18:03:26 +0530 |
|---|---|---|
| committer | Your Name <agrawalshagun07@gmail.com> | 2025-03-16 18:03:26 +0530 |
| commit | 32499638cef3c49ff686b19b5708d6b08712c526 (patch) | |
| tree | 31f09287602d243b22660fe455e5174bdcc280b4 /cljcc-compiler/src/cljcc/symbol.clj | |
| parent | 277319fa392f5ee9f21eedf2c4d224739f045690 (diff) | |
Refactor into cli and cljcc-compiler folders
Pass all tests.
Fix babashka tasks and build setup.
Repl is behaving in unexpected ways, otherwise working
as expected.
Diffstat (limited to 'cljcc-compiler/src/cljcc/symbol.clj')
| -rw-r--r-- | cljcc-compiler/src/cljcc/symbol.clj | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/cljcc-compiler/src/cljcc/symbol.clj b/cljcc-compiler/src/cljcc/symbol.clj new file mode 100644 index 0000000..c410dac --- /dev/null +++ b/cljcc-compiler/src/cljcc/symbol.clj @@ -0,0 +1,50 @@ +(ns cljcc.symbol) + +;; Contains functions related to symbol table manipulation. + +(defn create-symbol [type attribute] + {:type type + :attribute attribute}) + +(defn local-attribute [] + {:type :local}) + +(defn static-attribute [initial-value global?] + {:type :static + :initial-value initial-value + :global? global?}) + +(defn fun-attribute [defined? global?] + {:type :fun + :defined? defined? + :global? global?}) + +(defn no-initializer-iv [] + {:type :no-initializer}) + +(defn tentative-iv [] + {:type :tentative}) + +(defn initial-iv [static-init] + {:type :initial + :static-init static-init}) + +(defn int-init [v] + {:type :int-init + :value v}) + +(defn uint-init [v] + {:type :uint-init + :value v}) + +(defn long-init [v] + {:type :long-init + :value v}) + +(defn ulong-init [v] + {:type :ulong-init + :value v}) + +(defn double-init [v] + {:type :double-init + :value v}) |
