#!/usr/bin/python import re def Boundary(object): class Plus: pass class Minus: pass def __init__(self, which, what): sign = None offset = 0 parts = re.match('', which) if '+' in which: offset_phrase = which.split('+') class RangeBoundary(object): def __init__(self, phrase): self.phrase = phrase class Range(object): def __init__(self, start, end): self.start = start self.end = end