3 import java_cup.runtime.ComplexSymbolFactory;
4 import java_cup.runtime.ScannerBuffer;
6 import java.util.Collection;
7 import java.util.Collections;
8 import java.util.HashMap;
9 import java.util.HashSet;
10 import java.util.List;
14 import iotpolicy.parser.Lexer;
15 import iotpolicy.parser.Parser;
16 import iotpolicy.tree.ParseNode;
17 import iotpolicy.tree.ParseNodeVector;
18 import iotpolicy.tree.ParseTreeHandler;
19 import iotpolicy.tree.CapabilityDecl;
20 import iotpolicy.tree.InterfaceDecl;
21 import iotpolicy.tree.RequiresDecl;
23 /** Class IoTCompiler is the main interface/stub compiler for
24 * files generation. This class calls helper classes
25 * such as Parser, Lexer, InterfaceDecl, CapabilityDecl,
26 * RequiresDecl, ParseTreeHandler, etc.
28 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
32 public class IoTCompiler {
37 private ParseTreeHandler ptHandler;
38 private InterfaceDecl intDecl;
39 private CapabilityDecl capDecl;
40 private RequiresDecl reqDecl;
41 private Map<String,Set<String>> mapCapabMethods;
42 // Data structure to store our types (primitives and non-primitives) for compilation
43 //private Set<String> setPrimitives;
44 private Map<String,String> mapPrimitives;
45 private Map<String,String> mapNonPrimitivesJava;
46 private Map<String,String> mapNonPrimitivesCplus;
47 private PrintWriter pw;
49 private String subdir;
54 private final static String OUTPUT_DIRECTORY = "output_files";
57 * Primitive data types
59 private final static String[] primitives = new String[] {
83 * Primitive data types in C++ to map the primitives list
85 private final static String[] primitivesCplus = new String[] {
109 * Non-primitive data types supported by this compiler
111 private final static String[] nonPrimitives = new String[] {
122 * Non-primitive Java libraries based on the list above
124 private final static String[] nonPrimitiveJavaLibs = new String[] {
131 "java.util.ArrayList"
135 * Non-primitive C++ libraries based on the list above
137 private final static String[] nonPrimitiveCplusLibs = new String[] {
147 private enum ParamCategory {
149 PRIMITIVES, // All the primitive types, e.g. byte, short, int, long, etc.
150 NONPRIMITIVES, // Non-primitive types, e.g. Set, Map, List, etc.
151 USERDEFINED // Non-supported type by default; assumed as driver classes
157 public IoTCompiler() {
159 ptHandler = new ParseTreeHandler();
163 mapCapabMethods = new HashMap<String,Set<String>>();
164 mapPrimitives = new HashMap<String,String>();
165 arraysToMap(mapPrimitives, primitives, primitivesCplus);
166 mapNonPrimitivesJava = new HashMap<String,String>();
167 arraysToMap(mapNonPrimitivesJava, nonPrimitives, nonPrimitiveJavaLibs);
168 mapNonPrimitivesCplus = new HashMap<String,String>();
169 arraysToMap(mapNonPrimitivesCplus, nonPrimitives, nonPrimitiveCplusLibs);
171 dir = OUTPUT_DIRECTORY;
176 public IoTCompiler(String _intface, ParseNode _pnPol, ParseNode _pnReq) {
178 ptHandler = new ParseTreeHandler(_intface, _pnPol, _pnReq);
182 mapCapabMethods = new HashMap<String,Set<String>>();
183 mapPrimitives = new HashMap<String,String>();
184 arraysToMap(mapPrimitives, primitives, primitivesCplus);
185 mapNonPrimitivesJava = new HashMap<String,String>();
186 arraysToMap(mapNonPrimitivesJava, nonPrimitives, nonPrimitiveJavaLibs);
187 mapNonPrimitivesCplus = new HashMap<String,String>();
188 arraysToMap(mapNonPrimitivesCplus, nonPrimitives, nonPrimitiveCplusLibs);
190 dir = OUTPUT_DIRECTORY;
196 * parsePolicyFile() parses policy file
198 * It also generates parse tree and
199 * copies useful information from parse tree into
200 * InterfaceDecl, CapabilityDecl, and RequiresDecl
202 * Additionally, the data structure handles are
203 * returned from tree-parsing for further process.
206 public void parsePolicyFile() {
208 ptHandler.processInterfaceDecl();
209 intDecl = ptHandler.getInterfaceDecl();
211 ptHandler.processCapabilityDecl();
212 capDecl = ptHandler.getCapabilityDecl();
214 ptHandler.processRequiresDecl();
215 reqDecl = ptHandler.getRequiresDecl();
220 * getMethodsForIntface() reads for methods in the data structure
222 * It is going to give list of methods for a certain interface
223 * based on the declaration of capabilities.
225 public void getMethodsForIntface() {
227 // Get set of new interfaces, e.g. CameraWithCaptureAndData
228 // Generate this new interface with all the methods it needs
229 // from different capabilities it declares
230 Set<String> setIntfaces = reqDecl.getInterfaces();
231 for (String strInt : setIntfaces) {
233 // Initialize a set of methods
234 Set<String> setMethods = new HashSet<String>();
235 // Get list of capabilities, e.g. ImageCapture, VideoRecording, etc.
236 List<String> listCapab = reqDecl.getCapabList(strInt);
237 for (String strCap : listCapab) {
239 // Get list of methods for each capability
240 List<String> listCapabMeth = capDecl.getMethods(strCap);
241 for (String strMeth : listCapabMeth) {
243 // Add methods into setMethods
244 // This is to also handle redundancies (say two capabilities
245 // share the same methods)
246 setMethods.add(strMeth);
249 // Add interface and methods information into map
250 mapCapabMethods.put(strInt, setMethods);
256 * generateJavaLocalInterface() writes the local interface to provide type-checking
258 * It needs to rewrite and exchange USERDEFINED types in input parameters of stub
259 * and original interfaces, e.g. exchange Camera and CameraWithVideoAndRecording.
260 * The local interface has to be the input parameter for the stub and the stub
261 * interface has to be the input parameter for the local class.
263 public void generateJavaLocalInterface(String _intface) throws IOException {
265 // Create a new directory
266 createDirectory(dir);
267 // Open a new file to write into
268 String intface = _intface;
269 FileWriter fw = new FileWriter(dir + "/" + intface + ".java");
270 pw = new PrintWriter(new BufferedWriter(fw));
271 // Pass in set of methods and get import classes
272 List<String> methods = intDecl.getMethods();
273 Set<String> importClasses = getImportClasses(methods);
274 printImportStatements(importClasses);
275 // Write interface header
277 println("public interface " + intface + " {");
279 for (String method : methods) {
281 List<String> methParams = intDecl.getMethodParams(method);
282 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
283 print("public " + intDecl.getMethodType(method) + " " +
284 intDecl.getMethodId(method) + "(");
285 for (int i = 0; i < methParams.size(); i++) {
286 // Check for params with driver class types and exchange it
287 // with its remote interface
288 String paramType = checkAndGetParamClass(methPrmTypes.get(i));
289 print(paramType + " " + methParams.get(i));
290 // Check if this is the last element (don't print a comma)
291 if (i != methParams.size() - 1) {
299 System.out.println("IoTCompiler: Generated local interface " + intface + ".java...");
304 * generateCplusLocalInterface() writes the local interface to provide type-checking
306 * It needs to rewrite and exchange USERDEFINED types in input parameters of stub
307 * and original interfaces, e.g. exchange Camera and CameraWithVideoAndRecording.
308 * The local interface has to be the input parameter for the stub and the stub
309 * interface has to be the input parameter for the local class.
311 public void generateCplusLocalInterface(String _intface) throws IOException {
313 // Create a new directory
314 createDirectory(dir);
315 // Open a new file to write into
316 String intface = _intface;
317 FileWriter fw = new FileWriter(dir + "/" + intface + ".hpp");
318 pw = new PrintWriter(new BufferedWriter(fw));
319 // Write file headers
320 println("#include <iostream>");
321 // Pass in set of methods and get import classes
322 List<String> methods = intDecl.getMethods();
323 Set<String> includeClasses = getIncludeClasses(methods);
324 printIncludeStatements(includeClasses);
326 println("using namespace std;");
328 println("class " + intface);
332 for (String method : methods) {
334 List<String> methParams = intDecl.getMethodParams(method);
335 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
336 print("virtual " + convertType(intDecl.getMethodType(method)) + " " +
337 intDecl.getMethodId(method) + "(");
338 for (int i = 0; i < methParams.size(); i++) {
339 // Check for params with driver class types and exchange it
340 // with its remote interface
341 String paramType = checkAndGetParamClass(methPrmTypes.get(i));
342 paramType = checkAndGetCplusType(paramType);
343 print(paramType + " " + methParams.get(i));
344 // Check if this is the last element (don't print a comma)
345 if (i != methParams.size() - 1) {
354 System.out.println("IoTCompiler: Generated local interface " + intface + ".hpp...");
359 * generateJavaInterfaces() generate stub interfaces based on the methods list in Java
361 public void generateJavaInterfaces() throws IOException {
363 // Create a new directory
364 createDirectories(dir, subdir);
365 for (Map.Entry<String,Set<String>> intMeth : mapCapabMethods.entrySet()) {
367 // Open a new file to write into
368 String newIntface = intMeth.getKey();
369 FileWriter fw = new FileWriter(dir + "/" + subdir + "/" + newIntface + ".java");
370 pw = new PrintWriter(new BufferedWriter(fw));
371 // Pass in set of methods and get import classes
372 Set<String> importClasses = getImportClasses(intMeth.getValue());
373 printImportStatements(importClasses);
374 // Write interface header
376 println("public interface " + newIntface + " {");
377 List<String> meths = intDecl.getMethods();
379 for (String method : intMeth.getValue()) {
381 List<String> methParams = intDecl.getMethodParams(method);
382 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
383 print("public " + intDecl.getMethodType(method) + " " +
384 intDecl.getMethodId(method) + "(");
385 for (int i = 0; i < methParams.size(); i++) {
386 print(methPrmTypes.get(i) + " " + methParams.get(i));
387 // Check if this is the last element (don't print a comma)
388 if (i != methParams.size() - 1) {
396 System.out.println("IoTCompiler: Generated interface " + newIntface + ".java...");
402 * generateCPlusInterfaces() generate stub interfaces based on the methods list in C++
404 * For C++ we use virtual classe as interface
406 public void generateCPlusInterfaces() throws IOException {
408 // Create a new directory
409 createDirectories(dir, subdir);
410 for (Map.Entry<String,Set<String>> intMeth : mapCapabMethods.entrySet()) {
412 // Open a new file to write into
413 String newIntface = intMeth.getKey();
414 FileWriter fw = new FileWriter(dir + "/" + subdir + "/" + newIntface + ".hpp");
415 pw = new PrintWriter(new BufferedWriter(fw));
416 // Write file headers
417 println("#include <iostream>");
418 // Pass in set of methods and get import classes
419 Set<String> includeClasses = getIncludeClasses(intMeth.getValue());
420 printIncludeStatements(includeClasses);
422 println("using namespace std;");
424 println("class " + newIntface);
428 for (String method : intMeth.getValue()) {
430 List<String> methParams = intDecl.getMethodParams(method);
431 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
432 print("virtual " + convertType(intDecl.getMethodType(method)) + " " +
433 intDecl.getMethodId(method) + "(");
434 for (int i = 0; i < methParams.size(); i++) {
436 String methPrmType = checkAndGetCplusType(methPrmTypes.get(i));
437 print(methPrmType + " " + methParams.get(i));
438 // Check if this is the last element (don't print a comma)
439 if (i != methParams.size() - 1) {
448 System.out.println("IoTCompiler: Generated interface " + newIntface + ".hpp...");
454 * generateJavaStubClasses() generate stubs based on the methods list in Java
456 public void generateJavaStubClasses() throws IOException {
458 // Create a new directory
459 createDirectories(dir, subdir);
460 for (Map.Entry<String,Set<String>> intMeth : mapCapabMethods.entrySet()) {
462 // Open a new file to write into
463 String newIntface = intMeth.getKey();
464 String newStubClass = newIntface + "_Stub";
465 FileWriter fw = new FileWriter(dir + "/" + subdir + "/" + newStubClass + ".java");
466 pw = new PrintWriter(new BufferedWriter(fw));
467 // Pass in set of methods and get import classes
468 Set<String> importClasses = getImportClasses(intMeth.getValue());
469 printImportStatements(importClasses);
470 // Write interface header
472 println("public class " + newStubClass + " implements " + newIntface + " {");
475 for (String method : intMeth.getValue()) {
477 List<String> methParams = intDecl.getMethodParams(method);
478 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
479 print("public " + intDecl.getMethodType(method) + " " +
480 intDecl.getMethodId(method) + "(");
481 for (int i = 0; i < methParams.size(); i++) {
483 print(methPrmTypes.get(i) + " " + methParams.get(i));
484 // Check if this is the last element (don't print a comma)
485 if (i != methParams.size() - 1) {
490 // Check if this is not "void"
491 if (!intDecl.getMethodType(method).equals("void")) {
492 String retStmt = generateReturnStmt(intDecl.getMethodType(method));
493 println("return " + retStmt + ";");
495 println("}"); println("");
499 System.out.println("IoTCompiler: Generated stub class " + newStubClass + ".java...");
505 * generateCPlusStubClasses() generate stubs based on the methods list in C++
507 public void generateCPlusStubClasses() throws IOException {
509 // Create a new directory
510 createDirectories(dir, subdir);
511 for (Map.Entry<String,Set<String>> intMeth : mapCapabMethods.entrySet()) {
513 // Open a new file to write into
514 String newIntface = intMeth.getKey();
515 String newStubClass = newIntface + "_Stub";
516 FileWriter fw = new FileWriter(dir + "/" + subdir + "/" + newStubClass + ".hpp");
517 pw = new PrintWriter(new BufferedWriter(fw));
518 // Write file headers
519 println("#include <iostream>");
520 println("#include \"" + newIntface + ".hpp\""); println("");
521 println("using namespace std;"); println("");
522 println("class " + newStubClass + " : public " + newIntface);
524 println("public:"); println("");
525 // Add default constructor and destructor
526 println(newStubClass + "() { }"); println("");
527 println("~" + newStubClass + "() { }"); println("");
529 for (String method : intMeth.getValue()) {
531 List<String> methParams = intDecl.getMethodParams(method);
532 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
533 print(convertType(intDecl.getMethodType(method)) + " " +
534 intDecl.getMethodId(method) + "(");
535 for (int i = 0; i < methParams.size(); i++) {
537 String methPrmType = checkAndGetCplusType(methPrmTypes.get(i));
538 print(methPrmType + " " + methParams.get(i));
539 // Check if this is the last element (don't print a comma)
540 if (i != methParams.size() - 1) {
545 // Check if this is not "void"
546 if (!intDecl.getMethodType(method).equals("void")) {
547 String retStmt = generateReturnStmt(intDecl.getMethodType(method));
548 if (retStmt.equals("null")) { // null = NULL in C++
551 println("return " + retStmt + ";");
553 println("}"); println("");
555 print("}"); println(";");
557 System.out.println("IoTCompiler: Generated stub class " + newIntface + ".hpp...");
563 * generateReturnStmt() generate return statement based on methType
565 public String generateReturnStmt(String methType) {
567 // Generate dummy returns for now
568 if (methType.equals("short")||
569 methType.equals("int") ||
570 methType.equals("long") ||
571 methType.equals("float")||
572 methType.equals("double")) {
575 } else if ( methType.equals("String") ||
576 methType.equals("byte")) {
579 } else if ( methType.equals("char")) {
582 } else if ( methType.equals("boolean")) {
592 * setDirectory() set a new directory for stub files
594 public void setDirectory(String _subdir) {
601 * printUsage() prints the usage of this compiler
603 public static void printUsage() {
605 System.out.println();
606 System.out.println("Sentinel interface and stub compiler version 1.0");
607 System.out.println("Copyright (c) 2015-2016 University of California, Irvine - Programming Language Group.");
608 System.out.println("All rights reserved.");
609 System.out.println("Usage:");
610 System.out.println("\tjava IoTCompiler --help / -h\t\t\t\t\tDisplay this help texts");
611 System.out.println("\tjava IoTCompiler <main-policy-file> <req-policy-file>\t\tGenerate both Java and C++ stub files");
612 System.out.println("\tjava IoTCompiler <main-policy-file> <req-policy-file> [options]");
613 System.out.println("Options:");
614 System.out.println("\t-java\t<directory>\tGenerate Java stub files");
615 System.out.println("\t-cplus\t<directory>\tGenerate C++ stub files");
616 System.out.println();
621 * parseFile() prepares Lexer and Parser objects, then parses the file
623 public static ParseNode parseFile(String file) {
627 ComplexSymbolFactory csf = new ComplexSymbolFactory();
628 ScannerBuffer lexer =
629 new ScannerBuffer(new Lexer(new BufferedReader(new FileReader(file)),csf));
630 Parser parse = new Parser(lexer,csf);
631 pn = (ParseNode) parse.parse().value;
632 } catch (Exception e) {
633 System.out.println("IoTCompiler: ERROR parsing policy file!");
641 /**================================================
642 * Helper functions to write stub codes into files
643 **================================================
645 boolean newline=true;
648 private void print(String str) {
653 for(int i=0; i<tab; i++)
662 * This function converts Java to C++ type for compilation
664 private String convertType(String jType) {
666 return mapPrimitives.get(jType);
670 private void println(String str) {
675 for(int i=0; i<tab; i++)
684 private void updatetabbing(String str) {
685 tablevel+=count(str,'{')-count(str,'}');
689 private int count(String str, char key) {
690 char[] array = str.toCharArray();
692 for(int i=0; i<array.length; i++) {
700 private void createDirectory(String dirName) {
702 File file = new File(dirName);
703 if (!file.exists()) {
705 System.out.println("IoTCompiler: Directory " + dirName + " has been created!");
707 System.out.println("IoTCompiler: Failed to create directory " + dirName + "!");
710 System.out.println("IoTCompiler: Directory " + dirName + " exists...");
715 // Create a directory and possibly a sub directory
716 private void createDirectories(String dir, String subdir) {
718 createDirectory(dir);
719 if (subdir != null) {
720 createDirectory(dir + "/" + subdir);
725 // Inserting array members into a Map object
726 // that maps arrKey to arrVal objects
727 private void arraysToMap(Map map, Object[] arrKey, Object[] arrVal) {
729 for(int i = 0; i < arrKey.length; i++) {
731 map.put(arrKey[i], arrVal[i]);
736 // Return parameter category, i.e. PRIMITIVES, NONPRIMITIVES, or USERDEFINED
737 private ParamCategory getParamCategory(String paramType) {
739 if (mapPrimitives.containsKey(paramType)) {
740 return ParamCategory.PRIMITIVES;
741 // We can either use mapNonPrimitivesJava or mapNonPrimitivesCplus here
742 } else if (mapNonPrimitivesJava.containsKey(getSimpleType(paramType))) {
743 return ParamCategory.NONPRIMITIVES;
745 return ParamCategory.USERDEFINED;
749 // Return full class name for non-primitives to generate Java import statements
750 // e.g. java.util.Set for Set, java.util.Map for Map
751 private String getNonPrimitiveJavaClass(String paramNonPrimitives) {
753 return mapNonPrimitivesJava.get(paramNonPrimitives);
757 // Return full class name for non-primitives to generate Cplus include statements
758 // e.g. #include <set> for Set, #include <map> for Map
759 private String getNonPrimitiveCplusClass(String paramNonPrimitives) {
761 return mapNonPrimitivesCplus.get(paramNonPrimitives);
765 // Get simple types, e.g. HashSet for HashSet<...>
766 // Basically strip off the "<...>"
767 private String getSimpleType(String paramType) {
769 // Check if this is generics
770 if(paramType.contains("<")) {
771 String[] type = paramType.split("<");
778 // Generate a set of classes for import statements
779 private Set<String> getImportClasses(Collection<String> methods) {
781 Set<String> importClasses = new HashSet<String>();
782 for (String method : methods) {
783 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
784 for (String paramType : methPrmTypes) {
786 String simpleType = getSimpleType(paramType);
787 if (getParamCategory(simpleType) == ParamCategory.NONPRIMITIVES) {
788 importClasses.add(getNonPrimitiveJavaClass(simpleType));
792 return importClasses;
796 // Generate a set of classes for include statements
797 private Set<String> getIncludeClasses(Collection<String> methods) {
799 Set<String> includeClasses = new HashSet<String>();
800 for (String method : methods) {
802 List<String> methPrmTypes = intDecl.getMethodParamTypes(method);
803 for (String paramType : methPrmTypes) {
805 String simpleType = getSimpleType(paramType);
806 if (getParamCategory(simpleType) == ParamCategory.NONPRIMITIVES) {
807 includeClasses.add(getNonPrimitiveCplusClass(simpleType));
811 return includeClasses;
815 private void printImportStatements(Set<String> importClasses) {
817 for(String cls : importClasses) {
818 println("import " + cls + ";");
823 private void printIncludeStatements(Set<String> includeClasses) {
825 for(String cls : includeClasses) {
826 println("#include <" + cls + ">");
831 // Get the C++ version of a non-primitive type
832 // e.g. set for Set and map for Map
833 // Input nonPrimitiveType has to be generics in format
834 private String[] getTypeOfGeneric(String nonPrimitiveType) {
836 // Handle <, >, and , for 2-type generic/template
837 String[] substr = nonPrimitiveType.split("<")[1].split(">")[0].split(",");
842 private String checkAndGetCplusType(String paramType) {
844 if (getParamCategory(paramType) == ParamCategory.PRIMITIVES) {
845 return convertType(paramType);
846 } else if (getParamCategory(paramType) == ParamCategory.NONPRIMITIVES) {
848 // Check for generic/template format
849 if (paramType.contains("<") && paramType.contains(">")) {
851 String genericClass = getSimpleType(paramType);
852 String[] genericType = getTypeOfGeneric(paramType);
853 String cplusTemplate = null;
854 if (genericType.length == 1) // Generic/template with one type
855 cplusTemplate = getNonPrimitiveCplusClass(genericClass) +
856 "<" + convertType(genericType[0]) + ">";
857 else // Generic/template with two types
858 cplusTemplate = getNonPrimitiveCplusClass(genericClass) +
859 "<" + convertType(genericType[0]) + "," + convertType(genericType[1]) + ">";
860 return cplusTemplate;
862 return getNonPrimitiveCplusClass(paramType);
864 // Just return it as is if it's not non-primitives
869 // Get simple types, e.g. HashSet for HashSet<...>
870 // Basically strip off the "<...>"
871 private String checkAndGetParamClass(String paramType) {
873 // Check if this is generics
874 if(getParamCategory(paramType) == ParamCategory.USERDEFINED) {
875 // TODO: replace this with the proper stub interface name
876 return paramType + "Remote";
882 public static void main(String[] args) throws Exception {
885 if (args.length > 1) {
887 if ((args[0].equals("--help") ||
888 (args[0].equals("-h")))) {
889 IoTCompiler.printUsage();
891 // Parse main policy file
892 ParseNode pnPol = IoTCompiler.parseFile(args[0]);
893 // Parse "requires" policy file
894 ParseNode pnReq = IoTCompiler.parseFile(args[1]);
895 // Get interface name
896 String intface = ParseTreeHandler.getOrigIntface(pnPol);
897 IoTCompiler comp = new IoTCompiler(intface, pnPol, pnReq);
898 // Generate all policy files if just policy file is provided
899 comp.parsePolicyFile();
900 comp.getMethodsForIntface();
901 if (args.length == 2) {
902 comp.generateJavaLocalInterface(intface);
903 comp.generateJavaInterfaces();
904 comp.generateJavaStubClasses();
905 comp.generateCplusLocalInterface(intface);
906 comp.generateCPlusInterfaces();
907 comp.generateCPlusStubClasses();
909 // Check other options
911 while(i < args.length) {
912 // Check whether <directory> is provided
913 if ((i + 1) < args.length) {
914 comp.setDirectory(args[i+1]);
916 throw new Error("IoTCompiler: ERROR - please provide <directory> after option: " + args[i]);
917 if (args[i].equals("-java")) {
918 comp.generateJavaLocalInterface(intface);
919 comp.generateJavaInterfaces();
920 comp.generateJavaStubClasses();
921 } else if (args[i].equals("-cplus")) {
922 comp.generateCplusLocalInterface(intface);
923 comp.generateCPlusInterfaces();
924 comp.generateCPlusStubClasses();
926 throw new Error("IoTCompiler: ERROR - unrecognized command line option: " + args[i]);
933 // Need at least the policy file name
934 IoTCompiler.printUsage();
935 throw new Error("IoTCompiler: At least two arguments (main and requires policy files) have to be provided!");