Commit 28742f3a authored by Anders Nilsson's avatar Anders Nilsson

Having problems with top-level classes no longer explicitly declaring themselves on top level

parent cd5ee26b
......@@ -10,7 +10,7 @@ import AST.Start;
public class DumpClasses extends Parser {
public static void main(String args[]) {
Start ast = parse(args);
Start ast = parse(args[0]);
// Dump the AST
// ast.dumpTree(" ", System.out);
......
......@@ -14,10 +14,14 @@ public class GenCompiler extends Parser {
public static void main(String args[]) {
String name = "default";
String dirName = "default";
String owlFile = "";
int i = 0;
while (i<args.length) {
if (args[i].equals("-d")) {
dirName = args[++i];
i++;
} else if (args[i].equals("-n")) {
name = args[++i];
i++;
} else {
......@@ -27,7 +31,7 @@ public class GenCompiler extends Parser {
Start ast = parse(owlFile);
File siarasDir = new File(name);
File siarasDir = new File(dirName);
if (!siarasDir.isDirectory()) {
siarasDir.mkdir();
}
......@@ -35,17 +39,17 @@ public class GenCompiler extends Parser {
String fileName = null;
try {
// Generate JastAdd abstract grammar
fileName = name+"/"+name+".ast";
fileName = dirName+"/"+name+".ast";
PrintStream pStream = new PrintStream(new File(fileName));
ast.genAbsGrammar(pStream);
// Generate Parser.java
fileName = name+"/Parser.java";
fileName = dirName+"/Parser.java";
pStream = new PrintStream(new File(fileName));
ast.genParser(pStream);
// Generate aspects
fileName = name+"/GeneratedAspects.jrag";
fileName = dirName+"/GeneratedAspects.jrag";
pStream = new PrintStream(new File(fileName));
ast.genAspects(pStream);
......
......@@ -31,6 +31,7 @@ aspect Types {
eq OwlClassUse.decl() {
ComplexElement top = getTopElement();
for (int i=0; i<top.getNumElement(); i++) {
// System.out.println(getId()+" == "+((ComplexElement) top.getElement(i)).getId());
if ((top.getElement(i) instanceof ComplexElement) &&
getId().equals(((ComplexElement) top.getElement(i)).getId())) {
return (OwlClassDecl) top.getElement(i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment