Search in sources :

Example 1 with MemberReferenceNode

use of com.google.auto.value.processor.escapevelocity.ReferenceNode.MemberReferenceNode in project auto by google.

the class Parser method parseReferenceMember.

/**
   * Parses a reference member, which is either a property reference like {@code $x.y} or a method
   * call like {@code $x.y($z)}.
   * <pre>{@code
   * <reference-member> -> .<id><reference-method-or-property><reference-suffix>
   * <reference-method-or-property> -> <id> |
   *                                   <id> ( <method-parameter-list> )
   * }</pre>
   *
   * @param lhs the reference node representing what appears to the left of the dot, like the
   * {@code $x} in {@code $x.foo} or {@code $x.foo()}.
   */
private ReferenceNode parseReferenceMember(ReferenceNode lhs) throws IOException {
    assert c == '.';
    next();
    String id = parseId("Member");
    ReferenceNode reference;
    if (c == '(') {
        reference = parseReferenceMethodParams(lhs, id);
    } else {
        reference = new MemberReferenceNode(lhs, id);
    }
    return parseReferenceSuffix(reference);
}
Also used : IndexReferenceNode(com.google.auto.value.processor.escapevelocity.ReferenceNode.IndexReferenceNode) MemberReferenceNode(com.google.auto.value.processor.escapevelocity.ReferenceNode.MemberReferenceNode) MethodReferenceNode(com.google.auto.value.processor.escapevelocity.ReferenceNode.MethodReferenceNode) PlainReferenceNode(com.google.auto.value.processor.escapevelocity.ReferenceNode.PlainReferenceNode) MemberReferenceNode(com.google.auto.value.processor.escapevelocity.ReferenceNode.MemberReferenceNode)

Aggregations

IndexReferenceNode (com.google.auto.value.processor.escapevelocity.ReferenceNode.IndexReferenceNode)1 MemberReferenceNode (com.google.auto.value.processor.escapevelocity.ReferenceNode.MemberReferenceNode)1 MethodReferenceNode (com.google.auto.value.processor.escapevelocity.ReferenceNode.MethodReferenceNode)1 PlainReferenceNode (com.google.auto.value.processor.escapevelocity.ReferenceNode.PlainReferenceNode)1