Made Symbol always stack, not heap, allocated. Finally fixed bugs with ASTTransformation.

This commit is contained in:
Nathan Braswell
2013-10-02 03:15:20 -04:00
parent 0110672f50
commit b9ffe33d0b
25 changed files with 375 additions and 278 deletions

View File

@@ -1,27 +1,30 @@
#ifndef ASTDATA_H
#define ASTDATA_H
#include <vector>
#include "Symbol.h"
#ifndef NULL
#define NULL 0
#endif
#include "Symbol.h"
enum ASTType {translation_unit, interpreter_directive, identifier,
import, function, code_block,
typed_parameter, expression, boolean_expression, statement,
if_statement, return_statement, assignment_statement, function_call,
value};
enum ValueType {none, boolean, integer, floating, double_percision, char_string };
#include <vector>
class ASTData {
public:
enum ASTType {translation_unit, interpreter_directive, identifier,
import, interpreter_directive, function, code_block,
typed_parameter, expression, boolean_expression, statement,
if_statement, return_statement, assignment_statement, function_call,
value};
enum ValueType {none, boolean, integer, floating, double_percision, char_string }
ASTData(ASTType type, ValueType valueType = none);
ASTData(ASTType type, Symbol* symbol, ValueType valueType = none);
ASTData(ASTType type, Symbol symbol, ValueType valueType = none);
~ASTData();
std::string toString();
ASTType type;
Symbol* symbol;
ValueType valueType;
Symbol symbol;
private:
};