Jump to content

Photo

bblint


51 replies to this topic

#1 RevEng ONLINE  

RevEng

    River Patroller

  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Fri Jan 28, 2011 1:46 PM

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

#2 diogoandrei OFFLINE  

diogoandrei

    Chopper Commander

  • 211 posts
  • Location:Brazil

Posted Fri Jan 28, 2011 2:07 PM

This looks really interesting! I am gonna try it out this weekend =)

#3 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Fri Jan 28, 2011 5:43 PM

Thanks diogoandrei!

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

#4 jwierer OFFLINE  

jwierer

    Dragonstomper

  • 893 posts
  • Location:Seattle,WA

Posted Fri Jan 28, 2011 6:54 PM

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

#5 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Fri Jan 28, 2011 7:09 PM

Sounds perfect Jeff!

#6 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Sat Jan 29, 2011 5:59 AM

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

#7 diogoandrei OFFLINE  

diogoandrei

    Chopper Commander

  • 211 posts
  • Location:Brazil

Posted Sat Jan 29, 2011 7:19 AM

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 =)

#8 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Sat Jan 29, 2011 7:28 AM

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.

Edited by RevEng, Sat Jan 29, 2011 7:51 AM.


#9 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Mon Jan 31, 2011 1:02 PM

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.

#10 Uberkatzchen OFFLINE  

Uberkatzchen

    Combat Commando

  • 6 posts
  • Location:England

Posted Wed Feb 2, 2011 2:14 AM

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!

Attached Files



#11 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Wed Feb 2, 2011 4:53 AM

Thanks Uberkatzchen! :thumbsup:

#12 Uberkatzchen OFFLINE  

Uberkatzchen

    Combat Commando

  • 6 posts
  • Location:England

Posted Wed Feb 2, 2011 5:37 AM

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:

#13 yuppicide OFFLINE  

yuppicide

    I am the Black Knight. Give me your money!

  • 6,933 posts
  • Location:New Jersey

Posted Thu Feb 3, 2011 8:44 PM

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.



#14 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Mon Mar 7, 2011 9:57 PM

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)

Edited by RevEng, Mon Mar 7, 2011 10:22 PM.


#15 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Sun Dec 11, 2011 7:06 PM

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.

#16 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 8,821 posts

Posted Thu Dec 22, 2011 9:56 AM

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 :)

#17 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Thu Dec 22, 2011 11:23 AM

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

#18 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 8,821 posts

Posted Thu Dec 22, 2011 1:41 PM

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, Thu Dec 22, 2011 1:42 PM.


#19 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Thu Dec 22, 2011 2:54 PM

:)

Sounds like a good idea! When I get a chance I'll add that in.

#20 iesposta OFFLINE  

iesposta

    River Patroller

  • 3,308 posts
  • Retro-gaming w/my VCS
  • Location:Pennsylvania

Posted Sat Oct 27, 2012 7:03 AM

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.

#21 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Sat Oct 27, 2012 7:20 AM

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

[removed]

#22 iesposta OFFLINE  

iesposta

    River Patroller

  • 3,308 posts
  • Retro-gaming w/my VCS
  • Location:Pennsylvania

Posted Sat Oct 27, 2012 7:56 PM

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

scorecolor: error still happening.
Changed every bblint.exe

#23 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Sat Oct 27, 2012 9:23 PM

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.

#24 jwierer OFFLINE  

jwierer

    Dragonstomper

  • 893 posts
  • Location:Seattle,WA

Posted Sun Oct 28, 2012 12:57 AM

The latest still reports a version number of v.03.

-Jeff

#25 RevEng ONLINE  

RevEng

    River Patroller

  • Topic Starter
  • 4,580 posts
  • Bitnik
  • Location:Canada

Posted Sun Oct 28, 2012 8:11 AM

I just posted one in the first post that's correctly reporting the version and has a bug-fix, thanks to iesposta.




0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users