From e349b1d698fbe6f2006b0ad8acb5e2e7409853e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Mon, 2 Feb 2015 19:36:29 -0500 Subject: [PATCH] jwrapper: deal with the optional "Compiled from" line in the grammar MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- contrib/jwrapper/grammar/javap.sablecc | 4 +++- contrib/jwrapper/src/jwrapper.nit | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) 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) -- 1.7.9.5