@Test public void executeMain() { MyDSLTool.main(new String[]{"src/test/resources/example/MyModel.mydsl"}); assertTrue(!false); }
public static void main(String[] args) { if (args.length != 1) { Log.error("0xC0004 Please specify only one single path to the input model."); return; } Log.enableFailQuick(false); Log.info("MyDSL Tool", MyDSLTool.class.getName()); Log.info("----------", MyDSLTool.class.getName()); String model = args[0]; final MyDSLLanguage lang = new MyDSLLanguage(); final ASTMyModel ast = parse(model, lang.getParser()); Log.info(model + " parsed successfully!", MyDSLTool.class.getName()); MyDSLArtifactScope modelTopScope = createSymbolTable(lang, ast); Optional<MyElementSymbol> aSymbol = modelTopScope.resolveMyElement("Car"); if (aSymbol.isPresent()) { Log.info("Resolved element symbol \"Car\"; FQN = " + aSymbol.get().toString(), MyDSLTool.class.getName()); } runDefaultCoCos(ast); Log.info("Running customized set of context conditions", MyDSLTool.class.getName()); MyDSLCoCoChecker customCoCos = new MyDSLCoCoChecker(); customCoCos.addCoCo(new MyElementNameStartsWithCapitalLetter()); customCoCos.checkAll(ast); CountMyElements cs = new CountMyElements(); cs.handle(ast); Log.info("The model contains " + cs.getCount() + " elements.", MyDSLTool.class.getName()); PrettyPrinter pp = new PrettyPrinter(); Log.info("Pretty printing the parsed model into console:", MyDSLTool.class.getName()); System.out.println(pp.prettyprint(ast)); }
MyDSLTool { public static void main(String[] args) { if (args.length != 1) { Log.error("0xC0004 Please specify only one single path to the input model."); return; } Log.enableFailQuick(false); Log.info("MyDSL Tool", MyDSLTool.class.getName()); Log.info("----------", MyDSLTool.class.getName()); String model = args[0]; final MyDSLLanguage lang = new MyDSLLanguage(); final ASTMyModel ast = parse(model, lang.getParser()); Log.info(model + " parsed successfully!", MyDSLTool.class.getName()); MyDSLArtifactScope modelTopScope = createSymbolTable(lang, ast); Optional<MyElementSymbol> aSymbol = modelTopScope.resolveMyElement("Car"); if (aSymbol.isPresent()) { Log.info("Resolved element symbol \"Car\"; FQN = " + aSymbol.get().toString(), MyDSLTool.class.getName()); } runDefaultCoCos(ast); Log.info("Running customized set of context conditions", MyDSLTool.class.getName()); MyDSLCoCoChecker customCoCos = new MyDSLCoCoChecker(); customCoCos.addCoCo(new MyElementNameStartsWithCapitalLetter()); customCoCos.checkAll(ast); CountMyElements cs = new CountMyElements(); cs.handle(ast); Log.info("The model contains " + cs.getCount() + " elements.", MyDSLTool.class.getName()); PrettyPrinter pp = new PrettyPrinter(); Log.info("Pretty printing the parsed model into console:", MyDSLTool.class.getName()); System.out.println(pp.prettyprint(ast)); } }
MyDSLTool { public static void main(String[] args) { if (args.length != 1) { Log.error("0xC0004 Please specify only one single path to the input model."); return; } Log.enableFailQuick(false); Log.info("MyDSL Tool", MyDSLTool.class.getName()); Log.info("----------", MyDSLTool.class.getName()); String model = args[0]; final MyDSLLanguage lang = new MyDSLLanguage(); final ASTMyModel ast = parse(model, lang.getParser()); Log.info(model + " parsed successfully!", MyDSLTool.class.getName()); MyDSLArtifactScope modelTopScope = createSymbolTable(lang, ast); Optional<MyElementSymbol> aSymbol = modelTopScope.resolveMyElement("Car"); if (aSymbol.isPresent()) { Log.info("Resolved element symbol \"Car\"; FQN = " + aSymbol.get().toString(), MyDSLTool.class.getName()); } runDefaultCoCos(ast); Log.info("Running customized set of context conditions", MyDSLTool.class.getName()); MyDSLCoCoChecker customCoCos = new MyDSLCoCoChecker(); customCoCos.addCoCo(new MyElementNameStartsWithCapitalLetter()); customCoCos.checkAll(ast); CountMyElements cs = new CountMyElements(); cs.handle(ast); Log.info("The model contains " + cs.getCount() + " elements.", MyDSLTool.class.getName()); PrettyPrinter pp = new PrettyPrinter(); Log.info("Pretty printing the parsed model into console:", MyDSLTool.class.getName()); System.out.println(pp.prettyprint(ast)); }  }
MyDSLTool { public static void main(String[] args) { if (args.length != 1) { Log.error("0xC0004 Please specify only one single path to the input model."); return; } Log.enableFailQuick(false); Log.info("MyDSL Tool", MyDSLTool.class.getName()); Log.info("----------", MyDSLTool.class.getName()); String model = args[0]; final MyDSLLanguage lang = new MyDSLLanguage(); final ASTMyModel ast = parse(model, lang.getParser()); Log.info(model + " parsed successfully!", MyDSLTool.class.getName()); MyDSLArtifactScope modelTopScope = createSymbolTable(lang, ast); Optional<MyElementSymbol> aSymbol = modelTopScope.resolveMyElement("Car"); if (aSymbol.isPresent()) { Log.info("Resolved element symbol \"Car\"; FQN = " + aSymbol.get().toString(), MyDSLTool.class.getName()); } runDefaultCoCos(ast); Log.info("Running customized set of context conditions", MyDSLTool.class.getName()); MyDSLCoCoChecker customCoCos = new MyDSLCoCoChecker(); customCoCos.addCoCo(new MyElementNameStartsWithCapitalLetter()); customCoCos.checkAll(ast); CountMyElements cs = new CountMyElements(); cs.handle(ast); Log.info("The model contains " + cs.getCount() + " elements.", MyDSLTool.class.getName()); PrettyPrinter pp = new PrettyPrinter(); Log.info("Pretty printing the parsed model into console:", MyDSLTool.class.getName()); System.out.println(pp.prettyprint(ast)); }  static void main(String[] args); static ASTMyModel parse(String model, MyDSLParser parser); static MyDSLArtifactScope createSymbolTable(MyDSLLanguage lang, ASTMyModel ast); static void runDefaultCoCos(ASTMyModel ast); }
MyDSLTool { public static void main(String[] args) { if (args.length != 1) { Log.error("0xC0004 Please specify only one single path to the input model."); return; } Log.enableFailQuick(false); Log.info("MyDSL Tool", MyDSLTool.class.getName()); Log.info("----------", MyDSLTool.class.getName()); String model = args[0]; final MyDSLLanguage lang = new MyDSLLanguage(); final ASTMyModel ast = parse(model, lang.getParser()); Log.info(model + " parsed successfully!", MyDSLTool.class.getName()); MyDSLArtifactScope modelTopScope = createSymbolTable(lang, ast); Optional<MyElementSymbol> aSymbol = modelTopScope.resolveMyElement("Car"); if (aSymbol.isPresent()) { Log.info("Resolved element symbol \"Car\"; FQN = " + aSymbol.get().toString(), MyDSLTool.class.getName()); } runDefaultCoCos(ast); Log.info("Running customized set of context conditions", MyDSLTool.class.getName()); MyDSLCoCoChecker customCoCos = new MyDSLCoCoChecker(); customCoCos.addCoCo(new MyElementNameStartsWithCapitalLetter()); customCoCos.checkAll(ast); CountMyElements cs = new CountMyElements(); cs.handle(ast); Log.info("The model contains " + cs.getCount() + " elements.", MyDSLTool.class.getName()); PrettyPrinter pp = new PrettyPrinter(); Log.info("Pretty printing the parsed model into console:", MyDSLTool.class.getName()); System.out.println(pp.prettyprint(ast)); }  static void main(String[] args); static ASTMyModel parse(String model, MyDSLParser parser); static MyDSLArtifactScope createSymbolTable(MyDSLLanguage lang, ASTMyModel ast); static void runDefaultCoCos(ASTMyModel ast);  }