core: Add initial token definitions
Signed-off-by: Ian Moffett <ian@mirocom.org>
This commit is contained in:
28
inc/rifle/token.h
Normal file
28
inc/rifle/token.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef RIFLE_TOKEN_H
|
||||
#define RIFLE_TOKEN_H 1
|
||||
|
||||
/*
|
||||
* Represents valid token types
|
||||
*/
|
||||
typedef enum {
|
||||
TT_NONE, /* <NONE> */
|
||||
TT_PLUS, /* '+' */
|
||||
TT_MINUS, /* '-' */
|
||||
TT_STAR, /* '*' */
|
||||
TT_SLASH, /* '/' */
|
||||
} tt_t;
|
||||
|
||||
/*
|
||||
* Represents a single lexical element found within
|
||||
* the source input.
|
||||
*
|
||||
* @type: Token type
|
||||
*/
|
||||
struct token {
|
||||
tt_t type;
|
||||
union {
|
||||
char c;
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* !RIFLE_TOKEN_H */
|
||||
Reference in New Issue
Block a user