def _toks_to_compartment(self, toks): label = None uis = None if toks.label: label = deescape_string(toks.label) if toks.uis: uis = deescape_string(toks.uis) return Compartment(label=label, uis=uis)
def _toks_to_sv(self, toks): val = None var = None if toks.val: val = deescape_string(toks.val) if toks.var: var = deescape_string(toks.var) return StateVariable(val=val, var=var)
def _toks_to_process(self, toks): process = toks.clazz() if toks.label: process.label = deescape_string(toks.label) for reactant in toks.reactants: process.reactants += reactant for product in toks.products: process.products += product return process
def _toks_to_subentity(self, toks): subentity = toks.clazz() if toks.label: subentity.label = deescape_string(toks.label) if toks.svs: for sv in toks.svs: subentity.add_sv(sv) if toks.uis: for ui in toks.uis: subentity.add_ui(ui) if toks.components: for component in toks.components: subentity.add_component(component) return subentity
def _toks_to_ui(self, toks): pre = None if toks.pre: pre = deescape_string(toks.pre) label = deescape_string(toks.label) return UnitOfInformation(prefix=pre, label=label)