annotate src/parse.s @ 121:5d5472b11ccd

Initital skeleton of separation of separate parsing scheme This is the first commit in a long series related to separating the parsing of the input code from the execution of the code. It should allow for more efficient, and probably simpler, execution while giving quicker feedback when someone types in syntactically invalid code.
author William Astle <lost@l-w.ca>
date Sun, 31 Dec 2023 17:44:39 -0700
parents
children 5681cdada362
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
163 ; Parsing a potential keyword here. This works using a recursive lookup table. Each lookup table starts with a 18 bit
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
164 ; size entry for the table. Each entry is then 2 bytes. The first is the character to
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
165 ; match for this entry. The second is either token_eot to indicate a sub table needs to be consulted, token_ident to
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
166 ; indicate that the token should be parsed as an identifier, or a token type code which indicates the value should
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
167 ; be accepted. If a sub table is to be consulted, the table will appear inline with the same format. Should matching
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
168 ; fall off the end of a table, the character being considered will be "ungot" and processing will return back up the
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
169 ; call chain, ungetting characters, until the top level at which point token_ident will be returned.
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
170 ;
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
171 ; If the match character is negative, the match character represents the number of characters to "unget" and then
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
172 ; return the specified token. This is for handling look-aheads.
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
173 parse_nexttok16 pshs a,x ; save input character
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
174 ldd ,x++ ; get number of entries in the table
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
175 addd 1,s ; set pointer to end of table
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
176 std 1,s
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
177 parse_nexttok17 cmpa ,x++ ; does this entry match?
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
178 beq parse_nexttok21 ; brif so
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
179 ldb -2,x ; was this a look-ahead non-match?
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
180 bpl parse_nexttok19 ; brif not
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
181 leay b,y ; back up the input pointer
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
182 ldb -1,x ; get match token
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
183 parse_nexttok18 puls a,x,pc ; clean up stack and return the matched token
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
184 parse_nexttok19 ldb -1,x ; is there a sub table?
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
185 cmpb #token_eot
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
186 bne parse_nexttok20 ; brif not
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
187 ldd ,x++ ; move past the sub table
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
188 leax d,x
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
189 parse_nexttok20 cmpx 1,s ; did we reach the end of this table?
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
190 blo parse_nexttok17 ; brif not
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
191 ldb #token_ident ; flag identifier required
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
192 puls a,x,pc ; restore input character, clean up stack, and return
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
193 parse_nexttok21 ldb -1,x ; what token did we match?
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
194 cmpb #token_eot ; sub table?
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
195 bne parse_nexttok18 ; brif not - ding! ding! ding! we have a match
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
196 leas 3,s ; clean up stack
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
197 bsr parse_nextcharu ; fetch next input character
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
198 bne parse_nexttok16 ; process sub table entries if we have input
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
199 ldb #token_ident ; indicate we have an ident
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
200 leay -1,y ; unget the end of input
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
201 rts
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
202 parse_number jmp parse_tokerr
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
203 ; Relational token table, bits are > = <
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
204 parse_reltab fcb token_error
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
205 fcb token_lt
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
206 fcb token_eq
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
207 fcb token_le
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
208 fcb token_gt
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
209 fcb token_ne
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
210 fcb token_ge
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
211 fcb token_reltrue
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
212 ; Single character token lookup table
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
213 parse_chartab fcb 0x21,token_bang ; !
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
214 fcb 0x23,token_hash ; #
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
215 fcb 0x24,token_dollar ; $
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
216 fcb 0x25,token_percent ; %
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
217 fcb 0x26,token_amp ; &
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
218 fcb 0x27,token_apos ; '
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
219 fcb 0x28,token_oparen ; (
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
220 fcb 0x29,token_cparen ; )
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
221 fcb 0x2a,token_star ; *
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
222 fcb 0x2b,token_plus ; +
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
223 fcb 0x2c,token_comma ; ,
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
224 fcb 0x2d,token_minus ; -
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
225 fcb 0x2f,token_slash ; /
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
226 fcb 0x3a,token_stmtsep ; :
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
227 fcb 0x3b,token_semi ; ;
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
228 fcb 0x3f,token_print ; ? - print shortcut
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
229 fcb 0x40,token_at ; @
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
230 fcb 0x5e,token_exp ; ^ - exponentiation
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
231 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
232 ; 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
233 *pragmapush list
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
234 *pragma nolist
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
235 parse_toknum set 0
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
236 parse_tokdef macro noexpand
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
237 \1 equ parse_toknum
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
238 parse_toknum set parse_toknum+1
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
239 fdb \2
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
240 endm
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
241 *pragmapop list
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
242 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
243 parse_tokdef token_eot,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
244 parse_tokdef token_lt,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
245 parse_tokdef token_le,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
246 parse_tokdef token_gt,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
247 parse_tokdef token_ge,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
248 parse_tokdef token_eq,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
249 parse_tokdef token_ne,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
250 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
251 parse_tokdef token_stmtsep,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
252 parse_tokdef token_apos,parse_rem
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
253 parse_tokdef token_special,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
254 parse_tokdef token_bang,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
255 parse_tokdef token_hash,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
256 parse_tokdef token_dollar,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
257 parse_tokdef token_percent,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
258 parse_tokdef token_amp,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
259 parse_tokdef token_oparen,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
260 parse_tokdef token_cparen,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
261 parse_tokdef token_star,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
262 parse_tokdef token_plus,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
263 parse_tokdef token_comma,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
264 parse_tokdef token_minus,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
265 parse_tokdef token_slash,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
266 parse_tokdef token_semi,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
267 parse_tokdef token_at,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
268 parse_tokdef token_exp,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
269 parse_tokdef token_ident,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
270 parse_tokdef token_rem,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
271 parse_tokdef token_return,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
272 parse_tokdef token_run,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
273 parse_tokdef token_data,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
274 parse_tokdef token_else,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
275 parse_tokdef token_end,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
276 parse_tokdef token_stop,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
277 parse_tokdef token_sub,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
278 parse_tokdef token_let,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
279 parse_tokdef token_list,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
280 parse_tokdef token_new,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
281 parse_tokdef token_not,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
282 parse_tokdef token_print,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
283 parse_tokdef token_pop,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
284 parse_tokdef token_to,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
285 parse_tokdef token_and,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
286 parse_tokdef token_or,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
287 parse_tokdef token_go,parse_noop
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
288 parse_rem rts
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
289
5d5472b11ccd Initital skeleton of separation of separate parsing scheme
William Astle <lost@l-w.ca>
parents:
diff changeset
290 *pragmapop list