contrib/jwrapper grammar: fix generic types parameters with bounds
[nit.git] / contrib / jwrapper / grammar / javap.sablecc
index 6ec9f18..34785d5 100644 (file)
@@ -24,7 +24,7 @@ class_declaration = modifier* class_or_interface full_class_name
 class_or_interface = 'class'|'interface';
 
 modifier
-       = 'public'|'private'|'protected'|'static'|'final'|'native'|'synchronized'|'abstract'|'threadsafe'|'transient'|'volatile';
+       = 'public'|'private'|'protected'|'static'|'final'|'native'|'synchronized'|'abstract'|'threadsafe'|'transient'|'volatile'|'strictfp';
 type = primitive_type brackets*;
 primitive_type
        = 'boolean'|'byte'|'char'|'short'|'int'|'float'|'long'|'double'
@@ -32,8 +32,11 @@ primitive_type
 
 type_ref
        = full_class_name
-       | generic_identifier 'extends' full_class_name
-       | question_mark;
+       | generic_identifier 'extends' type_bound
+       | wildcard;
+type_bound
+       = {tail:} type_bound '&' full_class_name
+       | {head:} full_class_name;
 
 generic_param = '<' generic_parameter_list '>';
 generic_parameter_list
@@ -60,7 +63,7 @@ method_id = identifier;
 
 property_declaration
        = {method:} modifier* generic_param? type method_id '(' parameter_list? ')' throws_declaration? ';'
-       | {constructor:} modifier* full_class_name '(' parameter_list? ')' throws_declaration? ';'
+       | {constructor:} modifier* generic_param? full_class_name '(' parameter_list? ')' throws_declaration? ';'
        | {attribute:} modifier* type attribute_id throws_declaration? ';'
        | {static:} modifier* '{' '}' ';'
        | ';';