Author Topic: Axe Interpreter  (Read 24271 times)

0 Members and 1 Guest are viewing this topic.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Axe Interpreter
« on: December 20, 2011, 02:33:19 pm »
Edit: Links to latest updates at bottom of post.

I was bored, so I tried making an implementation of Axe Parser in Python.  It currently only supports a very limited subset of Axe (only a few tokens, no pointers, strings, subroutines, HL madness, etc), but I thought this would be a good project to try this Christmas break.

It has both an interpreter mode, where you can type commands in on the fly, and a mode to execute from a text file.  It currently will not open 8xp files -- given the small number of tokens I support, it wouldn't even be useful at this point anyways.



This should be compatible with all major OSes, but was tested on Windows 7 and Linux Mint. 
No .exes, sorry -- you need Python 2.7 and Pygame.

To run the interpreter, type
Code: [Select]
$ python source/main.py --interpreter
To run a text file, type
Code: [Select]
$ python source/main.py myfile.txt
A full list of supported tokens and other miscellaneous details can be found in the readme.


Note: I'm not really fond of the name 'Axe Interpreter' -- can anybody think up a better one?



### EDIT -- Latest releases: ###

  • v0.3: http://ourl.ca/14554/301297
    Completely redone, now with grayscale and goto statements.  I also made a dodgeball game to demo.
  • v0.2: http://ourl.ca/14554/273474
    A bunch of new features: getKey, more pxl-commands, more math, rudimentary pointers, and more control structures.  I also made a tunnel game using the commands currently available.
  • v0.1: http://ourl.ca/14554/273054
    Slightly tweaked UI, exe only (windows and linux)
  • v0.0: [See attached]
    Initial release.  Source code only.
« Last Edit: May 13, 2012, 10:21:25 am by Michael_Lee »
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: Axe Interpreter
« Reply #1 on: December 20, 2011, 02:46:02 pm »
Nice Idea, I like it!
* Sorunome might try some time

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Interpreter
« Reply #2 on: December 20, 2011, 02:51:32 pm »
Hmm seems interesting. I hope it runs commands exactly like the calc counterparts, although in the future it would be cool if it was extended for computer usage too, such as higher resolution and stuff. :D

This project kinda reminds me of Basic++ by Miotatsu actually. He tried making a TI-83+ BASIC interpreter in C++, but he lost the entire source. :(

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Interpreter
« Reply #3 on: December 20, 2011, 02:59:01 pm »
Hmm seems interesting. I hope it runs commands exactly like the calc counterparts, although in the future it would be cool if it was extended for computer usage too, such as higher resolution and stuff. :D

This project kinda reminds me of Basic++ by Miotatsu actually. He tried making a TI-83+ BASIC interpreter in C++, but he lost the entire source. :(

Yeah, that's kind of what I want to turn this into.  Ideally, my version should be able to run Axe source code and make it look exactly as it does on the calculator, although I have a long ways to go before I hit that point :|

Changing the resolution -- that might actually be a neat idea.  I'll look into trying something like that.
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Interpreter
« Reply #4 on: December 20, 2011, 03:19:28 pm »
Need two other programs in order to run?
Gosh, darnit! :P

Looks awesome, anyways :D
« Last Edit: December 20, 2011, 03:19:55 pm by epic7 »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Interpreter
« Reply #5 on: December 20, 2011, 03:36:03 pm »
Wow cool!  If you need any help about how I implement any complicated commands feel free to ask and I can explain :)
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Axe Interpreter
« Reply #6 on: December 20, 2011, 08:22:06 pm »
No .exes, sorry -- you need Python 2.7 and Pygame.

Wow, I know I've been on Omnimaga too long when I read the above sentence as:
Quote
No .exes, sorry -- you need Python 2.7 and Thegame.
Seriously, I think I need to have my head examined... x.x

Anyhow... This looks pretty sweet. At first glance I though it might be an on calc interpreter that ran Axe programs in a way similar to how Grammer works. I know a few people have mentioned attempting such a thing. Cool project though. :)

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Interpreter
« Reply #7 on: December 20, 2011, 08:25:49 pm »
I have python but it wont open.

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Axe Interpreter
« Reply #8 on: December 20, 2011, 08:30:42 pm »
What parts not opening? the GUI? Command Line?
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Interpreter
« Reply #9 on: December 20, 2011, 08:39:20 pm »
Click on the compiled code, a black thing shows up, then dissapears.

Offline saintrunner

  • Custom Spriter: You ask it! I'll Make it!
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1787
  • Rating: +115/-11
  • Flogging Molly
    • View Profile
    • Jonny K Music
Re: Axe Interpreter
« Reply #10 on: December 20, 2011, 08:43:14 pm »
So a command line? What did you use to compile?
My Sprites Thread   :Updated often :) for your viewing pleasure

GAMES:

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Interpreter
« Reply #11 on: December 20, 2011, 08:47:42 pm »
Woah, what?  What compiled code?

Go to the command line, navigate over to where the extracted axe-interpreter folder is, then type
Code: [Select]
python source/main.py --interpret
Hmm, on second thought, maybe it would be better to have double clicking open the interpreter without needed anything appended...
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Interpreter
« Reply #12 on: December 20, 2011, 08:50:14 pm »
I have no idea what to do.

Offline Michael_Lee

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1019
  • Rating: +124/-9
    • View Profile
Re: Axe Interpreter
« Reply #13 on: December 20, 2011, 08:51:49 pm »
If you wait about 10-20 minutes, I can make exes for both Linux and Windows.
My website: Currently boring.

Projects:
Axe Interpreter
   > Core: Done
   > Memory: Need write code to add constants.
   > Graphics: Rewritten.  Needs to integrate sprites with constants.
   > IO: GetKey done.  Need to add mostly homescreen IO stuff.
Croquette:
   > Stomping bugs
   > Internet version: On hold until I can make my website less boring/broken.

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Axe Interpreter
« Reply #14 on: December 20, 2011, 08:52:49 pm »
Ok. It would take me more than 20 minutes to figure it out by my random button-smashing technique that I'm using now. :P