Public Member Functions | |
boolean | atEnd () |
boolean | atEnd () |
void | consume (final String token) throws ParseException |
void | consume (final String token) throws ParseException |
boolean | consumeBoolean () throws ParseException |
boolean | consumeBoolean () throws ParseException |
ByteString | consumeByteString () throws ParseException |
ByteString | consumeByteString () throws ParseException |
double | consumeDouble () throws ParseException |
double | consumeDouble () throws ParseException |
float | consumeFloat () throws ParseException |
float | consumeFloat () throws ParseException |
String | consumeIdentifier () throws ParseException |
String | consumeIdentifier () throws ParseException |
int | consumeInt32 () throws ParseException |
int | consumeInt32 () throws ParseException |
long | consumeInt64 () throws ParseException |
long | consumeInt64 () throws ParseException |
String | consumeString () throws ParseException |
String | consumeString () throws ParseException |
int | consumeUInt32 () throws ParseException |
int | consumeUInt32 () throws ParseException |
long | consumeUInt64 () throws ParseException |
long | consumeUInt64 () throws ParseException |
boolean | lookingAt (String text) |
boolean | lookingAt (String text) |
boolean | lookingAtInteger () |
boolean | lookingAtInteger () |
void | nextToken () |
void | nextToken () |
ParseException | parseException (final String description) |
ParseException | parseException (final String description) |
ParseException | parseExceptionPreviousToken (final String description) |
ParseException | parseExceptionPreviousToken (final String description) |
boolean | tryConsume (final String token) |
boolean | tryConsume (final String token) |
boolean | tryConsumeDouble () |
boolean | tryConsumeDouble () |
boolean | tryConsumeFloat () |
boolean | tryConsumeFloat () |
boolean | tryConsumeIdentifier () |
boolean | tryConsumeIdentifier () |
boolean | tryConsumeInt64 () |
boolean | tryConsumeInt64 () |
boolean | tryConsumeString () |
boolean | tryConsumeString () |
boolean | tryConsumeUInt64 () |
boolean | tryConsumeUInt64 () |
UnknownFieldParseException | unknownFieldParseExceptionPreviousToken (final String unknownField, final String description) |
UnknownFieldParseException | unknownFieldParseExceptionPreviousToken (final String unknownField, final String description) |
Private Member Functions | |
void | consumeByteString (List< ByteString > list) throws ParseException |
void | consumeByteString (List< ByteString > list) throws ParseException |
ParseException | floatParseException (final NumberFormatException e) |
ParseException | floatParseException (final NumberFormatException e) |
ParseException | integerParseException (final NumberFormatException e) |
ParseException | integerParseException (final NumberFormatException e) |
void | skipWhitespace () |
void | skipWhitespace () |
Tokenizer (final CharSequence text) | |
Tokenizer (final CharSequence text) | |
Private Attributes | |
int | column = 0 |
String | currentToken |
int | line = 0 |
final Matcher | matcher |
int | pos = 0 |
int | previousColumn = 0 |
int | previousLine = 0 |
final CharSequence | text |
Static Private Attributes | |
static final Pattern | DOUBLE_INFINITY |
static final Pattern | FLOAT_INFINITY |
static final Pattern | FLOAT_NAN = Pattern.compile("nanf?", Pattern.CASE_INSENSITIVE) |
static final Pattern | TOKEN |
static final Pattern | WHITESPACE = Pattern.compile("(\\s|(#.*$))++", Pattern.MULTILINE) |
Represents a stream of tokens parsed from a
.
The Java standard library provides many classes that you might think would be useful for implementing this, but aren't. For example:
Luckily, Java's regular expression support does manage to be useful to us. (Barely: We need
, which is new in Java 1.5.) So, we can use that, at least. Unfortunately, this implies that we need to have the entire input in one contiguous string.
Definition at line 816 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Construct a tokenizer that parses tokens from the given text.
Definition at line 851 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Construct a tokenizer that parses tokens from the given text.
Definition at line 936 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Are we at the end of the input?
Definition at line 875 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Are we at the end of the input?
Definition at line 960 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token exactly matches
, consume it. Otherwise, throw a {}.
Definition at line 939 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token exactly matches
, consume it. Otherwise, throw a {}.
Definition at line 1024 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a boolean, consume it and return its value. Otherwise, throw a {}.
Definition at line 1158 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a boolean, consume it and return its value. Otherwise, throw a {}.
Definition at line 1243 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a string, consume it, unescape it as a ByteString, and return it. Otherwise, throw a ParseException.
Definition at line 1198 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a string, consume it, unescape it as a ByteString, and return it. Otherwise, throw a ParseException.
Definition at line 1283 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Like consumeByteString() but adds each token of the string to the given list. String literals (whether bytes or text) may come in multiple adjacent tokens which are automatically concatenated, like in C or Python.
Definition at line 1212 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Like consumeByteString() but adds each token of the string to the given list. String literals (whether bytes or text) may come in multiple adjacent tokens which are automatically concatenated, like in C or Python.
Definition at line 1297 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a double, consume it and return its value. Otherwise, throw a {}.
Definition at line 1082 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a double, consume it and return its value. Otherwise, throw a {}.
Definition at line 1167 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a float, consume it and return its value. Otherwise, throw a {}.
Definition at line 1120 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a float, consume it and return its value. Otherwise, throw a {}.
Definition at line 1205 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is an identifier, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 964 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is an identifier, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1049 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 32-bit signed integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1000 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 32-bit signed integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1085 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit signed integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1028 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit signed integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1113 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a string, consume it and return its (unescaped) value. Otherwise, throw a ParseException.
Definition at line 1180 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a string, consume it and return its (unescaped) value. Otherwise, throw a ParseException.
Definition at line 1265 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 32-bit unsigned integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1014 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 32-bit unsigned integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1099 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit unsigned integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1055 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit unsigned integer, consume it and return its value. Otherwise, throw a ParseException.
Definition at line 1140 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Constructs an appropriate ParseException for the given
when trying to parse a float or double.
Definition at line 1262 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Constructs an appropriate ParseException for the given
when trying to parse a float or double.
Definition at line 1347 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Constructs an appropriate ParseException for the given
when trying to parse an integer.
Definition at line 1254 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Constructs an appropriate ParseException for the given
when trying to parse an integer.
Definition at line 1339 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns
if the current token's text is equal to that specified.
Definition at line 956 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns
if the current token's text is equal to that specified.
Definition at line 1041 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns
if the next token is an integer, but does not consume it.
Definition at line 946 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns
if the next token is an integer, but does not consume it.
Definition at line 1031 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Advance to the next token.
Definition at line 880 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Advance to the next token.
Definition at line 965 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns a ParseException with the current line and column numbers in the description, suitable for throwing.
Definition at line 1236 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns a ParseException with the current line and column numbers in the description, suitable for throwing.
Definition at line 1321 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns a ParseException with the line and column numbers of the previous token in the description, suitable for throwing.
Definition at line 1245 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns a ParseException with the line and column numbers of the previous token in the description, suitable for throwing.
Definition at line 1330 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Skip over any whitespace so that the matcher region starts at the next token.
Definition at line 915 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inlineprivate |
Skip over any whitespace so that the matcher region starts at the next token.
Definition at line 1000 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token exactly matches
, consume it and return
. Otherwise, return
without doing anything.
Definition at line 926 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token exactly matches
, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1011 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a double, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1107 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a double, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1192 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a float, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1145 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a float, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1230 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is an identifier, consume it and return
. Otherwise, return
without doing anything.
Definition at line 987 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is an identifier, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1072 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit signed integer, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1042 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit signed integer, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1127 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a string, consume it and return true. Otherwise, return false.
Definition at line 1185 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a string, consume it and return true. Otherwise, return false.
Definition at line 1270 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit unsigned integer, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1069 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
If the next token is a 64-bit unsigned integer, consume it and return
. Otherwise, return
without doing anything.
Definition at line 1154 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns a UnknownFieldParseException with the line and column numbers of the previous token in the description, and the unknown field name, suitable for throwing.
Definition at line 1270 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
inline |
Returns a UnknownFieldParseException with the line and column numbers of the previous token in the description, and the unknown field name, suitable for throwing.
Definition at line 1355 of file protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 826 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 819 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
staticprivate |
Definition at line 844 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
staticprivate |
Definition at line 846 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
staticprivate |
Definition at line 848 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 825 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 818 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 822 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 831 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 830 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
private |
Definition at line 817 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
staticprivate |
Definition at line 836 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.
|
staticprivate |
Definition at line 835 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/TextFormat.java.