use of com.google.auto.value.processor.escapevelocity.ReferenceNode.IndexReferenceNode in project auto by google.
the class Parser method parseReferenceIndex.
/**
* Parses an index suffix to a method, like {@code $x[$i]}.
* <pre>{@code
* <reference-index> -> [ <expression> ]
* }</pre>
*
* @param lhs the reference node representing what appears to the left of the dot, like the
* {@code $x} in {@code $x[$i]}.
*/
private ReferenceNode parseReferenceIndex(ReferenceNode lhs) throws IOException {
assert c == '[';
next();
ExpressionNode index = parseExpression();
if (c != ']') {
throw parseException("Expected ]");
}
next();
ReferenceNode reference = new IndexReferenceNode(lhs, index);
return parseReferenceSuffix(reference);
}
Aggregations