Posts: 4,655
Threads: 1,498
Joined: Sep 2016
i would like to parse some text string like Python code. it is an assignment expression. the idea is to break it apart just like it would be done for Python code. in particular i want to break apart literal strings into one string item and support [ and ] for a list. it would return a list of items. is there a tool suitable for this?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,655
Threads: 1,498
Joined: Sep 2016
it's not a language intended for public. it's just an embedded language for a program which needs to add a few new statements which in most cases will be "compiled" to a function call.
> Have you looked at how the Python interpreter works?
yes, but not recently. i don't want to re-implement Python.
> Also, if you're writing a language, perhaps you need to get your hands on a copy of the dragon book or something similar.
i wrote a small compiler when i was in school for my compiler class. it was a lot of work and i don't want to do that again. but compiling to Python would be simpler. compile Python to Python. that's trivial. now add the Python 2 print command so you have both the command and the function. you just convert each command to a function call. easy. i just want to keep this simple.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,655
Threads: 1,498
Joined: Sep 2016
i don't understand what you are getting, but it does not seem to be an iterator of strings which is what i would expect.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.