project-langx / X

A placeholder language with shareable bytecode IR.
2 stars 0 forks source link

Add support for new grammar in stack based Python decompiler #20

Closed frankhart2018 closed 3 years ago

frankhart2018 commented 3 years ago

Closes #8

Implementation

  1. Push the constants in a constant pool.
  2. If operations are performed then write them to string and push them to constant pool.
  3. If print is requested then pop from this constant pool and print that with appropriate format specifier (according to left dtype, but this will change when there is implicit typecasting in future).
  4. In (2) checked type for int or float and added the appropriate division symbol (// or /).