Skip to content

Teddybear182/little-interpreter

Repository files navigation

little-interpreter

simple interpreter for my own programming language(inter)

it's a for-fun project, nothing serious.

! important ! ---> to make new inter project, just create new file with file type .inter and write the code

Code:

  • read --> reads the user input, can only be number

  • push --> pushes/adds new number to the stack

  • pop --> deletes the newest number from stack and returns it

  • add --> adds two numbers

  • sub --> subtracts two numbers

  • mul --> multiplies two numbers

  • div --> divides two numbers

  • jump0 --> jumps to the specified label if the number at the top of the stack is 0

  • jumpGreater0 --> jumps to the specified label if the number at the top of the stack is greater than 0