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..
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.