projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some variables are ordinal.
[pspp]
/
src
/
language
/
lexer
/
token.h
diff --git
a/src/language/lexer/token.h
b/src/language/lexer/token.h
index 67bc7ddc3b74753d587e4e1a29e4b356caf033d0..8ec28f3714ba54046f10c910e6276b2088df6eef 100644
(file)
--- a/
src/language/lexer/token.h
+++ b/
src/language/lexer/token.h
@@
-17,28
+17,25
@@
#ifndef TOKEN_H
#define TOKEN_H 1
#ifndef TOKEN_H
#define TOKEN_H 1
+#include <stdbool.h>
#include <stdio.h>
#include "libpspp/assertion.h"
#include "libpspp/str.h"
#include "data/identifier.h"
#include <stdio.h>
#include "libpspp/assertion.h"
#include "libpspp/str.h"
#include "data/identifier.h"
-/* A PSPP syntax token.
-
- The 'type' member is used by the scanner (see scan.h) for SCAN_* values as
- well, which is why it is not declared as type "enum token_type". */
+/* A PSPP syntax token. */
struct token
{
struct token
{
- int type; /* Usually a "enum token_type" value. */
+ enum token_type type;
double number;
struct substring string;
};
double number;
struct substring string;
};
-#define TOKEN_INITIALIZER(TYPE, NUMBER, STRING) \
- { TYPE, NUMBER, SS_LITERAL_INITIALIZER (STRING) }
-
-void token_init (struct token *);
+void token_copy (struct token *, const struct token *);
void token_uninit (struct token *);
void token_uninit (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 *);
char *token_to_string (const struct token *);
void token_print (const struct token *, FILE *);