1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-05 15:40:10 +00:00
OpenMW/apps/openmw/mwscript/compilercontext.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.2 KiB
C++
Raw Normal View History

2010-07-02 17:21:27 +02:00
#ifndef GAME_SCRIPT_COMPILERCONTEXT_H
#define GAME_SCRIPT_COMPILERCONTEXT_H
#include <components/compiler/context.hpp>
namespace MWScript
{
class CompilerContext : public Compiler::Context
{
public:
enum Type
{
2016-12-14 22:11:22 +01:00
Type_Full, // global, local, targeted
Type_Dialogue,
Type_Console
};
2022-09-22 21:26:05 +03:00
private:
Type mType;
2022-09-22 21:26:05 +03:00
public:
CompilerContext(Type type);
2022-09-22 21:26:05 +03:00
/// Is the compiler allowed to declare local variables?
bool canDeclareLocals() const override;
2022-09-22 21:26:05 +03:00
/// 'l: long, 's': short, 'f': float, ' ': does not exist.
char getGlobalType(const std::string& name) const override;
2022-09-22 21:26:05 +03:00
std::pair<char, bool> getMemberType(const std::string& name, const std::string& id) const override;
///< Return type of member variable \a name in script \a id or in script of reference of
/// \a id
/// \return first: 'l: long, 's': short, 'f': float, ' ': does not exist.
/// second: true: script of reference
2022-09-22 21:26:05 +03:00
bool isId(const std::string& name) const override;
///< Does \a name match an ID, that can be referenced?
2010-07-02 17:21:27 +02:00
};
}
#endif