indexing
description: "Mechanisms for building lexical analyzers from regular expressions."
legal: "See notice at end of class."
status: "See notice at end of class."
date: "$Date: 2006-01-22 18:25:44 -0800 (Sun, 22 Jan 2006) $"
revision: "$Revision: 56675 $"
class interface
METALEX
create
make
LEX_BUILDER
ensure LEX_BUILDER
last_character_set: last_character_code = last_ascii
make_extended (char_code: INTEGER_32)
`char_code'
LEX_BUILDER
require LEX_BUILDER
valid_char_code: char_code > 0
ensure LEX_BUILDER
last_character_set: last_character_code = char_code
feature
initialize
analyzer
LEX_BUILDER
ensure LEX_BUILDER
initialized
make
LEX_BUILDER
ensure LEX_BUILDER
last_character_set: last_character_code = last_ascii
pdfa_make (n, i: INTEGER_32)
`n'`i'
PDFA
array_make (min_index, max_index: INTEGER_32)
`min_index'`max_index'
`min_index'`max_index'
ARRAY
require ARRAY
valid_bounds: min_index <= max_index + 1
ensure ARRAY
lower_set: lower = min_index
upper_set: upper = max_index
items_set: all_default
make_analyzer
require
not_initialized: not initialized
ensure
initialized
analyzer_created: analyzer /= Void
lexical_frozen
make_extended (char_code: INTEGER_32)
`char_code'
LEX_BUILDER
require LEX_BUILDER
valid_char_code: char_code > 0
ensure LEX_BUILDER
last_character_set: last_character_code = char_code
make_from_array (a: ARRAY [LINKED_LIST [INTEGER_32]])
`a'
`ARRAY'
ARRAY
require ARRAY
array_exists: a /= Void
make_from_cil (na: NATIVE_ARRAY [like pdfa_item])
`na'
ARRAY
require ARRAY
is_dotnet: {PLATFORM}.is_dotnet
na_not_void: na /= Void
feature
ack: INTEGER_32 is 6
ASCII
ampersand: INTEGER_32 is 38
ASCII
analyzer: LEXICAL
LEX_BUILDER
area: SPECIAL [LINKED_LIST [INTEGER_32]]
TO_SPECIAL
back_space: INTEGER_32 is 8
ASCII
backslash: INTEGER_32 is 92
ASCII
bar: INTEGER_32 is 124
ASCII
bel: INTEGER_32 is 7
ASCII
blank: INTEGER_32 is 32
ASCII
break: INTEGER_32 is -7
ASCII
bs: INTEGER_32 is 8
ASCII
buf_overflow: INTEGER_32 is -9
ASCII
can: INTEGER_32 is 24
ASCII
carriage_return: INTEGER_32 is 13
ASCII
case_diff: INTEGER_32 is 32
Lower_aUpper_a
ASCII
case_sensitive: BOOLEAN
LEX_BUILDER
categories_table: ARRAY [INTEGER_32]
LEX_BUILDER
character_set_size: INTEGER_32 is 128
ASCII
circumflex: INTEGER_32 is 94
ASCII
closing_brace: INTEGER_32 is 125
ASCII
colon: INTEGER_32 is 58
ASCII
comma: INTEGER_32 is 44
ASCII
commercial_at: INTEGER_32 is 64
ASCII
cr: INTEGER_32 is 13
ASCII
ctrl_a: INTEGER_32 is 1
ASCII
ctrl_b: INTEGER_32 is 2
ASCII
ctrl_backslash: INTEGER_32 is 28
ASCII
ctrl_c: INTEGER_32 is 3
ASCII
ctrl_circumflex: INTEGER_32 is 30
ASCII
ctrl_d: INTEGER_32 is 4
ASCII
ctrl_e: INTEGER_32 is 5
ASCII
ctrl_f: INTEGER_32 is 6
ASCII
ctrl_g: INTEGER_32 is 7
ASCII
ctrl_h: INTEGER_32 is 8
ASCII
ctrl_i: INTEGER_32 is 9
ASCII
ctrl_j: INTEGER_32 is 10
ASCII
ctrl_k: INTEGER_32 is 11
ASCII
ctrl_l: INTEGER_32 is 12
ASCII
ctrl_lbracket: INTEGER_32 is 27
ASCII
ctrl_m: INTEGER_32 is 13
ASCII
ctrl_n: INTEGER_32 is 14
ASCII
ctrl_o: INTEGER_32 is 15
ASCII
ctrl_p: INTEGER_32 is 16
ASCII
ctrl_q: INTEGER_32 is 17
ASCII
ctrl_questmark: INTEGER_32 is 127
ASCII
ctrl_r: INTEGER_32 is 18
ASCII
ctrl_rbracket: INTEGER_32 is 29
ASCII
ctrl_s: INTEGER_32 is 19
ASCII
ctrl_t: INTEGER_32 is 20
ASCII
ctrl_u: INTEGER_32 is 21
ASCII
ctrl_underlined: INTEGER_32 is 31
ASCII
ctrl_v: INTEGER_32 is 22
ASCII
ctrl_w: INTEGER_32 is 23
ASCII
ctrl_x: INTEGER_32 is 24
ASCII
ctrl_y: INTEGER_32 is 25
ASCII
ctrl_z: INTEGER_32 is 26
ASCII
dc1: INTEGER_32 is 17
ASCII
dc2: INTEGER_32 is 18
ASCII
dc3: INTEGER_32 is 19
ASCII
dc4: INTEGER_32 is 20
ASCII
del: INTEGER_32 is 127
ASCII
dfa: FIXED_DFA
NDFA
dle: INTEGER_32 is 16
ASCII
dollar: INTEGER_32 is 36
ASCII
dot: INTEGER_32 is 46
ASCII
doublequote: INTEGER_32 is 34
ASCII
down_arrow: INTEGER_32 is -3
ASCII
eight: INTEGER_32 is 56
ASCII
em: INTEGER_32 is 25
ASCII
enq: INTEGER_32 is 5
ASCII
entry (i: INTEGER_32): LINKED_LIST [INTEGER_32]
`i'
ARRAY
require ARRAY
valid_key: valid_index (i)
eot: INTEGER_32 is 4
ASCII
equal_sign: INTEGER_32 is 61
ASCII
error_list: ERROR_LIST
LEX_BUILDER
esc: INTEGER_32 is 27
ASCII
etb: INTEGER_32 is 23
ASCII
etx: INTEGER_32 is 3
ASCII
exclamation: INTEGER_32 is 33
ASCII
final_array: ARRAY [INTEGER_32]
`final'
PDFA
first_printable: INTEGER_32 is 32
ASCII
five: INTEGER_32 is 53
ASCII
four: INTEGER_32 is 52
ASCII
fs: INTEGER_32 is 28
ASCII
generating_type: STRING_8
ANY
generator: STRING_8
ANY
grave_accent: INTEGER_32 is 96
ASCII
greaterthan: INTEGER_32 is 62
ASCII
greatest_input: INTEGER_32
AUTOMATON
gs: INTEGER_32 is 29
ASCII
has (v: LINKED_LIST [INTEGER_32]): BOOLEAN
`v'
object_comparison
ARRAY
ensure CONTAINER
not_found_in_empty: Result implies not is_empty
has_letters: BOOLEAN
PDFA
home_arrow: INTEGER_32 is -6
ASCII
ht: INTEGER_32 is 9
ASCII
input_array: ARRAY [FIXED_INTEGER_SET]
PDFA
item alias "[]" (i: INTEGER_32): LINKED_LIST [INTEGER_32] assign put
`i'
ARRAYinfix "@"
ARRAY
require TABLE
valid_key: valid_index (i)
require TO_SPECIAL
valid_index: valid_index (i)
keyword_h_table: HASH_TABLE [INTEGER_32, STRING_8]
LEX_BUILDER
keywords_case_sensitive: BOOLEAN
LEX_BUILDER
keywords_list: LINKED_LIST [STRING_8]
PDFA
last_ascii: INTEGER_32 is 127
ASCII
last_character_code: INTEGER_32
LEX_BUILDER
last_created_tool: INTEGER_32
LEX_BUILDER
last_printable: INTEGER_32 is 126
ASCII
lbracket: INTEGER_32 is 91
ASCII
lcurly: INTEGER_32 is 40
ASCII
left_arrow: INTEGER_32 is -4
ASCII
lessthan: INTEGER_32 is 60
ASCII
letter_layout: INTEGER_32 is 70
ASCII
lexical_frozen: BOOLEAN
LEX_BUILDER
line_feed: INTEGER_32 is 10
ASCII
lower_a: INTEGER_32 is 97
ASCII
lower_b: INTEGER_32 is 98
ASCII
lower_c: INTEGER_32 is 99
ASCII
lower_d: INTEGER_32 is 100
ASCII
lower_e: INTEGER_32 is 101
ASCII
lower_f: INTEGER_32 is 102
ASCII
lower_g: INTEGER_32 is 103
ASCII
lower_h: INTEGER_32 is 104
ASCII
lower_i: INTEGER_32 is 105
ASCII
lower_j: INTEGER_32 is 106
ASCII
lower_k: INTEGER_32 is 107
ASCII
lower_l: INTEGER_32 is 108
ASCII
lower_m: INTEGER_32 is 109
ASCII
lower_n: INTEGER_32 is 110
ASCII
lower_o: INTEGER_32 is 111
ASCII
lower_p: INTEGER_32 is 112
ASCII
lower_q: INTEGER_32 is 113
ASCII
lower_r: INTEGER_32 is 114
ASCII
lower_s: INTEGER_32 is 115
ASCII
lower_t: INTEGER_32 is 116
ASCII
lower_u: INTEGER_32 is 117
ASCII
lower_v: INTEGER_32 is 118
ASCII
lower_w: INTEGER_32 is 119
ASCII
lower_x: INTEGER_32 is 120
ASCII
lower_y: INTEGER_32 is 121
ASCII
lower_z: INTEGER_32 is 122
ASCII
minus: INTEGER_32 is 45
ASCII
nak: INTEGER_32 is 21
ASCII
nine: INTEGER_32 is 57
ASCII
nl: INTEGER_32 is 10
ASCII
np: INTEGER_32 is 12
ASCII
nul: INTEGER_32 is 0
ASCII
number_sign: INTEGER_32 is 35
ASCII
one: INTEGER_32 is 49
ASCII
opening_brace: INTEGER_32 is 123
ASCII
overflow: INTEGER_32 is -8
ASCII
percent: INTEGER_32 is 37
ASCII
plus: INTEGER_32 is 43
ASCII
questmark: INTEGER_32 is 63
ASCII
rbracket: INTEGER_32 is 93
ASCII
rcurly: INTEGER_32 is 41
ASCII
right_arrow: INTEGER_32 is -5
ASCII
rs: INTEGER_32 is 30
ASCII
selected_tools: LINKED_LIST [INTEGER_32]
LEX_BUILDER
semicolon: INTEGER_32 is 59
ASCII
seven: INTEGER_32 is 55
ASCII
si: INTEGER_32 is 15
ASCII
singlequote: INTEGER_32 is 39
ASCII
six: INTEGER_32 is 54
ASCII
slash: INTEGER_32 is 47
ASCII
so: INTEGER_32 is 14
ASCII
soh: INTEGER_32 is 1
ASCII
sp: INTEGER_32 is 32
ASCII
star: INTEGER_32 is 42
ASCII
start_number: INTEGER_32
AUTOMATON
stx: INTEGER_32 is 2
ASCII
sub: INTEGER_32 is 26
ASCII
syn: INTEGER_32 is 22
ASCII
tabulation: INTEGER_32 is 9
ASCII
three: INTEGER_32 is 51
ASCII
tilde: INTEGER_32 is 126
ASCII
token_type_list: LINKED_LIST [INTEGER_32]
LEX_BUILDER
tool_list: LINKED_LIST [PDFA]
LEX_BUILDER
tool_names: LINKED_LIST [STRING_8]
LEX_BUILDER
two: INTEGER_32 is 50
ASCII
underlined: INTEGER_32 is 95
ASCII
up_arrow: INTEGER_32 is -2
ASCII
upper_a: INTEGER_32 is 65
ASCII
upper_b: INTEGER_32 is 66
ASCII
upper_c: INTEGER_32 is 67
ASCII
upper_d: INTEGER_32 is 68
ASCII
upper_e: INTEGER_32 is 69
ASCII
upper_f: INTEGER_32 is 70
ASCII
upper_g: INTEGER_32 is 71
ASCII
upper_h: INTEGER_32 is 72
ASCII
upper_i: INTEGER_32 is 73
ASCII
upper_j: INTEGER_32 is 74
ASCII
upper_k: INTEGER_32 is 75
ASCII
upper_l: INTEGER_32 is 76
ASCII
upper_m: INTEGER_32 is 77
ASCII
upper_n: INTEGER_32 is 78
ASCII
upper_o: INTEGER_32 is 79
ASCII
upper_p: INTEGER_32 is 80
ASCII
upper_q: INTEGER_32 is 81
ASCII
upper_r: INTEGER_32 is 82
ASCII
upper_s: INTEGER_32 is 83
ASCII
upper_t: INTEGER_32 is 84
ASCII
upper_u: INTEGER_32 is 85
ASCII
upper_v: INTEGER_32 is 86
ASCII
upper_w: INTEGER_32 is 87
ASCII
upper_x: INTEGER_32 is 88
ASCII
upper_y: INTEGER_32 is 89
ASCII
upper_z: INTEGER_32 is 90
ASCII
us: INTEGER_32 is 31
ASCII
vt: INTEGER_32 is 11
ASCII
zero: INTEGER_32 is 48
ASCII
infix "@" (i: INTEGER_32): LINKED_LIST [INTEGER_32] assign put
`i'
ARRAY`item'
ARRAY
require TABLE
valid_key: valid_index (i)
require TO_SPECIAL
valid_index: valid_index (i)
feature
additional_space: INTEGER_32
RESIZABLE
ensure RESIZABLE
at_least_one: Result >= 1
capacity: INTEGER_32
ARRAYcount
ARRAY
require BOUNDED
True
ensure then ARRAY
consistent_with_bounds: Result = upper - lower + 1
count: INTEGER_32
ARRAYcapacity
ARRAY
require FINITE
True
ensure then ARRAY
consistent_with_bounds: Result = upper - lower + 1
growth_percentage: INTEGER_32 is 50
RESIZABLE
index_set: INTEGER_INTERVAL
ARRAY
require INDEXABLE
True
ensure INDEXABLE
not_void: Result /= Void
ensure then ARRAY
same_count: Result.count = count
same_bounds: ((Result.lower = lower) and (Result.upper = upper))
lower: INTEGER_32
ARRAY
minimal_increase: INTEGER_32 is 5
RESIZABLE
nb_states: INTEGER_32
AUTOMATON
occurrences (v: LINKED_LIST [INTEGER_32]): INTEGER_32
`v'
ARRAY
ensure BAG
non_negative_occurrences: Result >= 0
upper: INTEGER_32
ARRAY
feature
frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
shallow_implies_deep: standard_equal (some, other) implies Result
both_or_none_void: (some = Void) implies (Result = (other = Void))
same_type: (Result and (some /= Void)) implies some.same_type (other)
symmetric: Result implies deep_equal (other, some)
frozen equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))
is_equal (other: like Current): BOOLEAN
`other'
ARRAY
require ANY
other_not_void: other /= Void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))
frozen standard_is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
same_type: Result implies same_type (other)
symmetric: Result implies other.standard_is_equal (Current)
feature
all_default: BOOLEAN
ARRAY
ensure ARRAY
definition: Result = (count = 0 or else ((pdfa_item (upper) = Void or else pdfa_item (upper) = pdfa_item (upper).default) and subarray (lower, upper - 1).all_default))
changeable_comparison_criterion: BOOLEAN
object_comparison
CONTAINER
conforms_to (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
extendible: BOOLEAN
ARRAY
full: BOOLEAN
ARRAY
require BOX
True
is_empty: BOOLEAN
FINITE
require CONTAINER
True
is_inserted (v: LINKED_LIST [INTEGER_32]): BOOLEAN
`v'
`has (v)'
COLLECTION
object_comparison: BOOLEAN
equal`='
`='
CONTAINER
prunable: BOOLEAN
ARRAY
resizable: BOOLEAN
capacity
RESIZABLE
same_items (other: like Current): BOOLEAN
`other'
ARRAY
require ARRAY
other_not_void: other /= Void
ensure ARRAY
definition: Result = ((count = other.count) and then (count = 0 or else (pdfa_item (upper) = other.pdfa_item (other.upper) and subarray (lower, upper - 1).same_items (other.subarray (other.lower, other.upper - 1)))))
same_type (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
definition: Result = (conforms_to (other) and other.conforms_to (Current))
valid_index (i: INTEGER_32): BOOLEAN
`i'
ARRAY
require TABLE
True
require TO_SPECIAL
True
ensure then INDEXABLE
only_if_in_index_set: Result implies ((i >= index_set.lower) and (i <= index_set.upper))
valid_index_set: BOOLEAN
ARRAY
feature
compare_objects
equal
`='
CONTAINER
require CONTAINER
changeable_comparison_criterion: changeable_comparison_criterion
ensure CONTAINER
object_comparison
compare_references
`='
equal
CONTAINER
require CONTAINER
changeable_comparison_criterion: changeable_comparison_criterion
ensure CONTAINER
reference_comparison: not object_comparison
set_e_transition (source, target: INTEGER_32)
`source'`target'
PDFA
require NDFA
source_in_automaton: source >= 1 and source <= nb_states
target_in_automaton: target >= 1 and target <= nb_states
set_final (s, r: INTEGER_32)
`s'`r'
PDFA
set_letters
PDFA
set_start (n: INTEGER_32)
`n'
AUTOMATON
require AUTOMATON
no_other_start: start_number = 0 or start_number = n
is_in_automaton: n <= nb_states and n >= 1
set_transition (source, input_doc, target: INTEGER_32)
`source'`target'`input_doc'
PDFA
require AUTOMATON
True
require else NDFA
source_in_automaton: source >= 1 and source <= nb_states
target_in_automaton: target >= 1 and target <= nb_states
possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
require else PDFA
source_in_automaton: source >= 1 and source <= nb_states
target_in_automaton: target >= 1 and target <= nb_states
possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
good_successor: target = source + 1
feature
add_keyword (word: STRING_8)
`word'
PDFA
add_word (s: STRING_8; n: INTEGER_32)
`s'
`n'
require
s_not_void: s /= Void
s_not_empty: s.capacity >= 1
any_character
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
any_printable
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
append (p, s: INTEGER_32)
`p'`s'
`s'`p'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
p_in_tool: p >= 1 and p <= last_created_tool
s_in_tool: s >= 1 and s <= last_created_tool
append_optional (p, s: INTEGER_32)
`p'
`s'`p'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
p_in_tool: p >= 1 and p <= last_created_tool
s_in_tool: s >= 1 and s <= last_created_tool
associate (t, n: INTEGER_32)
`t'`n'
`t'
LEX_BUILDER
require LEX_BUILDER
t_selected: selected_tools.has (t)
n_not_zero: n /= 0
n_not_minus_one: n /= -1
build_dollar_any
HIGH_BUILDER
require HIGH_BUILDER
good_first_character: description.item (cursor) = '.'
build_dollar_b
HIGH_BUILDER
build_dollar_n
HIGH_BUILDER
build_dollar_p
HIGH_BUILDER
require HIGH_BUILDER
good_first_character: description.item (cursor) = 'P'
build_dollar_r
HIGH_BUILDER
build_dollar_z
HIGH_BUILDER
case_insensitive (c: INTEGER_32)
`c'
`c'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
z_possible: last_character_code >= lower_z
c_in_tool: c >= 1 and c <= last_created_tool
difference (r: INTEGER_32; c: CHARACTER_8)
`r'`c'
`r'`a'`z'
`a'`z'`0'`9'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
r_exists: r >= 1 and r <= last_created_tool
r_simple_category: tool_list.i_th (r).nb_states = 2
enter (v: like pdfa_item; i: INTEGER_32)
`i'`v'
ARRAY
require ARRAY
valid_key: valid_index (i)
fill (other: CONTAINER [LINKED_LIST [INTEGER_32]])
`other'
`other'
COLLECTION
require COLLECTION
other_not_void: other /= Void
extendible: extendible
force (v: like pdfa_item; i: INTEGER_32)
`v'`i'
`i'
ARRAY
ensure ARRAY
inserted: pdfa_item (i) = v
higher_count: count >= old count
include (fa: PDFA; shift: INTEGER_32)
`fa'
`shift'
`final'
PDFA
require PDFA
same_inputs: greatest_input = fa.greatest_input
nb_states_large_enough: nb_states >= fa.nb_states + shift
interval (b, e: CHARACTER_8)
`b'`e'`b'`b'`e'
LEX_BUILDER
require LEX_BUILDER
not_built: not lexical_frozen
e_code_small_enough: e.code <= last_character_code
b_code_large_enough: b.code >= 0
b_before_e: b.code <= e.code
iteration (c: INTEGER_32)
`c'
`c'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
c_in_tool: c >= 1 and c <= last_created_tool
iteration1 (c: INTEGER_32)
`c'
`c'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
c_in_tool: c >= 1 and c <= last_created_tool
iteration_n (n, c: INTEGER_32)
`n'`c'
`n'`c'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
n_large_enough: n > 0
c_in_tool: c >= 1 and c <= last_created_tool
optional (c: INTEGER_32)
`c'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
c_in_tool: c >= 1 and c <= last_created_tool
prepend_optional (p, s: INTEGER_32)
`s'
`s'`p'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
p_in_tool: p >= 1 and p <= last_created_tool
s_in_tool: s >= 1 and s <= last_created_tool
pdfa_put (v: like pdfa_item; i: INTEGER_32)
`i'`v'
ARRAY
require TABLE
valid_key: valid_index (i)
require TO_SPECIAL
valid_index: valid_index (i)
ensure then INDEXABLE
insertion_done: pdfa_item (i) = v
ensure TO_SPECIAL
inserted: pdfa_item (i) = v
put_expression (s: STRING_8; n: INTEGER_32; c: STRING_8)
`s'
`n'`c'
require
source_long_enough: s.capacity > 0
put_keyword (s: STRING_8; exp: INTEGER_32)
`s'
`exp'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
exp_selected: token_type_list /= Void and then token_type_list.has (exp)
put_nameless_expression (s: STRING_8; n: INTEGER_32)
`s'`n'
HIGH_BUILDER
require HIGH_BUILDER
source_long_enough: s.count > 0
recognize (s: STRING_8): INTEGER_32
`s'
LEX_BUILDER
remove_case_sensitiveness
PDFA
require PDFA
z_possible: greatest_input >= lower_z
select_tool (i: INTEGER_32)
`i'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
i_exist: i > 0 and i <= last_created_tool
ensure LEX_BUILDER
i_selected: selected_tools.has (i)
set_word (word: STRING_8)
`word'
`w'`o'`r'`d'
LEX_BUILDER
require LEX_BUILDER
word_not_empty: word.count >= 1
subcopy (other: ARRAY [like pdfa_item]; start_pos, end_pos, index_pos: INTEGER_32)
`other'`start_pos'`end_pos'
`index_pos'
ARRAY
require ARRAY
other_not_void: other /= Void
valid_start_pos: other.valid_index (start_pos)
valid_end_pos: other.valid_index (end_pos)
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
valid_index_pos: valid_index (index_pos)
enough_space: (upper - index_pos) >= (end_pos - start_pos)
union (a, b: INTEGER_32)
`a'`a'`b'
`a'`a'`b'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
a_not_too_small: a >= 1
b_not_too_large: b <= last_created_tool
a_smaller_than_b: a <= b
union2 (a, b: INTEGER_32)
`a'`b'
`a'`b'`a'`b'
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
a_in_tool: a >= 1 and a <= last_created_tool
b_in_tool: b >= 1 and b <= last_created_tool
up_to (word: STRING_8)
`word'
`word'
LEX_BUILDER
require LEX_BUILDER
word_not_empty: word.count > 0
not_frozen: not lexical_frozen
feature
clear_all
ARRAY
ensure ARRAY
stable_lower: lower = old lower
stable_upper: upper = old upper
default_items: all_default
delete_transition (source, input_doc, target: INTEGER_32)
`source'`target'`input_doc'
PDFA
require NDFA
source_in_automaton: source >= 1 and source <= nb_states
target_in_automaton: target >= 1 and target <= nb_states
possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
require else PDFA
source_in_automaton: source >= 1 and source <= nb_states
target_in_automaton: target >= 1 and target <= nb_states
possible_input_doc: input_doc >= 0 and input_doc <= greatest_input
good_successor: target = source + 1
discard_items
ARRAY
ensure ARRAY
default_items: all_default
prune_all (v: LINKED_LIST [INTEGER_32])
`v'
object_comparison
COLLECTION
require COLLECTION
prunable: prunable
ensure COLLECTION
no_more_occurrences: not has (v)
remove
LEX_BUILDER
require LEX_BUILDER
not_frozen: not lexical_frozen
at_least_one_regular: last_created_tool >= 1
feature
automatic_grow
Growth_percentage
RESIZABLE
ensure RESIZABLE
increased_capacity: capacity >= old capacity + old capacity * growth_percentage // 100
conservative_resize (min_index, max_index: INTEGER_32)
`min_index'`max_index'
ARRAY
require ARRAY
good_indices: min_index <= max_index
ensure ARRAY
no_low_lost: lower = min_index or else lower = old lower
no_high_lost: upper = max_index or else upper = old upper
grow (i: INTEGER_32)
`i'
ARRAY
ensure RESIZABLE
new_capacity: capacity >= i
feature
construct_dfa
NDFA
require NDFA
start_number_designated: start_number > 0
feature
linear_representation: LINEAR [LINKED_LIST [INTEGER_32]]
ARRAY
to_cil: NATIVE_ARRAY [LINKED_LIST [INTEGER_32]]
ARRAY
require ARRAY
is_dotnet: {PLATFORM}.is_dotnet
ensure ARRAY
to_cil_not_void: Result /= Void
to_special: SPECIAL [LINKED_LIST [INTEGER_32]]
ARRAY
ensure ARRAY
to_special_not_void: Result /= Void
feature
copy (other: like Current)
`other'
clone
ARRAY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
ensure then ARRAY
equal_areas: area.is_equal (other.area)
frozen deep_copy (other: like Current)
copy`other'deep_twin
ANY
require ANY
other_not_void: other /= Void
ensure ANY
deep_equal: deep_equal (Current, other)
frozen deep_twin: like Current
ANY
ensure ANY
deep_equal: deep_equal (Current, Result)
frozen standard_copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_standard_equal: standard_is_equal (other)
frozen standard_twin: like Current
`other'
ANY
ensure ANY
standard_twin_not_void: Result /= Void
equal: standard_equal (Result, Current)
subarray (start_pos, end_pos: INTEGER_32): ARRAY [LINKED_LIST [INTEGER_32]]
`start_pos'`end_pos'
ARRAY
require ARRAY
valid_start_pos: valid_index (start_pos)
valid_end_pos: end_pos <= upper
valid_bounds: (start_pos <= end_pos) or (start_pos = end_pos + 1)
ensure ARRAY
lower: Result.lower = start_pos
upper: Result.upper = end_pos
frozen twin: like Current
`Current'
twincopycopy
ANY
ensure ANY
twin_not_void: Result /= Void
is_equal: Result.is_equal (Current)
feature
frozen default: like Current
ANY
frozen default_pointer: POINTER
`POINTER'
`p'default
`p'`POINTER'
ANY
default_rescue
ANY
frozen do_nothing
ANY
feature
cursor: INTEGER_32
HIGH_BUILDER
description: STRING_8
HIGH_BUILDER
initialized: BOOLEAN
LEX_BUILDER
feature
no_token: INTEGER_32 is 0
read_grammar (token_file_name: STRING_8)
`token_file_name'
`name'`regular_expression'
ensure
analyzer_exists: analyzer /= Void
feature {ANY}
retrieve_analyzer (file_name: STRING_8)
analyzer`file_name'
LEX_BUILDER
feature
do_all (action: PROCEDURE [ANY, TUPLE [LINKED_LIST [INTEGER_32]]])
`action'
`action'
ARRAY
require ARRAY
action_not_void: action /= Void
do_if (action: PROCEDURE [ANY, TUPLE [LINKED_LIST [INTEGER_32]]]; test: FUNCTION [ANY, TUPLE [LINKED_LIST [INTEGER_32]], BOOLEAN])
`action'`test'
`action'`test'
ARRAY
require ARRAY
action_not_void: action /= Void
test_not_void: test /= Void
for_all (test: FUNCTION [ANY, TUPLE [LINKED_LIST [INTEGER_32]], BOOLEAN]): BOOLEAN
`test'
ARRAY
require ARRAY
test_not_void: test /= Void
there_exists (test: FUNCTION [ANY, TUPLE [LINKED_LIST [INTEGER_32]], BOOLEAN]): BOOLEAN
`test'
ARRAY
require ARRAY
test_not_void: test /= Void
feature {ANY}
store_analyzer (file_name: STRING_8)
analyzer`file_name'
LEX_BUILDER
require LEX_BUILDER
initialized: initialized
feature
io: STD_FILES
ANY
out: STRING_8
ANYtagged_out
ANY
print (some: ANY)
`some'
ANY
frozen tagged_out: STRING_8
ANYout
ANY
trace
PDFA
feature
operating_environment: OPERATING_ENVIRONMENT
ANY
feature
distinguish_case
LEX_BUILDER
ensure LEX_BUILDER
case_sensitive
ignore_case
LEX_BUILDER
ensure LEX_BUILDER
not case_sensitive
keywords_distinguish_case
LEX_BUILDER
require LEX_BUILDER
no_tool_built: tool_list.is_empty
ensure LEX_BUILDER
keywords_case_sensitive
keywords_ignore_case
LEX_BUILDER
require LEX_BUILDER
no_tools_built: tool_list = Void or else tool_list.is_empty
ensure LEX_BUILDER
not keywords_case_sensitive
invariant
HIGH_BUILDER
cursor_not_too_far: cursor <= description_length
LEX_BUILDER
last_created: tool_list = Void or else last_created_tool = tool_list.count
ARRAY
area_exists: area /= Void
consistent_size: capacity = upper - lower + 1
non_negative_count: count >= 0
index_set_has_same_count: valid_index_set
RESIZABLE
increase_by_at_least_one: minimal_increase >= 1
BOUNDED
valid_count: count <= capacity
full_definition: full = (count = capacity)
FINITE
empty_definition: is_empty = (count = 0)
non_negative_count: count >= 0
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
INDEXABLE
index_set_not_void: index_set /= Void
indexing
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
356 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end METALEX