INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "SQL parsing features"
project: "Visual Eiffel"
revision: "$Revision: 1.1 $"
copyright: "Copyright (C) 1996-2005 Object Tools Group"
license: "http://visual-eiffel.com/license"
cluster: dale
class SQL_PARSER
inherit

DALE_SERVER
end
feature -- Attributes:

last_string: STRING

array: ARRAY [STRING]
feature -- Commands:

string_to_composed_name (s: STRING; cnt: INTEGER; q, o, c, n, qs: STRING; qe: BOOLEAN)
-- parse 's' exposing name, container, owner and qualifier
require
valid_string: s /= void and then not s.is_empty
valid_attr_count: 1 <= cnt and then cnt <= 4
valid_name: n /= void
valid_separator: q /= void implies (qs /= void and then not qs.is_empty)

composed_name_to_string (q, o, c, n, qs: STRING; qe: BOOLEAN)
-- compose name from components; result will be in 'last_string'
require
valid_name: n /= void
valid_separator: q /= void implies (qs /= void and then not qs.is_empty)

string_to_item_list (s: STRING)
-- creates items of this comma-delimited list; in the 'last_string'
-- it will be the origin SQL string with liberated "noise";
-- note, that quoted literals are taken as a whole
-- TEMPORARY RESTRICTION: "noise" brackets can't be enclosed
require
valid_string: s /= void and then not s.is_empty

item_list_to_string (a: ARRAY [STRING])
-- converts item list to comma-delimited list
require
valid_list: a /= void and then a.lower = 1

expose_alias_name (s: STRING): STRING
-- expose alias name; returns Void if there is no alias name
-- 'last_string' then contains this name without its alias
-- RESTRICTED VERSION: alway returns Void
require
valid_string: s /= void and then not s.is_empty

expose_parameters (s: STRING; begin_c, end_c: CHARACTER)
-- parses SQL string, exposing parameter lists which will be
-- in 'parameters', resulting SQL string will be in 'last_string'
require
valid_string: s /= void and not s.is_empty
feature -- Validations:

valid_composed_name_part (s: STRING): BOOLEAN
-- returns True
require
not_void: s /= void

valid_parameter_name (s: STRING): BOOLEAN
-- returns True only if 's' is valid parameter name, i.e.
-- contains only 'a'-'z', 'A'-'Z', '0'-'9', '_', '@', '#' or '$'
-- and starts from a letter
require
valid_string: s /= void

valid_identifier (s: STRING): BOOLEAN
-- returns True if 's' starts from a letter and contains
-- only contains only 'a'-'z', 'A'-'Z', '0'-'9', '^', '#', '$',
-- '@' or '_'
require
valid_string: s /= void
end -- class SQL_PARSER

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES