# 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
    elif "rdf" in bits[0]:
        return "rdf_" + bits[1]
    elif "model-qualifiers" in bits[0]:
        return "bqmodel_" + bits[1]
    elif "biology-qualifiers" in bits[0]:
        return "bqbiol_" + bits[1]
    else:
        return "%s:%s" % (bits[0], bits[1])


class LEMSXMLNode:
    def __init__(self, pyxmlnode):
        self.tag = get_nons_tag_from_node(pyxmlnode)
        self.ltag = self.tag.lower()

        self.attrib = dict()
        self.lattrib = dict()

        for k in pyxmlnode.attrib:
            self.attrib[k] = pyxmlnode.attrib[k]
            self.lattrib[k.lower()] = pyxmlnode.attrib[k]

        self.children = list()
        for pyxmlchild in pyxmlnode:
            self.children.append(LEMSXMLNode(pyxmlchild))

    def __str__(self):
        return "LEMSXMLNode <{0} {1}>".format(self.tag, self.attrib)



# 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

    elif "rdf" in bits[0]:
        return "rdf_" + bits[1]
    elif "model-qualifiers" in bits[0]:
        return "bqmodel_" + bits[1]
    elif "biology-qualifiers" in bits[0]:
        return "bqbiol_" + bits[1]
    else:
        return "%s:%s" % (bits[0], bits[1])


class LEMSXMLNode:
    def __init__(self, pyxmlnode):
        self.tag = get_nons_tag_from_node(pyxmlnode)
        self.ltag = self.tag.lower()

        self.attrib = dict()
        self.lattrib = dict()

        for k in pyxmlnode.attrib:
            self.attrib[k] = pyxmlnode.attrib[k]
            self.lattrib[k.lower()] = pyxmlnode.attrib[k]

        self.children = list()
        for pyxmlchild in pyxmlnode:
            self.children.append(LEMSXMLNode(pyxmlchild))

    def __str__(self):
        return "LEMSXMLNode <{0} {1}>".format(self.tag, self.attrib)



class LEMSFileParser(LEMSBase):