V-Gears 0
Free Final Fantasy VII engine.
LuaLanguage Class Reference

Provides formatters and keywords for the LUA language. More...

#include <LuaLanguage.h>

Public Types

enum  CONTEXT {
  TO_ELSE_BLOCK , BEGIN_ELSE , END_OF_IF , END_OF_WHILE ,
  END_OF_IF_ELSE_CHAIN , BEGIN_WHILE , END_WHILE
}
 

Public Member Functions

virtual const std::string LoopBreak ()
 The Lua "break" keyword. More...
 
virtual const std::string LoopContinue ()
 The Lua "continue" keyword. More...
 
virtual std::string Goto (uint32 target)
 A Lua "goto" instruction. More...
 
virtual const std::string DoLoopHeader ()
 The Lua "repeat" keyword. More...
 
virtual std::string DoLoopFooter (bool before_expr)
 The Lua parts of a do-loop footer. More...
 
virtual std::string If (bool before_expr)
 The Lua parts of a if control sentence. More...
 
virtual std::string WhileHeader (bool before_expr)
 The Lua parts of a while control sentence. More...
 
virtual const std::string FunctionCallArgumentSeperator ()
 The Lua argument separator. More...
 
virtual const std::string FunctionCallBegin ()
 The Lua function argument list opener. More...
 
virtual const std::string FunctionCallEnd ()
 The Lua function argument list closer. More...
 
virtual std::string Label (uint32 addr)
 Generates a Lua label to use with goto. More...
 
virtual const std::string Else ()
 The Lua "else" keyword. More...
 
virtual std::string StartBlock (CONTEXT context)
 The Lua block starter (none). More...
 
virtual std::string EndBlock (CONTEXT context)
 A Lua block ender. More...
 
virtual const std::string LineTerminator ()
 The Lua line terminator (none). More...
 

Detailed Description

Provides formatters and keywords for the LUA language.

Member Enumeration Documentation

◆ CONTEXT

Enumerator
TO_ELSE_BLOCK 

End of if/elseif block and about to start a final else.

BEGIN_ELSE 

Begin of else block.

END_OF_IF 

End of if block.

END_OF_WHILE 

End of while block.

END_OF_IF_ELSE_CHAIN 

End of an if/elseif/else block.

BEGIN_WHILE 

Begin of a while block.

END_WHILE 

End of a while block.

Member Function Documentation

◆ DoLoopFooter()

std::string LuaLanguage::DoLoopFooter ( bool  before_expr)
virtual

The Lua parts of a do-loop footer.

Parameters
[in]before_exprTrue to fetch the initial part of the footer, false for the ending part.
Returns
"until (" if before_expr is true, ")" if not.

◆ DoLoopHeader()

const std::string LuaLanguage::DoLoopHeader ( )
virtual

The Lua "repeat" keyword.

Returns
"repeat".

◆ Else()

const std::string LuaLanguage::Else ( )
virtual

The Lua "else" keyword.

Returns
"else".

◆ EndBlock()

std::string LuaLanguage::EndBlock ( CONTEXT  context)
virtual

A Lua block ender.

Parameters
[in]contextThe current context.
Returns
"end", unles the current context is {
See also
TO_ELSE_BLOCK}, in which case it will return an empty string, because "end" is not needed before an else.

◆ FunctionCallArgumentSeperator()

const std::string LuaLanguage::FunctionCallArgumentSeperator ( )
virtual

The Lua argument separator.

Returns
",".

◆ FunctionCallBegin()

const std::string LuaLanguage::FunctionCallBegin ( )
virtual

The Lua function argument list opener.

Returns
"(".

◆ FunctionCallEnd()

const std::string LuaLanguage::FunctionCallEnd ( )
virtual

The Lua function argument list closer.

Returns
")".

◆ Goto()

std::string LuaLanguage::Goto ( uint32  target)
virtual

A Lua "goto" instruction.

Parameters
[in]targetA memory address label.
Returns
"goto label_0x<target>X".

◆ If()

std::string LuaLanguage::If ( bool  before_expr)
virtual

The Lua parts of a if control sentence.

Parameters
[in]before_exprTrue to fetch the initial part of the sentence, false for the ending part.
Returns
"if (" if before_expr is true, ") then" if not.

◆ Label()

std::string LuaLanguage::Label ( uint32  addr)
virtual

Generates a Lua label to use with goto.

Parameters
[in]addrTarget address label.
Returns
"::label_0x<target>X::"

◆ LineTerminator()

const std::string LuaLanguage::LineTerminator ( )
virtual

The Lua line terminator (none).

Returns
An empty string.

◆ LoopBreak()

const std::string LuaLanguage::LoopBreak ( )
virtual

The Lua "break" keyword.

Returns
"break".

◆ LoopContinue()

const std::string LuaLanguage::LoopContinue ( )
virtual

The Lua "continue" keyword.

Continue is not implemented in Lua.

Returns
A commented string.

◆ StartBlock()

std::string LuaLanguage::StartBlock ( CONTEXT  context)
virtual

The Lua block starter (none).

Parameters
[in]contextUnused.
Returns
An empty string.

◆ WhileHeader()

std::string LuaLanguage::WhileHeader ( bool  before_expr)
virtual

The Lua parts of a while control sentence.

Parameters
[in]before_exprTrue to fetch the initial part of the sentence, false for the ending part.
Returns
"while (" if before_expr is true, ") do" if not.

The documentation for this class was generated from the following files: