summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpschonbac2008-01-22 11:21:26 (EST)
committerpschonbac2008-01-22 11:21:26 (EST)
commitbc21db7259ea458fac29e6df992149b861d78f16 (patch)
tree0ac6ea6da7ce01962f54405d2725f1811b679944
parent218785bb3cb66ebeb11ba6d6f1d086b7c677689f (diff)
downloadorg.eclipse.xpand-bc21db7259ea458fac29e6df992149b861d78f16.zip
org.eclipse.xpand-bc21db7259ea458fac29e6df992149b861d78f16.tar.gz
org.eclipse.xpand-bc21db7259ea458fac29e6df992149b861d78f16.tar.bz2
Initial checkin
-rw-r--r--doc/.classpath7
-rw-r--r--doc/.cvsignore1
-rw-r--r--doc/.project28
-rw-r--r--doc/META-INF/MANIFEST.MF6
-rw-r--r--doc/build.properties4
-rw-r--r--doc/src/log4j.properties12
-rw-r--r--doc/src/metagen/ApiDoc.xpt127
-rw-r--r--doc/src/metagen/DocBook.xpt108
-rw-r--r--doc/src/metagen/Extensions.ext25
-rw-r--r--doc/src/metagen/Root.xpt4
-rw-r--r--doc/src/workflow.oaw34
11 files changed, 356 insertions, 0 deletions
diff --git a/doc/.classpath b/doc/.classpath
new file mode 100644
index 0000000..751c8f2
--- /dev/null
+++ b/doc/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/doc/.cvsignore b/doc/.cvsignore
new file mode 100644
index 0000000..49f394f
--- /dev/null
+++ b/doc/.cvsignore
@@ -0,0 +1 @@
+src-gen
diff --git a/doc/.project b/doc/.project
new file mode 100644
index 0000000..5319a6e
--- /dev/null
+++ b/doc/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.xpand.doc.api-generator</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/doc/META-INF/MANIFEST.MF b/doc/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..9ba841d
--- /dev/null
+++ b/doc/META-INF/MANIFEST.MF
@@ -0,0 +1,6 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: API generator Plug-in
+Bundle-SymbolicName: org.eclipse.xpand.doc.api_generator
+Bundle-Version: 1.0.0
+Require-Bundle: org.openarchitectureware.dependencies
diff --git a/doc/build.properties b/doc/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/doc/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/doc/src/log4j.properties b/doc/src/log4j.properties
new file mode 100644
index 0000000..f2ae601
--- /dev/null
+++ b/doc/src/log4j.properties
@@ -0,0 +1,12 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r %-5p %-18C{1} - %m%n
+
+# suppress jalopy logging
+log4j.logger.de.hunsicker=ERROR \ No newline at end of file
diff --git a/doc/src/metagen/ApiDoc.xpt b/doc/src/metagen/ApiDoc.xpt
new file mode 100644
index 0000000..99759a0
--- /dev/null
+++ b/doc/src/metagen/ApiDoc.xpt
@@ -0,0 +1,127 @@
+«EXTENSION metagen::Extensions»
+
+«DEFINE all FOR List[oaw::Type]»
+ «EXPAND framesetFile FOR this.get(0)»
+ «EXPAND menuFile FOR this»
+ «EXPAND typeDocFile FOREACH this»
+«ENDDEFINE»
+
+«DEFINE menuFile FOR List[oaw::Type]»
+«FILE "menu.html" HTML-»
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>Menu</title>
+</head>
+
+<body><br/><br/><br/><br/><br/><br/>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="white" CLASS="TableRowColor">
+<TD><FONT SIZE="+1"><B>All Types</B></FONT></TD>
+</TR>
+«FOREACH this AS type-»
+ <TR BGCOLOR="white" CLASS="TableRowColor">
+ <TD ALIGN="left" VALIGN="top" WIDTH="1%">
+ <CODE>«type.linkedName("mainFrame")»</CODE></TD>
+ </TR>
+«ENDFOREACH-»
+</body>
+</html>
+«ENDFILE»
+«ENDDEFINE»
+
+«DEFINE framesetFile FOR oaw::Type»
+«FILE "index.html" HTML-»
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>«this»</title>
+</head>
+
+ <frameset cols="200,*" frameborder="no" border="0" framespacing="0">
+ <frame src="menu.html" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
+ <frame src="«this.fileName()»" name="mainFrame" id="mainFrame" title="mainFrame" />
+ </frameset>
+<noframes><body>
+</body>
+</noframes></html>
+«ENDFILE»
+«ENDDEFINE»
+
+«DEFINE typeDocFile FOR oaw::Type»
+«FILE this.fileName() HTML-»
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<title>«this.name» API documentation</title>
+</head>
+<body>
+<br/>
+<H1>«this.name-»
+ «IF superTypes.size>0-»
+ extends
+«FOREACH superTypes AS e SEPARATOR ","-»
+«e.linkedName()-»
+«ENDFOREACH-»
+«ENDIF-»
+</H1>
+<HR>
+«documentation-»
+«IF this.getOwnedProperties().size >0-»
+<!-- properties -->
+<HR>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=2><FONT SIZE="+2">
+<B>Properties</B></FONT></TD>
+</TR>
+ «FOREACH getOwnedProperties() AS p»
+ <TR BGCOLOR="white" CLASS="TableRowColor">
+ <TD ALIGN="right" VALIGN="top" WIDTH="1%">
+ <FONT SIZE="-1">
+ <CODE>«p.returnType.linkedName()»</CODE>
+ </FONT>
+ </TD>
+ <TD><CODE><B>«p.name»</A></B></CODE></TD>
+ </TR>
+ <TR BGCOLOR="white" CLASS="TableRowColor">
+ <TD ALIGN="right" VALIGN="top"></TD>
+ <TD>«p.documentation»</TD>
+ </TR>
+ «ENDFOREACH»
+</TABLE>
+«ENDIF»
+«IF this.getOwnedOperations().size >0»
+<!-- operations -->
+<HR>
+<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
+<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
+<TD COLSPAN=2><FONT SIZE="+2">
+<B>Operations</B></FONT></TD>
+</TR>
+ «FOREACH getOwnedOperations() AS o SEPARATOR "<!-- test -->"»
+ <TR BGCOLOR="white" CLASS="TableRowColor">
+ <TD ALIGN="right" VALIGN="top" WIDTH="1%">
+ <FONT SIZE="-1">
+ <CODE>«o.returnType.linkedName()»</CODE>
+ </FONT>
+ </TD>
+ <TD>
+ <CODE><B>«o.name»(«FOREACH o.getParameterTypes() AS pt SEPARATOR ","»«pt.linkedName()»«ENDFOREACH»)</B></CODE>
+ </TD>
+ </TR>
+ <TR BGCOLOR="white" CLASS="TableRowColor">
+ <TD ALIGN="right" VALIGN="top"></TD>
+ <TD>«o.documentation»</TD>
+ </TR>
+ «ENDFOREACH»
+</TABLE>
+«ENDIF»
+<HR>
+</body>
+</html>
+«ENDFILE»
+«ENDDEFINE» \ No newline at end of file
diff --git a/doc/src/metagen/DocBook.xpt b/doc/src/metagen/DocBook.xpt
new file mode 100644
index 0000000..ac43d95
--- /dev/null
+++ b/doc/src/metagen/DocBook.xpt
@@ -0,0 +1,108 @@
+«EXTENSION metagen::Extensions»
+
+
+«DEFINE Start FOR List[oaw::Type]»
+«FILE "builtin_api.xml" DOCBOOK»
+<section id="builtin_api">
+ <title>Built-in types API documentation</title>
+
+ «EXPAND Section FOREACH this»
+</section>
+«ENDFILE»
+«ENDDEFINE»
+
+«DEFINE Section FOR oaw::Type»
+ <section id="builtin_api_«name»">
+ <title><classname>«name»</classname></title>
+ <para>
+ Supertype:
+«IF superTypes.size>0»«FOREACH superTypes AS super SEPARATOR ", "»«super.db_linkedName()»«ENDFOREACH»«ELSE»none«ENDIF»
+ </para>
+ <para>
+ «EXPAND PropertyTable»
+ </para>
+ <para>
+ «EXPAND OperationTable»
+ </para>
+ </section>
+
+«ENDDEFINE»
+
+
+«DEFINE PropertyTable FOR oaw::Type»
+«IF !getOwnedProperties().isEmpty»
+ <table frame='all' id="builtin_api_«name»_Properties">
+ <title>Properties of <classname>«name»</classname></title>
+ <tgroup cols='3' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1'/>
+ <colspec colname='c2'/>
+ <colspec colname='c3'/>
+ <thead>
+ <row>
+ <entry>Type</entry>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+«FOREACH getOwnedProperties() AS prop-»
+ <row>
+ <entry>
+ «prop.returnType.db_linkedName()»
+ </entry>
+ <entry>
+ <methodname>«prop.name»</methodname>
+ </entry>
+ <entry>
+ «prop.documentation»
+ </entry>
+ </row>
+«ENDFOREACH-»
+ </tbody>
+ </tgroup>
+ </table>
+«ELSE»
+ This type does not define any properties.
+«ENDIF»
+«ENDDEFINE»
+
+
+
+«DEFINE OperationTable FOR oaw::Type»
+«IF !getOwnedOperations().isEmpty»
+ <table frame='all' id="builtin_api_«name»_Operations">
+ <title>Operations of <classname>«name»</classname></title>
+ <?dbfo keep-together.within-column="auto" ?>
+ <tgroup cols='3' align='left' colsep='1' rowsep='1'>
+ <colspec colname='c1'/>
+ <colspec colname='c2'/>
+ <colspec colname='c3'/>
+ <thead>
+ <row>
+ <entry>Return type</entry>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+«FOREACH getOwnedOperations() AS op-»
+ <row>
+ <entry>
+ «op.returnType.db_linkedName()»
+ </entry>
+ <entry>
+ <methodname>«op.name.replaceAll("<","&lt;").replaceAll(">","&gt;")»</methodname>
+ («FOREACH op.getParameterTypes() AS param SEPARATOR ", "»«param.db_linkedName()»«ENDFOREACH»)
+ </entry>
+ <entry>
+ «op.documentation»
+ </entry>
+ </row>
+«ENDFOREACH-»
+ </tbody>
+ </tgroup>
+ </table>
+«ELSE»
+ This type does not define any operations.
+«ENDIF»
+«ENDDEFINE»
diff --git a/doc/src/metagen/Extensions.ext b/doc/src/metagen/Extensions.ext
new file mode 100644
index 0000000..ecc30a1
--- /dev/null
+++ b/doc/src/metagen/Extensions.ext
@@ -0,0 +1,25 @@
+
+
+getOwnedProperties(oaw::Type t) :
+ t.allProperties.select(p|p.owner == t)
+;
+
+getOwnedOperations(oaw::Type t) :
+ t.allOperations.select(p|p.owner == t)
+;
+
+fileName(oaw::Type t) :
+ t.name.replaceAll("::","_")+".html"
+;
+
+linkedName(oaw::Type t) :
+ linkedName(t, null)
+;
+
+linkedName(oaw::Type t, String target) :
+ "<a href='" +t.fileName() +"' "+(target!=null ? "target='"+target+"'" : "")+">" +t +"</a>"
+;
+
+
+db_linkedName (oaw::Type t) :
+ "<classname><link linkend='builtin_api_"+t.name+"'>"+t.name+"</link></classname>"; \ No newline at end of file
diff --git a/doc/src/metagen/Root.xpt b/doc/src/metagen/Root.xpt
new file mode 100644
index 0000000..4658dca
--- /dev/null
+++ b/doc/src/metagen/Root.xpt
@@ -0,0 +1,4 @@
+«DEFINE Root FOR List[oaw::Type]»
+«EXPAND ApiDoc::all»
+«EXPAND DocBook::Start»
+«ENDDEFINE» \ No newline at end of file
diff --git a/doc/src/workflow.oaw b/doc/src/workflow.oaw
new file mode 100644
index 0000000..8b730d8
--- /dev/null
+++ b/doc/src/workflow.oaw
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="windows-1252"?>
+<workflow>
+ <property name="srcGenPath" value="./src-gen"/>
+ <property name="typeListExpression" value="{
+ Object,
+ String,
+ Integer,
+ Boolean,
+ Real,
+ Collection,
+ List,
+ Set,
+ oaw::Type,
+ oaw::Feature,
+ oaw::Property,
+ oaw::Operation,
+ oaw::StaticProperty,
+ Void,
+ xtend::AdviceContext,
+ xpand2::Definition,
+ xpand2::Iterator}"/>
+
+ <component class="org.eclipse.mwe.utils.DirectoryCleaner">
+ <directories value="${srcGenPath}"/>
+ </component>
+
+ <component class="org.eclipse.xpand2.Generator">
+ <expand value="metagen::Root::Root FOR ${typeListExpression}"/>
+ <outlet path="${srcGenPath}"/>
+ <outlet path="${srcGenPath}/html" name="HTML"/>
+ <outlet path="${srcGenPath}/docbook" name="DOCBOOK"/>
+ <fileEncoding value="iso-8859-1"/>
+ </component>
+</workflow> \ No newline at end of file