You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made the assumption that equ values would only be used to store expressions, but they may hold more syntax.
Example from "vm5" by Michal Janeczek:
d01 equ spl 0,1
d02 equ spl 0,#1
d03 equ spl -1,1
d04 equ spl -1,#1
d05 equ spl 0,@1
d06 equ spl -1,@1
for 4
y for 6
for 4
for CURLINE<MAXLENGTH
d&y
rof
rof
rof
rof
Solution
Probably use preprocesser to make a first pass of the lex stream for equ tokens, then use those values to preprocess the token stream on a second run of the lexer.
create lexer interface
Extract tokens from file with lexer
Return new implementation that wraps lexer and substitutes tokens with patterns in-stream
Remove equ handling from compiler, leave FOR handling (for now)
The text was updated successfully, but these errors were encountered:
bobertlo
changed the title
compiler: equ needs to be done before parsing
compiler: equ macro expansion needs to be done before parsing
Nov 20, 2024
Problem:
I made the assumption that equ values would only be used to store expressions, but they may hold more syntax.
Example from "vm5" by Michal Janeczek:
Solution
Probably use preprocesser to make a first pass of the lex stream for equ tokens, then use those values to preprocess the token stream on a second run of the lexer.
The text was updated successfully, but these errors were encountered: