X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FParsedSource.h;h=b0578a78e548d017f7834d7cd810e889f0992089;hb=cc3d698b8c1ad09d7a3f9e3f28bc84e0ac1735ea;hp=64baaaa4d3cb99cec172e65acbdcb14f7e69fd72;hpb=2a1d9169e1f6c2dfe0f93ed40d5fb68d3da342af;p=l2e.git diff --git a/src/loader/ParsedSource.h b/src/loader/ParsedSource.h index 64baaaa..b0578a7 100644 --- a/src/loader/ParsedSource.h +++ b/src/loader/ParsedSource.h @@ -1,10 +1,3 @@ -/* - * ParsedSource.h - * - * Created on: Aug 26, 2012 - * Author: holy - */ - #ifndef LOADER_PARSEDSOURCE_H_ #define LOADER_PARSEDSOURCE_H_ @@ -18,6 +11,40 @@ namespace loader { +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 { public: @@ -30,7 +57,8 @@ public: PATH, STRING, VECTOR, - OBJECT + OBJECT, + SCRIPT, }; public: @@ -43,6 +71,7 @@ public: Literal(const std::string &); Literal(int x, int y); Literal(const std::string &typeName, PropertyList *properties); + explicit Literal(const std::vector &); ~Literal(); private: Literal(const Literal &); @@ -67,12 +96,14 @@ public: int GetY() const; const std::string &GetTypeName() const; const PropertyList *GetProperties() const; + const std::vector &GetScript() const; private: PropertyList *props; std::string typeName, str; std::vector values; std::vector propertyLists; + std::vector script; int i1, i2, i3, i4; bool b; Type type;