Home | Trees | Indices | Help |
---|
|
object --+ | Tokenizer
Protocol buffer text representation tokenizer.
This class handles the lower level string parsing by splitting it into meaningful tokens.
It was directly ported from the Java protocol buffer API.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
_WHITESPACE = re.compile(r'\s
|
|||
_COMMENT = re.compile(r'
|
|||
_WHITESPACE_OR_COMMENT = re.compile(r'
|
|||
_TOKEN = re.compile(r'
|
|||
_IDENTIFIER = re.compile(r'
|
|||
_IDENTIFIER_OR_NUMBER = re.compile(r'\w
|
|||
mark =
|
|
|||
Inherited from |
|
x.__init__(...) initializes x; see help(type(x)) for signature
|
Checks the end of the text was reached. Returns: True iff the end was reached. |
Tries to consume a given piece of text. Args: token: Text to consume. Returns: True iff the text was consumed. |
Consumes a piece of text. Args: token: Text to consume. Raises: ParseError: If the text couldn't be consumed. |
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed. |
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed. |
Consumes an integer number. Args: is_long: True if the value should be returned as a long integer. Returns: The integer parsed. Raises: ParseError: If an integer couldn't be consumed. |
Consumes an floating point number. Returns: The number parsed. Raises: ParseError: If a floating point number couldn't be consumed. |
Consumes a boolean value. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed. |
Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed. |
Consumes a byte array value. Returns: The array parsed (as a string). Raises: ParseError: If a byte array value couldn't be consumed. |
Consume one token of a string literal. String literals (whether bytes or text) can come in multiple adjacent tokens which are automatically concatenated, like in C or Python. This method only consumes one token. Returns: The token parsed. Raises: ParseError: When the wrong format data is found. |
Creates and *returns* a ParseError for the previously read token. Args: message: A message to set for the exception. Returns: A ParseError instance. |
|
_TOKEN
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Fri Sep 6 13:21:35 2019 | http://epydoc.sourceforge.net |