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

85 lines
1.5 KiB

5 years ago
#ifndef INCLUDE_H
#define INCLUDE_H
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
5 years ago
#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
{
5 years ago
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
{
5 years ago
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
{
5 years ago
char *name;
variable_values *value;
struct variable *next;
5 years ago
} variable;
typedef struct print
{
5 years ago
int opperation;
double value;
char *string;
} print;
typedef struct logic
{
5 years ago
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;
5 years ago
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