]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/ParsedSource.h
more information in parsed source and output
[l2e.git] / src / loader / ParsedSource.h
index f78a49e7b66d402b11b46924ed2595d2c12ee366..97137fbad613e981e3f8956a6ccbfad1224ae255 100644 (file)
@@ -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<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);
 
+public:
+       Type GetType() const { return type; }
+
+       const std::vector<Value *> &GetValues() const;
+       const std::vector<PropertyList *> &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<std::string, Declaration *> Declarations() const { return declarations; }
-       const std::set<std::string> Exports() const { return exports; }
+       const std::map<std::string, Declaration *> &Declarations() const { return declarations; }
+       const std::map<std::string, Definition *> &Definitions() const { return definitions; }
+       const std::set<std::string> &Exports() const { return exports; }
 
 private:
        std::map<std::string, Declaration *> declarations;
+       std::map<std::string, Definition *> definitions;
        std::set<std::string> exports;
 
 };
@@ -154,6 +176,7 @@ private:
 namespace std {
 
 ostream &operator <<(ostream &, const loader::ParsedSource &);
+ostream &operator <<(ostream &, const loader::Literal &);
 
 }