Updating built in Io code to use += instead of x = x + y
[io/quag.git] / libs / iovm / source / IoToken.h
blob158a001b66ac224f9e97e8ed60523e6754058797
1 /* Copyright (c) 2003, Steve Dekorte
2 docLicense("BSD revised")
3 */
5 #ifndef IOTOKEN_DEFINED
6 #define IOTOKEN_DEFINED 1
8 #include "List.h"
9 #include <string.h>
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
15 typedef enum
17 NO_TOKEN,
19 OPENPAREN_TOKEN,
20 COMMA_TOKEN,
21 CLOSEPAREN_TOKEN,
23 MONOQUOTE_TOKEN,
24 TRIQUOTE_TOKEN,
26 IDENTIFIER_TOKEN,
27 TERMINATOR_TOKEN,
29 COMMENT_TOKEN,
30 NUMBER_TOKEN,
31 HEXNUMBER_TOKEN
32 } IoTokenType;
34 typedef struct IoToken IoToken;
36 struct IoToken
38 char *name;
39 size_t length;
40 IoTokenType type;
41 int charNumber;
42 int lineNumber;
43 IoToken *nextToken;
44 char *error;
47 IoToken *IoToken_new(void);
48 void IoToken_free(IoToken *self);
50 const char *IoToken_typeName(IoToken *self);
52 void IoToken_name_length_(IoToken *self, const char *name, size_t len);
53 void IoToken_name_(IoToken *self, const char *name);
54 char *IoToken_name(IoToken *self);
55 #define IOTOKEN_NAME(self) (self->name ? self->name : (char *)"")
57 void IoToken_error_(IoToken *self, const char *name);
58 char *IoToken_error(IoToken *self);
60 int IoToken_nameIs_(IoToken *self, const char *name);
61 IoTokenType IoToken_type(IoToken *self);
63 int IoToken_lineNumber(IoToken *self);
64 int IoToken_charNumber(IoToken *self);
66 void IoToken_quoteName_(IoToken *self, const char *name);
67 void IoToken_type_(IoToken *self, IoTokenType type);
68 void IoToken_nextToken_(IoToken *self, IoToken *nextToken);
69 void IoToken_print(IoToken *self);
70 void IoToken_printSelf(IoToken *self);
72 int IoTokenType_isValidMessageName(IoTokenType self);
74 #ifdef __cplusplus
76 #endif
77 #endif