class PACKRAT_NON_TERMINAL
Summary
A non-terminal meant to be put in a PARSE_TABLE.
Direct parents
Inherit list: PACKRAT_ATOM, PARSE_NON_TERMINAL
Class invariant
Overview
Creation features
{ANY}
Features
{ANY}
{PARSER_FACET}
{PARSE_TABLE}
{ANY}
  • copy (other: PACKRAT_NON_TERMINAL)
    Update current object using fields of object attached to other, so as to yield equal objects.
  • is_equal (other: PACKRAT_NON_TERMINAL): BOOLEAN
    Is other attached to an object considered equal to current object?
{}
{PACKRAT_NON_TERMINAL, PACKRAT_VISITOR}
{PACKRAT_SEQUENCE}
{ANY}
{PARSE_TABLE}
{}
{ANY}
{}
  • 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.
out_in_tagged_out_memory
effective procedure
{ANY}
Append terse printable representation of current object in tagged_out_memory.
require
      • locked: tagged_out_locked
        • locked: tagged_out_locked
        • locked: tagged_out_locked
      • locked: tagged_out_locked
        • locked: tagged_out_locked
        • locked: tagged_out_locked
ensure
  • still_locked: tagged_out_locked
  • not_cleared: tagged_out_memory.count >= old tagged_out_memory.count
  • append_only: old tagged_out_memory.twin.is_equal(tagged_out_memory.substring(1, old tagged_out_memory.count))
accept (visitor: PACKRAT_VISITOR)
effective procedure
{ANY}
Accept to be visited by the visitor.
require
  • visitor /= Void
pretty_print_on (stream: OUTPUT_STREAM)
effective procedure
{ANY}
require
    • stream.is_connected
    • stream.is_connected
is_coherent: BOOLEAN
effective function
{ANY}
require
    • table /= Void
    • table /= Void
ensure
  • must_be_coherent: Result
parse (context: PACKRAT_PARSE_CONTEXT): TRISTATE
effective function
The Result is yes if the parsing succeeded, no if there was a syntax error, or maybe if the parse could complete with some more text.
require
    • context /= Void
    • context /= Void
ensure
  • context.actions.count >= old context.actions.count
  • not Result.is_equal(yes) implies context.buffer.current_index = old context.buffer.current_index and then context.actions.count = old context.actions.count
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
require
    • is_coherent
    • is_coherent
copy (other: PACKRAT_NON_TERMINAL)
effective procedure
{ANY}
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
      • not immutable
      • same_dynamic_type(other)
        • not immutable
        • same_dynamic_type(other)
        • not immutable
        • same_dynamic_type(other)
      • 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: PACKRAT_NON_TERMINAL): BOOLEAN
effective function
{ANY}
Is other attached to an object considered equal to current object?
require
      • other /= Void
        • other /= Void
        • other /= Void
      • other /= Void
        • other /= Void
        • other /= Void
ensure
  • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)
make (a_pattern: PACKRAT_PATTERN)
effective procedure
{}
require
  • a_pattern /= Void
  • a_pattern.nt = Void
ensure
sequence_count: INTEGER_32
writable attribute
{}
is_initialized: BOOLEAN
writable attribute
{}
new_sequence_number: INTEGER_32
effective function
writable attribute
{ANY}
table: PARSE_TABLE[C_]
writable attribute
{ANY}
set (a_name: ABSTRACT_STRING, a_table: PARSE_TABLE[C_])
effective procedure
require
  • name = Void
  • table = Void
  • not a_name.is_empty
  • a_table /= Void
ensure
set_table (a_table: PARSE_TABLE[C_])
effective procedure
require
  • a_table /= Void
ensure
add_error_position (error: STRING, buffer: MINI_PARSER_BUFFER)
effective procedure
{}
print_error_position (o: OUTPUT_STREAM, buffer: MINI_PARSER_BUFFER)
effective procedure
{}
yes: TRISTATE
effective function
{ANY}
effective function
{ANY}
maybe: TRISTATE
effective function
{ANY}
log: LOGGER
effective function
{}
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
{}
The cached logger.
The ugly name is intentional. Don't use directly.