projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lexer: New function lex_ofs_representation().
[pspp]
/
src
/
data
/
identifier.h
diff --git
a/src/data/identifier.h
b/src/data/identifier.h
index 85299979c034c5c2be05633d79704a7bf497f188..dcbce970cda97168ab96a22c3e51660d33efc763 100644
(file)
--- a/
src/data/identifier.h
+++ b/
src/data/identifier.h
@@
-21,14
+21,15
@@
#include <stdbool.h>
#include <unitypes.h>
#include "libpspp/str.h"
#include <stdbool.h>
#include <unitypes.h>
#include "libpspp/str.h"
+#include "gl/verify.h"
#define TOKEN_TYPES \
#define TOKEN_TYPES \
+ TOKEN_TYPE(STOP) /* End of input. */ \
+ \
TOKEN_TYPE(ID) /* Identifier. */ \
TOKEN_TYPE(ID) /* Identifier. */ \
- TOKEN_TYPE(MACRO_ID) /* Identifier starting with '!'. */ \
TOKEN_TYPE(POS_NUM) /* Positive number. */ \
TOKEN_TYPE(NEG_NUM) /* Negative number. */ \
TOKEN_TYPE(STRING) /* Quoted string. */ \
TOKEN_TYPE(POS_NUM) /* Positive number. */ \
TOKEN_TYPE(NEG_NUM) /* Negative number. */ \
TOKEN_TYPE(STRING) /* Quoted string. */ \
- TOKEN_TYPE(STOP) /* End of input. */ \
\
TOKEN_TYPE(ENDCMD) /* . */ \
TOKEN_TYPE(PLUS) /* + */ \
\
TOKEN_TYPE(ENDCMD) /* . */ \
TOKEN_TYPE(PLUS) /* + */ \
@@
-37,10
+38,14
@@
TOKEN_TYPE(SLASH) /* / */ \
TOKEN_TYPE(EQUALS) /* = */ \
TOKEN_TYPE(LPAREN) /* (*/ \
TOKEN_TYPE(SLASH) /* / */ \
TOKEN_TYPE(EQUALS) /* = */ \
TOKEN_TYPE(LPAREN) /* (*/ \
- TOKEN_TYPE(RPAREN) /*
) */
\
+ TOKEN_TYPE(RPAREN) /*
) */
\
TOKEN_TYPE(LBRACK) /* [ */ \
TOKEN_TYPE(RBRACK) /* ] */ \
TOKEN_TYPE(LBRACK) /* [ */ \
TOKEN_TYPE(RBRACK) /* ] */ \
+ TOKEN_TYPE(LCURLY) /* { */ \
+ TOKEN_TYPE(RCURLY) /* } */ \
TOKEN_TYPE(COMMA) /* , */ \
TOKEN_TYPE(COMMA) /* , */ \
+ TOKEN_TYPE(SEMICOLON) /* ; */ \
+ TOKEN_TYPE(COLON) /* : */ \
\
TOKEN_TYPE(AND) /* AND */ \
TOKEN_TYPE(OR) /* OR */ \
\
TOKEN_TYPE(AND) /* AND */ \
TOKEN_TYPE(OR) /* OR */ \
@@
-58,16
+63,22
@@
TOKEN_TYPE(TO) /* TO */ \
TOKEN_TYPE(WITH) /* WITH */ \
\
TOKEN_TYPE(TO) /* TO */ \
TOKEN_TYPE(WITH) /* WITH */ \
\
- TOKEN_TYPE(EXP) /* ** */
-
+ TOKEN_TYPE(EXP) /* ** */ \
+ \
+ TOKEN_TYPE(MACRO_ID) /* Identifier starting with '!'. */ \
+ TOKEN_TYPE(MACRO_PUNCT) /* Miscellaneous punctuator. */
/* Token types. */
enum token_type
{
#define TOKEN_TYPE(TYPE) T_##TYPE,
TOKEN_TYPES
/* Token types. */
enum token_type
{
#define TOKEN_TYPE(TYPE) T_##TYPE,
TOKEN_TYPES
- TOKEN_N_TYPES
#undef TOKEN_TYPE
};
#undef TOKEN_TYPE
};
+verify(T_STOP == 0);
+
+#define TOKEN_TYPE(TYPE) + 1
+enum { TOKEN_N_TYPES = TOKEN_TYPES };
+#undef TOKEN_TYPE
const char *token_type_to_name (enum token_type);
const char *token_type_to_string (enum token_type);
const char *token_type_to_name (enum token_type);
const char *token_type_to_string (enum token_type);