|
So I've never really gotten into scripting before, and I've been curious for a while with how they (and programming languages in general) work regarding compilation and execution (especially after asking Andrew how RuneScript works).
Because of this, I did a little research into creating your own scripting language and started my own.
It could evolve into something which is actually used for my server (Gielinor, as of yet unreleased), but that may never happen.
At the moment it's just something to learn from and something to add to my portfolio to stand out from all the other applicants when looking for an internship in the future.
My language uses a lexer/tokenizer and a parser in order to be interpreted in Java.
Current features:
- PRINT statements
- Evaluate mathematical statements which can be printed
- Basic variable implementation (can only store numbers)
- Built in methods, i.e. "LIST_VARS" to print out all current variable names and values
- Commenting
Planned features:
- Call variables, i.e. "PRINT var_name"
- More work on variables: store strings, mathematical operations i.e. var_1 = var_2 + var_3
- Boolean logic: if statements, boolean variables
- User created methods (long-term goal)
- Improve the code, currently it's all cobbled together
- Throwing errors
- Making it more robust and flexible (i.e. "PRINT" and "print" doing the same thing)
Example script and output:
Spoiler for Media:
Snippets:
Spoiler for Parser:
This is all only 1 days work so far.
Again, I'm by no stretch an expert and I don't really know what I'm doing, so constructive feedback is appreciated
Good luck!
Best of luck, interested to see how you go with this.
best of luck, looks pretty interesting!
This is really interesting, honestly! I'm pumped to see how you get on with this, best of luck.
nice progress, good luck with your project.
lookup into AST
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |