Mercurial > hg > index.cgi
annotate src/parse.s @ 123:5681cdada362
Redo keyword table handling to handle keywords differing in length
Some keywords differ only due to length. That is, the shorter keyword
matches the leading characters of the longer one. Make the keyword table
builder and processor handle these cases. Also re-implement the handler
based on evolved understanding of its requirements.
author | William Astle <lost@l-w.ca> |
---|---|
date | Mon, 01 Jan 2024 15:15:45 -0700 |
parents | 5d5472b11ccd |
children | 8770e6f977c3 |
rev | line source |
---|---|
121
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
1 *pragmapush list |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
2 *pragma list |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
4 ; This is the overall parsing package. This is responsible for converting program text into the internal byte code and |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
5 ; reporting any syntax errors and anything else reasonably detectable at parse time without having overly complicated |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
6 ; code analysis. |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
7 ; |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
8 ; This is a recursive descent parser. |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
9 ; |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
10 ; Entry: |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
11 ; X Points to the text to encode |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
12 ; B Nonzero to prevent generating any output (error check/length calculation only) |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
13 ; |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
14 ; Exit: |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
15 ; U Points to the encoded line |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
16 ; D Length of the encoded line |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
17 ; CC.C clear |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
18 |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
19 ; Error Exit: |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
20 ; B Error code |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
21 ; U Offset to error input |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
22 ; CC.C set |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
23 parse stb parse_noout ; save no-output flag |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
24 leay ,x ; save input pointer in a less useful register |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
25 ldu freestart ; point to start of free memory where we will build the output |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
26 pshs u ; save original free memory location |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
27 parse_nextstmt jsr parse_nexttok ; fetch the next token, return type in D |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
28 bcc parse0 ; brif we succeeded in parsing a token |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
29 parse_error puls u ; restore original free memory location - deallocate any encoding |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
30 stu freestart |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
31 ldu parse_tokenst ; get start location we started parsing the token at |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
32 rts ; return error condition |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
33 parse0 ldx #parse_stmtjump ; point to jump table for token type handler |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
34 abx ; offset to handler address |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
35 abx |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
36 jsr [,x] ; call handler |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
37 bcs parse_error ; brif handler flagged error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
38 jsr parse_curtoken ; get the token we terminated on |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
39 cmpb #token_eot ; end of input? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
40 bne parse1 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
41 ldb #bc_eol ; stash an end of line op |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
42 bsr parse_write |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
43 bcs parse_error ; brif we errored out writing to the result (OM?) |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
44 tfr u,d ; calculate the length of the result |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
45 subd ,s |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
46 puls u,pc ; get pointer to start of encoded result and return (C is already clear) |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
47 parse1 cmpb #token_stmtsep ; statement separator? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
48 beq parse_nextstmt ; brif so - do another statement |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
49 cmpb #token_apos ; ' token? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
50 beq parse0 ; brif so - parse it as a new statement |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
51 comb ; set C for error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
52 ldb #err_sn ; raise syntax error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
53 bra parse_error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
54 parse_write lda parse_noout ; are we doing output? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
55 beq parse_write0 ; brif so |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
56 leau 1,u ; just count up the output and don't do anything |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
57 rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
58 parse_write0 leax -stackheadroom,s ; calculate bottom of stack with headroom |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
59 cmpx freestart ; did the stack run into the end of the output? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
60 bhs parse_write1 ; brif not - we're good |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
61 ldb #err_om ; raise out of memory error, C already set from comparison |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
62 rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
63 parse_write1 stb ,u+ ; save output byte |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
64 stu freestart ; save new to of used memory |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
65 parse_noop rts ; return all clear - C clear from comparison above |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
66 parse_curtoken ldb parse_curtok ; fetch token code of current token |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
67 rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
68 parse_tokerr comb ; flag error - unexpected token |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
69 ldb #err_sn ; raise syntax error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
70 rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
71 parse_nextchar lda ,y ; at end of input already? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
72 beq parse_curchar ; brif so |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
73 leay 1,y ; move to next input character |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
74 parse_curchar lda ,y ; fetch input character |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
75 rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
76 parse_nexttok bsr parse_curchar ; fetch current input |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
77 beq parse_nexttok1 ; brif end of input |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
78 parse_nexttok0 cmpa #0x20 ; space? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
79 bne parse_nexttok2 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
80 bsr parse_nextchar ; eat the space |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
81 bne parse_nexttok0 ; brif not end of input |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
82 parse_nexttok1 ldb #token_eot ; flag end of input |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
83 bra parse_nexttok6 ; go return it |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
84 parse_nexttok2 sty parse_tokenst ; save start of current token after skipping spaces |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
85 cmpa #'. ; leading decimal? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
86 beq parse_nexttok3 ; brif so - parse number |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
87 cmpa #'0 ; is it a digit |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
88 blo parse_nexttok4 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
89 cmpa #'9 ; is it still a digit? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
90 bhi parse_nexttok4 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
91 parse_nexttok3 jmp parse_number ; go parse a number |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
92 parse_nexttok4 ldx #parse_chartab ; point to list of single character tokens to recognize |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
93 parse_nexttok5 ldb 1,x ; get token value |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
94 cmpa ,x++ ; character match (and move to next entry) |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
95 bne parse_nexttok7 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
96 parse_nexttok6 stb parse_curtok ; save token type |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
97 leay 1,y ; eat the input character |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
98 clra ; clear C to indicate no error (and clear Z also) |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
99 rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
100 parse_nexttok7 cmpb #token_eot ; end of table? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
101 bne parse_nexttok5 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
102 clrb ; initialize relational flags |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
103 pshs d ; save input character and relational flags for later |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
104 parse_nexttok8 cmpa #'< ; less than? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
105 blo parse_nexttok9 ; brif not <, =, or > |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
106 cmpa #'> ; still <, =, or >? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
107 bhi parse_nexttok9 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
108 suba #'< ; adjust < to 0 |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
109 cmpa #1 ; set C if <, clear if = or > |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
110 rola ; now 4 if >, 2 if =, or 1 if < |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
111 eora 1,s ; merge with previous relational characters |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
112 cmpa 1,s ; if it doesn't match, we have a dupe |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
113 bne parse_nexttok9 ; brif it's not valid - we won't recognize more in the token |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
114 sta 1,s ; save new relational flags |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
115 bsr parse_nextchar ; fetch next input |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
116 sta ,s ; save input character |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
117 bne parse_nexttok8 ; brif there was one - go handle it |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
118 parse_nexttok9 puls d ; get back input character and relational flag |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
119 tstb ; was it a relational operator? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
120 beq parse_nexttok10 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
121 ldx #parse_reltab ; point to relational operator token table |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
122 ldb b,x ; get the token code |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
123 clra ; flag no error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
124 rts ; return - but don't advance - we already did looking for multiples |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
125 parse_nexttok10 bsr parse_toupper ; convert to upper case |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
126 cmpa #'A ; is it alpha? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
127 blo parse_nexttok11 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
128 cmpa #'Z ; is it still alpha? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
129 bls parse_nexttok12 ; brif so |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
130 parse_nexttok11 comb ; flag error - unrecognized token |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
131 ldb #token_error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
132 rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
133 parse_nextcharu bsr parse_nextchar ; fetch next input character |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
134 beq parse_toupper0 ; brif end of input |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
135 parse_toupper cmpa #'a ; is it lower case alpha? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
136 blo parse_toupper0 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
137 cmpa #'z ; is it still lower case alpha? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
138 bhi parse_toupper0 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
139 suba #0x20 ; adjust to upper case alpha |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
140 parse_toupper0 rts ; Z only set here if input was zero entering from parse_nextcharu |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
141 ; We parse alpha keywords and identifiers here, of the form [a-zA-Z][a-zA-Z0-9]* with a possible nonalpha characters |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
142 ; in actual keywords. We use a table to parse keywords. As soon as we find a character that doesn't match a keyword |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
143 ; table entry, we fall back to looking for the end of an identifier and then returning that. |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
144 parse_nexttok12 ldx #parse_wordtab ; point to keyword table |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
145 bsr parse_nexttok16 ; process this table entry |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
146 cmpb #token_ident ; did we match a token? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
147 bne parse_nexttok6 ; brif so - go return it |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
148 parse_nexttok13 cmpa #'0 ; was it alphanumeric? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
149 blo parse_nexttok15 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
150 cmpa #'9 ; was it numeric? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
151 bls parse_nexttok14 ; brif so |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
152 cmpa #'A ; was it alpha? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
153 blo parse_nexttok15 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
154 cmpa #'Z ; is it still alpha? |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
155 bhi parse_nexttok15 ; brif not |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
156 parse_nexttok14 bsr parse_nextcharu ; fetch next character and force upper case |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
157 bne parse_nexttok13 ; if not end of input, see if we have alphanumeric |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
158 parse_nexttok15 tfr y,d ; fetch input location |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
159 subd parse_tokenst ; calculate length of token |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
160 std val0+val.strlen ; save the length of the identifier |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
161 ldb #token_ident ; set token type to identifier (variable name, probably) |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
162 rts ; return token type, do not advance since we already did above |
123
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
163 ; This routine parses tokens using the table at parse_wordtab. The table is structured as follows: |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
164 ; |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
165 ; * two bytes which contain the length of the table less the two bytes for this length value |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
166 ; * a sequence of entries consisting of a single byte matching character and a token code followed |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
167 ; by an optional sub table, structured exactly the same way. |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
168 ; |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
169 ; The optional subtable will be present if the token code is token_eot |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
170 ; |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
171 ; If the character match is negative, it means a lookahead failed. The negative value is the number |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
172 ; of characters to unget and the token code is the token value to return. No other entries after this |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
173 ; in a table will be considered since thie negative match is a global match. |
121
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
174 ; |
123
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
175 ; When a token_eot match is found, if there are no further characters in the input, the match is |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
176 ; determined to be invalid and processing continues with the next entry. |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
177 parse_wordtab0 leas 3,s ; clean up stack for sub table handling |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
178 parse_wordtab pshs a,x ; save input character and start of table |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
179 ldd ,x++ ; get length of this table |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
180 addd 1,s ; calculate the address of the end of the table |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
181 std 1,s ; save end address for comparison later |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
182 lda ,s ; get back input character |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
183 parse_wordtab1 ldb -1,x ; fetch token code for this entry |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
184 cmpa ,x++ ; does this entry match? |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
185 bne parse_wordtab4 ; brif not |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
186 cmpb #token_eot ; is it indicating a sub table? |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
187 bne parse_wordtab6 ; brif not |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
188 bsr parse_nextcharu ; fetch next input character (for sub table match) |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
189 bne parse_wordtab0 ; brif we are going to check the sub table |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
190 parse_wordtab2 ldd ,x++ ; fetch length of sub table |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
191 leax d,x ; move past sub table |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
192 parse_wordtab3 lda ,s ; get back input character |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
193 cmpx 1,s ; are we at the end of the table? |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
194 blo parse_wordtab1 ; brif not - check another entry |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
195 comb ; indicate no match |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
196 puls a,x,pc ; clean up stack and return |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
197 parse_wordtab4 lda -2,x ; get the match character |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
198 bmi parse_wordtab5 ; brif negative - lookahead fail |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
199 cmpb #token_eot ; is there a sub table to skip? |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
200 beq parse_wordtab2 ; brif so - skip sub table |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
201 bra parse_wordtab3 ; otherwise just move to the next entry |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
202 parse_wordtab5 leay a,y ; move back the specified number of characters |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
203 parse_wordtab6 clra ; clear C to indicate a match |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
204 puls a,x,pc ; clean up stack and return |
121
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
205 parse_number jmp parse_tokerr |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
206 ; Relational token table, bits are > = < |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
207 parse_reltab fcb token_error |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
208 fcb token_lt |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
209 fcb token_eq |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
210 fcb token_le |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
211 fcb token_gt |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
212 fcb token_ne |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
213 fcb token_ge |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
214 fcb token_reltrue |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
215 ; Single character token lookup table |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
216 parse_chartab fcb 0x21,token_bang ; ! |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
217 fcb 0x23,token_hash ; # |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
218 fcb 0x24,token_dollar ; $ |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
219 fcb 0x25,token_percent ; % |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
220 fcb 0x26,token_amp ; & |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
221 fcb 0x27,token_apos ; ' |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
222 fcb 0x28,token_oparen ; ( |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
223 fcb 0x29,token_cparen ; ) |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
224 fcb 0x2a,token_star ; * |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
225 fcb 0x2b,token_plus ; + |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
226 fcb 0x2c,token_comma ; , |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
227 fcb 0x2d,token_minus ; - |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
228 fcb 0x2f,token_slash ; / |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
229 fcb 0x3a,token_stmtsep ; : |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
230 fcb 0x3b,token_semi ; ; |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
231 fcb 0x3f,token_print ; ? - print shortcut |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
232 fcb 0x40,token_at ; @ |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
233 fcb 0x5e,token_exp ; ^ - exponentiation |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
234 fcb 0x00,token_eot ; end of table flag |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
235 ; Parse tokens - define them in order using the macro parse_tokdef |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
236 *pragmapush list |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
237 *pragma nolist |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
238 parse_toknum set 0 |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
239 parse_tokdef macro noexpand |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
240 \1 equ parse_toknum |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
241 parse_toknum set parse_toknum+1 |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
242 fdb \2 |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
243 endm |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
244 *pragmapop list |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
245 parse_stmtjump parse_tokdef token_error,parse_tokerr |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
246 parse_tokdef token_eot,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
247 parse_tokdef token_lt,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
248 parse_tokdef token_le,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
249 parse_tokdef token_gt,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
250 parse_tokdef token_ge,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
251 parse_tokdef token_eq,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
252 parse_tokdef token_ne,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
253 parse_tokdef token_reltrue,parse_noop // always true relational operator |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
254 parse_tokdef token_stmtsep,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
255 parse_tokdef token_apos,parse_rem |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
256 parse_tokdef token_special,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
257 parse_tokdef token_bang,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
258 parse_tokdef token_hash,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
259 parse_tokdef token_dollar,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
260 parse_tokdef token_percent,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
261 parse_tokdef token_amp,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
262 parse_tokdef token_oparen,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
263 parse_tokdef token_cparen,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
264 parse_tokdef token_star,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
265 parse_tokdef token_plus,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
266 parse_tokdef token_comma,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
267 parse_tokdef token_minus,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
268 parse_tokdef token_slash,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
269 parse_tokdef token_semi,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
270 parse_tokdef token_at,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
271 parse_tokdef token_exp,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
272 parse_tokdef token_ident,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
273 parse_tokdef token_rem,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
274 parse_tokdef token_return,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
275 parse_tokdef token_run,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
276 parse_tokdef token_data,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
277 parse_tokdef token_else,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
278 parse_tokdef token_end,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
279 parse_tokdef token_stop,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
280 parse_tokdef token_sub,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
281 parse_tokdef token_let,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
282 parse_tokdef token_list,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
283 parse_tokdef token_new,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
284 parse_tokdef token_not,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
285 parse_tokdef token_print,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
286 parse_tokdef token_pop,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
287 parse_tokdef token_to,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
288 parse_tokdef token_and,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
289 parse_tokdef token_or,parse_noop |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
290 parse_tokdef token_go,parse_noop |
123
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
291 parse_tokdef token_as,parse_noop |
5681cdada362
Redo keyword table handling to handle keywords differing in length
William Astle <lost@l-w.ca>
parents:
121
diff
changeset
|
292 parse_tokdef token_asc,parse_noop |
121
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
293 parse_rem rts |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
294 |
5d5472b11ccd
Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff
changeset
|
295 *pragmapop list |