summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/heads/abstract.h (renamed from src/headers/abstract.h)0
-rw-r--r--src/heads/codegen.h (renamed from src/headers/codegen.h)0
-rw-r--r--src/heads/freeast.h (renamed from src/headers/freeast.h)0
-rw-r--r--src/heads/kat.h (renamed from src/headers/kat.h)0
-rw-r--r--src/rbc.c29
5 files changed, 16 insertions, 13 deletions
diff --git a/src/headers/abstract.h b/src/heads/abstract.h
index efecaa0..efecaa0 100644
--- a/src/headers/abstract.h
+++ b/src/heads/abstract.h
diff --git a/src/headers/codegen.h b/src/heads/codegen.h
index d629caf..d629caf 100644
--- a/src/headers/codegen.h
+++ b/src/heads/codegen.h
diff --git a/src/headers/freeast.h b/src/heads/freeast.h
index 544d183..544d183 100644
--- a/src/headers/freeast.h
+++ b/src/heads/freeast.h
diff --git a/src/headers/kat.h b/src/heads/kat.h
index f5a3a00..f5a3a00 100644
--- a/src/headers/kat.h
+++ b/src/heads/kat.h
diff --git a/src/rbc.c b/src/rbc.c
index 5316cda..1e6a3de 100644
--- a/src/rbc.c
+++ b/src/rbc.c
@@ -46,17 +46,18 @@
* Debug compile = 'cc rbc.c -o crbc -g -O0 -Wall -Wextra -pedantic -fsanitize=address,undefined'
*/
+// Include directives
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// git@github.com:jstmaxlol/kat
-#include "headers/kat.h"
+#include "heads/kat.h"
// CReborn headers (CReborn APIs)
-#include "headers/codegen.h"
-#include "headers/abstract.h"
-#include "headers/freeast.h"
+#include "heads/codegen.h"
+#include "heads/abstract.h"
+#include "heads/freeast.h"
// ASTs in abstract.h
//
@@ -81,26 +82,26 @@ int main(int argc, char **argv) {
printf(":> No arguments were found. (%d)\n\n", argc-1);
}
- const char *ident_buff = "number";
- const char *type_buff = "int";
+ const char *identBuff = "number";
+ const char *typeBuff = "int";
- int value_buff = 2;
+ int valueBuff = 2;
if (argc == 3) {
if (strlen(argv[1]) >= 1)
- ident_buff = argv[1];
+ identBuff = argv[1];
//if (strlen(argv[2]) >= 1)
- // type_buff = argv[2];
+ // typeBuff = argv[2];
if (strlen(argv[2]) >= 1)
- value_buff = atoi(argv[2]);
+ valueBuff = atoi(argv[2]);
}
- Expr *e = ExprIntLiteral(value_buff);
- Decl *decl = DeclareVariable(ident_buff, type_buff, e);
+ Expr *e = ExprIntLiteral(valueBuff);
+ Decl *decl = DeclareVariable(identBuff, typeBuff, e);
if (decl->kind == DECL_VAR) {
DeclVar *v = decl->as;
- printf("v->ident=%s, v->type=%s\nlet %s: %s = %d;", v->ident, v->type, v->ident, v->type, value_buff);
+ printf("v->ident=%s, v->type=%s\nlet %s: %s = %d;", v->ident, v->type, v->ident, v->type, valueBuff);
}
FreeExpr(e);
@@ -112,6 +113,8 @@ int main(int argc, char **argv) {
// Functions (definitions)
//
static inline int Eval(int x) {
+ // TODO
+ // (work on this after AST is finished)
return x;
}