Author Topic: Axalyzer (tentative)  (Read 5042 times)

0 Members and 2 Guests are viewing this topic.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Axalyzer (tentative)
« on: January 16, 2011, 03:18:51 pm »
As a side project, I was thinking about creating a utility for Axe programmers that would enable you to run your source code through the program, and it would spit out:

The commands and the number of times they appear in your program.
The variables you use (and how many times you use them)
The amount of data in the program

and possibly....(using Runer112's documentation on Axe command speed/sizes) the iterations per second of loops in your program. (This could get messy, I think maybe I would have the user instead mark off a section of code with special comments and then Axalyzer would return the iterations per second (and Tstates) of that section perhaps)

I have a basic idea of how the program will work and read tokens and stuff: it's a variation on the NPC system of Ash:Phoenix actually :P

Yeah so I'm just starting a topic to gather my thoughts...and you can discuss/request features here. ;D

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axalyzer (tentative)
« Reply #1 on: January 16, 2011, 03:23:32 pm »
http://www.omnimaga.org/index.php?action=dlattach;topic=6129.0;attach=5599

here is the source code i have for analyzing what variables have been used. (does not check if it's a comment or not.  does check strings though)

the compiled is only about 800 bytes too.


I hope this goes well, good luck
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axalyzer (tentative)
« Reply #2 on: January 17, 2011, 07:19:33 pm »
Got some stuff done.

Currently it only checks program A00A...I haven't yet implemented selection of programs (but that's easy anyway)
Variable scanning works flawlessly, and it also counts the number of tokens/lines in the program.

Run with Asm(), if you want you can try and find bugs by entering crap into a prgmA00A (I'd appreciate that ;) )

2 byte tokens, sub(), asm(), axiom(), lbl, goto, [], E, "", and comments are all covered...So far only the transpose tokenizer T and multiline comments are not supported.

Besides "variables" and "quit," none of the other options do anything yet :P
« Last Edit: January 17, 2011, 07:23:28 pm by squidgetx »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axalyzer (tentative)
« Reply #3 on: January 17, 2011, 08:37:21 pm »
well, screw my project :P

good work. It looks nice
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axalyzer (tentative)
« Reply #4 on: January 17, 2011, 09:17:10 pm »
I feel kinda bad about sort of stealing your program (the idea: I actually didn't use any if your code :P) this wasn't really intended to be a variable scanner. It will scan for variables in the same way that it scans for other functions; it's just that for testing purposes scanning variables are the easiest to quickly code :x

Also I realized that probably subroutine arguments aren't accounted for. I will fix these bugs and then I'm going to add the rest of axe's commands: so you can see how many times you use each one. Oh and also I'll add vat scanning so itll work not just on prgmA00A
« Last Edit: January 17, 2011, 09:29:28 pm by squidgetx »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axalyzer (tentative)
« Reply #5 on: January 17, 2011, 10:27:40 pm »
how did you get Sub( to be scanned in properly?
It only worked if Sub(Sub( was done in a prog instead of Sub(  :P


I will be using this :)
« Last Edit: January 17, 2011, 10:33:29 pm by happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

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: Axalyzer (tentative)
« Reply #6 on: January 18, 2011, 01:36:58 am »
Nice squidgetx, sometimes it's good to remember which var we used because we forget (unless we don't forget to write them down). :P

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axalyzer (tentative)
« Reply #7 on: January 18, 2011, 08:02:24 pm »
Woohoo, this does something useful now :D

Now featuring lightning fast analysis (about 4000 tokens per second on an 84+), lots of bugfixes (though still no multiline comments), a sexy GUI, a symbol counter, a command tracker that returns data that appears to be gibberish but is actually accurate (don't worry this will be finished in the next update) and a program selection menu. It only allows you to choose programs that have Axe headers that are in RAM.

Note that if you use a lot of tokens that aren't Axe supported, or have a bunch of syntax errors, it may return nonsensical data.
« Last Edit: January 18, 2011, 08:02:57 pm by squidgetx »

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: Axalyzer (tentative)
« Reply #8 on: January 19, 2011, 03:36:20 pm »
Wow great! Seems pretty straight forward too. Nice job so far. :)

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Axalyzer (tentative)
« Reply #9 on: January 19, 2011, 06:28:12 pm »
kk pretty much last update for a while unless you guys have any easy feature requests because I want to get back to Ash:Phoenix.

I'm pretty proud of it now; it now tells you exactly how many and which commands you've used throughout your program: it's good for optimizing out unnecessary functions.

Almost all of Axe's functions are supported, even those annoying 2 byte ones...except for multiline comments. :P

Screeny showing off the 576 lines of the main engine of Ash:Phoenix
« Last Edit: January 19, 2011, 06:29:18 pm by squidgetx »

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axalyzer (tentative)
« Reply #10 on: January 19, 2011, 06:31:03 pm »
Feature request:  Tell the user if a variable is in a program but not used.  (If anything is stowed to a variable, but the variable is never called.
Also:  Search for code in program feature.
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Axalyzer (tentative)
« Reply #11 on: January 19, 2011, 06:34:51 pm »
I just checked it, it looks pretty good ;D

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axalyzer (tentative)
« Reply #12 on: January 19, 2011, 08:04:15 pm »
Oooh, looks cool!  Nice job! :D

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: Axalyzer (tentative)
« Reply #13 on: January 20, 2011, 08:21:37 pm »
Great job! Why aren't the variables sorted by alphabetical order, though? ???

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Axalyzer (tentative)
« Reply #14 on: January 20, 2011, 08:23:37 pm »
pwned :P

I am sure he will add that
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________