Kulla: API naming question JLS vs JVM class
Robert Field
robert.field at oracle.com
Sun Jun 21 20:45:37 UTC 2015
Two off lists responses --
-------------------------
I vote for: TYPE_DECL, VAR_DECL, METHOD_DECL.
-------------------------
"Type" usually references to a type not a declaration. Variable
similarly. And their Keys subclass off DeclarationKey. So, a _DECL
suffix makes sense.
-------------------------
-R
On 06/20/15 19:19, Robert Field wrote:
> Keys for what is called a "class" in the JVM (that is a class, enum,
> interface, or annotation interface in JLS speak) have Key.Kind.CLASS
> and are instances of Key.ClassKey.
>
> This is awkward both in terms of documenting them (I'm referencing the
> JLS) and because the SubKind values are JLS-speak:
>
> CLASS_SUBKIND(Key.Kind.CLASS),
> INTERFACE_SUBKIND(Key.Kind.CLASS),
> ENUM_SUBKIND(Key.Kind.CLASS),
> ANNOTATION_TYPE_SUBKIND(Key.Kind.CLASS),
>
> Looking at the JLS the syntax production is TypeDeclaration. So, I
> think the Key.Kind should be changed to TYPE.
>
> It could be changed to TYPE_DECLARATION but then we would want to also
> change VARIABLE and METHOD to
>
> VARIABLE_DECLARATION
> METHOD_DECLARATION
>
> Which would make use pretty verbose. Could be abbreviated, but the
> API currently mostly shies away from abbreviations.
>
> So, the choices are:
>
> (1) TYPE TypeKey
>
> (2) TYPE_DECLARATION TypeDeclarationKey
>
> (3) TYPE_DECL TypeDeclKey
>
> (4) CLASS ClassKey
>
> What do you all think?
>
> Thanks,
> Robert
>
More information about the kulla-dev
mailing list