Rename lexer_states to lexer
This commit is contained in:
40
include/lexer/lexer.h
Normal file
40
include/lexer/lexer.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#ifndef LEXER_STATES_H
|
||||
#define LEXER_STATES_H
|
||||
|
||||
#include "aliases.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#define VALID_JSON true
|
||||
#define INVALID_JSON false
|
||||
|
||||
typedef enum {
|
||||
TK_L_BRACE,
|
||||
TK_R_BRACE,
|
||||
TK_L_BRACKET,
|
||||
TK_R_BRACKET,
|
||||
TK_COLON,
|
||||
TK_COMMA,
|
||||
TK_NULL,
|
||||
TK_TRUE,
|
||||
TK_FALSE,
|
||||
TK_STRING_LITERAL,
|
||||
TK_INTEGER_LITERAL,
|
||||
TK_DOUBLE_LITERAL,
|
||||
} token_type_t;
|
||||
|
||||
typedef union {
|
||||
void *no_val;
|
||||
i64 num_int;
|
||||
f64 num_frac;
|
||||
} token_value_t;
|
||||
|
||||
typedef struct {
|
||||
token_type_t type;
|
||||
token_value_t value;
|
||||
} token_t;
|
||||
|
||||
typedef struct lexer lexer_t;
|
||||
|
||||
bool validate_json(char *json);
|
||||
|
||||
#endif // !LEXER_STATES_H
|
@@ -1,13 +0,0 @@
|
||||
#ifndef LEXER_STATES_H
|
||||
#define LEXER_STATES_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#define VALID_JSON true
|
||||
#define INVALID_JSON false
|
||||
|
||||
typedef struct lexer lexer_t;
|
||||
|
||||
bool validate_json(char *json);
|
||||
|
||||
#endif // !LEXER_STATES_H
|
Reference in New Issue
Block a user