uBlink
0.0.1
TheBlinkProtocol
|
Used by blink_schema to convert schema syntax into tokens and values.
Functions | |
enum blink_token | BLINK_Lexer_getToken (blink_stream_t in, char *buffer, size_t max, union blink_token_value *value, struct blink_token_location *location) |
Use this function to convert a stream of characters into a token. More... | |
const char * | BLINK_Lexer_tokenToString (enum blink_token token) |
Convert a token enum to a string representation. More... | |
Data Structures | |
union | blink_token_value |
struct | blink_token_value.literal |
struct | blink_token_location |
Typedefs | |
typedef struct blink_stream * | blink_stream_t |
Enumerations | |
enum | blink_token { TOK_STRING = 0, TOK_BINARY, TOK_FIXED, TOK_BOOL, TOK_U8, TOK_U16, TOK_U32, TOK_U64, TOK_I8, TOK_I16, TOK_I32, TOK_I64, TOK_F64, TOK_DATE, TOK_TIME_OF_DAY_MILLI, TOK_TIME_OF_DAY_NANO, TOK_MILLI_TIME, TOK_NANO_TIME, TOK_DECIMAL, TOK_OBJECT, TOK_NAME, TOK_CNAME, TOK_EQUAL, TOK_COMMA, TOK_PERIOD, TOK_QUESTION, TOK_LBRACKET, TOK_RBRACKET, TOK_LPAREN, TOK_RPAREN, TOK_STAR, TOK_BAR, TOK_SLASH, TOK_AT, TOK_COLON, TOK_RARROW, TOK_LARROW, TOK_NAMESPACE, TOK_SCHEMA, TOK_TYPE, TOK_UINT, TOK_INT, TOK_LITERAL, TOK_UNKNOWN, TOK_EOF, TOK_ENOMEM } |
union blink_token_value |
Data Fields | ||
---|---|---|
struct blink_token_value | literal | |
uint64_t | number | Initialised for TOK_UINT. |
int64_t | signedNumber | Initialised for TOK_INT. |
enum blink_token |
enum blink_token BLINK_Lexer_getToken | ( | blink_stream_t | in, |
char * | buffer, | ||
size_t | max, | ||
union blink_token_value * | value, | ||
struct blink_token_location * | location | ||
) |
Use this function to convert a stream of characters into a token.
[in] | in | input stream |
[in] | buffer | a buffer for caching name, cname, or literal |
[in] | max | byte length of buffer |
[out] | value | value of token (only initialised for TOK_NAME, TOK_CNAME, TOK_UINT, TOK_INT, TOK_LITERAL) |
[out] | location | optional location information |
const char* BLINK_Lexer_tokenToString | ( | enum blink_token | token | ) |
Convert a token enum to a string representation.
[in] | token | token to convert to string |