Skip to content

Latest commit

 

History

History
61 lines (41 loc) · 1.07 KB

README.md

File metadata and controls

61 lines (41 loc) · 1.07 KB

MCA

image

It's a math expression evaluator/compiler to asm.

Basically, you can pass programming language math as a string, and get back a file in asm that do this math or just evaluate (which is very useful).

The name:

  • M math
  • C compiler
  • A asm

error handling

Available operators

  • * times
  • - subtract
  • + sum
  • / divide
  • % modules
  • ^ power

all the numbers will be handled as C Doubles.

Examples

10 + 10
2 + 2 / 2
(2 + 2) / 2
2 * 2 / (2 + (2 - 3))
5.5 * 2 / 3

We have some bugs yet

I'm not properly parsing the tokens before mount the ast, so expressions like 2 * 2 - 2 2 2 will kinda work, but with the wrong result. Or for example 2 (^ 2 + 2), will return a wrong result without any errors.

Debugging

you can export MCA_LOG_ENABLED as 1 to enable logging.

export MCA_LOG_ENABLED=1