#676: extended logging for text import, imorpt logic moved to separated class, allow to ignore errors duting import

This commit is contained in:
2014-11-23 22:54:19 +01:00
parent abb3ec9dc7
commit 1cf0c28c74
61 changed files with 573 additions and 472 deletions
@@ -2978,7 +2978,7 @@ public final class Flasm3Lexer {
zzInput = zzBufferL[zzCurrentPosL++];
}
}
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput]];
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]];
if (zzNext == -1) {
break zzForAction;
}
@@ -1308,7 +1308,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
if (type instanceof UnboundedTypeItem) {
return 0;
}
if((""+type).equals("*")){
if (("" + type).equals("*")) {
return 0;
}
@@ -1487,7 +1487,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
}
}
int slotScope = subMethod? 0 : 1;
int slotScope = subMethod ? 0 : 1;
for (AssignableAVM2Item an : subvariables) {
if (an instanceof NameAVM2Item) {
@@ -1777,7 +1777,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
isNs = true;
}
}
if ((type instanceof TypeItem) && (((TypeItem) type).fullTypeName.equals("Namespace"))) {
isNs = true;
}
@@ -1840,7 +1840,7 @@ public class AVM2SourceGenerator implements SourceGenerator {
if (t instanceof TraitSlotConst) {
if (((TraitSlotConst) t).isNamespace()) {
Namespace ns = a.constants.getNamespace(((TraitSlotConst) t).value_index);
return abc.constants.getNamespaceId(new Namespace(ns.kind, abc.constants.getStringId(ns.getName(a.constants, true),true)), 0, true);
return abc.constants.getNamespaceId(new Namespace(ns.kind, abc.constants.getStringId(ns.getName(a.constants, true), true)), 0, true);
}
}
}
@@ -1357,7 +1357,7 @@ public final class ActionScriptLexer {
zzCurrentPosL += Character.charCount(zzInput);
}
}
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput]];
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]];
if (zzNext == -1) {
break zzForAction;
}
@@ -587,9 +587,9 @@ public class ActionScriptParser {
throw new AVM2ParseException("Only one static keyword allowed", lexer.yyline());
}
isStatic = true;
} else if(s.type == SymbolType.NAMESPACE) {
} else if (s.type == SymbolType.NAMESPACE) {
break;
} else if(s.type == SymbolType.NATIVE) {
} else if (s.type == SymbolType.NATIVE) {
throw new AVM2ParseException("Cannot compile native code", lexer.yyline());
} else if (s.group == SymbolGroup.IDENTIFIER) {
customAccess = s.value.toString();
@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. */
* License along with this library.
*/
package com.jpexs.decompiler.flash.abc.avm2.parser.script;
import com.jpexs.decompiler.flash.SourceGeneratorLocalData;
@@ -237,9 +238,9 @@ public class NameAVM2Item extends AssignableAVM2Item {
return toSourceMerge(localData, generator,
ins(new GetScopeObjectIns(), slotScope),
assignedValue, !(("" + assignedValue.returnType()).equals("" + type) && (basicTypes.contains("" + type))) ? generateCoerce(localData, generator, type) : null, needsReturn
? dupSetTemp(localData, generator, ret_temp) : null, generateSetLoc(regNumber), slotNumber > -1
? ins(new SetSlotIns(), slotNumber)
: null,
? dupSetTemp(localData, generator, ret_temp) : null, generateSetLoc(regNumber), slotNumber > -1
? ins(new SetSlotIns(), slotNumber)
: null,
needsReturn ? getTemp(localData, generator, ret_temp) : null,
killTemp(localData, generator, Arrays.asList(ret_temp)));
} else {
@@ -258,7 +258,7 @@ public class PropertyAVM2Item extends AssignableAVM2Item {
for (int i = 0; i < openedNamespaces.size(); i++) {
int nsindex = openedNamespaces.get(i);
int nsKind = abc.constants.constant_namespace.get(openedNamespaces.get(i)).kind;
String nsname = abc.constants.constant_namespace.get(openedNamespaces.get(i)).getName(abc.constants, true);
String nsname = abc.constants.constant_namespace.get(openedNamespaces.get(i)).getName(abc.constants, true);
int name_index = 0;
for (int m = 1; m < abc.constants.constant_multiname.size(); m++) {
Multiname mname = abc.constants.constant_multiname.get(m);
@@ -326,7 +326,7 @@ public class UnresolvedAVM2Item extends AssignableAVM2Item {
impName = impName.substring(impName.lastIndexOf('.') + 1);
}
if (impName.equals(parts.get(0))) {
TypeItem ret = new TypeItem(imp);
TypeItem ret = new TypeItem(imp);
resolved = ret;
for (int i = 1; i < parts.size(); i++) {
resolved = new PropertyAVM2Item(resolved, parts.get(i), abc, otherAbcs, openedNamespaces, new ArrayList<MethodBody>());
@@ -866,7 +866,7 @@ public final class MethodInfoLexer {
zzInput = zzBufferL[zzCurrentPosL++];
}
}
int zzNext = zzTransL[ zzRowMapL[zzState] + zzCMapL[zzInput]];
int zzNext = zzTransL[zzRowMapL[zzState] + zzCMapL[zzInput]];
if (zzNext == -1) {
break zzForAction;
}
@@ -323,7 +323,7 @@ public class MethodInfo {
} else {
restName = "rest";
}
HighlightData pdata = new HighlightData();
pdata.declaration = true;
pdata.declaredType = "*";