DumpClasses.jrag 1.69 KB
Newer Older
1 2
/* -*-Java-*- */

3
/* 
4
 * Copyright (C) 2006,2010  Anders Nilsson <anders.nilsson@control.lth.se>
5 6
 *
 * This file is part of OntologyCompiler.
7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * OntologyCompiler is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.

 * OntologyCompiler is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 
 * You should have received a copy of the GNU General Public License
 * along with OntologyCompiler.  If not, see <http://www.gnu.org/licenses/>.
20 21
 */

22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
import java.io.PrintStream;

aspect DumpClasses {
    void ASTNode.dumpClasses(PrintStream pStream) {	
	for (int i=0; i<getNumChild(); i++) {
	    getChild(i).dumpClasses(pStream);
	}
    }

    public void Start.dumpClasses(PrintStream pStream) {
	super.dumpClasses(pStream);
    }

    void OwlClassDecl.dumpClasses(PrintStream pStream) {
	pStream.print(getId());
37
	pStream.print(" : "+getSuperClass().getId());	
38 39 40 41 42 43 44 45
	pStream.print(" ::=");
	Restrictions restrs = getRestrictions();
	for (int i=0; i<restrs.getNumOwlRestriction(); i++) {
	  pStream.print(" "+"restr");
	}
	
// 	Properties props = getProperties();
// 	for (int i=0; i<props.getNumProperty(); i++) {
Anders Nilsson's avatar
Anders Nilsson committed
46
// 	    pStream.print("<");
47
// 	    pStream.print(" "+props.getProperty(i).getId());
Anders Nilsson's avatar
Anders Nilsson committed
48 49 50 51
// 	    pStream.print(":");
// 	    pStream.print(props.getProperty(i).range().type());
// 	    pStream.print(">");
// 	    pStream.print(" ");
52
// 	}
53
	pStream.println(";");
54
    }
Anders Nilsson's avatar
Anders Nilsson committed
55
}