# 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
        if tag == "":
            t = node.ltag
        else:
            t = tag.lower()

        for child in node.children:
            self.xml_node_stack = [child] + self.xml_node_stack

            ctagl = child.ltag

            if ctagl in self.tag_parse_table and ctagl in self.valid_children[t]:
                # print("Processing known type: %s"%ctagl)
                self.tag_parse_table[ctagl](child)
            else:
                # print("Processing unknown type: %s"%ctagl)
                self.parse_component_by_typename(child, child.tag)

            self.xml_node_stack = self.xml_node_stack[1:]

    def parse(self, xmltext):
        """
        Parse a string containing LEMS XML text.

        :param xmltext: String containing LEMS XML formatted text.
        :type xmltext: str
        """

        xml = LEMSXMLNode(xe.XML(xmltext))

        if xml.ltag != "lems" and xml.ltag != "neuroml":

# 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

        if tag == "":
            t = node.ltag
        else:
            t = tag.lower()

        for child in node.children:
            self.xml_node_stack = [child] + self.xml_node_stack

            ctagl = child.ltag

            if ctagl in self.tag_parse_table and ctagl in self.valid_children[t]:
                # print("Processing known type: %s"%ctagl)
                self.tag_parse_table[ctagl](child)
            else:
                # print("Processing unknown type: %s"%ctagl)
                self.parse_component_by_typename(child, child.tag)

            self.xml_node_stack = self.xml_node_stack[1:]

    def parse(self, xmltext):
        """
        Parse a string containing LEMS XML text.

        :param xmltext: String containing LEMS XML formatted text.
        :type xmltext: str
        """

        xml = LEMSXMLNode(xe.XML(xmltext))

        if xml.ltag != "lems" and xml.ltag != "neuroml":

            raise ParseError(