Commit dea65328 authored by Anders Nilsson's avatar Anders Nilsson
Browse files

Cleaned up. Removed old commented-out code blocks

parent 5c86f48d
......@@ -22,7 +22,6 @@ aspect AbsGrammarGeneration {
pStream.println("abstract Thing : ComplexElement ::=;");
pStream.println("abstract Element;");
pStream.println("ComplexElement : Element ::= OwlIdentifier Attribute* Element*;");
// pStream.println("ComplexElement ::= id1:OwlIdentifier id2:OwlIdentifier;");
pStream.println("abstract SimpleElement : Element;");
pStream.println("StringElement : SimpleElement ::= OwlIdentifier;");
pStream.println("IntElement : SimpleElement ::= <INTEGER_LITERAL>;");
......@@ -68,9 +67,6 @@ aspect AbsGrammarGeneration {
}
void OwlRestriction.genAbsGrammar(PrintStream pStream) {
// pStream.print(getRestrictionClassId().substring(0,1).toLowerCase()+
// getRestrictionClassId().substring(1));
// pStream.print(":");
pStream.print(name());
if (allValuesFrom()) {
pStream.print("*");
......@@ -177,14 +173,11 @@ aspect GenRewrites {
pStream.println(ind(2)+"when (getOwlIdentifier().getIDENTIFIER().equals(\""+
name()+"\") && !(this instanceof Thing))");
pStream.println(ind(3)+"to "+name()+" {");
// pStream.println(ind(3)+"System.out.println(\"rewriting: \"+getOwlIdentifier().getIDENTIFIER());");
pStream.println(ind(3)+name()+" node = new "+name()+"();");
pStream.println(ind(3)+"node.setOwlIdentifier(getOwlIdentifier());");
pStream.println(ind(3)+"node.setAttributeList(getAttributeList());");
pStream.println(ind(3)+"node.setElementList(getElementList());");
// Very temporary solution just so that DumpTree will not
// crasch from NullPointerException. Children should be filled
// in from rewrites instead
Restrictions restr = getRestrictions();
pStream.println(ind(3)+"List l;");
for (int i=0; i<restr.getNumOwlRestriction(); i++) {
......@@ -197,7 +190,6 @@ aspect GenRewrites {
pStream.println(ind(3)+"}");
if (r.allValuesFrom()) {
pStream.println(ind(3)+"node.set"+r.name()+"List(l);");
// pStream.println(ind(3)+"node.set"+r.name()+"List(new List());");
} else {
pStream.println(ind(3)+r.name()+" c"+ix+" = new "+r.name()+"();");
pStream.println(ind(3)+"node.set"+r.name()+"(c"+(ix++)+");");
......
......@@ -14,10 +14,6 @@ public class GenCompiler extends Parser {
public static void main(String args[]) {
Start ast = parse(args);
// Dump the AST
// ast.dumpTree(" ", System.out);
File siarasDir = new File("siaras");
if (!siarasDir.isDirectory()) {
siarasDir.mkdir();
......@@ -30,11 +26,6 @@ public class GenCompiler extends Parser {
PrintStream pStream = new PrintStream(new File(fileName));
ast.genAbsGrammar(pStream);
// Generate JavaCC configuration
// fileName = "siaras/Siaras.jjt";
// pStream = new PrintStream(new File(fileName));
// ast.genJavaCC(pStream);
// Generate Parser.java
fileName = "siaras/Parser.java";
pStream = new PrintStream(new File(fileName));
......@@ -44,13 +35,7 @@ public class GenCompiler extends Parser {
fileName = "siaras/GeneratedAspects.jrag";
pStream = new PrintStream(new File(fileName));
ast.genAspects(pStream);
// ast.genRewrites(pStream);
// ast.genPrettyPrinter("",pStream);
// Generate PrettyPrinter
// fileName = "siaras/PrettyPrinter.jrag";
// pStream = new PrintStream(new File(fileName));
// ast.genPrettyPrinter("",pStream);
} catch (java.io.FileNotFoundException e) {
System.out.println("Could not create file: "+fileName);
e.printStackTrace();
......
Supports Markdown
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