Files
kraken/include/ASTData.h

42 lines
1.1 KiB
C
Raw Normal View History

#ifndef ASTDATA_H
#define ASTDATA_H
#include <vector>
2013-12-27 13:05:07 -06:00
#include <map>
2015-06-19 11:27:37 -04:00
#include <set>
#include "Symbol.h"
2014-01-07 13:14:58 -05:00
//Circular dependency
class Type;
#include "Type.h"
#ifndef NULL
#define NULL ((void*)0)
#endif
2014-01-07 13:14:58 -05:00
enum ASTType {undef, translation_unit, interpreter_directive, import, identifier, type_def,
function, code_block, typed_parameter, expression, boolean_expression, statement,
if_statement, while_loop, for_loop, return_statement, break_statement, continue_statement, defer_statement,
assignment_statement, declaration_statement, if_comp, simple_passthrough, passthrough_params,
in_passthrough_params, out_passthrough_params, opt_string, param_assign, function_call, value};
class ASTData {
public:
2013-10-16 01:43:18 -04:00
ASTData();
2014-01-07 13:14:58 -05:00
ASTData(ASTType type, Type *valueType = NULL);
ASTData(ASTType type, Symbol symbol, Type *valueType = NULL);
~ASTData();
std::string toString();
2013-10-16 01:43:18 -04:00
static std::string ASTTypeToString(ASTType type);
ASTType type;
2014-01-07 13:14:58 -05:00
Type* valueType;
Symbol symbol;
std::map<std::string, std::vector<NodeTree<ASTData>*>> scope;
2015-06-19 11:27:37 -04:00
std::set<NodeTree<ASTData>*> closedVariables;
private:
};
2015-04-04 01:32:40 -04:00
#endif