GNU
|
Liberty Eiffel
|
Automated Tests
|
Wiki
|
Savannah project
|
Debian packages
|
Documentation
>
libraries
>
DESCENDING_NON_TERMINAL
+
Point of view
PARSE_TABLE
ANY
INTERNALS_HANDLER
TYPED_INTERNALS
PARSE_TABLE
PARSER_FACET
DESCENDING_NON_TERMINAL
All features
class DESCENDING_NON_TERMINAL
Summary
top
A non-terminal meant to be put in a
PARSE_TABLE
.
The only way to create a non-terminal is to use SmartEiffel's manifest notation.
The structure of this notation is:
{
DESCENDING_NON_TERMINAL
<< rule, agent; rule, agent; . . . rule, agent >>}
where each rule is a
TRAVERSABLE
[
STRING
] (with each String being the name of an atom of the
PARSE_TABLE
), and each agent may either be Void or a
PROCEDURE
[
TUPLE
] called when reducing the non-terminal.
Direct parents
Inherit list:
PARSE_NON_TERMINAL
Overview
top
Creation features
Exported features
out_in_tagged_out_memory
is_coherent
:
BOOLEAN
pretty_print_on
(stream:
OUTPUT_STREAM
)
set_default_tree_builders
(non_terminal_builder:
PROCEDURE
[
TUPLE 2
[
FIXED_STRING
,
TRAVERSABLE
[
FIXED_STRING
]]], terminal_builder:
PROCEDURE
[
TUPLE 2
[
FIXED_STRING
,
PARSER_IMAGE
]])
copy
(other: DESCENDING_NON_TERMINAL)
is_equal
(other: DESCENDING_NON_TERMINAL):
BOOLEAN
add
(rule:
TRAVERSABLE
[
FIXED_STRING
], action:
PROCEDURE
[
TUPLE
])
name
:
FIXED_STRING
table
: PARSE_TABLE[C_]
set
(a_name:
ABSTRACT_STRING
, a_table: PARSE_TABLE[C_])
set_table
(a_table: PARSE_TABLE[C_])
yes
:
TRISTATE
no
:
TRISTATE
maybe
:
TRISTATE
out_in_tagged_out_memory
effective procedure
top
is_coherent
:
BOOLEAN
effective function
top
require
table /= Void
ensure
must_be_coherent:
Result
pretty_print_on
(stream:
OUTPUT_STREAM
)
effective procedure
top
require
stream.is_connected
set_default_tree_builders
(non_terminal_builder:
PROCEDURE
[
TUPLE 2
[
FIXED_STRING
,
TRAVERSABLE
[
FIXED_STRING
]]], terminal_builder:
PROCEDURE
[
TUPLE 2
[
FIXED_STRING
,
PARSER_IMAGE
]])
effective procedure
top
require
is_coherent
copy
(other: DESCENDING_NON_TERMINAL)
effective procedure
top
require
not immutable
same_dynamic_type(other)
not immutable
same_dynamic_type(other)
not immutable
same_dynamic_type(other)
ensure
is_equal(other)
is_equal
(other: DESCENDING_NON_TERMINAL):
BOOLEAN
effective function
top
require
other /= Void
other /= Void
other /= Void
ensure
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
add
(rule:
TRAVERSABLE
[
FIXED_STRING
], action:
PROCEDURE
[
TUPLE
])
effective procedure
top
name
:
FIXED_STRING
writable attribute
top
table
: PARSE_TABLE[C_]
writable attribute
top
set
(a_name:
ABSTRACT_STRING
, a_table: PARSE_TABLE[C_])
effective procedure
top
require
name
= Void
table
= Void
not a_name.is_empty
a_table /= Void
ensure
name
= a_name.intern
table
= a_table
set_table
(a_table: PARSE_TABLE[C_])
effective procedure
top
require
a_table /= Void
ensure
table
= a_table
yes
:
TRISTATE
effective function
top
no
:
TRISTATE
effective function
top
maybe
:
TRISTATE
effective function
top
{DESCENDING_NON_TERMINAL << rule, agent; rule, agent; . . . rule, agent >>}where each rule is a TRAVERSABLE[STRING] (with each String being the name of an atom of the PARSE_TABLE), and each agent may either be Void or a PROCEDURE[TUPLE] called when reducing the non-terminal.