示例#1
0
 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
示例#2
0
 def __init__(self, begin_token, position:StreamPosition):
     Token.__init__(self, _TokenTypes.END, StreamRange(position, position))
     self.begin = begin_token
     begin_token.end = self
示例#3
0
 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)
示例#4
0
 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
示例#5
0
 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."""
示例#6
0
 def __init__(self, position:StreamPosition):
     Token.__init__(self, _TokenTypes.VALID_RESTART_TO, StreamRange(position, position))
示例#7
0
 def __init__(self, value:str, first_position:StreamPosition, position_after:StreamPosition):
     Token.__init__(self, _TokenTypes.COMMENT, StreamRange(first_position, position_after))
     self.value = value
示例#8
0
 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
示例#9
0
 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
示例#10
0
 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