code: private static Expression buildAccessChain(
        Expression base, CodeChunk.Generator generator, Iterator<ChainAccess> chain) {
      if (!chain.hasNext()) {
        return base; // base case
      }
      ChainAccess link = chain.next();
      if (link.nullSafe) {
        if (!base.isCheap()) {
          base = generator.declarationBuilder().setRhs(base).build().ref();
        }
        return ifExpression(base.doubleEqualsNull(), LITERAL_NULL)
            .setElse(buildAccessChain(link.extend(base), generator, chain))
            .build(generator);
      }
      return buildAccessChain(link.extend(base), generator, chain);
    }
docs: Builds the access chain.
  
  <p>For chains with no null-safe accessses this is a simple and direct approach. However, for
  null safe accesses we will stash base expressions into a temporary variable so we can generate
  multiple references to it.
  
  <p>For example:
  
  <ol>
  <li>{@code $a.b} -> {@code a.b}
  <li>{@code $a?.b} -> {@code var t = a; t == null ? null : a.b}
  <li>{@code a?.b?.c} -> {@code var t = a; var r;if (t== null) {var t2 = a.b; r= t2 == null ?
  null : t2.c}}
  <li>{@code a?.b?.c.d} {@code var t = a; var r;if (t== null) {var t2 = a.b; r= t2 == null ?
  null : t2.c.d}}
  </ol>