# Path: lems/base/base.py
# class LEMSBase(object):
#     """
#     Base object for PyLEMS.
#     """
# 
#     def copy(self):
#         return copy.deepcopy(self)
# 
#     def toxml(self):
#         return ""
# 
# Path: lems/base/errors.py
# class ParseError(LEMSError):
#     """
#     Exception class to signal errors found during parsing.
#     """
# 
#     pass
# 
# Path: lems/base/util.py
# def make_id():
#     global id_counter
#     id_counter = id_counter + 1
#     return "__id_{0}__".format(id_counter)


import xml.etree.ElementTree as xe
from lems.base.base import LEMSBase
from lems.base.errors import ParseError
from lems.model.fundamental import *
from lems.model.component import *
from lems.model.dynamics import *
from lems.model.structure import *
from lems.model.simulation import *
from lems.base.util import make_id
    LEMS XML file format parser class.
    """

    def __init__(self, model, include_dirs=[], include_includes=True):
        """
        Constructor.

        See instance variable documentation for more details on parameters.
        """

        self.model = model
        """ Model instance to be populated from the parsed file.
        :type: lems.model.model.Model """

        self.include_dirs = include_dirs
        """ List of directories to search for included files.
        :type: list(str) """

        self.tag_parse_table = None
        """ Dictionary of xml tags to parse methods
        :type: dict(string -> function) """

        self.valid_children = None
        """ Dictionary mapping each tag to it's list of valid child tags.
        :type: dict(string -> string) """

        self.id_counter = None
        """ Counter generator for generating unique ids.
        :type: generator(int) """


# Path: lems/base/base.py
# class LEMSBase(object):
#     """
#     Base object for PyLEMS.
#     """
# 
#     def copy(self):
#         return copy.deepcopy(self)
# 
#     def toxml(self):
#         return ""
# 
# Path: lems/base/errors.py
# class ParseError(LEMSError):
#     """
#     Exception class to signal errors found during parsing.
#     """
# 
#     pass
# 
# Path: lems/base/util.py
# def make_id():
#     global id_counter
#     id_counter = id_counter + 1
#     return "__id_{0}__".format(id_counter)


# Path: lems/parser/LEMS.py
import xml.etree.ElementTree as xe
from lems.base.base import LEMSBase
from lems.base.errors import ParseError
from lems.model.fundamental import *
from lems.model.component import *
from lems.model.dynamics import *
from lems.model.structure import *
from lems.model.simulation import *
from lems.base.util import make_id

    LEMS XML file format parser class.
    """

    def __init__(self, model, include_dirs=[], include_includes=True):
        """
        Constructor.

        See instance variable documentation for more details on parameters.
        """

        self.model = model
        """ Model instance to be populated from the parsed file.
        :type: lems.model.model.Model """

        self.include_dirs = include_dirs
        """ List of directories to search for included files.
        :type: list(str) """

        self.tag_parse_table = None
        """ Dictionary of xml tags to parse methods
        :type: dict(string -> function) """

        self.valid_children = None
        """ Dictionary mapping each tag to it's list of valid child tags.
        :type: dict(string -> string) """

        self.id_counter = None
        """ Counter generator for generating unique ids.
        :type: generator(int) """


        self.include_includes = include_includes