From 24397e5682514f2988072d7039ed39c08e3ba7ef Mon Sep 17 00:00:00 2001 From: Shagun Agrawal Date: Sun, 8 Dec 2024 21:57:39 +0530 Subject: Add tacky phase for long type generation Tacky phase generation for for long types Refactor expression handling for Tacky phase by using postwalk function Refactor symbol namespaces --- src/cljcc/symbol.clj | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/cljcc/symbol.clj (limited to 'src/cljcc/symbol.clj') diff --git a/src/cljcc/symbol.clj b/src/cljcc/symbol.clj new file mode 100644 index 0000000..3cc4af9 --- /dev/null +++ b/src/cljcc/symbol.clj @@ -0,0 +1,38 @@ +(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 long-init [v] + {:type :long-init + :value v}) -- cgit v1.2.3