1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-28 18:18:52 +00:00
OpenMW/components/compiler/literals.hpp

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

41 lines
1.0 KiB
C++
Raw Normal View History

#ifndef COMPILER_LITERALS_H_INCLUDED
#define COMPILER_LITERALS_H_INCLUDED
#include <string>
#include <vector>
#include <components/interpreter/types.hpp>
namespace Compiler
{
/// \brief Literal values.
2022-09-22 18:26:05 +00:00
class Literals
{
std::vector<Interpreter::Type_Integer> mIntegers;
std::vector<Interpreter::Type_Float> mFloats;
std::vector<std::string> mStrings;
2022-09-22 18:26:05 +00:00
public:
const std::vector<Interpreter::Type_Integer>& getIntegers() const { return mIntegers; }
2022-09-22 18:26:05 +00:00
const std::vector<Interpreter::Type_Float>& getFloats() const { return mFloats; }
2022-09-22 18:26:05 +00:00
const std::vector<std::string>& getStrings() const { return mStrings; }
2022-09-22 18:26:05 +00:00
int addInteger(Interpreter::Type_Integer value);
///< add integer liternal and return index.
2022-09-22 18:26:05 +00:00
int addFloat(Interpreter::Type_Float value);
///< add float literal and return value.
2022-09-22 18:26:05 +00:00
int addString(const std::string& value);
///< add string literal and return value.
2022-09-22 18:26:05 +00:00
void clear();
///< remove all literals.
};
}
#endif