GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
PACKRAT_PARSER
+
Point of view
All features
ANY
PACKRAT_INTERNAL
PACKRAT_PRIMARY
All features
class PACKRAT_PARSER
Summary
top
The entry point to Packrat parsing (for PEGs: Parsing Expression Grammars)
See
http://bford.info/packrat/
Direct parents
Inherit list:
ABSTRACT_PARSER
Overview
top
Features
{
ANY
}
parse
(buffer:
MINI_PARSER_BUFFER
, grammar:
PARSE_TABLE
[
PACKRAT_PARSE_CONTEXT
], start:
STRING
, a_actions:
COLLECTION
[
PARSE_ACTION
]):
BOOLEAN
Returns True if the parsing succeeded or definitely could not succeed, False if some more text could make it succeed.
{
ANY
}
eval
(buffer:
MINI_PARSER_BUFFER
, grammar: PARSE_TABLE[C_], start:
STRING
):
BOOLEAN
Returns True if the parsing succeeded or definitely could not succeed, False if some more text could make it succeed.
error
:
PARSE_ERROR
{}
used_actions
:
FAST_ARRAY
[
FAST_ARRAY
[
PARSE_ACTION
]]
free_actions
:
FAST_ARRAY
[
FAST_ARRAY
[
PARSE_ACTION
]]
actions
:
FAST_ARRAY
[
PARSE_ACTION
]
save_actions
restore_actions
new_free_actions
:
FAST_ARRAY
[
PARSE_ACTION
]
{
ANY
}
yes
:
TRISTATE
no
:
TRISTATE
maybe
:
TRISTATE
{}
log
:
LOGGER
There is one logger per concrete type; for performance reasons it is cached in each instance.
log_memory__0_
:
LOGGER
The cached logger.
parse
(buffer:
MINI_PARSER_BUFFER
, grammar:
PARSE_TABLE
[
PACKRAT_PARSE_CONTEXT
], start:
STRING
, a_actions:
COLLECTION
[
PARSE_ACTION
]):
BOOLEAN
effective function
{
ANY
}
top
Returns True if the parsing succeeded or definitely could not succeed, False if some more text could make it succeed.
require
a_actions /= Void
grammar.is_coherent
grammar.has(start)
ensure
a_actions.count >= old a_actions.count
not Result implies a_actions.count = old a_actions.count
eval
(buffer:
MINI_PARSER_BUFFER
, grammar: PARSE_TABLE[C_], start:
STRING
):
BOOLEAN
effective function
{
ANY
}
top
Returns True if the parsing succeeded or definitely could not succeed, False if some more text could make it succeed.
error
:
PARSE_ERROR
writable attribute
{
ANY
}
top
used_actions
:
FAST_ARRAY
[
FAST_ARRAY
[
PARSE_ACTION
]]
once function
{}
top
free_actions
:
FAST_ARRAY
[
FAST_ARRAY
[
PARSE_ACTION
]]
once function
{}
top
actions
:
FAST_ARRAY
[
PARSE_ACTION
]
writable attribute
{}
top
save_actions
effective procedure
{}
top
ensure
actions
.is_empty
old
actions
/= Void and then not
actions
.is_empty implies
used_actions
.last = old
actions
old
actions
/= Void and then not
actions
.is_empty implies
used_actions
.count = old
used_actions
.count + 1
restore_actions
effective procedure
{}
top
require
actions
.is_empty
ensure
actions
/= Void
not old
used_actions
.is_empty implies
actions
= old
used_actions
.twin.last
not old
used_actions
.is_empty implies
used_actions
.count = old
used_actions
.count - 1
new_free_actions
:
FAST_ARRAY
[
PARSE_ACTION
]
effective function
{}
top
ensure
Result.is_empty
yes
:
TRISTATE
effective function
{
ANY
}
top
no
:
TRISTATE
effective function
{
ANY
}
top
maybe
:
TRISTATE
effective function
{
ANY
}
top
log
:
LOGGER
effective function
{}
top
There is one logger per concrete type; for performance reasons it is cached in each instance.
ensure
Result /= Void
log_memory__0_
:
LOGGER
writable attribute
{}
top
The cached logger.
The ugly name is intentional. Don't use directly.