Skip to content

Commit 5a43fec

Browse files
committed
Updated STATEMENT for the parser.
1 parent 2b20215 commit 5a43fec

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

src/Essentials/Statement.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#include "Statement.h"
2+
3+
namespace FPL::Statement {
4+
Statement::Statement(StatementKind kind, std::string name, FPL::Types::Types type) {
5+
StatementType = type;
6+
StatementName = name;
7+
StatementKind{kind};
8+
}
9+
}

src/Essentials/Statement.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#pragma once
2+
3+
#include <iostream>
4+
#include <map>
5+
#include <string>
6+
7+
#include "Types.h"
8+
9+
namespace FPL::Statement {
10+
11+
enum class StatementKind: int {
12+
VARIABLE_DECLARATION,
13+
FUNCTION_CALL,
14+
LITTERAL
15+
};
16+
17+
inline constexpr const char* sStatementKindStrings[] = {
18+
"VARIABLE_DECLARATION",
19+
"FUNCTION_CALL",
20+
"LITTERAL"
21+
};
22+
23+
class Statement {
24+
public:
25+
Statement();
26+
Statement(StatementKind kind, std::string name, FPL::Types::Types type);
27+
28+
std::string StatementName;
29+
FPL::Types::Types StatementType{FPL::Types::Types("vide", FPL::Types::BUILTIN_TYPE::VOID)};
30+
StatementKind kind{};
31+
};
32+
}

0 commit comments

Comments
 (0)