public List<AMethodDeclIR> getNamedTypeInvMethods(ADefaultClassDeclIR clazz) { List<AMethodDeclIR> invDecls = new LinkedList<AMethodDeclIR>(); for (ATypeDeclIR typeDecl : clazz.getTypeDecls()) { if (typeDecl.getDecl() instanceof ANamedTypeDeclIR) { AMethodDeclIR m = getInvMethod(typeDecl); if (m != null) { invDecls.add(m); } } } return invDecls; }
public List<ARecordDeclIR> getRecords(List<IRStatus<PIR>> ast) { List<ARecordDeclIR> records = new LinkedList<ARecordDeclIR>(); for (IRStatus<ADefaultClassDeclIR> classStatus : IRStatus.extract(ast, ADefaultClassDeclIR.class)) { for (ATypeDeclIR typeDecl : classStatus.getIrNode().getTypeDecls()) { if (typeDecl.getDecl() instanceof ARecordDeclIR) { records.add((ARecordDeclIR) typeDecl.getDecl()); } } } return records; }
@Override public void caseADefaultClassDeclIR(ADefaultClassDeclIR node) throws AnalysisException { for (ATypeDeclIR typeDecl : node.getTypeDecls()) { if (typeDecl.getDecl() instanceof ARecordDeclIR) { ARecordDeclIR rec = (ARecordDeclIR) typeDecl.getDecl(); rec.getMethods().addFirst(recCreator.genToStringMethod(rec)); rec.getMethods().addFirst(recCreator.genCopyMethod(rec)); rec.getMethods().addFirst(recCreator.genHashcodeMethod(rec)); rec.getMethods().addFirst(recCreator.genEqualsMethod(rec)); rec.getMethods().addFirst(recCreator.genRecConstructor(rec)); } } } }
for (ATypeDeclIR typeDecl : clazz.getTypeDecls()) List<ATypeDeclIR> classTypeDecls = new LinkedList<ATypeDeclIR>(clazz.getTypeDecls());
List<ATypeDeclIR> copy = new ArrayList<ATypeDeclIR>(node.getTypeDecls()); for( ATypeDeclIR e : copy)
List<ATypeDeclIR> copy = new ArrayList<ATypeDeclIR>(node.getTypeDecls()); for( ATypeDeclIR e : copy)
List<ATypeDeclIR> copy = new ArrayList<ATypeDeclIR>(node.getTypeDecls()); for( ATypeDeclIR e : copy)
List<ATypeDeclIR> copy = new ArrayList<ATypeDeclIR>(node.getTypeDecls()); for( ATypeDeclIR e : copy)
List<ATypeDeclIR> copy = new ArrayList<ATypeDeclIR>(node.getTypeDecls()); for( ATypeDeclIR e : copy)
for (ATypeDeclIR d : clazz.getTypeDecls())
typeDecl.setAccess(IRConstants.PUBLIC); clazz.getTypeDecls().add(typeDecl); typeDecl.setDecl(record); clazz.getTypeDecls().add(typeDecl);
for (ATypeDeclIR typeDecl : clazz.getTypeDecls())