contrib/jwrapper grammar: reorder of the grammar file (no other changes)
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 2 Aug 2015 16:20:01 +0000 (12:20 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 5 Aug 2015 01:37:52 +0000 (21:37 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/jwrapper/grammar/javap.sablecc

index ead17fd..8d281ae 100644 (file)
@@ -15,6 +15,9 @@ dots = '...';
 Parser
 Ignored blank;
 
+// ---
+// Class and properties
+
 files = file+;
 file = compiled_from? class_declaration;
 
@@ -22,13 +25,32 @@ class_declaration = modifier* class_or_interface full_class_name
        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
@@ -47,24 +69,10 @@ generic_identifier
        = {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?;