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

Copyright (C) 2008 Eithon Cadag
 
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 
sexpparse.py - module that reads in a schema, sources and links using s-expression syntax
 
Eithon Cadag
 
Example usage:
reader = SexpSchemaSourceLinkReader('my_schema.txt')
reader.get_schema()
reader.get_links()
reader.get_sources()

 
Modules
       
pydi.schema
pydi.sexpr
pydi.srccat

 
Classes
       
exceptions.Exception(exceptions.BaseException)
ExtendingClsNotFoundException
MemAllocParseException
SexpSchemaSourceMappingParseException
pydi.schema.SchemaReader
SexpSchemaReader
MemConfigReader
SexpSchemaSourceLinkReader
pydi.srccat.SourceLinkReader
SexpSourceLinkReader
pydi.srccat.SourceReader
SexpSourceReader

 
class ExtendingClsNotFoundException(exceptions.Exception)
    
Method resolution order:
ExtendingClsNotFoundException
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, msg)

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

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x6cb87ab0>
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 MemAllocParseException(exceptions.Exception)
    
Method resolution order:
MemAllocParseException
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, msg)

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

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x6cb87ab0>
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 MemConfigReader
     Methods defined here:
__init__(self, srcmemloc)
parse_alloc(self)

Data and other attributes defined here:
KW_MEM = ':mem'

 
class SexpSchemaReader(pydi.schema.SchemaReader)
     Methods defined here:
__init__(self, clses_raw_list)
parse(self)
serialize_schema(self)

Data and other attributes defined here:
KW_ARITY_MULTIPLE = '*'
KW_ARITY_SINGULAR = '.'
KW_ATR = ':atr'
KW_CLS = ':cls'
KW_ISA = ':isa'
POS_ATTR_ARITY = 2
POS_ATTR_NAME = 1
POS_CLS_ATTRS = 3
POS_CLS_NAME = 1
POS_CLS_PARENTS = 2
POS_CLS_PARENT_NAME = 1

 
class SexpSchemaSourceLinkReader
     Methods defined here:
__init__(self, path)
get_links(self)
get_schema(self)
get_sources(self)

Data and other attributes defined here:
KW_CLS = ':cls'
KW_LNK = ':lnk'
KW_SRC = ':src'
POS_DECLARATION = 0

 
class SexpSchemaSourceMappingParseException(exceptions.Exception)
    
Method resolution order:
SexpSchemaSourceMappingParseException
exceptions.Exception
exceptions.BaseException
__builtin__.object

Methods defined here:
__init__(self, msg)

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

Data and other attributes inherited from exceptions.Exception:
__new__ = <built-in method __new__ of type object at 0x6cb87ab0>
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 SexpSourceLinkReader(pydi.srccat.SourceLinkReader)
     Methods defined here:
__init__(self, srcs, lnk_raw)
Takes a list of sources and list of raw link sexpr lists.
parse(self)
serialize_links(self)

Data and other attributes defined here:
KW_CLS = ':cls'
KW_GEN = ':gen'
KW_LNK = ':lnk'
KW_MAP = ':map'
KW_PRP = ':prp'
KW_QRY = ':qry'
KW_SRC = ':src'
POS_LNK_CONTENT_SRC = 1
POS_LNK_CONTENT_SRC_CLS = 2
POS_LNK_CONTENT_SRC_CLS_NAME = 1
POS_LNK_CONTENT_SRC_CLS_PROPERTY = 2
POS_LNK_CONTENT_SRC_CLS_PROPERTY_NAME = 1
POS_LNK_CONTENT_SRC_CLS_QUERY = 2
POS_LNK_CONTENT_SRC_CLS_QUERY_MAPPINGS = 2
POS_LNK_CONTENT_SRC_CLS_QUERY_MAP_LABEL = 1
POS_LNK_CONTENT_SRC_CLS_QUERY_MAP_PROPERTY = 2
POS_LNK_CONTENT_SRC_CLS_QUERY_NAME = 1
POS_LNK_CONTENT_SRC_NAME = 1
POS_LNK_GEN = 2
POS_LNK_GEN_NAME = 1
POS_LNK_HEAD = 3
POS_LNK_NAME = 1
POS_LNK_TAIL = 4

 
class SexpSourceReader(pydi.srccat.SourceReader)
     Methods defined here:
__init__(self, sources_raw_list, schema)
parse(self)
serialize_sources(self)

Data and other attributes defined here:
KW_ARITY_MULTIPLE = '*'
KW_ARITY_SINGULAR = '.'
KW_CLS = ':cls'
KW_MAP = ':map'
KW_PAR = ':par'
KW_PRP = ':prp'
KW_QRY = ':qry'
KW_SRC = ':src'
KW_TRG = ':trg'
POS_SRC_CLS_LIST = 2
POS_SRC_CLS_MAPPINGS = 4
POS_SRC_CLS_MAPPING_LBL = 1
POS_SRC_CLS_MAPPING_MAPTO = 2
POS_SRC_CLS_NAME = 1
POS_SRC_CLS_PROPERTIES = 3
POS_SRC_CLS_PROPERTY_ARITY = 2
POS_SRC_CLS_PROPERTY_NAME = 1
POS_SRC_CLS_QUERIES = 5
POS_SRC_CLS_QUERY_NAME = 1
POS_SRC_CLS_QUERY_PARAMETERS = 3
POS_SRC_CLS_QUERY_PARAMETER_NAME = 1
POS_SRC_CLS_QUERY_PARAMETER_VALUE = 2
POS_SRC_CLS_QUERY_PROPERTIES = 2
POS_SRC_CLS_QUERY_PROPERTY_ARITY = 2
POS_SRC_CLS_QUERY_PROPERTY_NAME = 1
POS_SRC_CLS_TRIGGER = 2
POS_SRC_CLS_TRIGGER_NAME = 1
POS_SRC_NAME = 1

 
Functions
       
test()