Ah I see - when you have a print
call in your data.vis it doesn't print anything in the compiler program, but when you call copy
from your compiler program it does create main.vis but the file contains File.Copy("@"C:/test.txt", "C:/output.txt");
?
There's an extra leading double quote there before the @ - is that the issue you're trying to solve?
I've not done much compiler work myself but from what I've seen the common pattern is to split the process into "lexing" to find meaningful tokens from the stream of characters, then "parsing" to produce language constructs based on the tokens.
Here's how I'd be tempted to structure it: https://pastebin.com/xbtv2WYG
This is a bit abstract - would you mind including the contents of your data.vis file, the actual contents of your main.vis file and the expected contents of your main.vis?
Okay, the main.vis file is never created, and data.vis contains:
print(Hello)
Which the outcome is meant to be not written to main.vis like most of the commands are and it is meant to display "Hello." But, if I were to make data.vis have:
The output in main.vis is:
From your code there is nothing other than file manipulation, what did you expect?
I was expecting errors, but ones I could figure out what they are.
Above is what I expect.
Sign in to comment