Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: omit comments in PL/SQL source code

Re: omit comments in PL/SQL source code

From: Ivan Bukovcan <b_at_buko.sk>
Date: 8 Jun 2004 00:26:09 -0700
Message-ID: <c85e68d1.0406072326.6dc66ca0@posting.google.com>


"Jim Kennedy" <kennedy-downwithspammersfamily_at_attbi.net> wrote in message news:<BB6xc.1757$0y.739_at_attbi_s03>...
> "Ivan Bukovcan" <b_at_buko.sk> wrote in message
> news:c85e68d1.0406070744.3ab3d551_at_posting.google.com...
> > Hi,
> >
> > I have this situation:
> > I am doing simple parser to parse PL/SQL packages and create some
> > metadata from it.
> > I select the package source from SYS.ALL_SOURCE view.
> >
> > My question is:
> > Is it possible to omit all comments (both /**/ and -- ) in the source
> > code, so my parser would not have to parse them? There may be large
> > blocks of commented source which I dont want to be parsed, I want to
> > skip it.
> >
> > Is there some way to do this or do I have to create "comments parser"
> > to get rid of all the comments in the source?
> >
> > Many thanks for suggestions,
> >
> > Ivan
>
> Why? Is there a real good reason to write your own? Some of us have better
> things to do than reinvent the wheel.
> Jim

Is it already invented? Could you point me where can I find it? That would help me more.

Other way, I had to do my own. LOOP through source code, check for '-' and '-' and not '+' or check for '/' and '*' and not '+' for opening comment, '*' and '/' for closing comment. (omiting hints would not matter in my case, but then it would not be real "comments parser" but "comments and hints parser").

I'd prefer to write in it PL/SQL - it has only limited string functions but I can imagine make it with help of SUBSTR and INSTR and some PL/SQL table.

Many thanks for your suggestions

Ivan Received on Tue Jun 08 2004 - 02:26:09 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US