From: Alexis Laferrière Date: Tue, 3 Feb 2015 00:36:29 +0000 (-0500) Subject: jwrapper: deal with the optional "Compiled from" line in the grammar X-Git-Tag: v0.7.2~35^2~2 X-Git-Url: http://nitlanguage.org jwrapper: deal with the optional "Compiled from" line in the grammar Signed-off-by: Alexis Laferrière --- diff --git a/contrib/jwrapper/grammar/javap.sablecc b/contrib/jwrapper/grammar/javap.sablecc index 87dfa12..0777c88 100644 --- a/contrib/jwrapper/grammar/javap.sablecc +++ b/contrib/jwrapper/grammar/javap.sablecc @@ -9,10 +9,12 @@ separator = ('.'|'/'); Parser Ignored blank; -multi_files = class_or_interface*; +multi_files = compiled_from? class_or_interface; class_or_interface = class_declaration | interface_declaration; +compiled_from = 'Compiled from "' identifier+ '.java"'; + class_declaration = class_header '{' property_declaration* '}'; class_header = modifier* 'class' full_class_name extends_declaration? diff --git a/contrib/jwrapper/src/jwrapper.nit b/contrib/jwrapper/src/jwrapper.nit index 861d986..56128b7 100644 --- a/contrib/jwrapper/src/jwrapper.nit +++ b/contrib/jwrapper/src/jwrapper.nit @@ -65,9 +65,6 @@ end var javap = new IProcess("javap", "-public", dot_class) -# Eat the superfluous output line -javap.read_line - var p = new TestParser_javap var tree = p.work(javap.read_all)