Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • 3
    So is this about converting sources? Do you got any specific BASIC in mind? After all, this depends much on the keywords valid. Can it be assumed, that it's correct BASIC code, so no ambiguities? If yes, some Perl regex may doe it. Commented Dec 9, 2019 at 22:53
  • 1
    Let's assume that the code is valid. Minimum target would be PET BASIC 4, though MSX BASIC would be ideal. Commented Dec 9, 2019 at 23:02
  • 1
    Assuming valid code does help, except it would still depends much on the vocabulary. 10 LETA=NOTA would already give a headache in PET-BASIC - or worse, 10 A=BMODC which in PET BASIC would have to stay like that, while as MSX it needs to be turned into 10 A = B MOD C. I guess it would need to be a tool tuned to a certain dialect and work according to this dialects keyword list. Not to mention the classic GO TO vs. GOTO (Oh, and no, I do not know any existing generic tool. I'd just sit down and sketch up a bunch of Perl) Commented Dec 9, 2019 at 23:35
  • 4
    It seems that it'd be easier to write a pretty-printer if you did have the tokenized form rather than the text; the lexing has all been done for you. Commented Dec 10, 2019 at 0:19
  • 1
    but I don't have the tokens, @another-dave … I wouldn't have this issue if I did Commented Dec 10, 2019 at 2:31