Advanced Oracle PL/SQL Programming with Packages

Advanced Oracle PL/SQL Programming with PackagesSearch this book
Previous: 5.21 PLVprs: String ParsingChapter 5
PL/Vision Package Specifications
Next: 5.23 PLVrb: Rollback Processing
 

5.22 PLVprsps: PL/SQL Source Code Parsing

The PLVprsps (PL/Vision PaRSe PL/SQL) package is a more specialized string parser than PRSprs; it parses PL/SQL source code into its separate atomics. See Chapter 10 for details.

5.22.1 Package constants

The following constants are used to specify the types of tokens to be preserved when PL/SQL source code is parsed.

c_all_tokens CONSTANT VARCHAR2(1) := 'A';

Specifies "all tokens".

c_kw_tokens CONSTANT VARCHAR2(1) := 'K';

Specifies "keywords only".

c_nonkw_tokens CONSTANT VARCHAR2(1) := 'N';

Specifies "non-keywords only" or application-specific identifiers.

c_bi_tokens CONSTANT VARCHAR2(1) := 'B';

Specifies keywords that are builtins.

5.22.2 Specifying tokens of interest

PROCEDURE keep_all;

Specifies that when a PL/SQL string is parsed, all tokens are to be kept (stored in a PL/SQL table).

PROCEDURE keep_kw;

Specifies that when a PL/SQL string is parsed, only keywords are to be kept.

PROCEDURE keep_nonkw;

Specifies that when a PL/SQL string is parsed, only non-keywords are to be kept.

PROCEDURE keep_bi;

Specifies that when a PL/SQL string is parsed, only keywords that are builtins are to be kept.

PROCEDURE nokeep_all;

Specifies that when a PL/SQL string is parsed, all tokens are to be ignored.

PROCEDURE nokeep_kw;

Specifies that when a PL/SQL string is parsed, all keywords are to be ignored.

PROCEDURE nokeep_nonkw;

Specifies that when a PL/SQL string is parsed, only non-keywords are to be ignored.

PROCEDURE nokeep_bi;

Specifies that when a PL/SQL string is parsed, only builtin keywords are to be ignored.

5.22.3 Parsing PL/SQL source code

PROCEDURE init_table
(tokens_out IN OUT PLVtab.vc2000_table,
num_tokens_out IN OUT INTEGER);

Initializes (to empty) a PL/SQL table that will hold the parsed tokens.

PROCEDURE plsql_string
(line_in IN VARCHAR2,
tokens_out IN OUT PLVtab.vc2000_table,
num_tokens_out IN OUT INTEGER,
in_multiline_comment_out IN OUT BOOLEAN);

Parses a single line of code -- a PL/SQL string -- and deposits the separate tokens in the PL/SQL table. It also passes back a Boolean flag to indicate whether, at the end of this string, the code is within a multiline comment block.

PROCEDURE module
(module_in IN VARCHAR2 := NULL,
tokens_out IN OUT PLVtab.vc2000_table,
num_tokens_out IN OUT INTEGER);

Parses all the lines of code for the specified program.

PROCEDURE module
(tokens_out IN OUT PLVtab.vc2000_table,
num_tokens_out IN OUT INTEGER);

Parses all the lines of code for the current object as specified by the PLVobj package.


Previous: 5.21 PLVprs: String ParsingAdvanced Oracle PL/SQL Programming with PackagesNext: 5.23 PLVrb: Rollback Processing
5.21 PLVprs: String ParsingBook Index5.23 PLVrb: Rollback Processing

The Oracle Library Navigation

Copyright (c) 2000 O'Reilly & Associates. All rights reserved.

Library Home Oracle PL/SQL Programming, 2nd. Ed. Guide to Oracle 8i Features Oracle Built-in Packages Advanced PL/SQL Programming with Packages Oracle Web Applications Oracle PL/SQL Language Pocket Reference Oracle PL/SQL Built-ins Pocket Reference