Package rxpy :: Package graph :: Module support :: Class CharSet
[hide private]
[frames] | no frames]

Class CharSet

source code


A set of possible values for a character, described as a collection of intervals. Each interval is [a, b] (ie a <= x <= b, where x is a character code). We use open bounds to avoid having to specify an "out of range" value.

The intervals are stored in a normalised list, ordered by a, joining overlapping intervals as necessary.

[This is based on lepl.regexp.interval.Character]

Instance Methods [hide private]
 
__init__(self, intervals, alphabet)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
append(self, interval, alphabet)
Add an interval to the existing intervals.
source code
 
__contains__(self, c)
Does the value lie within the intervals?
source code
 
__format_interval(self, interval, alphabet) source code
 
to_str(self, alphabet) source code
 
simplify(self, alphabet, default) source code
 
__bool__(self) source code
 
__nonzero__(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, intervals, alphabet)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__
(inherited documentation)

append(self, interval, alphabet)

source code 

Add an interval to the existing intervals.

This maintains self.intervals in the normalized form described above.