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,58 +1,59 @@
|
|||
#ifndef COMPILER_FILEPARSER_H_INCLUDED
|
||||
#define COMPILER_FILEPARSER_H_INCLUDED
|
||||
|
||||
#include "locals.hpp"
|
||||
#include "parser.hpp"
|
||||
#include "scriptparser.hpp"
|
||||
#include "locals.hpp"
|
||||
|
||||
namespace Compiler
|
||||
{
|
||||
// Top-level parser, to be used for global scripts, local scripts and targeted scripts
|
||||
|
||||
|
||||
class FileParser : public Parser
|
||||
{
|
||||
enum State
|
||||
{
|
||||
BeginState, NameState, BeginCompleteState, EndNameState,
|
||||
EndCompleteState
|
||||
};
|
||||
|
||||
ScriptParser mScriptParser;
|
||||
State mState;
|
||||
std::string mName;
|
||||
Locals mLocals;
|
||||
enum State
|
||||
{
|
||||
BeginState,
|
||||
NameState,
|
||||
BeginCompleteState,
|
||||
EndNameState,
|
||||
EndCompleteState
|
||||
};
|
||||
|
||||
public:
|
||||
|
||||
FileParser (ErrorHandler& errorHandler, Context& context);
|
||||
ScriptParser mScriptParser;
|
||||
State mState;
|
||||
std::string mName;
|
||||
Locals mLocals;
|
||||
|
||||
std::string getName() const;
|
||||
///< Return script name.
|
||||
public:
|
||||
FileParser(ErrorHandler& errorHandler, Context& context);
|
||||
|
||||
void getCode (std::vector<Interpreter::Type_Code>& code) const;
|
||||
///< store generated code in \a code.
|
||||
|
||||
const Locals& getLocals() const;
|
||||
///< get local variable declarations.
|
||||
std::string getName() const;
|
||||
///< Return script name.
|
||||
|
||||
bool parseName (const std::string& name, const TokenLoc& loc,
|
||||
Scanner& scanner) override;
|
||||
///< Handle a name token.
|
||||
/// \return fetch another token?
|
||||
void getCode(std::vector<Interpreter::Type_Code>& code) const;
|
||||
///< store generated code in \a code.
|
||||
|
||||
bool parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner) override;
|
||||
///< Handle a keyword token.
|
||||
/// \return fetch another token?
|
||||
const Locals& getLocals() const;
|
||||
///< get local variable declarations.
|
||||
|
||||
bool parseSpecial (int code, const TokenLoc& loc, Scanner& scanner) override;
|
||||
///< Handle a special character token.
|
||||
/// \return fetch another token?
|
||||
bool parseName(const std::string& name, const TokenLoc& loc, Scanner& scanner) override;
|
||||
///< Handle a name token.
|
||||
/// \return fetch another token?
|
||||
|
||||
void parseEOF (Scanner& scanner) override;
|
||||
///< Handle EOF token.
|
||||
|
||||
void reset() override;
|
||||
///< Reset parser to clean state.
|
||||
bool parseKeyword(int keyword, const TokenLoc& loc, Scanner& scanner) override;
|
||||
///< Handle a keyword token.
|
||||
/// \return fetch another token?
|
||||
|
||||
bool parseSpecial(int code, const TokenLoc& loc, Scanner& scanner) override;
|
||||
///< Handle a special character token.
|
||||
/// \return fetch another token?
|
||||
|
||||
void parseEOF(Scanner& scanner) override;
|
||||
///< Handle EOF token.
|
||||
|
||||
void reset() override;
|
||||
///< Reset parser to clean state.
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue