diff --git a/siaras/SQLGen.jrag b/siaras/SQLGen.jrag new file mode 100644 index 0000000000000000000000000000000000000000..4821cab9346ced71f34cfcb3f017110ef1db9c36 --- /dev/null +++ b/siaras/SQLGen.jrag @@ -0,0 +1,25 @@ +/* -*-Java-*- */ + +/* + * Copyright (C) 2007 Anders Nilsson <anders.nilsson@cs.lth.se> + * + * This file is part of OntologyCompiler. + */ + +import java.io.PrintStream; + +aspect SQLInstances { + + public void ASTNode.genSQLInstances(PrintStream pStream) { + for (int i=0; i<getNumChild(); i++) { + getChild(i).genSQLInstances(pStream); + } + } + + public void Device.genSQLInstances(PrintStream pStream) { + pStream.println(id()); + for (int i=0; i<getNumProperty(); i++) { + pStream.println(" "+getProperty(i).id()); + } + } +} diff --git a/siaras/SQLInstances.java b/siaras/SQLInstances.java new file mode 100644 index 0000000000000000000000000000000000000000..c2c0214d13c51a91114b846bcf69a1b974211143 --- /dev/null +++ b/siaras/SQLInstances.java @@ -0,0 +1,20 @@ + +/* + * Copyright (C) 2007 Anders Nilsson <anders.nilsson@cs.lth.se> + * + * This file is part of OntologyCompiler. + */ + +import AST.Start; + +public class SQLInstances extends Parser { + public static void main(String args[]) { + Start ast = parse(args); + + // Generate SQL INSERT stmts for all OWL device and property + // instances found in input. + ast.genSQLInstances(System.out); + + + } +} diff --git a/siaras/build.xml b/siaras/build.xml index 185c1fc3fc94115c97bb6f4dd3a6826ce8e528db..47e4880483ee1376e0ee1b6554640adb03794646 100644 --- a/siaras/build.xml +++ b/siaras/build.xml @@ -27,7 +27,7 @@ <!-- compile sources --> <target name="build" depends="gen"> - <javac compiler="jikes" debug="true" nowarn="true" srcdir="." includes="**/*.java" excludes="tools/** siaras/**" classpath=".:${tools}/beaver-rt.jar:${tools}/junit.jar"/> + <javac debug="true" nowarn="true" srcdir="." includes="**/*.java" excludes="tools/** siaras/**" classpath=".:${tools}/beaver-rt.jar:${tools}/junit.jar"/> </target> <!-- generate compiler source files -->