But that causes a shift-reduce conflict, and it does not parse correctly. I am writing my own AST classes, and would like to keep the initialization logic as simple as possible, but I can't find a solution that helps me.

What I ended up doing to make it work is create a Method class and a Static method class that inherits from method and sets a flag for static. I then had to build my grammar like this:

Ok, I think that works pretty well. It looks like I have an additional shift-reduce conflict elsewhere in my grammar that this exposes. I've only ever created LL grammars before, so I'm not too comfortable formatting the rules to remove ambiguity.