Public Attributes | |
token | |
Private Member Functions | |
def | _ConsumeSingleByteString (self) |
def | _ConsumeSingleByteString (self) |
def | _PopLine (self) |
def | _PopLine (self) |
def | _SkipWhitespace (self) |
def | _SkipWhitespace (self) |
def | _StringParseError (self, e) |
def | _StringParseError (self, e) |
Private Attributes | |
_column | |
_current_line | |
_line | |
_lines | |
_more_lines | |
_position | |
_previous_column | |
_previous_line | |
_skip_comments | |
_token_start | |
_whitespace_pattern | |
Static Private Attributes | |
_COMMENT = re.compile(r'(\s*#.*$)', re.MULTILINE) | |
_IDENTIFIER = re.compile(r'[^\d\W]\w*') | |
_IDENTIFIER_OR_NUMBER = re.compile(r'\w+') | |
_TOKEN | |
_WHITESPACE = re.compile(r'\s+') | |
_WHITESPACE_OR_COMMENT = re.compile(r'(\s|(#.*$))+', re.MULTILINE) | |
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.
Definition at line 1181 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.__init__ | ( | self, | |
lines, | |||
skip_comments = True |
|||
) |
Definition at line 1205 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.__init__ | ( | self, | |
lines, | |||
skip_comments = True |
|||
) |
Definition at line 1241 of file protobuf/python/google/protobuf/text_format.py.
|
private |
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.
Definition at line 1448 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
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.
Definition at line 1481 of file protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1233 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1269 of file protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1245 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1281 of file protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1499 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1532 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.AtEnd | ( | self | ) |
Checks the end of the text was reached. Returns: True iff the end was reached.
Definition at line 1225 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.AtEnd | ( | self | ) |
Checks the end of the text was reached. Returns: True iff the end was reached.
Definition at line 1261 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.Consume | ( | self, | |
token | |||
) |
Consumes a piece of text. Args: token: Text to consume. Raises: ParseError: If the text couldn't be consumed.
Definition at line 1268 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.Consume | ( | self, | |
token | |||
) |
Consumes a piece of text. Args: token: Text to consume. Raises: ParseError: If the text couldn't be consumed.
Definition at line 1304 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeBool | ( | self | ) |
Consumes a boolean value. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed.
Definition at line 1396 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeBool | ( | self | ) |
Consumes a boolean value. Returns: The bool parsed. Raises: ParseError: If a boolean value couldn't be consumed.
Definition at line 1429 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeByteString | ( | self | ) |
Consumes a byte array value. Returns: The array parsed (as a string). Raises: ParseError: If a byte array value couldn't be consumed.
Definition at line 1434 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeByteString | ( | self | ) |
Consumes a byte array value. Returns: The array parsed (as a string). Raises: ParseError: If a byte array value couldn't be consumed.
Definition at line 1467 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeComment | ( | self | ) |
Definition at line 1280 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeComment | ( | self | ) |
Definition at line 1316 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeCommentOrTrailingComment | ( | self | ) |
Consumes a comment, returns a 2-tuple (trailing bool, comment str).
Definition at line 1287 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeCommentOrTrailingComment | ( | self | ) |
Consumes a comment, returns a 2-tuple (trailing bool, comment str).
Definition at line 1323 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeEnum | ( | self, | |
field | |||
) |
Definition at line 1474 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeEnum | ( | self, | |
field | |||
) |
Definition at line 1507 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeFloat | ( | self | ) |
Consumes an floating point number. Returns: The number parsed. Raises: ParseError: If a floating point number couldn't be consumed.
Definition at line 1380 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeFloat | ( | self | ) |
Consumes an floating point number. Returns: The number parsed. Raises: ParseError: If a floating point number couldn't be consumed.
Definition at line 1413 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeIdentifier | ( | self | ) |
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed.
Definition at line 1310 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeIdentifier | ( | self | ) |
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed.
Definition at line 1346 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeIdentifierOrNumber | ( | self | ) |
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed.
Definition at line 1332 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeIdentifierOrNumber | ( | self | ) |
Consumes protocol message field identifier. Returns: Identifier string. Raises: ParseError: If an identifier couldn't be consumed.
Definition at line 1368 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeInteger | ( | self | ) |
Consumes an integer number. Returns: The integer parsed. Raises: ParseError: If an integer couldn't be consumed.
Definition at line 1390 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeInteger | ( | self, | |
is_long = False |
|||
) |
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.
Definition at line 1355 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeString | ( | self | ) |
Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed.
Definition at line 1419 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ConsumeString | ( | self | ) |
Consumes a string value. Returns: The string parsed. Raises: ParseError: If a string value couldn't be consumed.
Definition at line 1452 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.LookingAt | ( | self, | |
token | |||
) |
Definition at line 1222 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.LookingAt | ( | self, | |
token | |||
) |
Definition at line 1258 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.NextToken | ( | self | ) |
Reads the next meaningful token.
Definition at line 1502 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.NextToken | ( | self | ) |
Reads the next meaningful token.
Definition at line 1535 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ParseError | ( | self, | |
message | |||
) |
Creates and *returns* a ParseError for the current token.
Definition at line 1494 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ParseError | ( | self, | |
message | |||
) |
Creates and *returns* a ParseError for the current token.
Definition at line 1527 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ParseErrorPreviousToken | ( | self, | |
message | |||
) |
Creates and *returns* a ParseError for the previously read token. Args: message: A message to set for the exception. Returns: A ParseError instance.
Definition at line 1482 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.ParseErrorPreviousToken | ( | self, | |
message | |||
) |
Creates and *returns* a ParseError for the previously read token. Args: message: A message to set for the exception. Returns: A ParseError instance.
Definition at line 1515 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsume | ( | self, | |
token | |||
) |
Tries to consume a given piece of text. Args: token: Text to consume. Returns: True iff the text was consumed.
Definition at line 1254 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsume | ( | self, | |
token | |||
) |
Tries to consume a given piece of text. Args: token: Text to consume. Returns: True iff the text was consumed.
Definition at line 1290 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeByteString | ( | self | ) |
Definition at line 1412 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeByteString | ( | self | ) |
Definition at line 1445 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeFloat | ( | self | ) |
Definition at line 1373 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeFloat | ( | self | ) |
Definition at line 1406 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeIdentifier | ( | self | ) |
Definition at line 1303 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeIdentifier | ( | self | ) |
Definition at line 1339 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeIdentifierOrNumber | ( | self | ) |
Definition at line 1325 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeIdentifierOrNumber | ( | self | ) |
Definition at line 1361 of file protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeInteger | ( | self | ) |
Definition at line 1347 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
def google.protobuf.text_format.Tokenizer.TryConsumeInteger | ( | self | ) |
Definition at line 1383 of file protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1208 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
staticprivate |
Definition at line 1191 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1212 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
staticprivate |
Definition at line 1202 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
staticprivate |
Definition at line 1203 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1207 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1211 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1215 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1206 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1214 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1213 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1216 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
staticprivate |
Definition at line 1193 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1209 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
staticprivate |
Definition at line 1190 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
staticprivate |
Definition at line 1192 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
|
private |
Definition at line 1217 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.
google.protobuf.text_format.Tokenizer.token |
Definition at line 1210 of file bloaty/third_party/protobuf/python/google/protobuf/text_format.py.