Working on lexer first

This commit is contained in:
Krzosa Karol
2022-04-28 13:49:32 +02:00
commit d462892e14
7 changed files with 645 additions and 0 deletions

44
ideas.cpp Normal file
View File

@@ -0,0 +1,44 @@
Builtin types:
B8,B16,B32,B64
S8,S16,S32,S64
U8,U16,U32,U64
SizeI, SizeU
F32, F64
Decls:
S32 *var;
S32 (*func)();
S32 *var[expr][expr];
S32 **var;
Global scope:
function S32
do_thing(S32 a, U32 b){
stmt_list
}
function S32
do_thing(S32 a, S32 b);
typedef struct Thing Thing;
struct Thing{};
typedef struct Thing{} Thing;
typedef enum Thingy Thingy;
enum Thingy{};
typedef enum Thingy{} Thingy;
global S32 variable = expr | compound;
// typedef S32 NewName;
// typedef S32 BaseFunctionType(S32 thing);
// typedef S32 (*FunctionPointer)(S32 thing);
Local scope-(stmts):
S32 variable = expr;
variable = expr;
variable++;
return 0;
if(a){}elseif(b){}else{}