NameCheck

Anything QL Software or Programming Related.
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: NameCheck

Post by dilwyn »

martyn_hill wrote:Hi everyone
[Arguably going off-topic - or rather expanding upon this specific and valid use-case that Dilwyn's solution aims to address...]
I would also like to encourage exploring MasterBasic in this context - fundamentally it works 'within' the SBASIC environment, thus knows the context of each name in the Name Table, rather than trying to deduce usage from a purely external syntactical analysis using awk, sed and their ilk.
Whilst I'm not so thrilled in limiting SBASIC editing capability to what QDOS/SMSQE offer (i.e. ED), MasterBasic to my mind is a truly impressive bit of software engineering with some incredible SBASIC profiling tools. To my mind, if QD or some other SBASIC 'aware' editing tool could be integrated with MasterBasic's tools against a 'resident' SBASIC tokenised program, I think we'd have a fantastic basis for a next-gen SBASIC 'IDE'. Wishful thinking, I know...
I'd certainly agree with that, Martyn.

If Davide (Ergon) is able to update the program (afraid I can't remember who the original author was), that would be a good direction to take the program to. Yes, we have things like SSB and the JMS QD/QLib utility whose name I've forgotten, but a true development environment with profiling tools and S*BASIC aware would be great.

Actually, I learned a few things in writing NameCheck (I forced myself to study SMSQ/E sources to learn a few things), so even if it never gets completed, it would have been worth it.


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: NameCheck

Post by NormanDunbar »

Hi Tim,
Thanks for the fix. The two sections should be all one script. Easy enough to be fixed by who ever downloads it.
No problem.

In the example with version$, the script will find "version$"
Excellent.
The script assumes that all variables must have an assignment, so I looked for "=".
In which case function/procedure formal parameters or function/procedure actual parameters (when calling the FN/PROCs) might get missed.
I did not think about function or procedure names
.

Ha! Neither did I! I thought about parameters, not the function/procedure names. :(

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: NameCheck

Post by dilwyn »

Took a bit longer than I'd like - here is the latest version of NameCheck.

It's now fully functional, able to scan _sav files (tokenised BASIC), QREF listings and individual name checks, as well as scanning Job 0 nametable and program. Where relevant, lists line numbers where names are used to assist with editing and changing names. Can send output to a printer or even file so that you can have a hard copy of name clashes to help you with editing.

There is a manual now, including details of how to recompile the program - all sources included. It has a config block to help you set defaults for the compiled version.

Still a bit of work on error trapping etc left to do. It is usable, but easily crashed. But almost complete now.
namecheck10.zip
namecheck10a.jpg
namecheck10b.jpg


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: NameCheck

Post by stevepoole »

Hi Dilwyn,

Nice piece of coding !

Seems to work ok so far on what I chuck at it.....

Will make a useful job on future prototype programs in development.

Many thanks too for the freeware status.

Steve.
_______________


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: NameCheck

Post by dilwyn »

Latest version of NameCheck. Not many changes to the program itself, mainly increased dataspace, with substantial changes to the namessc_txt file list of keywords. Many additions, and some corrections.
namecheck020.zip


Post Reply