Skip to content
Snippets Groups Projects
Commit d7d6cff3 authored by Ronny Böttger's avatar Ronny Böttger
Browse files

fixed AddEmptyDeclaration

fixed relativize problem
parent 4755bd24
No related branches found
No related tags found
No related merge requests found
Pipeline #11728 passed
aspect AddEmptyDeclaration {
syn GrammarFile GrammarFile.addEmptyDecl() {
public GrammarFile GrammarFile.addEmptyDecl() {
Declaration emptyDecl = new EmptyDeclaration();
SingleLineComment slc = new SingleLineComment();
slc.setText("// DO NOT EDIT. Automatically generated using RoleAST.jar");
slc.setText("// DO NOT EDIT. Automatically generated using RoleAST.jar\n");
emptyDecl.addComment(slc);
JastAddList declList = new JastAddList();
declList.add(emptyDecl);
for (Declaration decl : this.getDeclarationList()) {
declList.add(decl);
}
this.setDeclarationList(declList);
this.getDeclarationList().insertChild(emptyDecl, 0);
//this.addDeclaration(emptyDecl);
return this;
......
......@@ -109,7 +109,8 @@ public class Main extends org.jastadd.relast.compiler.RelAstProcessor {
printMessage("Writing output file " + grammarFile.getFileName());
// TODO decide and document what the file name should be, the full path or a simple name?
grammarFile.addEmptyDecl();
writeToFile(outputBasePath.resolve(inputBasePath.relativize(Paths.get(grammarFile.getFileName()))), grammarFile.generateAbstractGrammar());
System.out.println(grammarFile.getFileName());
writeToFile(outputBasePath.resolve(grammarFile.getFileName()), grammarFile.generateAbstractGrammar());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment