+
Point of view
All features
class TEST_INSERT_UNDERSCORES
Summary
Direct parents
Insert list: NAME_CONVERTER
Overview
Creation features
{ANY}
Features
{ANY}
Auxiliary features
{ANY}
Constants
{}
Maximum:
{}
Minimum:
{}
Bits:
{}
Various exceptions codes:
{ANY}
{ANY}
Status report:
{ANY}
Basic operations:
{ANY}
  • die (code: INTEGER_32)
    Terminate execution with exit status code, without triggering an exception.
  • raise (name: STRING)
    Raise a developer exception of name name.
  • throw (a_exception: EXCEPTION)
Non-Standard Extensions:
{ANY}
{}
test
effective procedure
{ANY}
eiffel_feature (a_name: ABSTRACT_STRING): STRING
effective function
{ANY}
Translate a_name content into a proper feature name for the Gnu-Eiffel language.
 "CamelCase" is translated into "camel_case",
"ENOO" is translated into "enoo". Eventual underscores in front of
a_name are removed: "__foo" becomes "foo"; symbols starting with
underscores folloed by a number are prefixed with "a_"; reserved
language names and names of features of class ANY are escaped.
TODO: handle in a fairly
require
  • name_not_void: a_name /= Void
  • name_not_empty: not a_name.is_empty
eiffel_argument (a_name: ABSTRACT_STRING): STRING
effective function
{ANY}
a_name content translated into a proper argument placeholder for the Gnu-Eiffel language.
 "CamelCase" is translated into
"a_camel_case", "ENOO" is translated into "an_enoo". Eventual
underscores in front of a_name are removed: "__foo" becomes
"a_foo". See also eiffel_feature.
require
  • name_not_void: a_name /= Void
insert_underscores (a_string: STRING)
effective procedure
{ANY}
Insert an underscore ('_') before each uppercase letter following a lowercase one.
require
  • a_string /= Void
  • not a_string.is_empty
