Skip to content

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

License

Notifications You must be signed in to change notification settings

marcos-venicius/MCA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks