Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: squidgetx on January 16, 2011, 03:18:51 pm

Title: Axalyzer (tentative)
Post by: squidgetx 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
Title: Re: Axalyzer (tentative)
Post by: Happybobjr 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
Title: Re: Axalyzer (tentative)
Post by: squidgetx 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
Title: Re: Axalyzer (tentative)
Post by: Happybobjr on January 17, 2011, 08:37:21 pm
well, screw my project :P

good work. It looks nice
Title: Re: Axalyzer (tentative)
Post by: squidgetx 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
Title: Re: Axalyzer (tentative)
Post by: Happybobjr 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 :)
Title: Re: Axalyzer (tentative)
Post by: DJ Omnimaga 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
Title: Re: Axalyzer (tentative)
Post by: squidgetx 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.
Title: Re: Axalyzer (tentative)
Post by: DJ Omnimaga on January 19, 2011, 03:36:20 pm
Wow great! Seems pretty straight forward too. Nice job so far. :)
Title: Re: Axalyzer (tentative)
Post by: squidgetx 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
Title: Re: Axalyzer (tentative)
Post by: Happybobjr 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.
Title: Re: Axalyzer (tentative)
Post by: Munchor on January 19, 2011, 06:34:51 pm
I just checked it, it looks pretty good ;D
Title: Re: Axalyzer (tentative)
Post by: ztrumpet on January 19, 2011, 08:04:15 pm
Oooh, looks cool!  Nice job! :D
Title: Re: Axalyzer (tentative)
Post by: DJ Omnimaga on January 20, 2011, 08:21:37 pm
Great job! Why aren't the variables sorted by alphabetical order, though? ???
Title: Re: Axalyzer (tentative)
Post by: Happybobjr on January 20, 2011, 08:23:37 pm
pwned :P

I am sure he will add that
Title: Re: Axalyzer (tentative)
Post by: Munchor on January 21, 2011, 03:25:10 pm
An option to choose how we want to sort them would be even better!