home
classes/clusters list
class information
+
Point of view
PARSE_TABLE
ANY
PARSE_NON_TERMINAL
PARSE_NT_NODE
ESE_PARSER
PARSE_TABLE
TYPED_INTERNALS
INTERNALS_HANDLER
All features
class PARSE_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:
{
PARSE_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_ATOM
Overview
top
creation features
exported features
is_coherent
:
BOOLEAN
set_default_tree_builders
(non_terminal_builder:
PROCEDURE
[
TUPLE 2
[
STRING
,
TRAVERSABLE
[
STRING
]]], terminal_builder:
PROCEDURE
[
TUPLE 2
[
STRING
,
PARSER_IMAGE
]])
copy
(other: PARSE_NON_TERMINAL)
Update current object using fields of object attached to
other
, so as to yield equal objects.
is_equal
(other: PARSE_NON_TERMINAL):
BOOLEAN
Is
other
attached to an object considered equal to current object?
add
(rule:
TRAVERSABLE
[
STRING
], action:
PROCEDURE
[
TUPLE
])
name
:
STRING
table
:
PARSE_TABLE
set
(a_name:
STRING
, a_table:
PARSE_TABLE
)
set_table
(a_table:
PARSE_TABLE
)
is_coherent
:
BOOLEAN
effective function
top
ensure
must_be_coherent:
Result
set_default_tree_builders
(non_terminal_builder:
PROCEDURE
[
TUPLE 2
[
STRING
,
TRAVERSABLE
[
STRING
]]], terminal_builder:
PROCEDURE
[
TUPLE 2
[
STRING
,
PARSER_IMAGE
]])
effective procedure
top
require
is_coherent
copy
(other: PARSE_NON_TERMINAL)
effective procedure
top
Update current object using fields of object attached to
other
, so as to yield equal objects.
Note: you can't copy object from a different dynamic type.
require
same_dynamic_type(other)
ensure
is_equal(other)
is_equal
(other: PARSE_NON_TERMINAL):
BOOLEAN
effective function
top
Is
other
attached to an object considered equal to current object?
require
other /= Void
ensure
commutative:
generating_type = other.generating_type implies Result = other.is_equal(Current)
add
(rule:
TRAVERSABLE
[
STRING
], action:
PROCEDURE
[
TUPLE
])
effective procedure
top
require
rule /= Void
name
:
STRING
writable attribute
top
table
:
PARSE_TABLE
writable attribute
top
set
(a_name:
STRING
, a_table:
PARSE_TABLE
)
effective procedure
top
require
not a_name.is_empty
a_table /= Void
ensure
name
= a_name
table
= a_table
set_table
(a_table:
PARSE_TABLE
)
effective procedure
top
require
a_table /= Void
ensure
table
= a_table
{PARSE_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.