loom

Форк
0
/
ScriptOperationCode.cpp 
185 строк · 5.4 Кб
1
/*
2
MIT License
3

4
Copyright (c) 2019 МГТУ им. Н.Э. Баумана, кафедра ИУ-6, Михаил Фетисов,
5

6
https://bmstu.codes/lsx/simodo
7
*/
8

9
#include "ScriptOperationCode.h"
10

11
namespace simodo::interpret
12
{
13
    std::string getSblOperationCodeName(ScriptOperationCode op) noexcept
14
    {
15
        std::string str;
16

17
        switch(op)
18
        {
19
        case ScriptOperationCode::None:
20
            str = "None";
21
            break;
22
        case ScriptOperationCode::PushConstant:
23
            str = "PushConstant";
24
            break;
25
        case ScriptOperationCode::PushVariable:
26
            str = "PushVariable";
27
            break;
28
        case ScriptOperationCode::ObjectElement:
29
            str = "ObjectElement";
30
            break;
31
        case ScriptOperationCode::FunctionCall:
32
            str = "FunctionCall";
33
            break;
34
        case ScriptOperationCode::ProcedureCheck:
35
            str = "ProcedureCheck";
36
            break;
37
        case ScriptOperationCode::Print:
38
            str = "Print";
39
            break;
40
        case ScriptOperationCode::Block:
41
            str = "Block";
42
            break;
43
        case ScriptOperationCode::ArrayElement:
44
            str = "ArrayElement";
45
            break;
46
        case ScriptOperationCode::Contract:
47
            str = "ContractDefinition";
48
            break;
49
        case ScriptOperationCode::Type:
50
            str = "TypeDefinition";
51
            break;
52
        case ScriptOperationCode::Announcement:
53
            str = "Announcement";
54
            break;
55
        case ScriptOperationCode::Import:
56
            str = "Import";
57
            break;
58
        case ScriptOperationCode::Declaration:
59
            str = "Declaration";
60
            break;
61
        case ScriptOperationCode::ObjectStructure:
62
            str = "RecordStructure";
63
            break;
64
        case ScriptOperationCode::ArrayStructure:
65
            str = "ArrayStructure";
66
            break;
67
        case ScriptOperationCode::Initialize:
68
            str = "Initialize";
69
            break;
70
        case ScriptOperationCode::Assignment:
71
            str = "Assignment";
72
            break;
73
        case ScriptOperationCode::Plus:
74
            str = "Plus";
75
            break;
76
        case ScriptOperationCode::Minus:
77
            str = "Minus";
78
            break;
79
        case ScriptOperationCode::Or:
80
            str = "Or";
81
            break;
82
        case ScriptOperationCode::And:
83
            str = "And";
84
            break;
85
        case ScriptOperationCode::Equal:
86
            str = "Equal";
87
            break;
88
        case ScriptOperationCode::NotEqual:
89
            str = "NotEqual";
90
            break;
91
        case ScriptOperationCode::Less:
92
            str = "Less";
93
            break;
94
        case ScriptOperationCode::LessOrEqual:
95
            str = "LessOrEqual";
96
            break;
97
        case ScriptOperationCode::More:
98
            str = "More";
99
            break;
100
        case ScriptOperationCode::MoreOrEqual:
101
            str = "MoreOrEqual";
102
            break;
103
        case ScriptOperationCode::Addition:
104
            str = "Addition";
105
            break;
106
        case ScriptOperationCode::Subtraction:
107
            str = "Subtraction";
108
            break;
109
        case ScriptOperationCode::Multiplication:
110
            str = "Multiplication";
111
            break;
112
        case ScriptOperationCode::Division:
113
            str = "Division";
114
            break;
115
        case ScriptOperationCode::Modulo:
116
            str = "Modulo";
117
            break;
118
        case ScriptOperationCode::Power:
119
            str = "Power";
120
            break;
121
        case ScriptOperationCode::Ternary:
122
            str = "Ternary";
123
            break;
124
        case ScriptOperationCode::If:
125
            str = "If";
126
            break;
127
        case ScriptOperationCode::MeasureUnit:
128
            str = "MeasureUnit";
129
            break;
130
        case ScriptOperationCode::MeasureRatio:
131
            str = "MeasureRatio";
132
            break;
133
        case ScriptOperationCode::AssignmentAddition:
134
            str = "AssignmentAddition";
135
            break;
136
        case ScriptOperationCode::AssignmentSubtraction:
137
            str = "AssignmentSubtraction";
138
            break;
139
        case ScriptOperationCode::AssignmentMultiplication:
140
            str = "AssignmentMultiplication";
141
            break;
142
        case ScriptOperationCode::AssignmentDivision:
143
            str = "AssignmentDivision";
144
            break;
145
        case ScriptOperationCode::AssignmentModulo:
146
            str = "AssignmentModulo";
147
            break;
148
        case ScriptOperationCode::FunctionDefinition:
149
            str = "FunctionDefinition";
150
            break;
151
        case ScriptOperationCode::FunctionDefinitionEnd:
152
            str = "FunctionDefinitionEnd";
153
            break;
154
        case ScriptOperationCode::Break:
155
            str = "Break";
156
            break;
157
        case ScriptOperationCode::Continue:
158
            str = "Continue";
159
            break;
160
        case ScriptOperationCode::Return:
161
            str = "Return";
162
            break;
163
        case ScriptOperationCode::For:
164
            str = "For";
165
            break;
166
        case ScriptOperationCode::While:
167
            str = "While";
168
            break;
169
        case ScriptOperationCode::DoWhile:
170
            str = "DoWhile";
171
            break;
172
        case ScriptOperationCode::Apply:
173
            str = "Apply";
174
            break;
175
        case ScriptOperationCode::Using:
176
            str = "Using";
177
            break;
178
        default:
179
            str = "***";
180
            break;
181
        }
182

183
        return str;
184
    }
185
}

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.