FoodMaxxing
- 3 Devlogs
- 7 Total hours
Custom interpreted coding language.
Custom interpreted coding language.
Variables!!!
I finally got variables to work after hours of debugging! Now, a user can use the syntax, “put (number) in a bowl”, to store a value in the ‘bowl’ variable. Probably gonna allow strings to be stored in the bowl (and add other variables). I added text.strip() so the console didn’t nuke itself every time someone entered blank space instead of a valid command. Added runtime errors so it shows people what they need to type in order for the code to work properly. I’m probably gonna change the text that shows up after you store a number in a bowl.
Numbers!!
The Work So Far:
I’ve started making the interpreter. Right now, it can only handle number operations. I’ll be working on the rest later today. The current syntax I have is “ mix (number) and (number) with a (spoon/fork/knife/spatula)”. Just something random I came up with to test everything out. I don’t really have anything else in mind for basic commands (like printing etc.). Nothing else to say.
Wanted to work on a project that will take a long time so I decided to make my own programming language: FoodMaxxing (this name will probably be changed idk)
The Work So Far (bad explanation):
Made the lexer. It turns raw text into a list of tokens. My current tokens are int, float, plus (+), minus (-), multi (*), div (/), left parenthesis, right parenthesis, identifier (the main thing that’ll differentiate my lines of code), keywords (necessary words for code structure). Made lists of constants which are assigned to tokens based on criteria. The lexer goes through each character inputted, takes notes of what line/column/index each character is on and will return this position if an error is found at a certain character (this probably sounds like garbage idk how to explain it well). Made the parser. It makes sure the tokens form grammatically correct statements (forms an Abstract Syntax Tree). If someone were to put ’5 + ’ into the terminal, an error will return saying that there should be an int/float after the plus sign. Added a recipe function in my Parser class to look out for certain cooking themed words and make sure whatever it is gets assigned to its proper token.
Next Course of Action:
I have to add the other cooking utensils so they can carry out their respective operations and come up for more bs to turn into actual code. There’s other things I need to do but I lowkey forgot..