2013-09-26 15:16:58 -04:00
|
|
|
#ifndef ASTDATA_H
|
|
|
|
|
#define ASTDATA_H
|
|
|
|
|
|
2013-10-02 03:15:20 -04:00
|
|
|
#include <vector>
|
2013-10-26 11:47:34 -04:00
|
|
|
#include <set>
|
2013-12-23 01:26:24 -06:00
|
|
|
|
2013-10-02 03:15:20 -04:00
|
|
|
#include "Symbol.h"
|
2013-12-23 01:26:24 -06:00
|
|
|
#include "Type.h"
|
2013-10-02 03:15:20 -04:00
|
|
|
|
2013-09-26 15:16:58 -04:00
|
|
|
#ifndef NULL
|
|
|
|
|
#define NULL 0
|
|
|
|
|
#endif
|
|
|
|
|
|
2013-10-26 11:47:34 -04:00
|
|
|
enum ASTType {undef, translation_unit, interpreter_directive, import, identifier,
|
|
|
|
|
function, code_block,
|
2013-10-02 03:15:20 -04:00
|
|
|
typed_parameter, expression, boolean_expression, statement,
|
2013-12-18 18:05:21 -06:00
|
|
|
if_statement, while_loop, for_loop, return_statement, assignment_statement, declaration_statement,
|
2013-12-22 01:34:59 -06:00
|
|
|
if_comp, simple_passthrough, function_call, value};
|
2013-09-26 15:16:58 -04:00
|
|
|
|
|
|
|
|
class ASTData {
|
|
|
|
|
public:
|
2013-10-16 01:43:18 -04:00
|
|
|
ASTData();
|
2013-12-23 01:26:24 -06:00
|
|
|
ASTData(ASTType type, Type valueType = Type());
|
|
|
|
|
ASTData(ASTType type, Symbol symbol, Type valueType = Type());
|
2013-10-02 03:15:20 -04:00
|
|
|
~ASTData();
|
|
|
|
|
std::string toString();
|
2013-10-16 01:43:18 -04:00
|
|
|
static std::string ASTTypeToString(ASTType type);
|
2013-09-26 15:16:58 -04:00
|
|
|
ASTType type;
|
2013-12-23 01:26:24 -06:00
|
|
|
Type valueType;
|
2013-10-02 03:15:20 -04:00
|
|
|
Symbol symbol;
|
2013-09-26 15:16:58 -04:00
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|