(((534>43)?435:42),234,((S64)32),Thing[10][2],Thing((1,2))) (4+(2*53)) ((4+2)*53) (++5) (--5) (-5) (+5) (sizeof(32)+sizeof(S32*)) ((S64**)5) (((S64)5)+3) ((534>43)?435:42) struct Thing{ int test; }; S32 thing = 100; (thing=(thing+10)); (++thing); { S32 thing_scoped = 10; (thing_scoped+=10); } typedef struct OpenGL OpenGL; typedef struct OS_Memory OS_Memory; typedef struct Arena Arena; typedef struct String String; typedef struct Token Token; typedef struct Lex_Stream Lex_Stream; typedef struct Expr Expr; typedef struct AST_Node AST_Node; typedef struct Parser_Error Parser_Error; typedef struct Scope Scope; typedef struct Parser Parser; struct test{ struct Array_Block{ Array_Block (*next); Based_Type_Represent (data[size]); }; struct Array{ Array_Block first; Array_Block (*last); S64 block; S64 len; }; function Based_Type_Represent array_make(Arena (*arena)){ Test_Type thing; Based_Type_Represent result; ((result.arena)=arena); ((result.last)=(&(result.first))); return result; } function void array_push(Array (*array), Based_Type_Represent (*item)){ if (((array->len)+1)>size){ assert((array->len)); Array_Block (*block) = ((Thing)arena_push_struct(((array->arena),sizeof(Array_Block)))); ((array->last)=(((array->last).next)=block)); ((array->len)=0); ((array->block)+=1); } (((array->last).data)[(++(array->len))]=(*item)); } }; struct OpenGL{ void (*glVertexAttribPointer)(GLuint, GLint, GLenumGLenum, GLboolean, GLsizei, GLvoid *); void (*glBindTexture)(GLenum, GLuint); void (*glDrawArrays)(GLenumGLenum, GLint, GLsizei); int (*(test_array[10])); Things (*thing); S64 thing_cap; S64 thing_len; }; struct OS_Memory{ void (*data); SizeU commit; SizeU reserve; }; struct Arena{ OS_Memory memory; U64 len; U64 alignment; }; struct String{ U8 (*str); S64 len; }; typedef String Intern_String; typedef enum Token_Kind{ TK_End, TK_Mul, TK_Div, TK_Add, TK_Sub, TK_Mod, TK_BitAnd, TK_BitOr, TK_BitXor, TK_Neg, TK_Not, TK_OpenParen, TK_CloseParen, TK_OpenBrace, TK_CloseBrace, TK_OpenBracket, TK_CloseBracket, TK_Comma, TK_Pound, TK_Question, TK_ThreeDots, TK_Semicolon, TK_Dot, TK_LesserThen, TK_GreaterThen, TK_Colon, TK_Assign, TK_DivAssign, TK_MulAssign, TK_ModAssign, TK_SubAssign, TK_AddAssign, TK_AndAssign, TK_OrAssign, TK_XorAssign, TK_LeftShiftAssign, TK_RightShiftAssign, TK_DoubleColon, TK_At, TK_Decrement, TK_Increment, TK_PostDecrement, TK_PostIncrement, TK_LesserThenOrEqual, TK_GreaterThenOrEqual, TK_Equals, TK_And, TK_Or, TK_NotEquals, TK_LeftShift, TK_RightShift, TK_Arrow, TK_ExprSizeof, TK_DocComment, TK_Comment, TK_Identifier, TK_StringLit, TK_U8Lit, TK_Character, TK_Error, TK_Float, TK_Int, TK_Keyword, }Token_Kind; struct Token{ Token_Kind kind; String string; union{ S64 integer_val; String error_val; Intern_String intern_val; }; String file; S64 line; U8 (*line_begin); }; struct Lex_Stream{ U8 (*stream); U8 (*line_begin); String filename; S64 line; }; typedef enum Expr_Kind{ EK_None, EK_Atom, EK_Unary, EK_Binary, EK_Ternary, EK_Cast, EK_List, EK_Call, EK_Index, }Expr_Kind; struct Expr{ Expr_Kind kind; Token (*token); Expr (*next); union{ struct{ AST_Node (*type); Expr (*expr); }cast_val; struct{ Expr (*first); Expr (*last); }list; struct{ Expr (*atom); Expr (*list); }call; struct{ Expr (*atom); Expr (*index); }index; struct{ Expr (*expr); }unary; struct{ Expr (*left); Expr (*right); }binary; struct{ Expr (*cond); Expr (*on_true); Expr (*on_false); }ternary; }; }; typedef enum AST_Kind{ AK_None, AK_BaseType, AK_Typedef, AK_Enum, AK_Struct, AK_Union, AK_Note, AK_List, AK_Pointer, AK_Array, AK_Function, AK_Variable, AK_EnumChild, }AST_Kind; struct AST_Node{ AST_Kind kind; Token (*pos); Intern_String name; AST_Node (*next); AST_Node (*next_scope); AST_Node (*first_note); AST_Node (*last_note); AST_Node (*first_child); AST_Node (*last_child); union{ SizeU base_type_size; AST_Node (*pointer); AST_Node (*typedef_type); AST_Node (*variable_type); AST_Node (*func_return_type); }; }; struct Parser_Error{ Parser_Error (*next); String message; Token (*token); }; struct Scope{ Scope (*next); AST_Node (*first); AST_Node (*last); }; struct Parser{ Arena main_arena; Arena intern_table_arena; Arena symbol_table_arena; Scope (*scope_free_list); Scope (*scope_stack); Scope (*global_scope); S64 symbols_inserted; S64 symbols_count; AST_Node (*symbols); Intern_String (*interns); S64 interns_in_bytes; S64 interns_inserted; S64 interns_count; U8 (*first_keyword); U8 (*last_keyword); Parser_Error default; Parser_Error error; };