V-Gears 0
Free Final Fantasy VII engine.
LuaLanguage.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2022 The V-Gears Team
3 *
4 * This file is part of V-Gears
5 *
6 * V-Gears is free software: you can redistribute it and/or modify it under
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, version 3.0 (GPLv3) of the License.
9 *
10 * V-Gears is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#pragma once
17
18#include "Value.h"
19
24
25 public:
26
27 enum CONTEXT{
28
33
38
43
48
53
58
63 };
64
70 virtual const std::string LoopBreak();
71
79 virtual const std::string LoopContinue();
80
87 virtual std::string Goto(uint32 target);
88
94 virtual const std::string DoLoopHeader();
95
103 virtual std::string DoLoopFooter(bool before_expr);
104
112 virtual std::string If(bool before_expr);
113
121 virtual std::string WhileHeader(bool before_expr);
122
128 virtual const std::string FunctionCallArgumentSeperator();
129
135 virtual const std::string FunctionCallBegin();
136
142 virtual const std::string FunctionCallEnd();
143
150 virtual std::string Label(uint32 addr);
151
157 virtual const std::string Else();
158
159
166 virtual std::string StartBlock(CONTEXT context);
167
176 virtual std::string EndBlock(CONTEXT context);
177
183 virtual const std::string LineTerminator();
184};
Provides formatters and keywords for the LUA language.
Definition: LuaLanguage.h:23
virtual std::string EndBlock(CONTEXT context)
A Lua block ender.
Definition: LuaLanguage.cpp:66
virtual std::string DoLoopFooter(bool before_expr)
The Lua parts of a do-loop footer.
Definition: LuaLanguage.cpp:35
virtual const std::string FunctionCallEnd()
The Lua function argument list closer.
Definition: LuaLanguage.cpp:54
virtual const std::string FunctionCallBegin()
The Lua function argument list opener.
Definition: LuaLanguage.cpp:52
virtual const std::string FunctionCallArgumentSeperator()
The Lua argument separator.
Definition: LuaLanguage.cpp:50
virtual const std::string LineTerminator()
The Lua line terminator (none).
Definition: LuaLanguage.cpp:72
virtual const std::string Else()
The Lua "else" keyword.
Definition: LuaLanguage.cpp:62
virtual std::string StartBlock(CONTEXT context)
The Lua block starter (none).
Definition: LuaLanguage.cpp:64
virtual const std::string LoopContinue()
The Lua "continue" keyword.
Definition: LuaLanguage.cpp:22
CONTEXT
Definition: LuaLanguage.h:27
@ END_OF_WHILE
End of while block.
Definition: LuaLanguage.h:47
@ END_OF_IF
End of if block.
Definition: LuaLanguage.h:42
@ BEGIN_ELSE
Begin of else block.
Definition: LuaLanguage.h:37
@ END_WHILE
End of a while block.
Definition: LuaLanguage.h:62
@ END_OF_IF_ELSE_CHAIN
End of an if/elseif/else block.
Definition: LuaLanguage.h:52
@ BEGIN_WHILE
Begin of a while block.
Definition: LuaLanguage.h:57
@ TO_ELSE_BLOCK
End of if/elseif block and about to start a final else.
Definition: LuaLanguage.h:32
virtual std::string Label(uint32 addr)
Generates a Lua label to use with goto.
Definition: LuaLanguage.cpp:56
virtual std::string WhileHeader(bool before_expr)
The Lua parts of a while control sentence.
Definition: LuaLanguage.cpp:45
virtual const std::string DoLoopHeader()
The Lua "repeat" keyword.
Definition: LuaLanguage.cpp:33
virtual std::string Goto(uint32 target)
A Lua "goto" instruction.
Definition: LuaLanguage.cpp:27
virtual std::string If(bool before_expr)
The Lua parts of a if control sentence.
Definition: LuaLanguage.cpp:40
virtual const std::string LoopBreak()
The Lua "break" keyword.
Definition: LuaLanguage.cpp:20
unsigned int uint32
Definition: scummsys.h:435