AMF lexer refactored to separate directory

This commit is contained in:
Jindra Petřík
2024-11-10 19:50:55 +01:00
parent 3712c3be45
commit d678e01a15
16 changed files with 1206 additions and 1216 deletions
@@ -132,7 +132,7 @@ import com.jpexs.decompiler.flash.importers.SwfXmlImporter;
import com.jpexs.decompiler.flash.importers.SymbolClassImporter;
import com.jpexs.decompiler.flash.importers.TextImporter;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3Importer;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3ParseException;
import com.jpexs.decompiler.flash.importers.amf.AmfParseException;
import com.jpexs.decompiler.flash.importers.svg.SvgImporter;
import com.jpexs.decompiler.flash.tags.ABCContainerTag;
import com.jpexs.decompiler.flash.tags.DefineBinaryDataTag;
@@ -1304,7 +1304,7 @@ public class CommandLineArgumentParser {
amfValue = ais.readValue("val");
break;
}
} catch (IOException | Amf3ParseException | NoSerializerExistsException ex) {
} catch (IOException | AmfParseException | NoSerializerExistsException ex) {
System.err.println("Error parsing input value: " + ex.getMessage());
System.exit(1);
return;
@@ -24,7 +24,7 @@ import com.jpexs.decompiler.flash.gui.View;
import com.jpexs.decompiler.flash.gui.ViewMessages;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3Importer;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3ParseException;
import com.jpexs.decompiler.flash.importers.amf.AmfParseException;
import com.jpexs.helpers.Helper;
import com.jpexs.helpers.ReflectionTools;
import java.awt.BorderLayout;
@@ -212,10 +212,10 @@ public class Amf3ValueEditor extends JPanel implements GenericTagEditor, FullSiz
if (!textVal.trim().isEmpty()) {
importer.stringToAmf(textVal);
}
} catch (IOException | Amf3ParseException ex) {
} catch (IOException | AmfParseException ex) {
if (ex instanceof Amf3ParseException) {
Amf3ParseException ape = (Amf3ParseException) ex;
if (ex instanceof AmfParseException) {
AmfParseException ape = (AmfParseException) ex;
if (ape.line > 0) {
editor.gotoLine((int) ape.line);
}
@@ -240,7 +240,7 @@ public class Amf3ValueEditor extends JPanel implements GenericTagEditor, FullSiz
String textVal = editor.getText();
try {
return textVal.trim().isEmpty() ? null : new Amf3Value(importer.stringToAmf(textVal));
} catch (IOException | Amf3ParseException ex) {
} catch (IOException | AmfParseException ex) {
return value;
}
}
@@ -27,7 +27,7 @@ import com.jpexs.decompiler.flash.gui.ViewMessages;
import com.jpexs.decompiler.flash.gui.editor.LineMarkedEditorPane;
import com.jpexs.decompiler.flash.importers.amf.amf0.Amf0Importer;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3Importer;
import com.jpexs.decompiler.flash.importers.amf.amf3.Amf3ParseException;
import com.jpexs.decompiler.flash.importers.amf.AmfParseException;
import com.jpexs.decompiler.flash.sol.SolFile;
import com.jpexs.helpers.Helper;
import java.awt.BorderLayout;
@@ -269,7 +269,7 @@ public class SolEditorFrame extends AppFrame {
amfVersionComboBox.setVisible(false);
amfVersionLabel.setVisible(true);
ViewMessages.showMessageDialog(this, translate("info.saved"), AppStrings.translate("message.info"), JOptionPane.INFORMATION_MESSAGE);
} catch (Amf3ParseException ex) {
} catch (AmfParseException ex) {
editor.gotoLine((int) ex.line);
editor.markError();
ViewMessages.showMessageDialog(this, translate("error.parse").replace("%reason%", ex.text).replace("%line%", "" + ex.line), AppStrings.translate("error"), JOptionPane.ERROR_MESSAGE);