summaryrefslogtreecommitdiff
path: root/devel/frink/files/patch-token.h
blob: f5d6591c49ab550c720cd46fbb71d1681fa2843c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
--- token.h.orig	2002-12-11 22:20:34 UTC
+++ token.h
@@ -18,11 +18,14 @@
 
 typedef struct input_s
 {
-    char *position;
+    const char *position;
     int	 remaining;
     int  pushed;
     char back[16];
-    char *text;
+    union {
+        const char *text; /* Use const in most cases */
+	char *atext;
+    };
     FILE *stream;
     int tcall;
     int texpr;
@@ -48,8 +51,11 @@ typedef struct token_s
     TokenType type;
     ConstType ckind;
     int isconc;
-    char *text;
-    int length;
+    union {
+        const char *text;
+        char *atext;
+    };
+    size_t length;
     struct token_s *sequence;
     struct token_s *next;
     char little[32];
@@ -69,12 +75,21 @@ extern void freeToken(Token *);
 extern void lprocess(Token*, int);
 extern void makeCall(Token*, Token*);
 extern void body(Token *, int, int);
+extern void comment(Token *);
 
 extern void output(Token *, int);
 extern void blank(void);
-extern void warn(Token *, char *);
-extern void fail(Token *, char *);
+extern void warn(const Token *, const char *);
+extern void fail(const Token *, const char *);
 
-extern Token *isArray(Token *);
-extern int constant(Token *tp);
+extern Token *isArray(const Token *);
+extern int constant(const Token *tp);
+extern int tclop(Token *hd, Token *line);
+extern void streamMore(Input *file);
+extern int handle(Token *line);
+extern void sprocess(Token *lst, int nls);
+extern void dumpToken(const Token *tk, FILE *ops);
+extern Token *tokenPop(Token **);
+extern void freeToken(Token *);
+
 #endif