Gitlab service upgraded. Please report any problems to dl_gitadmin@cs.lth.se

Commit 1bbb0990 authored by Anders Nilsson's avatar Anders Nilsson

Started implementing functionality for exporting SQL INSERT stmts for device...

Started implementing functionality for exporting SQL INSERT stmts for device instances and their properties.
parent 81e455f6
/* -*-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());
}
}
}
/*
* 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);
}
}
......@@ -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 -->
......
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