hsh :: command :: AggregateToken :: Class AggregateToken
[hide private]
[frames] | no frames]

Class AggregateToken

object --+    
         |    
     Token --+
             |
            AggregateToken
Known Subclasses:

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__str__(self)
Return the raw text entered by the user.
 
expand(self)
Expansions of subtokens are "multiplied" together.
 
__len__(self)
There is no default implementation of this method.
 
modify(self, txt='', begin=0, end=None)
Modify this token by replacing the text between begin and end with the given text.
 
create_token(self, txt, loc)
 
completions(self, cloc)
Return a list of completions for this token from the specified cursor location.
 
dump(self)
Return a representation of the token tree as a list of strings.

Inherited from Token: commences, expand_directives, terminated, terminates

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

Class Variables [hide private]

Inherited from Token: commencer_ch, dquotable

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

Return the raw text entered by the user. There is no default implementation of this method.

Overrides: object.__str__
(inherited documentation)

expand(self)

 

Expansions of subtokens are "multiplied" together. e.g. "a{u,v}b{w,x}" expands to ["aubw", "aubx", "avbw", "avbx"].

Overrides: Token.expand

__len__(self)
(Length operator)

 

There is no default implementation of this method.

Overrides: Token.__len__
(inherited documentation)

modify(self, txt='', begin=0, end=None)

 

Modify this token by replacing the text between begin and end with the given text. begin defaults to the beginning of the token, end to the end, and txt to the empty string.

Returns a 3-tuple:

  1. string: text which wasn't used by this token and spills over to the next token.
  2. boolean: True means that this token may absorb some characters from the next token. Spill over is not possible in this case.
  3. boolean: True means that this token needs to be deleted. May include spillover.

The default implementation checks the insertion range, raising an exception in case of error, but does not perform the actual modify.

Overrides: Token.modify
(inherited documentation)

completions(self, cloc)

 

Return a list of completions for this token from the specified cursor location. If no possible completions exist, [] is returned. If possible completions exist, a list of strings is returned. The first item is the root of the completions, the rest are possible extensions of the root. Most tokens will return None if the cursor is not at the end. The default implementation returns nothing.

Overrides: Token.completions
(inherited documentation)

dump(self)

 

Return a representation of the token tree as a list of strings. The default implementation returns an empty list.

Overrides: Token.dump
(inherited documentation)