#include "ParsedSource.h"
+#include "utility.h"
+
#include <ostream>
#include <stdexcept>
}
}
+void ParsedSource::WriteHeader(std::ostream &out) const {
+ for (std::set<string>::const_iterator i(exports.begin()), end(exports.end()); i != end; ++i) {
+ out << GetDeclaration(*i).TypeName() << ' ' << *i << std::endl;
+ }
+}
+
Definition::~Definition() {
if (isLiteral) {
const PropertyList *Definition::GetProperties() const {
if (!isLiteral) {
return reinterpret_cast<PropertyList *>(value);
+ } else if (GetLiteral()->GetType() == Literal::OBJECT) {
+ return GetLiteral()->GetProperties();
} else {
throw runtime_error("tried to access literal value as property list");
}
}
+Literal::Literal(const string &dir, const string &path)
+: props(0)
+, str(CatPath(dir, path))
+, i1(0), i2(0)
+, i3(0), i4(0)
+, b(false)
+, type(STRING) {
+
+}
+
Literal::Literal(const string &str)
: props(0)
, str(str)
case loader::Literal::NUMBER:
out << "number, " << l.GetNumber();
break;
+ case loader::Literal::PATH:
+ out << "path, \"" << l.GetString() << '"';
+ break;
case loader::Literal::STRING:
out << "string, \"" << l.GetString() << '"';
break;