X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fdata%2Fidentifier.h;h=dcbce970cda97168ab96a22c3e51660d33efc763;hb=4504e04f97804a96914ba12d9e450ddda49a7bab;hp=1fc63b4808f44e7e07ba3a92696f340f338d6922;hpb=ed109bf498216cef15a3cbf180827dc8b20eff0b;p=pspp diff --git a/src/data/identifier.h b/src/data/identifier.h index 1fc63b4808..dcbce970cd 100644 --- a/src/data/identifier.h +++ b/src/data/identifier.h @@ -21,13 +21,15 @@ #include #include #include "libpspp/str.h" +#include "gl/verify.h" #define TOKEN_TYPES \ + TOKEN_TYPE(STOP) /* End of input. */ \ + \ TOKEN_TYPE(ID) /* Identifier. */ \ 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) /* + */ \ @@ -39,7 +41,11 @@ TOKEN_TYPE(RPAREN) /* ) */ \ TOKEN_TYPE(LBRACK) /* [ */ \ TOKEN_TYPE(RBRACK) /* ] */ \ + TOKEN_TYPE(LCURLY) /* { */ \ + TOKEN_TYPE(RCURLY) /* } */ \ TOKEN_TYPE(COMMA) /* , */ \ + TOKEN_TYPE(SEMICOLON) /* ; */ \ + TOKEN_TYPE(COLON) /* : */ \ \ TOKEN_TYPE(AND) /* AND */ \ TOKEN_TYPE(OR) /* OR */ \ @@ -66,9 +72,13 @@ enum token_type { #define TOKEN_TYPE(TYPE) T_##TYPE, TOKEN_TYPES - TOKEN_N_TYPES #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);