class POSIX_REGULAR_EXPRESSION_BUILDER
Summary
Parses POSIX regular expressions and build its matchable form
regular-expression ::= alternative alternative ::= sequence [ '|' sequence ]... sequence ::= term [ term ]... term ::= factor [ repeat-spec ] repeat-spec ::= '?' | '*' | '+' | '{' integer [',' [integer]] '}' factor ::= group | union | '.' | '^' | '$' | escaped | text group ::= '(' alternative ')' union ::= '[' union ']' union ::= '[' ['^'] union_term... ']' union_term ::= union_factor ['-' union_factor] union_factor::= '[.' TEXT '.]' | '[:' CLASS ':]' | '[:<:]' | '[:>:]' | CHARACTER escaped ::= '\' CHARACTER text ::= A SEQUENCE NOT FOLLOWED BY EITHER '*', '+', '?', '{' OF NOT ESCAPED CHARACTERS
Direct parents
Inherit list: BACKTRACKING_REGULAR_EXPRESSION_BUILDER
Known children
Inherit list: PERL5_REGULAR_EXPRESSION_BUILDER
Class invariant
Overview
Creation features
Features
parsing
{BACKTRACKING_REGULAR_EXPRESSION_BUILDER}
parsing
{POSIX_REGULAR_EXPRESSION_BUILDER}
sub parts of union
{POSIX_REGULAR_EXPRESSION_BUILDER}
make
{ANY}
  • make
    Initialise the attributes.
behaviors
{ANY}
internal behavior
{}
parsing
{ANY}
results
{ANY}
build
{}
basic
{ANY}
error management
{ANY}
scanning
{ANY}
assertions
{ANY}
character classes
{ANY}
character class naming
{ANY}
{}
and/or basics
{ANY}
internal_parse
effective procedure
Main parse of a POSIX regular expression.
parse_alternative
effective procedure
Parses an alternative of sequences.
parse_sequence
effective procedure
Parses a sequence of terms.
parse_term
effective procedure
Parses a term.
parse_factor
effective procedure
Parses a factor.
parse_group
effective procedure
Parses a group.
parse_escaped
effective procedure
Parses an escaped character.
parse_text
effective procedure
Parses a text.
parse_union
effective procedure
Parses a union.
parse_union_term
effective procedure
Parses a union term.
parse_union_factor
effective procedure
Parses a union factor.
read_embedded
effective procedure
Parses the text embedded in one of '[.' TEXT '.]'
recorded_character: CHARACTER
writable attribute
Last union_factor's character recorded.
recorded_item: BACKTRACKING_NODE
writable attribute
Last union_factor's item (complex expression) recorded.
set_recorded_character (value: CHARACTER)
effective procedure
Records the union_factor's character 'value'.
set_recorded_item (value: BACKTRACKING_NODE)
effective procedure
Records the union_factor's item (complex expression) 'value'.
emit_recorded
effective procedure
Emits the last union_factor's recorded character or item, depending on its kind.
make
effective procedure
{ANY}
Initialise the attributes.
is_case_insensitive: BOOLEAN
writable attribute
{ANY}
Is the match case insensitive?
is_case_sensitive: BOOLEAN
effective function
{ANY}
Is the match case sensitive?
set_case_sensitive
effective procedure
{ANY}
Set the match as case sensitive.
set_case_insensitive
effective procedure
{ANY}
Set the match as case insensitive.
does_any_match_newline: BOOLEAN
writable attribute
{ANY}
Does the "any character" mark match a newline?
set_any_match_newline
effective procedure
{ANY}
The "any character" mark will match a newline.
set_any_dont_match_newline
effective procedure
{ANY}
The "any character" mark will not match a newline.
does_match_line_boundary: BOOLEAN
writable attribute
{ANY}
Does the begin/end marks match line boundary?
does_match_text_boundary: BOOLEAN
effective function
{ANY}
Does the begin/end marks match text boundary?
set_match_line_boundary
effective procedure
{ANY}
The begin/end marks will match line boundary.
set_match_text_boundary
effective procedure
{ANY}
The begin/end marks will match text boundary.
set_default_options
effective procedure
{ANY}
Set the default options
is_greedy: BOOLEAN
writable attribute
{}
Does match a maximal repeat?
set_greedy
effective procedure
{}
Will match a maximal repeat.
set_not_greedy
effective procedure
{}
Will match a minimal repeat.
is_looking_ahead: BOOLEAN
writable attribute
{}
Is building a look-ahead term?
is_looking_behind: BOOLEAN
writable attribute
{}
Is building a look-behind term?
is_looking_around: BOOLEAN
effective function
{}
Is building look-ahead or look-behind?
is_looking_positive: BOOLEAN
writable attribute
{}
Is the current look-around positive or negative?
parse_expression (expr: ABSTRACT_STRING)
effective procedure
{ANY}
Set the expression to parse and parse it.
parse
effective procedure
{ANY}
Parse the current expression.
has_result: BOOLEAN
effective function
{ANY}
Did the last 'parse' or 'parse_expression' produced a result in 'last_regular_expression'?
writable attribute
{ANY}
The last regular expression pattern built by 'parse' or 'parse_expression'
writable attribute
{}
The stack of items.
group_stack: FAST_ARRAY[INTEGER_32]
writable attribute
{}
The stack of groups
last_group_count: INTEGER_32
writable attribute
{}
The count of groups currently found.
once function
{}
The names of the named subgroups
Repeat_infiny: INTEGER_32
is -1
constant attribute
{}
Constant that means "infinite repetition".
emit (item: BACKTRACKING_NODE)
effective procedure
{}
Pushes 'item' on the stack.
effective function
{}
Pops the Result from the stack.
emit_any_character
effective procedure
{}
Push the match to any characters
emit_begin_of_line
effective procedure
{}
Push the match to begin of a line
emit_end_of_line
effective procedure
{}
Push the match to end of a line
prepare_group
effective procedure
{}
Declares that a new group begins.
emit_group
effective procedure
{}
Push the "end of group" item and update the group indicators
 [.. X] -> [.., end_group(i)]
emit_begin_group
effective procedure
{}
Push the "begin of group" item and update the group indicators
 [..]
emit_end_group
effective procedure
{}
Push the "end of group" item and update the group indicators
 [..]
emit_match_previous_group (group: INTEGER_32)
effective procedure
{}
Push the item that matches the character 'char'
 [..]
emit_match_single (char: CHARACTER)
effective procedure
{}
Push the item that matches the character 'char'
 [..]
emit_match_range (lower: CHARACTER, upper: CHARACTER)
effective procedure
{}
Push the item that matches the character range 'lower'..'
emit_match_text (text: STRING)
effective procedure
{}
Push the item that matches the 'text'
 [..]
begin_collect
effective procedure
{}
Begin to collect a collection of items by pushing Void on the stack.
is_collect_empty: BOOLEAN
effective function
{}
True if currently begun collect is empty
end_collect_true
effective procedure
{}
Replace an empty collection by TRUE
 [.., Void] -> [.., TRUE]
end_collect_or
effective procedure
{}
Collects the item on the stack until the collect mark (a Void) and replace it by a single item that is a or of all of them.
effective function
{}
end_collect_and
effective procedure
{}
Collects the item on the stack until the collect mark (a Void) and replace it by a single item that is a and of all of them.
emit_not
effective procedure
{}
Replaces the top of the stack by its negation.
emit_not_then_any
effective procedure
{}
Replaces the top of the stack by its negation followed by any.
emit_true_or
effective procedure
{}
Replaces the top of the stack by true or it
 [.., X] -> [.., true or X]
emit_or_true
effective procedure
{}
Replaces the top of the stack by it or true
 [.., X] -> [.., X or true]
emit_controled_or_true
effective procedure
{}
Replaces the top of the stack by
 if is_greedy then [.., X] -> [.., X or true]
              else [.., X] -> [.., true or X]
controled_or_true_item (x: BACKTRACKING_NODE): BACKTRACKING_NODE
effective function
{}
Returns an item for " 'x' or true ". The returned item depend on the flag 'is_greedy'.
 if is_greedy then Result = (X or true)
              else Result = (true or X)
emit_repeat (mini: INTEGER_32, maxi: INTEGER_32)
effective procedure
{}
Takes the top of the stack and replace it with a construction that will evaluate the repeating of it from 'mini' to 'maxi' times.
emit_looking
effective procedure
{}
scanned_string: ABSTRACT_STRING
writable attribute
{ANY}
The expression being currently build.
set_scanned_string (string: ABSTRACT_STRING)
effective procedure
{ANY}
Set the 'scanned_string' with 'string'.
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.
the_any_character_item: REGULAR_EXPRESSION_ITEM_ANY
once function
{ANY}
the_not_end_of_line_item: REGULAR_EXPRESSION_ITEM_NOT_END_OF_LINE
once function
{ANY}
the_begin_of_line_item: REGULAR_EXPRESSION_ITEM_BEGIN_OF_LINE
once function
{ANY}
once function
{ANY}
the_begin_of_text_item: REGULAR_EXPRESSION_ITEM_BEGIN_OF_TEXT
once function
{ANY}
the_real_end_of_text_item: REGULAR_EXPRESSION_ITEM_END_OF_TEXT
once function
{ANY}
once function
{ANY}
the_begin_of_word_item: REGULAR_EXPRESSION_ITEM_BEGIN_OF_WORD
once function
{ANY}
once function
{ANY}
the_is_posix_alnum_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_ALNUM
once function
{ANY}
the_is_posix_alpha_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_ALPHA
once function
{ANY}
the_is_posix_ascii_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_ASCII
once function
{ANY}
the_is_posix_blank_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_BLANK
once function
{ANY}
the_is_posix_cntrl_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_CNTRL
once function
{ANY}
the_is_posix_digit_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_DIGIT
once function
{ANY}
the_is_posix_graph_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_GRAPH
once function
{ANY}
the_is_posix_lower_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_LOWER
once function
{ANY}
the_is_posix_print_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_PRINT
once function
{ANY}
the_is_posix_punct_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_PUNCT
once function
{ANY}
the_is_posix_space_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_SPACE
once function
{ANY}
the_is_posix_upper_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_UPPER
once function
{ANY}
the_is_posix_word_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_WORD
once function
{ANY}
the_is_posix_xdigit_item: REGULAR_EXPRESSION_ITEM_IS_POSIX_XDIGIT
once function
{ANY}
has_named_posix_item (name: STRING): BOOLEAN
effective function
{ANY}
True if 'name' is for a valid POSIX character class
named_posix_item (name: STRING): REGULAR_EXPRESSION_ITEM
effective function
{ANY}
the item for the valid POSIX character class 'name'
has_named_perl_item (name: STRING): BOOLEAN
effective function
{ANY}
True if 'name' is for a valid Perl character class
named_perl_item (name: STRING): REGULAR_EXPRESSION_ITEM
effective function
{ANY}
the item for the valid Perl character class 'name'
internal_named_posix_item (name: STRING): REGULAR_EXPRESSION_ITEM
effective function
{}
the item for a presumed POSIX character class 'name'
internal_named_perl_item (name: STRING): REGULAR_EXPRESSION_ITEM
effective function
{}
the item for a presumed Perl character class 'name'
the_cut_node: BACKTRACKING_NODE_CUT
once function
{ANY}
the_true_node: BACKTRACKING_NODE_TRUE
once function
{ANY}
the_false_node: BACKTRACKING_NODE_FALSE
once function
{ANY}
the_cut_and_false_node: BACKTRACKING_NODE_CUT_AND_FALSE
once function
{ANY}