class MetaNode(spye.plugin): def __init__(self, parent, line, column): super(MetaNode, self).__init__(parent) self.line = line self.column = column ... class MetaText(MetaNode): def __init__(self, parent, line, column, text): super(MetaText, self).__init__(parent, line, column) self.text = text ... class XMSParser(spye.plugin): def token(self, tt, *args): return tt(self, 12, 34, *args) def test(self): self.token(MetaText, text)