Large Functions Update
This commit is contained in:
@@ -18,12 +18,16 @@ enum class OpType {
|
||||
PRINT, // print(int)
|
||||
PRINT_STRING, // print(string) - NOWE
|
||||
JMP_FALSE, // if (false) skocz...
|
||||
ARRAY_DECLARE, // int t[10];
|
||||
ARRAY_SET, // t[0] = 5;
|
||||
ARRAY_GET, // x = t[0]; - to obs³u¿ymy w ASSIGN, ale warto mieæ typ
|
||||
JMP, // else / pêtla
|
||||
LOGIC_AND, // &&
|
||||
LOGIC_OR, // ||
|
||||
LABEL, // miejsce skoku
|
||||
CALL, // wywo³anie funkcji
|
||||
RETURN, // return x
|
||||
MSGBOX, // msg box
|
||||
NOP // pusta instrukcja
|
||||
};
|
||||
|
||||
@@ -63,17 +67,10 @@ struct CompilerState {
|
||||
std::stack<std::string> loopStack;
|
||||
std::stack<std::string> blockStack;
|
||||
|
||||
// --- SEKCJA STRINGÓW (TU BY£Y B£ÊDY) ---
|
||||
|
||||
// Lista litera³ów do sekcji .data (np. "str_0" -> "Hello")
|
||||
// Musi byæ VECTOR, bo iterujemy po nim.
|
||||
std::vector<std::pair<std::string, std::string>> stringLiterals;
|
||||
|
||||
// Licznik do generowania nazw str_0, str_1...
|
||||
int stringCounter = 0;
|
||||
|
||||
// Mapa typów zmiennych (np. "imie" -> "string")
|
||||
// Musi byæ MAP, bo szukamy po nazwie.
|
||||
std::map<std::string, std::string> varTypes;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user