On 15/12/2009, at 6:47 AM, Dennis Lovelady wrote:

Is it special programming, or is there a rule that would help here?

I presume it's access to the command definition object that makes this work. The parser is not already in a comment area, it finds a space- delimited token (DSPOBJD), checks if it is a *CMD object, if so it interrogates the CDO and applies the "rules" of the command parameters to the data. Certain general rules also apply such as parameters are separated by spaces, parameter values cannot contain spaces unless quoted etc.

Thus in your example, the first slash is embedded in the second token therefore is a qualified name. DSPOBJD supports a qualified name for its first parameter so the parser applies it as such. It does not mistake the embedded /* of MYLIB/*ALL as a comment because:

1) The CDO indicates a qualified name is allowed
2) The CDO indicates *ALL is an allowed special value

For a generalised text parser without access to the CDO you'd have to set some rules that are likely not onerous such as the opening /* of a comment must have a space either before or after it. Most programmers are likely to this anyway because it makes the code tidier. For example:

dspobjd mylib/*all *jobq /* Show the object information */
vs.
dspobjd mylib/*all *jobq /*Show the object information*/
vs.
dspobjd mylib/*all *jobq/*Show the object information*/

The CL parser will accept the 3rd example but I don't know anyone who would write code like that.

Applying such rules will make your parser different from the CL one and therefore some coding styles could break it but I think that's the best you can do.

Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists

http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.