generalization

This commit is contained in:
ParkerTenBroeck 2025-04-26 10:07:57 -04:00
parent 9b0a9b7ad2
commit 95e7f6a59e
8 changed files with 174 additions and 104 deletions

View file

@ -81,11 +81,16 @@ public class GenSMBuilder extends StateMachineBuilder {
smmap.put(new SpecialMethod(CD_Gen, "ret", MTD_Gen),(_, _) -> new RetHandler(true));
}
@Override
protected String uniqueName() {
return "Gen"+super.uniqueName();
}
@Override
protected void buildStateMachineMethod(ClassBuilder clb){
clb.withInterfaces(List.of(clb.constantPool().classEntry(CD_Gen)));
clb.withMethod("next", MethodTypeDesc.of(CD_Res), ClassFile.ACC_PUBLIC, mb -> mb.withCode(cob -> {
buildStateMachineMethodCode(clb, cob);
buildStateMachineMethodCode(clb, cob, 1);
}));
}
}