wip parser structure with placeholders
This commit is contained in:
@@ -4,22 +4,37 @@
|
||||
#include "libft.h"
|
||||
#include "lexer.h"
|
||||
#include "errors.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TERM_LEFT, // a in "a = b"
|
||||
TERM_RIGHT, // b in "a = b"
|
||||
} term_type;
|
||||
} term_position;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TERM_PLUS, // +
|
||||
TERM_MINUS, // -
|
||||
} term_sign;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
TYPE_INT, // "123"
|
||||
TYPE_DOUBLE, // "123.456"
|
||||
} coefficient_type;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
term_type type;
|
||||
term_position position;
|
||||
term_sign sign;
|
||||
coefficient_type coefficient_type;
|
||||
union
|
||||
{
|
||||
char value_char;
|
||||
int value_int;
|
||||
double value_double;
|
||||
int coefficient_int;
|
||||
double coefficient_double;
|
||||
};
|
||||
int exponent;
|
||||
} term;
|
||||
|
||||
int parse(token *tokens, term *terms);
|
||||
|
||||
Reference in New Issue
Block a user