mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Apply clang-format to code base
This commit is contained in:
parent
f37d0be806
commit
ddb0522bbf
2199 changed files with 118692 additions and 114392 deletions
|
@ -1,8 +1,8 @@
|
|||
#ifndef COMPILER_EXTENSIONS_H_INCLUDED
|
||||
#define COMPILER_EXTENSIONS_H_INCLUDED
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <components/interpreter/types.hpp>
|
||||
|
@ -39,76 +39,73 @@ namespace Compiler
|
|||
class Extensions
|
||||
{
|
||||
|
||||
struct Function
|
||||
{
|
||||
char mReturn;
|
||||
ScriptArgs mArguments;
|
||||
int mCode;
|
||||
int mCodeExplicit;
|
||||
int mSegment;
|
||||
};
|
||||
struct Function
|
||||
{
|
||||
char mReturn;
|
||||
ScriptArgs mArguments;
|
||||
int mCode;
|
||||
int mCodeExplicit;
|
||||
int mSegment;
|
||||
};
|
||||
|
||||
struct Instruction
|
||||
{
|
||||
ScriptArgs mArguments;
|
||||
int mCode;
|
||||
int mCodeExplicit;
|
||||
int mSegment;
|
||||
};
|
||||
struct Instruction
|
||||
{
|
||||
ScriptArgs mArguments;
|
||||
int mCode;
|
||||
int mCodeExplicit;
|
||||
int mSegment;
|
||||
};
|
||||
|
||||
int mNextKeywordIndex;
|
||||
std::map<std::string, int> mKeywords;
|
||||
std::map<int, Function> mFunctions;
|
||||
std::map<int, Instruction> mInstructions;
|
||||
int mNextKeywordIndex;
|
||||
std::map<std::string, int> mKeywords;
|
||||
std::map<int, Function> mFunctions;
|
||||
std::map<int, Instruction> mInstructions;
|
||||
|
||||
public:
|
||||
public:
|
||||
Extensions();
|
||||
|
||||
Extensions();
|
||||
int searchKeyword(const std::string& keyword) const;
|
||||
///< Return extension keyword code, that is assigned to the string \a keyword.
|
||||
/// - if no match is found 0 is returned.
|
||||
/// - keyword must be all lower case.
|
||||
|
||||
int searchKeyword (const std::string& keyword) const;
|
||||
///< Return extension keyword code, that is assigned to the string \a keyword.
|
||||
/// - if no match is found 0 is returned.
|
||||
/// - keyword must be all lower case.
|
||||
bool isFunction(int keyword, ScriptReturn& returnType, ScriptArgs& argumentType, bool& explicitReference) const;
|
||||
///< Is this keyword registered with a function? If yes, return return and argument
|
||||
/// types.
|
||||
/// \param explicitReference In: has explicit reference; Out: set to false, if
|
||||
/// explicit reference is not available for this instruction.
|
||||
|
||||
bool isFunction (int keyword, ScriptReturn& returnType, ScriptArgs& argumentType,
|
||||
bool& explicitReference) const;
|
||||
///< Is this keyword registered with a function? If yes, return return and argument
|
||||
/// types.
|
||||
/// \param explicitReference In: has explicit reference; Out: set to false, if
|
||||
/// explicit reference is not available for this instruction.
|
||||
bool isInstruction(int keyword, ScriptArgs& argumentType, bool& explicitReference) const;
|
||||
///< Is this keyword registered with a function? If yes, return argument types.
|
||||
/// \param explicitReference In: has explicit reference; Out: set to false, if
|
||||
/// explicit reference is not available for this instruction.
|
||||
|
||||
bool isInstruction (int keyword, ScriptArgs& argumentType,
|
||||
bool& explicitReference) const;
|
||||
///< Is this keyword registered with a function? If yes, return argument types.
|
||||
/// \param explicitReference In: has explicit reference; Out: set to false, if
|
||||
/// explicit reference is not available for this instruction.
|
||||
void registerFunction(const std::string& keyword, ScriptReturn returnType, const ScriptArgs& argumentType,
|
||||
int code, int codeExplicit = -1);
|
||||
///< Register a custom function
|
||||
/// - keyword must be all lower case.
|
||||
/// - keyword must be unique
|
||||
/// - if explicit references are not supported, segment5codeExplicit must be set to -1
|
||||
/// \note Currently only segment 3 and segment 5 opcodes are supported.
|
||||
|
||||
void registerFunction (const std::string& keyword, ScriptReturn returnType,
|
||||
const ScriptArgs& argumentType, int code, int codeExplicit = -1);
|
||||
///< Register a custom function
|
||||
/// - keyword must be all lower case.
|
||||
/// - keyword must be unique
|
||||
/// - if explicit references are not supported, segment5codeExplicit must be set to -1
|
||||
/// \note Currently only segment 3 and segment 5 opcodes are supported.
|
||||
void registerInstruction(
|
||||
const std::string& keyword, const ScriptArgs& argumentType, int code, int codeExplicit = -1);
|
||||
///< Register a custom instruction
|
||||
/// - keyword must be all lower case.
|
||||
/// - keyword must be unique
|
||||
/// - if explicit references are not supported, segment5codeExplicit must be set to -1
|
||||
/// \note Currently only segment 3 and segment 5 opcodes are supported.
|
||||
|
||||
void registerInstruction (const std::string& keyword,
|
||||
const ScriptArgs& argumentType, int code, int codeExplicit = -1);
|
||||
///< Register a custom instruction
|
||||
/// - keyword must be all lower case.
|
||||
/// - keyword must be unique
|
||||
/// - if explicit references are not supported, segment5codeExplicit must be set to -1
|
||||
/// \note Currently only segment 3 and segment 5 opcodes are supported.
|
||||
void generateFunctionCode(int keyword, std::vector<Interpreter::Type_Code>& code, Literals& literals,
|
||||
const std::string& id, int optionalArguments) const;
|
||||
///< Append code for function to \a code.
|
||||
|
||||
void generateFunctionCode (int keyword, std::vector<Interpreter::Type_Code>& code,
|
||||
Literals& literals, const std::string& id, int optionalArguments) const;
|
||||
///< Append code for function to \a code.
|
||||
void generateInstructionCode(int keyword, std::vector<Interpreter::Type_Code>& code, Literals& literals,
|
||||
const std::string& id, int optionalArguments) const;
|
||||
///< Append code for function to \a code.
|
||||
|
||||
void generateInstructionCode (int keyword, std::vector<Interpreter::Type_Code>& code,
|
||||
Literals& literals, const std::string& id, int optionalArguments) const;
|
||||
///< Append code for function to \a code.
|
||||
|
||||
void listKeywords (std::vector<std::string>& keywords) const;
|
||||
///< Append all known keywords to \a kaywords.
|
||||
void listKeywords(std::vector<std::string>& keywords) const;
|
||||
///< Append all known keywords to \a kaywords.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue