Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Useful DCL parser

 
SOLVED
Go to solution
Antoniov.
Honored Contributor

Useful DCL parser

Hi to All,
I've been finishing to test DCLMAKE, a new DCL parser, written itself in DCL. DCLMAKE analyzes any source DCL file and detects most common mistakes. DCLMAKE let you the power of justify source DCL file and works like a compiler, removing all remarks from source file so command execution runs faster.
DCLMAKE checks the following errors:
- IF without THEN
- THEN without IF
- ELSE without IF
- ENDIF without IF
- IF without ENDIF
- Invalid label in GOTO/GOSUB and WRITE/READ statements
- Undefined symbol substitution (inside single quote)
- Various mistakes in simple expressions


DCLMAKE is released under GNU license.
You can free download here:
http://it.openvms.org/pages.php?page=download

Any feedback will be apreciated.

Antonio
http://it.openvms.org
Antonio Maria Vigliotti
20 REPLIES 20
Hoff
Honored Contributor

Re: Useful DCL parser

How does this tool compare with the DCL_CHECK (syntax) and DCL_DIET (size reduction) tools?

http://h71000.www7.hp.com/freeware/freeware80/dcl_check/
http://h71000.www7.hp.com/freeware/freeware80/dcl_diet/
Antoniov.
Honored Contributor

Re: Useful DCL parser

Ho Hoff,
currently I don't know all the differences between DCLMAKE and DCL_CHECK.
I tried DCL_CHEK some months ago and it worked fine.
Anyway DCL_CHECK uses much CPU's resource up and might be confused by strings inside quotes.
My DCLMAKE is lighter and recognize invalid label in string substitution too.
And don't forget, you would use just one software instead of two.

Antonio
http://it.openvms.org
Antonio Maria Vigliotti
Wim Van den Wyngaert
Honored Contributor

Re: Useful DCL parser

Antonio,

I downloaded it and ran it agains a 4300 lines of dcl script.

It seems to have difficulty with

if a .eqs. "a" .or. -
b .eqs. "b"
then
...
endif

Also the counting of lines seems to contain errors. The given line numbers do not correspond with what is in the script.

Also got a lot of untrue "to many endsubroutine" and "undefined symbols and labels" (usage before init due to gosub).

Wim
Wim
Wim Van den Wyngaert
Honored Contributor

Re: Useful DCL parser

BTW : the 4300 lines are checked by dcl_check without problems (but I removed some warnings from dcl check itself).

Wim
Wim
Antoniov.
Honored Contributor

Re: Useful DCL parser

Wim,
thank you for your feedback.
I'll check for the statement and I'll notice you about solution.

Antonio
http://it.openvms.org
Antonio Maria Vigliotti
Dean McGorrill
Valued Contributor

Re: Useful DCL parser

Hi Antonio
Looks like an interesting tool. It
did not recognize logout as a keyword fyi.
Also it didn't produce an output file (?)
I like the .XRF table.

Dean
****
$ @dclmake.com login.com login.test
DCL Parser V5.06 LOGIN.COM
$ write sys$output "ASDF"
$ logout/full
^^^ Expected colon at end of label (152)
$ logout/full
$ logout/brief
^^^ Expected colon at end of label (154)

$ REC=""
^^^ Symbol REC undefined (158)
158 lines, 4 labels, 194 symbols found.
$! lets see what it made
$ dir login.test
%DIRECT-W-NOFILES, no files found
$
John Gillings
Honored Contributor

Re: Useful DCL parser

Antonio,
I'm not sure I understand the error messages. I get these:

DCL Parser V5.06 TEST.DCL
$ GOTO COMPILE
$ GOSUB COMPILE
^^^ Label COMPILE not found (301)
$ GOTO CREATEMAC
$ GOSUB CREATEMAC
^^^ Label CREATEMAC not found (301)
$ GOTO CREATEOPT
$ GOSUB CREATEOPT
^^^ Label CREATEOPT not found (301)
$ GOTO DEFLOOP
$ GOSUB DEFLOOP
^^^ Label DEFLOOP not found (301)
$ GOTO GENLOOP
$ GOSUB GENLOOP
^^^ Label GENLOOP not found (301)
$ GOTO LOOP
$ GOSUB LOOP
^^^ Label LOOP not found (301)
$ GOTO P2
$ GOSUB P2
^^^ Label P2 not found (301)

$ PID=""
^^^ Symbol PID undefined (301)
$ GOTO VECCLEANUP
$ GOSUB VECCLEANUP
^^^ Label VECCLEANUP not found (301)
301 lines, 15 labels, 408 symbols found.

All the labels exist, for example:

$ search test.dcl compile:
$ COMPILE:

The only unusual usage is p2:

$ GOTO 'p2'

Symbol PID also exists. Are the errors supposed to be listing the lines? Why are they all (301)?
A crucible of informative mistakes
Antoniov.
Honored Contributor

Re: Useful DCL parser

