pydi.sexpr
index
/cygdrive/c/dev/workspace/pydi_open/src/pydi/sexpr.py

##
##  sexpr.py - by Yusuke Shinyama
##
##  * public domain *
##

 
Classes
       
exceptions.ValueError(exceptions.StandardError)
SExprIllegalClosingParenError
SExprPrematureEOFError
pydi.abstfilter.AbstractFilter
SExprReader
StrictSExprReader

 
class SExprIllegalClosingParenError(exceptions.ValueError)
    It throws an exception with an ill-structured input.
 
 
Method resolution order:
SExprIllegalClosingParenError
exceptions.ValueError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.ValueError:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.ValueError:
__new__ = <built-in method __new__ of type object at 0x6cb88c70>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class SExprPrematureEOFError(exceptions.ValueError)
    
Method resolution order:
SExprPrematureEOFError
exceptions.ValueError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.ValueError:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from exceptions.ValueError:
__new__ = <built-in method __new__ of type object at 0x6cb88c70>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message
exception message

 
class SExprReader(pydi.abstfilter.AbstractFilter)
    Usage:
 
reader = SExprReader(consumer)
reader.feed("(this is (sexpr))")
reader.close()
 
  Methods defined here:
__init__(self, next_filter, comment_begin=';', comment_end='\n', separator=' \t\n', paren_begin='(', paren_end=')', quote='"', escape=r'\')
close(self)
feed(self, tokens)
illegal_close_paren(self, i)
premature_eof(self, i, x)
reset(self)
terminate(self)

Data and other attributes defined here:
COMMENT_BEGIN = ';'
COMMENT_END = '\n'
ESCAPE = r'\'
PAREN_BEGIN = '('
PAREN_END = ')'
QUOTE = '"'
SEPARATOR = ' \t\n'

Methods inherited from pydi.abstfilter.AbstractFilter:
feed_next(self, s)
process(self, s)

 
class StrictSExprReader(SExprReader)
    
Method resolution order:
StrictSExprReader
SExprReader
pydi.abstfilter.AbstractFilter

Methods defined here:
illegal_close_paren(self, i)
premature_eof(self, i, x)

Methods inherited from SExprReader:
__init__(self, next_filter, comment_begin=';', comment_end='\n', separator=' \t\n', paren_begin='(', paren_end=')', quote='"', escape=r'\')
close(self)
feed(self, tokens)
reset(self)
terminate(self)

Data and other attributes inherited from SExprReader:
COMMENT_BEGIN = ';'
COMMENT_END = '\n'
ESCAPE = r'\'
PAREN_BEGIN = '('
PAREN_END = ')'
QUOTE = '"'
SEPARATOR = ' \t\n'

Methods inherited from pydi.abstfilter.AbstractFilter:
feed_next(self, s)
process(self, s)

 
Functions
       
sexpr2str(e)
convert a sexpr into Lisp-like representation.
str2sexpr(s)
parse a string as a sexpr.
str2sexpr_strict(s)
parse a string as a sexpr.
test()