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-10-02 03:15:20 -04:00
|
|
|
#include "Symbol.h"
|
|
|
|
|
|
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};
|
|
|
|
|
enum ValueType {none, void_type, boolean, integer, floating, double_percision, char_string };
|
2013-09-26 15:16:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ASTData {
|
|
|
|
|
public:
|
2013-10-16 01:43:18 -04:00
|
|
|
ASTData();
|
2013-09-26 15:16:58 -04:00
|
|
|
ASTData(ASTType type, ValueType valueType = none);
|
2013-10-02 03:15:20 -04:00
|
|
|
ASTData(ASTType type, Symbol symbol, ValueType valueType = none);
|
|
|
|
|
~ASTData();
|
|
|
|
|
std::string toString();
|
2013-10-16 01:43:18 -04:00
|
|
|
static std::string ASTTypeToString(ASTType type);
|
|
|
|
|
static std::string ValueTypeToString(ValueType type);
|
|
|
|
|
static ValueType strToType(std::string type);
|
2013-09-26 15:16:58 -04:00
|
|
|
ASTType type;
|
2013-10-02 03:15:20 -04:00
|
|
|
ValueType valueType;
|
|
|
|
|
Symbol symbol;
|
2013-09-26 15:16:58 -04:00
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|