+
Point of view
All features
class MINI_PARSER_BUFFER
Summary
Useful and efficient mini parsing buffer. From the user point of view, an object of this class can be considered as the combination of a STRING to be parsed with an extra INTEGER index to memorize the current position in this STRING.
Direct parents
Insert list: STRING_HANDLER
Class invariant
Overview
Creation features
{ANY}
Features
{ANY}
Memo
{ANY}
Queries
{ANY}
{}
initialize_with (string: ABSTRACT_STRING)
effective procedure
{ANY}
Initialize the Current buffer interning string.
require
  • string /= Void
ensure
next
effective procedure
{ANY}
Move the current_index forward by one.
require ensure
skip_separators
effective procedure
{ANY}
Skip all separators by using is_separator of class CHARACTER.
last_error: PARSE_ERROR
writable attribute
{ANY}
Can be used to memorize an error message.
set_last_error (error: PARSE_ERROR)
effective procedure
{ANY}
ensure
set_last_error_message (error_message: STRING)
effective procedure
{ANY}
ensure
set_current_index (new_index: INTEGER_32)
effective procedure
{ANY}
To be able to move (usually back) in the buffer
require ensure
print_position_on (stream: OUTPUT_STREAM)
effective procedure
{ANY}
require
  • stream.is_connected
set_memory (a_memory: MINI_PARSER_MEMORY)
effective procedure
{ANY}
require
  • a_memory /= Void
ensure
memo: INTEGER_32
effective function
{ANY}
restore (a_memo: INTEGER_32)
effective procedure
{ANY}
writable attribute
{ANY}
lower: INTEGER_32
effective function
{ANY}
upper: INTEGER_32
effective function
{ANY}
Maximum valid index in storage.
count: INTEGER_32
effective function
{ANY}
The length of the Current buffer which is also the maximum valid index.
capacity: INTEGER_32
effective function
{ANY}
Of storage.
current_index: INTEGER_32
writable attribute
{ANY}
Index of the current character.
current_character: CHARACTER
effective function
{ANY}
The current character (the one at current_index).
require
end_reached: BOOLEAN
effective function
{ANY}
Is the end of the buffer reached?
ensure
marked: BOOLEAN
writable attribute
{ANY}
clear_mark
effective procedure
{ANY}
ensure
storage: FIXED_STRING
writable attribute
{}
The storage area to be parsed.
default_create
effective procedure
{}
Default creation method.
It is used when no creation method is specified if allowed. Note it may be renamed.
once function
{}