5.16. PLVlex: Lexical Analysis

The PLVlex (PL/Vision LEXical analysis) package provides generic string-parsing extensions to PL/SQL; these extensions include an awareness of the syntax and delimiters of the PL/SQL language. See the companion disk (see http://examples.oreilly.com/advoracle) for details.

5.16.1. Analyzing PL/SQL string content

FUNCTION is_delimiter (character_in IN VARCHAR2, exclude_in IN VARCHAR2 := NULL) 
RETURN BOOLEAN;

Returns TRUE if the string is a PL/SQL delimiter.

FUNCTION is_oneline_comment (token_in IN VARCHAR2) RETURN BOOLEAN;

Returns TRUE if the string is a single-line comment indicator (a double hyphen).

FUNCTION starts_multiline_comment (token_in IN VARCHAR2)
RETURN BOOLEAN;

Returns TRUE if the string is equal to /*, which signals the start of a multiline or block comment.

FUNCTION ends_multiline_comment (token_in IN VARCHAR2)
RETURN BOOLEAN;

Returns TRUE if the string is equal to */, which signals the end of a multiline or block comment.

5.16.2. Scanning PL/SQL strings

FUNCTION next_atom_loc
    (string_in IN VARCHAR2, start_loc_in IN NUMBER)
RETURN NUMBER;

Returns the location of the beginning of the next PL/SQL atomic in the string.

PROCEDURE get_next_atomic
     (line_in IN VARCHAR2,
     start_pos_in IN VARCHAR2,
     atomic_out OUT VARCHAR2,
     new_start_pos_out OUT INTEGER,
     line_len_in IN INTEGER := NULL);

Gets the next PL/SQL atomic from the string. This procedure builds upon PLVlex.next_atom_loc and several low-level PLVprs functions to scan the ...

Get Advanced Oracle PL/SQL Programming with Packages now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.