1753288 Members
5468 Online
108792 Solutions
New Discussion юеВ

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)