Jump to content
RevEng

bblint

Recommended Posts

I put together a small utility to double-check the syntax of a bB basic program. This version changes the bundled Linux binary to 32-bit for wider compatibility.

 

If there are issues, bblint reports them along with the line numbers, if possible. If no problems are found, bblint just silently exits.

 

bblint is a command-line utility, so you'll need to know how to run those, or call it from visual bB. If you run bB from a Batch or Make file, it would be a good idea to include this command there to double check your work.

 

Win32 and Linux x86 versions are included, along with source.

 

download from 8bitdev.org

  • Like 8

Share this post


Link to post
Share on other sites

Thanks diogoandrei!

 

It's not the most thrilling of utilities, but hopefully it will save people time bug-hunting.

Share this post


Link to post
Share on other sites

I can integrate this into visualbB so that it's really easy to launch it and capture the output into the IDE for folks that aren't as comfortable with the command-line.

 

-Jeff

  • Like 3

Share this post


Link to post
Share on other sites

I can integrate this into visualbB so that it's really easy to launch it and capture the output into the IDE for folks that aren't as comfortable with the command-line.

 

-Jeff

 

Really, really cool! Nothing like a handy new feature =)

Share this post


Link to post
Share on other sites

How about something to analyze gosub and return commands or is that not doable?

gosub+return commands is more complicated. It's pretty much impossible to determine one subroutine's return from another, since there's no real way to check where a subroutine ends.

 

I can't even do gosub/return counts, since it's a valid technique to have multiple return points from a subroutine, and you could have multiple gosubs to the same sub.

 

I think I've hit a lot of the obvious checks, but I have a few other ideas on what could be added...

  • goto/gosub without real destination.
  • dimming a variable name that's a reserved keyword
  • setting up a constant that's a reserved keyword
...that said, I'm not rushing to update this right now, beyond bugfixes. I have too many projects right now as-is.

Share this post


Link to post
Share on other sites

v0.02 added to first post.

 

I've updated the keywords to include new ones from batari's v1.1 beta, and also fixed a bug where a rem statement was considered ended with a ':' character.

  • Like 1

Share this post


Link to post
Share on other sites

Thought I'd be helpful to less savvy Macintosh users, so here's an Intel only binary (built on 10.6.4 Snow 'kitten' Leopard ;D)

 

It's in a zip instead of a tar.gz because I'm currently on a 'doze' box, it'll still unpack fine though! Run using ./bblint *filename of src file*

 

Great piece of software!

bblint.zip

  • Like 1

Share this post


Link to post
Share on other sites

Thanks Uberkatzchen! :thumbsup:

 

No problem, I must commend you on your impeccable C chops, I didn't get a single warning and for a C program, that's pretty darn good! But that also meant I couldn't have fun nosing around and fixing bugs ;) :thumbsup:

Share this post


Link to post
Share on other sites

Figured as such, but thought I'd mention it anyway. I wouldn't even know where to begin, because sometimes I find myself getting lost in my goto and gosub/returns.

 

How about something to analyze gosub and return commands or is that not doable?

gosub+return commands is more complicated. It's pretty much impossible to determine one subroutine's return from another, since there's no real way to check where a subroutine ends.

 

I can't even do gosub/return counts, since it's a valid technique to have multiple return points from a subroutine, and you could have multiple gosubs to the same sub.

 

I think I've hit a lot of the obvious checks, but I have a few other ideas on what could be added...

 

  • goto/gosub without real destination.
  • dimming a variable name that's a reserved keyword
  • setting up a constant that's a reserved keyword

...that said, I'm not rushing to update this right now, beyond bugfixes. I have too many projects right now as-is.

Share this post


Link to post
Share on other sites

bblint v0.03 has been attached to the first post.

 

I updated bblint's internal keyword list to match the latest released bB 1.1 beta, and ; comments are now taken into account. (still need some work to support C style comments)

  • Like 1

Share this post


Link to post
Share on other sites

bblint v0.04 has been attached to the first post.

 

Understanding of "player#-#:" type statements has been added. Using these statements in your basic file with previous bblint versions would cause a warning about the "end" statement count.

  • Like 1

Share this post


Link to post
Share on other sites

What about renaming the bB compiler and having VisualbB call this instead? At the end of the bblint run you could then call the real compiler. Or, even better, you could ask the developer of VisualbB to add in support for calling bblint before compilation :)

Share this post


Link to post
Share on other sites

You have your wish - Jeff added integration into vbb a while back. :)

 

Great, next thing you'll tell me is parachute pants are out of style!

 

Okay, what about include support? You could allow insertion of seperate bB source files so peeps could have their own libraries.

 

INCLUDE BOPHADS.BAS

Edited by theloon

Share this post


Link to post
Share on other sites

Hit another small problem, using all latest VbB bB 1.1d

DPC+

 

If I add

 

scorecolor:

$44

$44

$44

$44

$44

$44

$44

$44

end

 

bblint errors saying 25 "end" statements... That's the only new code.

It is in Bank 1 right after define variables here

I can choose the option and continue to compile, and it builds and runs just fine.

I can comment that out and there is no error, but the score is not visible.

Share this post


Link to post
Share on other sites

It looks like the scorecolor command snuck up on me. Here's an updated version.

 

[removed]

  • Like 1

Share this post


Link to post
Share on other sites

It looks like the scorecolor command snuck up on me. Here's an updated version.

scorecolor: error still happening.

Changed every bblint.exe

Share this post


Link to post
Share on other sites

Can you please PM me the .bas causing the issue? It works as expected with a simple test file I made containing a scorecolor statement.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...