You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eon/includes/include.h

98 lines
1.6 KiB

5 years ago
#ifndef INCLUDE_H
#define INCLUDE_H
#include <stdlib.h>
#include <stdio.h>
#include "../hashmap/map.h"
/**
5 years ago
* VariableType is a enum of varible types that will be inside of my language.
5 years ago
*/
typedef enum variable_type {
VAR_STRING,
VAR_INT,
VAR_CHAR,
VAR_DOUBLE,
VAR_VOID
} variable_type;
/**
* VariableValues is a struct that holds all possible variable values
*/
typedef struct variable_values {
variable_type type;
char _char;
char *_string;
int _int;
double _double;
5 years ago
void* _void_pointer; //TODO create a concept of "void"
5 years ago
} variable_values;
/**
* Variables is a struct that has all the information needed for a variables
*/
typedef struct variable{
char *name;
variable_values *value;
struct Variable *next;
} variable;
typedef struct print {
int opperation;
double value;
char *string;
} print;
typedef struct logic {
int opperation;
int expr;
struct node_info *if_true;
struct node_info *else_false;
struct node_info *while_true;
} logic;
typedef struct node_info {
int opperation;
enum type{
ASSIGNMENT,
EXPRESSION,
STATEMENT,
LOGIC,
FUNCTION,
FUNCTION_CALL
}type;
char *name;
variable *var;
print printExpression;
logic logicalExpression;
struct node_info *next;
struct node_info *_function_body;
struct node_info *statement_list;
struct node_info *local_list;
struct map_void_t *_var_list;
} node_info;
#endif