camelcase_translator: REGULAR_EXPRESSION
once function
{ANY}
Insert an underscore ('_') between any lowercase letter followed by an uppercase one
multiple_underscores_remover: REGULAR_EXPRESSION
once function
{ANY}
Replace all multiple occurences of underscore "_" with a single one
lt_translator: REGULAR_EXPRESSION
once function
{ANY}
Replace all occurences of "<" (shown as "&lt;") with "_of_"
gt_translator: REGULAR_EXPRESSION
once function
{ANY}
Remove all occurences of ">" (shown as "&gt;")
namespace_separator_translator: REGULAR_EXPRESSION
once function
{ANY}
Replace all occurences of "::" (C++ namespace separator) with "_"
is_public_name (a_name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Does a_name start with an alphabetical character?
Names starting with underscores or other strange characters are usually considered private in C/C++ languages.
require
  • not_void: a_name /= Void
  • meaningful_length: a_name.count > 1
eiffel_class_name (a_string: ABSTRACT_STRING, a_suffix: ABSTRACT_STRING): STRING
effective function
{ANY}
An Eiffel class name derived from a_string.
Trailing and tail underscores are removed, dashes are turned into underscores, a_suffix is added at the end if not void, all is made uppercase.
require
  • a_string /= Void
ensure
is_valid_class_name (a_name: ABSTRACT_STRING): BOOLEAN
effective function
{ANY}
Does a_name represents a valid Eiffel class name?
i.e. does it start with an upper-case letter and contain only upper-case letters, underscores and numbers?
require
  • a_name /= Void
adapt (a_name: ABSTRACT_STRING, a_suffix: ABSTRACT_STRING): STRING
effective function
{ANY}
A valid, adapted identifier for an Eiffel feature labelled a_name.
Can be either a_name itself or a new string containing an adapatation. Reserved words and those of features belonging to ANY are "escaped", appending a_suffix.
require
  • name_not_void: a_name /= Void
  • valid_name: a_name.first /= '_'
  • suffix_not_void: a_suffix /= Void
  • suffix_not_empty: not a_suffix.is_empty
ensure
  • Result /= Void
once function
{}
any_features: HASHED_SET[ABSTRACT_STRING]
once function
{}
The names of the features contained in class ANY.
The following "static" definition of the features of ANY somehow unacceptable in a perfect world. Yet computing it each and every time would enlarge the memory usage of the program quite a lot, not counting the runtime requirements. We will do it when we will cache compilation results. The following "static" definition of the features of ANY somehow unacceptable in a perfect world. Yet computing it each and every time would enlarge the memory usage of the program quite a lot, not counting the runtime requirements. We will do it when we will cache compilation results.
Maximum_character_code: INTEGER_16
{}
Largest supported code for CHARACTER values.
ensure
  • meaningful: Result >= 127
Maximum_integer_8: INTEGER_8
is 127
constant attribute
{}
Largest supported value of type INTEGER_8.
Maximum_integer_16: INTEGER_16
is 32767
constant attribute
{}
Largest supported value of type INTEGER_16.
Maximum_integer: INTEGER_32
is 2147483647
constant attribute
{}
Largest supported value of type INTEGER/INTEGER_32.
Maximum_integer_32: INTEGER_32
is 2147483647
constant attribute
{}
Largest supported value of type INTEGER/INTEGER_32.
Maximum_integer_64: INTEGER_64
is 9223372036854775807
constant attribute
{}
Largest supported value of type INTEGER_64.
Maximum_real_32: REAL_32
is {REAL_32 3.4028234663852885981170418348451692544e+38}
constant attribute
{}
Largest non-special (no NaNs nor infinity) supported value of type REAL_32.
Maximum_real: REAL_64
{}
Largest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: 1.79769313486231570....e+308
Maximum_real_64: REAL_64
{}
Largest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: 1.79769313486231570....e+308
Maximum_real_80: REAL_EXTENDED
{}
Largest supported value of type REAL_80.
ensure
Minimum_character_code: INTEGER_16
{}
Smallest supported code for CHARACTER values.
ensure
  • meaningful: Result <= 0
Minimum_integer_8: INTEGER_8
is -128
constant attribute
{}
Smallest supported value of type INTEGER_8.
Minimum_integer_16: INTEGER_16
is -32768
constant attribute
{}
Smallest supported value of type INTEGER_16.
Minimum_integer: INTEGER_32
is -2147483648
constant attribute
{}
Smallest supported value of type INTEGER/INTEGER_32.
Minimum_integer_32: INTEGER_32
is -2147483648
constant attribute
{}
Smallest supported value of type INTEGER/INTEGER_32.
Minimum_integer_64: INTEGER_64
is -9223372036854775808
constant attribute
{}
Smallest supported value of type INTEGER_64.
Minimum_real_32: REAL_32
is {REAL_32 -3.40282346638528859811704183484516925440e+38}
constant attribute
{}
Smallest non-special (no NaNs nor infinity) supported value of type REAL_32.
Minimum_real: REAL_64
{}
Smallest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: -1.79769313486231570....e+308
Minimum_real_64: REAL_64
{}
Smallest non-special (no NaNs nor infinity) supported value of type REAL.
Just to give an idea of this value: -1.79769313486231570....e+308
Minimum_real_80: REAL_64
{}
Smallest supported value of type REAL_80.
ensure
  • meaningful: Result <= 0.0
Boolean_bits: INTEGER_32
{}
Number of bits in a value of type BOOLEAN.
ensure
  • meaningful: Result >= 1
Character_bits: INTEGER_32
{}
Number of bits in a value of type CHARACTER.
ensure
Integer_bits: INTEGER_32
{}
Number of bits in a value of type INTEGER.
ensure
  • integer_definition: Result = 32
Real_bits: INTEGER_32
is 64
constant attribute
{}
Number of bits in a value of type REAL.
Pointer_bits: INTEGER_32
{}
Number of bits in a value of type POINTER.
Check_instruction: INTEGER_32
is 1
constant attribute
{ANY}
Exception code for violated check.
Class_invariant: INTEGER_32
is 2
constant attribute
{ANY}
Exception code for violated class invariant.
Developer_exception: INTEGER_32
is 3
constant attribute
{ANY}
Exception code for developer exception.
See also: raise, throw
Incorrect_inspect_value: INTEGER_32
is 4
constant attribute
{ANY}
Exception code for inspect statement.
This exception occurs when Void is passed as the expression to inspect ("inspect on STRING only). This exception also occurs when the inspected value selects no branch (when the keyword "else" not used, one "when" branch _must_ be selected). Some value which is not one of the inspect constants, if there is no Else_part
Loop_invariant: INTEGER_32
is 5
constant attribute
{ANY}
Exception code for violated loop invariant
Loop_variant: INTEGER_32
is 6
constant attribute
{ANY}
Exception code for non-decreased loop variant
No_more_memory: INTEGER_32
is 7
constant attribute
{ANY}
Exception code for failed memory allocation
Postcondition: INTEGER_32
is 8
constant attribute
{ANY}
Exception code for violated postcondition.
Precondition: INTEGER_32
is 9
constant attribute
{ANY}
Exception code for violated precondition.
Routine_failure: INTEGER_32
is 10
constant attribute
{ANY}
Exception code for failed routine.
Os_signal: INTEGER_32
is 11
constant attribute
{ANY}
Exception code for a signal received from the OS.
Void_attached_to_expanded: INTEGER_32
is 12
constant attribute
{ANY}
Exception code for attachment of Void value to expanded entity.
Void_call_target: INTEGER_32
is 13
constant attribute
{ANY}
Exception code for feature applied to Void reference
System_level_type_error: INTEGER_32
is 14
constant attribute
{ANY}
Exception code for the system-level type error (this kind of error mostly arise with covariant redefinition).
exception_name: STRING
effective function
{ANY}
name_of_exception (a_exception: INTEGER_32): STRING
effective function
{ANY}
developer_exception: EXCEPTION
effective function
{ANY}
The last developer-thrown exception.
require
developer_exception_name: STRING
effective function
{ANY}
Name of last developer-raised exception.
require
is_developer_exception: BOOLEAN
effective function
{ANY}
Is the last exception originally due to a developer exception?
is_developer_named_exception: BOOLEAN
effective function
{ANY}
Is the last exception originally due to a developer exception?
is_developer_exception_of_name (name: STRING): BOOLEAN
effective function
{ANY}
Is the last exception originally due to a developer exception of name name?
assertion_violation: BOOLEAN
effective function
{ANY}
Is last exception originally due to a violated assertion or non-decreasing variant?
exception: INTEGER_32
{ANY}
Code of last exception that occurred.
is_signal: BOOLEAN
effective function
{ANY}
Is last exception originally due to an external event (operating system signal) ?
die (code: INTEGER_32)
effective procedure
{ANY}
Terminate execution with exit status code, without triggering an exception.
raise (name: STRING)
effective procedure
{ANY}
Raise a developer exception of name name.
require
  • name /= Void
throw (a_exception: EXCEPTION)
effective procedure
{ANY}
require
  • a_exception /= Void
signal_number: INTEGER_32
{ANY}
Signal Number received from OS.
 Zero if exception is not an OS signal.
named_exception: NAMED_EXCEPTION
once function
{}
developer_exception_memory: REFERENCE[EXCEPTION]
once function
{}
raise_exception (code: INTEGER_32)
{}