Parser
Ignored blank;
+// ---
+// Class and properties
+
files = file+;
file = compiled_from? class_declaration;
extends_declaration? implements_declaration? throws_declaration?
'{' property_declaration* '}';
+modifier
+ = 'public'|'private'|'protected'|'static'|'final'|'native'
+ |'synchronized'|'abstract'|'threadsafe'|'transient'|'volatile'|'strictfp';
+
class_or_interface = 'class'|'interface';
-modifier
- = 'public'|'private'|'protected'|'static'|'final'|'native'|'synchronized'|'abstract'|'threadsafe'|'transient'|'volatile'|'strictfp';
+implements_declaration = 'implements' types;
+extends_declaration = 'extends' types;
+throws_declaration = 'throws' types?;
+
+property_declaration
+ = {method:} modifier* generic_parameters? type identifier '(' types? ')' throws_declaration? ';'
+ | {constructor:} modifier* generic_parameters? full_class_name '(' types? ')' throws_declaration? ';'
+ | {attribute:} modifier* type identifier brackets* throws_declaration? ';'
+ | {static:} modifier* '{' '}' ';'
+ | ';';
+
+// ---
+// Types
type = base_type brackets* dots?;
+types
+ = {tail:} types ',' type
+ | {head:} type;
+
base_type
= {primitive:} primitive_base_type
| {class:} full_class_name
= {class:} full_class_name
| {wildcard:} wildcard;
+class_name = identifier generic_parameters?;
+
full_class_name
= {tail:} full_class_name separator class_name
| {head:} class_name;
-class_name = identifier generic_parameters?;
generic_parameters = '<' types '>';
-
-types
- = {tail:} types ',' type
- | {head:} type;
-
-property_declaration
- = {method:} modifier* generic_parameters? type identifier '(' types? ')' throws_declaration? ';'
- | {constructor:} modifier* generic_parameters? full_class_name '(' types? ')' throws_declaration? ';'
- | {attribute:} modifier* type identifier brackets* throws_declaration? ';'
- | {static:} modifier* '{' '}' ';'
- | ';';
-
-implements_declaration = 'implements' types;
-extends_declaration = 'extends' types;
-throws_declaration = 'throws' types?;