public String getElementName(String name) {
		if (".".equals(name)) {
			return "_wild";
		}

		if ( getCodeGenerator().g.getRule(name)!=null ) return name;
		int ttype = getCodeGenerator().g.getTokenType(name);
		if ( ttype==Token.INVALID_TYPE ) return name;
		return getTokenTypeAsTargetLabel(getCodeGenerator().g, ttype);
	}
If we know which actual function, we can provide the actual ctx type.
 This will contain implicit labels etc...  From outside, though, we
 see only ParserRuleContext unless there are externally visible stuff
 like args, locals, explicit labels, etc...
tool/src/org/antlr/v4/codegen/Target.java