X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Ftoken.h;h=b334edfef6c385cdc8a28482198dbb8ce8088a59;hb=fcb970c24584cf72f46676ff1cb2e08013951392;hp=8feaf8147298d813ac748c0c9e8134449f91ea09;hpb=fe8dc2171009e90d2335f159d05f7e6660e24780;p=pspp diff --git a/src/language/lexer/token.h b/src/language/lexer/token.h index 8feaf81472..b334edfef6 100644 --- a/src/language/lexer/token.h +++ b/src/language/lexer/token.h @@ -17,6 +17,7 @@ #ifndef TOKEN_H #define TOKEN_H 1 +#include #include #include "libpspp/str.h" #include "data/identifier.h" @@ -32,14 +33,26 @@ struct token struct substring string; }; -#define TOKEN_INITIALIZER(TYPE, NUMBER, STRING) \ - { TYPE, NUMBER, SS_LITERAL_INITIALIZER (STRING) } +void token_copy (struct token *, const struct token *); +void token_uninit (struct token *); -void token_init (struct token *); -void token_destroy (struct token *); +bool token_equal (const struct token *, const struct token *); char *token_to_string (const struct token *); void token_print (const struct token *, FILE *); + +struct tokens + { + struct token *tokens; + size_t n; + size_t allocated; + }; + +void tokens_copy (struct tokens *, const struct tokens *); +void tokens_uninit (struct tokens *); +void tokens_add (struct tokens *, const struct token *); + +void tokens_print (const struct tokens *, FILE *); #endif /* token.h */