#ifndef LOADER_PARSEDSOURCE_H_
#define LOADER_PARSEDSOURCE_H_
+#include "fwd.h"
+
#include <iosfwd>
#include <map>
#include <set>
namespace loader {
-class PropertyList;
-class Value;
+class ScriptToken {
+
+public:
+ enum Type {
+ COMMAND,
+ REGISTER,
+ IDENTIFIER,
+ LITERAL,
+ LABEL,
+ };
+
+ ScriptToken(const std::string &, Type);
+ explicit ScriptToken(Literal *);
+ ~ScriptToken();
+private:
+ ScriptToken(const ScriptToken &);
+ ScriptToken &operator =(const ScriptToken &);
+
+public:
+ Type GetType() const { return type; }
+ const std::string &RegisterName() const;
+ const std::string &CommandName() const;
+ const std::string &Identifier() const;
+ const std::string &Label() const;
+ const Literal *GetLiteral() const;
+
+private:
+ Literal *literal;
+ std::string str;
+ Type type;
+
+};
+
class Literal {
PATH,
STRING,
VECTOR,
- OBJECT
+ OBJECT,
+ SCRIPT,
};
public:
explicit Literal(const std::vector<Value *> &);
- explicit Literal(const std::vector<PropertyList *> &);
+ Literal(const std::string &, const std::vector<PropertyList *> &);
explicit Literal(bool);
Literal(int r, int g, int b, int a = 255);
explicit Literal(int number);
Literal(const std::string &);
Literal(int x, int y);
Literal(const std::string &typeName, PropertyList *properties);
+ explicit Literal(const std::vector<ScriptToken *> &);
~Literal();
private:
Literal(const Literal &);
int GetY() const;
const std::string &GetTypeName() const;
const PropertyList *GetProperties() const;
+ const std::vector<ScriptToken *> &GetScript() const;
private:
PropertyList *props;
- std::string str;
+ std::string typeName, str;
std::vector<Value *> values;
std::vector<PropertyList *> propertyLists;
+ std::vector<ScriptToken *> script;
int i1, i2, i3, i4;
bool b;
Type type;