Skip to content

Testing lemon parser and asmjit with a calculator that JIT-compiles expressions.

Notifications You must be signed in to change notification settings

Henning1/jitcalc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jitcalc

Trying out lemon parser and asmjit with a jit calculator. Sample output:

 ---- Enter a calculation ---- 
2*(3+4)

 ---- Abstract Syntax Tree ---- 
└── *
    ├──2
    └── +
        ├──3
        └──4

 ---- x86 Machine Assembly ---- 
.section .text {#0}
L1:
mov eax, 2
mov edx, 3
mov ecx, 4
add edx, ecx
imul eax, edx
L0:
ret

 ---- Result ---- 
 = 14

Instructions

  • First build asmjit: Go to jitcalc/asmjit and execute cmake . and make.
  • Then build jitcalc: Go to jitcalc and execute make.
  • Finally execute: Add jitcalc/asmjit to your library path, e.g. export DYLD_LIBRARY_PATH=./asmjit:$DYLD_LIBRARY_PATH on Mac. Then execute ./jitcalc.

About

Testing lemon parser and asmjit with a calculator that JIT-compiles expressions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published