class BACKTRACKING_REGULAR_EXPRESSION
Summary
Matcher for regular expressions
Direct parents
Inherit list: BACKTRACKING, REGULAR_EXPRESSION
Insert list: REGULAR_EXPRESSION_STRING_SCANNER
Class invariant
Overview
Creation features
{ANY}
Features
common
{ANY}
creation
{ANY}
backtracked search
{}
context management
{REGULAR_EXPRESSION_ITEM}
group facilities
{REGULAR_EXPRESSION_ITEM}
advancing the scan
{REGULAR_EXPRESSION_ITEM}
advancing the scan
{REGULAR_EXPRESSION_ITEM}
matching facilities
{REGULAR_EXPRESSION_ITEM}
positional predicates
{REGULAR_EXPRESSION_ITEM}
{ANY}
internal
{}
Common client features
{ANY}
Control of the exploration
{ANY}
Internal
{}
Specific to sequences
{ABSTRACT_BACKTRACKING_SEQUENCE}
Specific to alternatives
{ABSTRACT_BACKTRACKING_ALTERNATIVE}
internal: allocation and collection
{}
{ANY}
the pools
{ANY}
matching capabilities
{ANY}
substitution capabilities
{ANY}
Error informations
{ANY}
{}
{}
basic
{ANY}
error management
{ANY}
scanning
{ANY}
set_scanned_string (string: ABSTRACT_STRING)
effective procedure
{ANY}
Set 'scanned_string' to 'string'.
last_match_succeeded: BOOLEAN
writable attribute
{ANY}
True if the last match (match_first or match_next) operation was a success.
group_count: INTEGER_32
writable attribute
{ANY}
The count of groups
invalidate_last_match
effective procedure
{ANY}
Used to prevent 2 substitutions without intermediate matching.
basic_match_first
effective procedure
{ANY}
Starts to match and try to find the first substring of 'scanned_string' that matches the regular expression.
basic_match_next
effective procedure
{ANY}
Continues to match and try to find the next substring of 'scanned_string' that matches the regular expression.
match_from (text: ABSTRACT_STRING, first_index: INTEGER_32): BOOLEAN
effective function
{ANY}
Returns True if Current regular_expression can match the text starting from first_index.
matches_only_current_position: BOOLEAN
writable attribute
{ANY}
Does the matching occur only from current position?
set_matches_only_current_position (value: BOOLEAN)
effective procedure
{ANY}
Sets 'matches_only_current_position' to 'value'.
make
effective procedure
{ANY}
Creation.
effective procedure
{ANY}
Set the matched pattern.
root_node: BACKTRACKING_NODE
writable attribute
{}
The regular expression to be matched.
do_match
effective procedure
{}
Main matching routine.
context_type_frame: INTEGER_32
is -1
constant attribute
context_frame_cut: INTEGER_32
is -2
constant attribute
writable attribute
context_top: INTEGER_32
writable attribute
context_clear
effective procedure
Clear any saved context.
context_push
effective procedure
Push the current context.
context_restore
effective procedure
Restore the context to the last saved one.
context_restore_and_pop
effective procedure
Restore the context to the last saved one and drop it.
context_cut
effective procedure
Remove the last saved context.
set_group_first_index (group: INTEGER_32)
effective procedure
Records the beginning of a group.
set_group_last_index (group: INTEGER_32)
effective procedure
Records the end of a group.
clear_group (group: INTEGER_32)
effective procedure
Set 'group' to empty string.
clear_all_groups
effective procedure
Set all groups to empty string.
saved_look_position: INTEGER_32
writable attribute
the saved position for look ahead or look behind
begin_look_ahead
effective procedure
Begins to look-ahead.
end_look_ahead
effective procedure
Terminates to look-ahead.
begin_look_behind
effective procedure
Begins to look-behind.
end_look_behind
effective procedure
Terminates to look-behind.
direction: INTEGER_32
writable attribute
direction to advance (normal is +1, inverse is -1)
advance
effective procedure
Goes to the next character
advance_end_of_line
effective procedure
Skips the end of line.
match_character (char: CHARACTER)
effective procedure
If the character 'char' matches then advance and continue else backtrack.
match_character_no_case (char: CHARACTER)
effective procedure
If the character 'char' matches then advance and continue else backtrack.
match_string (text: STRING)
effective procedure
If the string 'text' matches then advance and continue else backtrack.
match_string_no_case (text: STRING)
effective procedure
If the string 'text' matches then advance and continue else backtrack.
match_previous_group (group: INTEGER_32)
effective procedure
If the previous 'group' matches then advance and continue else backtrack.
match_previous_group_no_case (group: INTEGER_32)
effective procedure
If the previous 'group' matches then advance and continue else backtrack.
is_begin_of_text: BOOLEAN
effective function
True if at begin of the text
is_end_of_text (really: BOOLEAN): BOOLEAN
effective function
True if at end of the text
is_begin_of_line: BOOLEAN
effective function
True if at begin of a line
is_end_of_line: BOOLEAN
effective function
True if at end of a line
is_begin_of_word: BOOLEAN
effective function
True if at begin of a word
is_end_of_word: BOOLEAN
effective function
True if at end of a word
set_current_node (node: BACKTRACKING_NODE)
effective procedure
{ANY}
Sets the next node of the BACKTRACKING_NODE graph to evaluate.
push_and (node: BACKTRACKING_NODE)
effective procedure
{ANY}
Pushes node in front of the continuation path.
push_and_list (list: BACKTRACKING_NODE_AND_LIST)
effective procedure
{ANY}
Pushes list in front of the continuation path.
push_or (node: BACKTRACKING_NODE)
effective procedure
{ANY}
Pushes node in front of the possible alternatives.
push_or_list (list: BACKTRACKING_NODE_OR_LIST)
effective procedure
{ANY}
Pushes list in front of the possible alternatives.
current_node: BACKTRACKING_NODE
writable attribute
{}
Current node of the BACKTRACKING_NODE graph to be evaluated.
evaluate_current_state
effective procedure
{}
That feature is called to evaluate the current state
search_first
effective procedure
{ANY}
Resets all and searches the first solution.
search_next
effective procedure
{ANY}
Searches the next solution.
search_is_success: BOOLEAN
writable attribute
{ANY}
True when search is successful
is_off: BOOLEAN
effective function
{ANY}
True when search is finished
clear
effective procedure
{ANY}
Clears the current state to nothing.
is_cleared: BOOLEAN
effective function
{ANY}
True if no partial data remain in the current state
push_sequence (sequence: ABSTRACT_BACKTRACKING_SEQUENCE)
effective procedure
{ANY}
Pushes the sequence in front of the continuation path.
push_alternative (alternative: ABSTRACT_BACKTRACKING_ALTERNATIVE)
effective procedure
{ANY}
Pushes the alternative before the continuation path.
continue
effective procedure
{ANY}
Continues the exploration of the current path.
backtrack
effective procedure
{ANY}
Stops the exploration of the current path and tries to explore the next alternative path.
push_cut_point
effective procedure
{ANY}
Inserts a cut point into the continuation path.
cut
effective procedure
{ANY}
Removes the alternatives until the one recorded by the next cut point in the continuation path.
cut_all
effective procedure
{ANY}
Cuts all alternatives.
stop_search_loop: BOOLEAN
writable attribute
{}
True if at the end of a search.
search
effective procedure
{}
Common search loop to search_first and search_next
cut_until (alternative: ABSTRACT_BACKTRACKING_ALTERNATIVE)
effective procedure
{}
Cut all alternatives until 'alternative'.
Stack of sequences represented by its top (can be Void)
current_continuation: ABSTRACT_BACKTRACKING_SEQUENCE
writable attribute
The current continuation path
pop_sequence
effective procedure
Removes the current sequence and replace it by the next sequence in the continuation path.
Stack of alternatives represented by its top (can be Void)
continue_alternative
effective procedure
Returns to the alternative on the top of the stack and put its saved continuation path as the current continuation path.
pop_alternative
effective procedure
Returns to the alternative on the top of the stack and put its saved continuation path as the current continuation path.
remove_top_sequence
effective procedure
{}
Removes the top sequence.
remove_top_alternative
effective procedure
{}
Removes the top alternative.
once function
{ANY}
Bank of cut points
once function
{ANY}
pool_of_sequence_list: BACKTRACKING_POOL_OF_SEQUENCE_LIST
once function
{ANY}
pool_of_alternative: BACKTRACKING_POOL_OF_ALTERNATIVE
once function
{ANY}
pool_of_alternative_list: BACKTRACKING_POOL_OF_ALTERNATIVE_LIST
once function
{ANY}
match (text: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Returns True if Current regular_expression can match the text.
match_next (text: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Returns True if Current regular_expression can match the same text one more time.
last_match_first_index: INTEGER_32
effective function
{ANY}
The starting position in the text where starts the sub-string who is matching the whole pattern.
last_match_last_index: INTEGER_32
effective function
{ANY}
The last position in the text where starts the sub-string who is matching the whole pattern.
last_match_count: INTEGER_32
effective function
{ANY}
Length of the string matching the whole pattern.
group_names: TRAVERSABLE[FIXED_STRING]
effective function
{ANY}
The names of the matched named group.
has_group_name (name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Is there a group names name?
ith_group_matched (i: INTEGER_32): BOOLEAN
effective function
{ANY}
Did the ith group match during last match?
named_group_matched (name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Did the group named name match during the last match?
ith_group_first_index (i: INTEGER_32): INTEGER_32
effective function
{ANY}
First index in the last matching text of the ith group.
named_group_first_index (name: ABSTRACT_STRING): INTEGER_32
effective function
{ANY}
First index in the last matching text of the group named name.
ith_group_last_index (i: INTEGER_32): INTEGER_32
effective function
{ANY}
Last index in the last matching text of the ith group.
named_group_last_index (name: ABSTRACT_STRING): INTEGER_32
effective function
{ANY}
Last index in the last matching text of the group named name.
ith_group_count (i: INTEGER_32): INTEGER_32
effective function
{ANY}
Length of the ith group of Current in the last matching.
named_group_count (name: ABSTRACT_STRING): INTEGER_32
effective function
{ANY}
Length of the group named name in the last matching.
for_all_matched_named_groups (text: ABSTRACT_STRING, action: PROCEDURE[TUPLE 2[FIXED_STRING, STRING]])
effective procedure
{ANY}
Call the action for each group that matched during the last match.
append_heading_text (text: ABSTRACT_STRING, buffer: STRING)
effective procedure
{ANY}
Append in buffer the text before the matching area.
append_pattern_text (text: ABSTRACT_STRING, buffer: STRING)
effective procedure
{ANY}
Append in buffer the text matching the pattern.
append_tailing_text (text: ABSTRACT_STRING, buffer: STRING)
effective procedure
{ANY}
Append in buffer the text after the matching area.
append_ith_group (text: ABSTRACT_STRING, buffer: STRING, i: INTEGER_32)
effective procedure
{ANY}
Append in buffer the text of the ith group.
append_named_group (text: ABSTRACT_STRING, buffer: STRING, name: ABSTRACT_STRING)
effective procedure
{ANY}
Append in buffer the text of the group named name.
named_group_value (text: ABSTRACT_STRING, name: ABSTRACT_STRING): STRING
effective function
{ANY}
Returns the text of the group named name (always the same STRING!)
prepare_substitution (p: ABSTRACT_STRING)
effective procedure
{ANY}
Set pattern p for substitution.
last_substitution: STRING
effective function
{ANY}
You need to copy this STRING if you want to keep it.
substitute_for (text: ABSTRACT_STRING)
effective procedure
{ANY}
This call has to be preceded by a successful matching on the same text.
substitute_in (text: STRING)
effective procedure
{ANY}
This call has to be preceded by a successful matching on the same text.
substitute_all_for (text: ABSTRACT_STRING)
effective procedure
{ANY}
Every matching part is substituted.
substitute_all_in (text: STRING)
effective procedure
{ANY}
Every matching part is substituted.
can_substitute: BOOLEAN
effective function
{ANY}
Substitution is only allowed when some valid substitution pattern has been registered and after a successful pattern matching.
substitution_pattern_ready: BOOLEAN
writable attribute
{ANY}
True if some valid substitution pattern has been registered.
pattern_error_message: STRING
writable attribute
{ANY}
Error message for the substitution pattern.
pattern_error_position: INTEGER_32
writable attribute
{ANY}
Error position in the substitution pattern.
save_matching_text (text: ABSTRACT_STRING): BOOLEAN
effective function
{}
Used in assertion only.
valid_substrings (text: ABSTRACT_STRING): BOOLEAN
effective function
{}
Used in assertion only.
valid_substitution: BOOLEAN
effective function
{}
Used in assertion only.
substitute_all_without_tail (text: ABSTRACT_STRING): INTEGER_32
effective function
{}
Substitute all matching parts from text.
substrings_first_indexes: ARRAY[INTEGER_32]
writable attribute
{}
Item(0) is the starting position in the text where starts the substring who is matching the whole pattern.
substrings_last_indexes: ARRAY[INTEGER_32]
writable attribute
{}
The ending position of the string starting at position found in matching_position at the same index.
writable attribute
{}
The names of the groups, if those names exist
group_names_memory: COLLECTION[FIXED_STRING]
writable attribute
{}
Cache for group_names
substitution_pattern: STRING
once function
{}
compiled_substitution_pattern: FAST_ARRAY[INTEGER_32]
writable attribute
{}
This array describe the substitution text as a suite of strings from substrings_first_indexes.
last_match_text: STRING
effective function
{}
For assertion only.
set_group_names_memory
effective procedure
{}
last_match_text_memory: STRING
writable attribute
{}
For assertion only.
last_substitution_memory: STRING
writable attribute
{}
_inline_agent38 (s: FIXED_STRING): BOOLEAN
frozen
effective function
{}
_inline_agent39 (s: FIXED_STRING): BOOLEAN
frozen
effective function
{}
_inline_agent40 (s: FIXED_STRING): BOOLEAN
frozen
effective function
{}
_inline_agent41 (i: INTEGER_32, s: FIXED_STRING): BOOLEAN
frozen
effective function
{}
scanned_string: ABSTRACT_STRING
writable attribute
{ANY}
The expression being currently build.
has_error: BOOLEAN
writable attribute
{ANY}
True when an error was encountered
clear_error
effective procedure
{ANY}
Remove the error flag
last_error: STRING
effective function
{ANY}
Returns a string recorded for the error.
set_error (message: STRING)
effective procedure
{ANY}
Set has_error and last_error.
position: INTEGER_32
writable attribute
{ANY}
The scanned position.
last_character: CHARACTER
writable attribute
{ANY}
The scanned character.
valid_last_character: BOOLEAN
writable attribute
{ANY}
True when 'last_character' is valid.
valid_previous_character: BOOLEAN
effective function
{ANY}
True if the position-1 is a valid position.
previous_character: CHARACTER
effective function
{ANY}
The character at position-1.
valid_next_character: BOOLEAN
effective function
{ANY}
True if the position+1 is a valid position.
next_character: CHARACTER
effective function
{ANY}
The character at position+1.
end_of_input: BOOLEAN
effective function
{ANY}
True when all the characters of 'scanned_string' are scanned.
goto_position (pos: INTEGER_32)
effective procedure
{ANY}
Change the currently scanned position to 'pos'.
read_character
effective procedure
{ANY}
Reads the next character.
read_integer
effective procedure
{ANY}
Reads an integer value beginning at the currently scanned position.
saved_position: INTEGER_32
writable attribute
{ANY}
The saved position (only one is currently enough).
save_position
effective procedure
{ANY}
Saves the current scanning position.
restore_saved_position
effective procedure
{ANY}
Restore the scanning position to the last saved one.
last_string: STRING
writable attribute
{ANY}
A string buffer.
last_integer: INTEGER_32
writable attribute
{ANY}
An integer buffer.