summaryrefslogtreecommitdiff
path: root/nasm.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-21 16:26:05 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-01-21 16:26:05 -0800
commitaeb57415dd383d929b64ee4d25093c784539241a (patch)
tree4d0f9eacbbc5f45e4a8370a0e435d6dc9e83c2f9 /nasm.h
parentbe2678cd315606b54041014d4d37f111766b9db4 (diff)
downloadnasm-aeb57415dd383d929b64ee4d25093c784539241a.tar.gz
nasm-aeb57415dd383d929b64ee4d25093c784539241a.tar.bz2
nasm-aeb57415dd383d929b64ee4d25093c784539241a.zip
nasm.h: make t_type an enum
Make t_type an enum to make debugging easier.
Diffstat (limited to 'nasm.h')
-rw-r--r--nasm.h34
1 files changed, 17 insertions, 17 deletions
diff --git a/nasm.h b/nasm.h
index 8a11afd..b2c1e93 100644
--- a/nasm.h
+++ b/nasm.h
@@ -158,26 +158,10 @@ typedef struct {
} ListGen;
/*
- * The expression evaluator must be passed a scanner function; a
- * standard scanner is provided as part of nasmlib.c. The
- * preprocessor will use a different one. Scanners, and the
- * token-value structures they return, look like this.
- *
- * The return value from the scanner is always a copy of the
- * `t_type' field in the structure.
- */
-struct tokenval {
- int t_type;
- int64_t t_integer, t_inttwo;
- char *t_charptr;
-};
-typedef int (*scanner) (void *private_data, struct tokenval * tv);
-
-/*
* Token types returned by the scanner, in addition to ordinary
* ASCII character values, and zero for end-of-string.
*/
-enum { /* token types, other than chars */
+enum token_type { /* token types, other than chars */
TOKEN_INVALID = -1, /* a placeholder value */
TOKEN_EOS = 0, /* end of string */
TOKEN_EQ = '=', TOKEN_GT = '>', TOKEN_LT = '<', /* aliases */
@@ -206,6 +190,22 @@ enum floatize {
FLOAT_128H,
};
+/*
+ * The expression evaluator must be passed a scanner function; a
+ * standard scanner is provided as part of nasmlib.c. The
+ * preprocessor will use a different one. Scanners, and the
+ * token-value structures they return, look like this.
+ *
+ * The return value from the scanner is always a copy of the
+ * `t_type' field in the structure.
+ */
+struct tokenval {
+ enum token_type t_type;
+ char *t_charptr;
+ int64_t t_integer, t_inttwo;
+};
+typedef int (*scanner) (void *private_data, struct tokenval * tv);
+
struct location {
int64_t offset;
int32_t segment;