def __init__(self, begin_token, value:str, first_position:StreamPosition, position_after:StreamPosition): Token.__init__(self, _TokenTypes.PUNCTUATION, StreamRange(first_position, position_after)) self.begin = begin_token self.value = value
def __init__(self, begin_token, position:StreamPosition): Token.__init__(self, _TokenTypes.END, StreamRange(position, position)) self.begin = begin_token begin_token.end = self
def __init__(self, begin_token, position:StreamPosition): assert isinstance(begin_token, BEGIN) Token.__init__(self, _TokenTypes.INDENT, StreamRange(position, position)) self.begin = begin_token begin_token.add_indent(self)
def __init__(self, value:str, first_position:StreamPosition, position_after:StreamPosition, message=None): Token.__init__(self, _TokenTypes.ERROR, StreamRange(first_position, position_after)) self.value = value self.message = message
def __init__(self, position:StreamPosition): Token.__init__(self, _TokenTypes.BEGIN, StreamRange(position, position)) self.end = None """The corresponding END token.""" self.indents = [] """A list of INDENT (indentation) tokens for this block of code."""
def __init__(self, position:StreamPosition): Token.__init__(self, _TokenTypes.VALID_RESTART_TO, StreamRange(position, position))
def __init__(self, value:str, first_position:StreamPosition, position_after:StreamPosition): Token.__init__(self, _TokenTypes.COMMENT, StreamRange(first_position, position_after)) self.value = value
def __init__(self, begin_token, text:str, first_position:StreamPosition, position_after:StreamPosition): Token.__init__(self,_TokenTypes.END_MACRO, StreamRange(first_position, position_after)) self.text = text self.begin = begin_token begin_token.end = self
def __init__(self, text:str, first_position:StreamPosition, position_after:StreamPosition): Token.__init__(self, _TokenTypes.BEGIN_MACRO, StreamRange(first_position, position_after)) self.text = text
def __init__(self, value:str, first_position:StreamPosition, position_after:StreamPosition, meta=None): Token.__init__(self, _TokenTypes.CONSTITUENT, StreamRange(first_position, position_after)) self.value = value self.meta = meta