2014-10-07 18:15:46 +00:00
|
|
|
#ifndef REZWORLD_H
|
|
|
|
#define REZWORLD_H
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <stack>
|
2014-10-14 00:19:26 +00:00
|
|
|
#include <string>
|
2014-10-07 18:15:46 +00:00
|
|
|
#include "ResourceDefinitions.h"
|
|
|
|
#include "Expression.h"
|
2014-10-21 20:37:43 +00:00
|
|
|
#include "ResourceFork.h"
|
2014-10-14 00:19:26 +00:00
|
|
|
#include "ResSpec.h"
|
2014-10-07 18:15:46 +00:00
|
|
|
|
2014-10-30 01:56:49 +00:00
|
|
|
class Diagnostic;
|
|
|
|
|
2014-10-07 18:15:46 +00:00
|
|
|
class RezWorld
|
|
|
|
{
|
2019-08-18 11:21:00 +00:00
|
|
|
friend class RezParser;
|
2014-10-07 18:15:46 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
std::map<TypeSpec, TypeDefinitionPtr> types;
|
|
|
|
std::stack<FieldListPtr> fieldLists;
|
|
|
|
std::stack<IdentifierExprPtr> functionCalls;
|
|
|
|
std::stack<SwitchFieldPtr> switches;
|
2014-10-08 00:52:34 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
Resources resources;
|
2014-10-30 01:56:49 +00:00
|
|
|
|
2014-10-07 18:15:46 +00:00
|
|
|
public:
|
2019-08-18 11:21:00 +00:00
|
|
|
RezWorld();
|
|
|
|
void addTypeDefinition(TypeSpec spec, TypeDefinitionPtr type);
|
2014-10-07 18:15:46 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
TypeDefinitionPtr getTypeDefinition(ResType type, int id, yy::location loc);
|
2014-10-08 00:52:34 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
void addResource(ResSpec spec, CompoundExprPtr body, yy::location loc);
|
|
|
|
void addData(ResSpec spec, const std::string& data, yy::location loc);
|
2014-10-08 00:52:34 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
Resources& getResources() { return resources; }
|
2014-10-09 20:15:13 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
bool verboseFlag;
|
|
|
|
bool hadErrors;
|
2014-10-30 01:56:49 +00:00
|
|
|
|
2019-08-18 11:21:00 +00:00
|
|
|
void problem(Diagnostic d);
|
2014-10-07 18:15:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // REZWORLD_H
|