Main /
ChangesToCCodeGeneratorJavaFileMadeForMbedBack to Mbed The purpose of this file is to log the changes made in CCodeGenerator.java, and hopefully help anyone else that needs to edit this file for compatibility issues.
Before: // Token declareBlock. if (typeMembers.length() != 0) { sharedStream.clear(); args.add(typeMembers.toString()); sharedStream.appendCodeBlock("tokenDeclareBlock", args); if (defineEmptyToken) { sharedStream.append("Token emptyToken; " + comment("Used by *_delete() and others.") + _eol); } codeH.append(sharedStream.toString()); } After: // Token declareBlock. if (typeMembers.length() != 0) { sharedStream.clear(); args.add(typeMembers.toString()); sharedStream.appendCodeBlock("tokenDeclareBlock", args); if (defineEmptyToken) { sharedStream.append("extern Token emptyToken; " + comment("Used by *_delete() and others.") + _eol); codeC.append("Token emptyToken;" + comment("Used by *_delete() and others.") + _eol); } codeH.append(sharedStream.toString()); }
Before: for (Object containedActorO : container.deepEntityList()) { NamedObj containedActor = (NamedObj) containedActorO; if (CodeGeneratorAdapter.generateName(containedActor).contains( "Controller")) { continue; } if (containedActor instanceof AtomicActor || containedActor instanceof FSMActor) { HCode.append("struct AtomicActor* " + CodeGeneratorAdapter.generateName(containedActor) + ";" + _eol); } else if (containedActor instanceof CompositeActor) { HCode.append("struct CompositeActor* " + CodeGeneratorAdapter.generateName(containedActor) + ";" + _eol); } } After: for (Object containedActorO : container.deepEntityList()) { NamedObj containedActor = (NamedObj) containedActorO; if (CodeGeneratorAdapter.generateName(containedActor).contains( "Controller")) { continue; } if (containedActor instanceof AtomicActor || containedActor instanceof FSMActor) { CCode.append("struct AtomicActor* " + CodeGeneratorAdapter.generateName(containedActor) + ";" + _eol); HCode.append("extern struct AtomicActor* " + CodeGeneratorAdapter.generateName(containedActor) + ";" + _eol); } else if (containedActor instanceof CompositeActor) { CCode.append("struct CompositeActor* " + CodeGeneratorAdapter.generateName(containedActor) + ";" + _eol); HCode.append("extern struct CompositeActor* " + CodeGeneratorAdapter.generateName(containedActor) + ";" + _eol); } } In order to fix #include issues that embedded platforms do not have, certain files that are included in the generated code have to be changed. An example of a change made"
In order to fix this. The include is wrapped in: #if !defined(__MBED___) #include <sys/dir.h> #endif |