make_var(p, sym, isref);
}
-
static int declare_temp(Parser* p, Type* type, int isref)
{
char name[32];
/* Public Interface
*****************************************************************************/
+
+void codegen_startmod(Parser* p)
+{
+ (void)p;
+ printf("typedef _Bool Bool;\n");
+ printf("typedef long Int;\n");
+ printf("typedef double Real;\n");
+}
+
+void codegen_endmod(Parser* p)
+{
+ (void)p;
+}
+
void codegen_setint(Item* item, Type* type, long long val)
{
item->mode = ITEM_CONST;
.size = -1
};
+void codegen_startmod(Parser* p)
+{
+ (void)p;
+}
+
+void codegen_endmod(Parser* p)
+{
+ (void)p;
+}
+
void codegen_setint(Item* item, Type* type, long long val)
{
item->mode = ITEM_CONST;
.size = -1
};
+void codegen_startmod(Parser* p)
+{
+ (void)p;
+}
+
+void codegen_endmod(Parser* p)
+{
+ (void)p;
+}
+
void codegen_setint(Item* item, Type* type, long long val)
{
item->mode = ITEM_CONST;
*****************************************************************************/
extern Type BoolType, IntType, RealType, StringType;
+void codegen_startmod(Parser* p);
+void codegen_endmod(Parser* p);
void codegen_setint(Item* item, Type* type, long long val);
void codegen_setreal(Item* item, double val);
void codegen_setstr(Item* item, char* val);
}
expect(p, END);
- symbol_closescope(p);
codegen_endproc(p);
+ symbol_closescope(p);
}
RULE(import_list)
},
.curr_reg = 0
};
+ codegen_startmod(p);
module(p, &(Item){0});
codegen_main(p);
+ codegen_endmod(p);
}
/* Grammar Unit Tests
end
begin
- a = true;
+# a = true;
# a = A;
# b = 24;
# b = B;