/** * Creates a root CST node which contains the particular CST for the file and its name and path. * * @param child * @param sourceFilePath * @return */ protected Node createRootNode(Element child, String sourceFilePath) { Node specficidNode = (Node) child; // The node to be returned Node file = CSTFactory.eINSTANCE.createNode(); file.setKind("file"); Leaf pathLeaf = CSTFactory.eINSTANCE.createLeaf(); pathLeaf.setKind("path"); pathLeaf.setValue(sourceFilePath); Leaf pathFileName = CSTFactory.eINSTANCE.createLeaf(); pathFileName.setKind("filename"); pathFileName.setValue(extractFileName(sourceFilePath)); file.getChildren().add(pathLeaf); file.getChildren().add(pathFileName); file.getChildren().add(specficidNode); return file; }