public:
Type GetType() const { return type; }
+ bool IsArray() const { return GetType() == ARRAY_VALUES || GetType() == ARRAY_PROPS; }
+ bool IsObject() const { return GetType() == OBJECT; }
+ int ArraySize() const { return GetType() == ARRAY_VALUES ? GetValues().size() : GetPropertyLists().size(); }
const std::vector<Value *> &GetValues() const;
const std::vector<PropertyList *> &GetPropertyLists() const;
const std::map<std::string, Definition *> &Definitions() const { return definitions; }
const std::set<std::string> &Exports() const { return exports; }
+public:
+ void WriteHeader(std::ostream &) const;
+
private:
std::map<std::string, Declaration *> declarations;
std::map<std::string, Definition *> definitions;