X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FParsedSource.h;fp=src%2Floader%2FParsedSource.h;h=97137fbad613e981e3f8956a6ccbfad1224ae255;hb=32b5ea1b0f05283eb588b2b069d667f7c36e84da;hp=f78a49e7b66d402b11b46924ed2595d2c12ee366;hpb=b7fcb21d8f1a6edba4693c879a2930db6f2fa95e;p=l2e.git diff --git a/src/loader/ParsedSource.h b/src/loader/ParsedSource.h index f78a49e..97137fb 100644 --- a/src/loader/ParsedSource.h +++ b/src/loader/ParsedSource.h @@ -21,6 +21,7 @@ class Value; class Literal { +public: enum Type { ARRAY_VALUES, ARRAY_PROPS, @@ -37,10 +38,28 @@ public: explicit Literal(const std::vector &); 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); +public: + Type GetType() const { return type; } + + const std::vector &GetValues() const; + const std::vector &GetPropertyLists() const; + bool GetBoolean() const; + int GetRed() const; + int GetGreen() const; + int GetBlue() const; + int GetAlpha() const; + int GetNumber() const; + const std::string &GetString() const; + int GetX() const; + int GetY() const; + const std::string &GetTypeName() const; + const PropertyList *GetProperties() const; + private: PropertyList *props; std::string str; @@ -136,14 +155,17 @@ public: public: void AddDeclaration(Declaration *); + void AddDefinition(Definition *); void ExportDeclaration(Declaration *); void ExportIdentifier(const std::string &); - const std::map Declarations() const { return declarations; } - const std::set Exports() const { return exports; } + const std::map &Declarations() const { return declarations; } + const std::map &Definitions() const { return definitions; } + const std::set &Exports() const { return exports; } private: std::map declarations; + std::map definitions; std::set exports; }; @@ -154,6 +176,7 @@ private: namespace std { ostream &operator <<(ostream &, const loader::ParsedSource &); +ostream &operator <<(ostream &, const loader::Literal &); }