Hi,
I'm impressed how you've been advicing a lot of good feedback.
Now I'll try to answer:
[Dean]
- File .XRF is a cross reference file; I use it to see labels. I've already planned to relase a new qualifier (like /CROSS or /XREF) to create a more readable text file.
- Your output file is login.$$$ because DCLMAKE doesn't create output file if it found any error.
- is a wrong message. I'm testing your example and think I can soon solve the trouble.
[John]
- Your error seems to me the same of Dean's wrong message. I'm amazed of theese wrong messages.
[Wim]
- I watched at my test unit and found the same test. So I think the real problem is before the statement. I think may be a long line before it. This version of DCLMAKE can't manage long line even if they are splitted by dash.

I'll soon release a new version.

Antonio
http://it.openvms.org
Antonio Maria Vigliotti
Dean McGorrill
Valued Contributor

Re: Useful DCL parser

Antonio,
Try it out on a copy of decnet plus
NET$CONFIGURE.COM - that would be a great
exercise, its around 800 blocks+- depending
on the decnet version, and its already
had comments etc removed. I ran dclmake on it, and it had a hard time with the if then else.

Thats a real tough task your doing!

Dean - from net$configure


$Set NoOn
$Then
^^^ Unexpected THEN (343)
$Set NoOn
$Else
^^^ ELSE without IF (345)
$Set NoOn
$Endif
^^^ Too many ENDIF (347)
Karl Rohwedder
Honored Contributor

Re: Useful DCL parser

Dean,

perhaps DECnet engineering really should run DCL_CHECK against NET$CONFIGURE to detect such flaws as e.g.:

$If prc .eqs ""

regards Kalle
Dean McGorrill
Valued Contributor

Re: Useful DCL parser

Kalle,

$If prc .eqs ""

I love it. what version is that from, I
don't see it 7.2. There was a lot of contention over that, whether we should
put that functionality into hard code. I
worked on that dcl for a couple of cases.
what a zoo to work on :)

Dean ex-hp-engineer-not-my-problem-no-more
Karl Rohwedder
Honored Contributor

Re: Useful DCL parser

Dean,

$ MC NCL SHO IMPLE
...
Version = "V8.3 ECO01 8-NOV-2006 04:00:13.34"

regards Kalle
Cramer_1
Occasional Visitor

Re: Useful DCL parser

Dear Antonio,

after two days of searching I finally found DCLMake - exactly, what I'am looking for!!!

Unfortunately I was not successful to reach
http://it.openvms.org/pages.php?page=download
to download it.

Did I make any mistake?

Thank you, best regards
Erwin

Hoff
Honored Contributor

Re: Useful DCL parser

The whole of the it.openvms.org site is not reachable. You could try contacting Ken Farmer via the OpenVMS.org site; he's responsible for the whole site. He might (will?) know what happened with the tool.

And I'd suggest starting a new thread for a new question.

I did acquire a copy of the zip archive from the Internet archive, if it somehow got lost over at the OpenVMS.org site.

http://web.archive.org/web/*/http://it.openvms.org/download/utilities/dclmake.zip

Antoniov.
Honored Contributor

Re: Useful DCL parser

Hi,
it.openvms.org is under attach. I'm talking site manager in order to restart the web site.
If you contact me at antoniov@openvms.org I can send you a file via mail.

Antoniov
Antonio Maria Vigliotti
Martin Vorlaender
Honored Contributor
Solution

Re: Useful DCL parser

I have put up a copy of it under
http://de.openvms.org/software-download/dclmake.zip

HTH,
Martin
Willem Grooters
Honored Contributor

Re: Useful DCL parser

Good initiative, but I doubt the usefullness.

The big problem with DCL programming is not invalid labels and if-then(-else)-endif constructs because these are clearly identified by DCL itself. Undefined symbols, unopened files are not a big issue either.
You'll find these when testing - which _should_ be done before a procedure is put into production.

No doubt that software, checking on these issues, can be useful. Foremost on big, lengthy procedures. But since DCL itself can take care of that, I think it's usability limited. I tried DCL_CHECK once, it did a good job but simply failed the major bug in the procedure I was working on at that time.

Mispelled logical names, and, foremost, symbol names, or local.vs. global assignements are a far greater concern because typo's are easily made and overlooked, especially in large, complex procedures:

$ dev1=""
$ avoid="TRUE"
...
$ devl=="some value"
$ aviod=="FALSE"
...
$ dev1=="something"
...
$ if avoid
$ then
$ if dev1 .eqs. "" then ....
...

Searching for a reason of unexpected, or errenous behaviour can be a tedious task in such an environment. If your procedure is capable of picking these out, then it's really useful.

WG
Willem Grooters
OpenVMS Developer & System Manager
Ian Miller.
Honored Contributor

Re: Useful DCL parser

Willem,
I think the symbol cross reference could help with the problem you mention.
____________________
Purely Personal Opinion
Hoff
Honored Contributor

Re: Useful DCL parser

Willem: switch the fonts selected for your displays.

It's good that you capture these errors, but it's also likely these arise either with the few ancient typists left around the industry or more commonly with poor font choices.

The default character display fonts on some operating system platforms were seemingly created by crayon-wielding children.

Changing fonts can help with this one versus ell confusion, with (better) antialiasing, and with general ease of viewing.

Antoniov.
Honored Contributor

Re: Useful DCL parser

DCLMAKE is just a beta release of software. It writes a cross reference.
It finds undefined symbols, wrong if-then-else-endif construct, some common mistakes in expression.
It's very simple but helps the programmer.

Antoniov
Antonio Maria Vigliotti