aboutsummaryrefslogtreecommitdiff
path: root/src/cljcc/symbol.clj
diff options
context:
space:
mode:
authorShagun Agrawal <agrawalshagun07@gmail.com>2024-12-08 21:57:39 +0530
committerShagun Agrawal <agrawalshagun07@gmail.com>2024-12-08 21:57:39 +0530
commit24397e5682514f2988072d7039ed39c08e3ba7ef (patch)
treed4048d1d689356eca9ebaaa5fdfc7a291d3bb1fc /src/cljcc/symbol.clj
parentfa049cc22c6c7b64b51e6e10b33a259fa58945d7 (diff)
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
Diffstat (limited to 'src/cljcc/symbol.clj')
-rw-r--r--src/cljcc/symbol.clj38
1 files changed, 38 insertions, 0 deletions
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})