forked from JavaTX/JavaCompilerCore
bug fix
This commit is contained in:
parent
398c1992fa
commit
56d919f446
@ -181,7 +181,7 @@ public class BytecodeGen implements ASTVisitor {
|
|||||||
Signature signature = new Signature(method, genericsAndBoundsMethod, methodParamsAndTypes,resultSet);
|
Signature signature = new Signature(method, genericsAndBoundsMethod, methodParamsAndTypes,resultSet);
|
||||||
sig = signature.toString();
|
sig = signature.toString();
|
||||||
}
|
}
|
||||||
|
System.out.println(sig);
|
||||||
NormalMethod meth = new NormalMethod(method,genericsAndBounds,genericsAndBoundsMethod,hasGen);
|
NormalMethod meth = new NormalMethod(method,genericsAndBounds,genericsAndBoundsMethod,hasGen);
|
||||||
methDesc = meth.accept(new DescriptorToString(resultSet));
|
methDesc = meth.accept(new DescriptorToString(resultSet));
|
||||||
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC+acc, method.getName(), methDesc, sig, null);
|
MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC+acc, method.getName(), methDesc, sig, null);
|
||||||
|
@ -31,6 +31,7 @@ import de.dhbwstuttgart.parser.SyntaxTreeGenerator.AssignToLocal;
|
|||||||
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
import de.dhbwstuttgart.syntaxtree.FormalParameter;
|
||||||
import de.dhbwstuttgart.syntaxtree.Method;
|
import de.dhbwstuttgart.syntaxtree.Method;
|
||||||
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
|
import de.dhbwstuttgart.syntaxtree.StatementVisitor;
|
||||||
|
import de.dhbwstuttgart.syntaxtree.statement.literal.BoolLiteral;
|
||||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
|
import de.dhbwstuttgart.syntaxtree.statement.literal.Literal;
|
||||||
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
import de.dhbwstuttgart.syntaxtree.statement.literal.Null;
|
||||||
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
import de.dhbwstuttgart.syntaxtree.type.RefTypeOrTPHOrWildcardOrGeneric;
|
||||||
@ -420,8 +421,8 @@ public class BytecodeGenMethod implements StatementVisitor{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(WhileStmt whileStmt) {
|
public void visit(WhileStmt whileStmt) {
|
||||||
// TODO Auto-generated method stub
|
whileStmt.expr.accept(this);
|
||||||
|
whileStmt.loopBlock.accept(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -437,7 +438,6 @@ public class BytecodeGenMethod implements StatementVisitor{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visit(Literal literal) {
|
public void visit(Literal literal) {
|
||||||
// value?
|
|
||||||
mv.visitLdcInsn(getResolvedType(literal.getType()));
|
mv.visitLdcInsn(getResolvedType(literal.getType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,9 +48,11 @@ public class DescriptorToString implements DescriptorVisitor{
|
|||||||
}else {
|
}else {
|
||||||
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||||
}
|
}
|
||||||
}else if(((RefType) fp.getType()).getParaList().size() > 0){
|
}
|
||||||
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.toString().replace(".", "%").replace("<", "%%").replace(">", "%%")+ ";";
|
// else if(((RefType) fp.getType()).getParaList().size() > 0){
|
||||||
}else {
|
// desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.toString().replace(".", "%").replace("<", "%%").replace(">", "%%")+ ";";
|
||||||
|
// }
|
||||||
|
else {
|
||||||
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,9 @@ public class TypeToSignature implements TypeVisitor<String> {
|
|||||||
params += "L"+param.toString().replace(".", "/");
|
params += "L"+param.toString().replace(".", "/");
|
||||||
if(it.hasNext())params += ";";
|
if(it.hasNext())params += ";";
|
||||||
}
|
}
|
||||||
params += ";>;";
|
params += ";>";
|
||||||
}
|
}
|
||||||
return refType.getName().toString().replace(".", "/") + params;
|
return refType.getName().toString().replace(".", "/") + params+";";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user