From 2bc043354c4edb1f5aad751285060fb722a63ea1 Mon Sep 17 00:00:00 2001 From: doko Date: Tue, 21 Oct 2008 17:55:01 +0000 Subject: libjava/ChangeLog: 2008-10-21 Andrew John Hughes * sources.am, Makfile.in: Regenerate. 2008-10-17 Matthias Klose * configure.ac: Fix bashisms. * configure: Regenerate. 2008-10-15 Matthias Klose * configure.ac: Disable build of gjdoc, if configured without --with-antlr-jar or if no antlr.jar found. * configure: Regenerate. 2008-10-09 Andrew John Hughes * classpath/configure.ac, * classpath/m4/ac_prog_antlr.m4, * classpath/m4/ac_prog_java.m4, * classpath/tools/Makefile.am: Ported --regen-gjdoc-parser patch and cantlr support from GNU Classpath. 2008-10-06 Andrew Haley * java/lang/Thread.java (Thread): Always create the ThreadLocalMap when creating a thread. (getThreadLocals) Don't lazily create the ThreadLocalMap. 2008-09-28 Andrew John Hughes * classpath/java/lang/ThreadLocalMap.java, * java/lang/ThreadLocalMap$Entry.h, * java/lang/ThreadLocalMap.h, * lib/java/lang/ThreadLocalMap.class, * lib/java/lang/ThreadLocalMap$Entry.class: Add the new files for the ThreadLocal patch. 2008-09-28 Andrew John Hughes * classpath/ChangeLog, * classpath/java/lang/InheritableThreadLocal.java, * classpath/java/lang/Thread.java, * classpath/java/lang/ThreadLocal.java: Merge Daniel Frampton's ThreadLocal patch. * gcj/javaprims.h: Updated. * java/lang/Thread.h: Regenerated. * java/lang/Thread.java: Replace WeakIdentityHashMap with ThreadLocalMap. (getThreadLocals()): Likewise. * java/lang/ThreadLocal.h: Regenerated. * java/lang/ThreadLocal.java: (computeNextHash()): New method. (ThreadLocal()): Initialise fastHash. (internalGet()): Updated to match Classpath's get(). (internalSet(Object)): Likewise for set(Object). (internalRemove()): Likewise for remove(). 2008-09-25 Andrew John Hughes * classpath/configure, * classpath/configure.ac: Resynchronise with Classpath's configure. * classpath/examples/Makefile.in: Add equivalent support for building as in tools/Makefile.in. * classpath/java/nio/Buffer.java, * classpath/java/nio/ByteBuffer.java, * classpath/java/nio/ByteBufferImpl.java, * classpath/java/nio/CharBuffer.java, * classpath/java/nio/CharBufferImpl.java, * classpath/java/nio/CharSequenceBuffer.java, * classpath/java/nio/CharViewBufferImpl.java, * classpath/java/nio/DirectByteBufferImpl.java, * classpath/java/nio/DoubleBuffer.java, * classpath/java/nio/DoubleBufferImpl.java, * classpath/java/nio/DoubleViewBufferImpl.java, * classpath/java/nio/FloatBuffer.java, * classpath/java/nio/FloatBufferImpl.java, * classpath/java/nio/FloatViewBufferImpl.java, * classpath/java/nio/IntBuffer.java, * classpath/java/nio/IntBufferImpl.java, * classpath/java/nio/IntViewBufferImpl.java, * classpath/java/nio/LongBuffer.java, * classpath/java/nio/LongBufferImpl.java, * classpath/java/nio/LongViewBufferImpl.java, * classpath/java/nio/MappedByteBuffer.java, * classpath/java/nio/MappedByteBufferImpl.java, * classpath/java/nio/ShortBuffer.java, * classpath/java/nio/ShortBufferImpl.java, * classpath/java/nio/ShortViewBufferImpl.java: Replace use of gnu.classpath.Pointer with gnu.gcj.RawData, and fix some formatting issues. * classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaLexer.java, * classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaLexer.smap, * classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.java, * classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.smap, * classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.java, * classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.txt: Regenerated (later version of antlr). * java/nio/Buffer.h: Regenerated. * java/nio/Buffer.java: Ported changes from Classpath. * java/nio/ByteBuffer.h, * java/nio/CharBuffer.h: Regenerated. * java/nio/DirectByteBufferImpl.java: Ported changes from Classpath. * java/nio/DoubleBuffer.h, * java/nio/FloatBuffer.h, * java/nio/IntBuffer.h, * java/nio/LongBuffer.h, * java/nio/MappedByteBuffer.h, * java/nio/MappedByteBufferImpl.h: Regenerated. * java/nio/MappedByteBufferImpl.java: Ported changes from Classpath. * java/nio/ShortBuffer.h: Regenerated. 2008-09-24 Matthias Klose * configure.ac: Search for antlr.jar, if not configured. * configure: Regenerate. 2008-09-24 Matthias Klose * Makefile.am: Build a gjdoc binary, if enabled. * configure.ac: Add options --disable-gjdoc, --with-antlr-jar=file. * Makefile.in, */Makefile.in, configure: Regenerate. 2008-09-22 Andrew Haley * java/lang/String.java (toString(char[], int, int)): New method. 2008-09-14 Matthias Klose Import GNU Classpath (libgcj-import-20080914). * Regenerate class and header files. * Regenerate auto* files. * configure.ac: Don't pass --disable-gjdoc to classpath. * sources.am: Regenerated. * HACKING: Mention to build gjdoc in maintainer builds. * gnu/classpath/Configuration.java: Update classpath version. * gcj/javaprims.h: Update. 2008-09-08 Andrew John Hughes * Makefile.am: Replace natStringBuffer.cc and natStringBuilder.cc with natAbstractStringBuffer.cc. * Makefile.in: Regenerated. * java/lang/AbstractStringBuffer.java: (append(int)): Made native. (regionMatches(int,String)): Likewise. * java/lang/StringBuffer.h: Regenerated. * java/lang/StringBuffer.java: Remerged with GNU Classpath. * java/lang/StringBuilder.h: Regenerated. * java/lang/StringBuilder.java: Remerged with GNU Classpath. * java/lang/natAbstractStringBuffer.cc: Provide common native methods for StringBuffer and StringBuilder. * java/lang/natStringBuffer.cc, * java/lang/natStringBuilder.cc: Removed. 2008-09-04 Andrew John Hughes * Makefile.in, * classpath/configure: Regenerated. * gnu/gcj/util/natDebug.cc, * gnu/gcj/xlib/natColormap.cc, * gnu/gcj/xlib/natDisplay.cc, * gnu/gcj/xlib/natDrawable.cc, * gnu/gcj/xlib/natFont.cc, * gnu/gcj/xlib/natWMSizeHints.cc, * gnu/gcj/xlib/natWindow.cc, * gnu/gcj/xlib/natXImage.cc: Add :: prefix to namespaces. * java/io/CharArrayWriter.h, * java/lang/StringBuffer.h: Regenerated using patched gjavah. * java/lang/natStringBuffer.cc: Fix naming of append(jint). * java/sql/Timestamp.h: Regenerated using patched gjavah. * jni.cc: Rename p to functions to match change in GNU Classpath. * scripts/makemake.tcl: Switch gnu.java.math to BC compilation. * sources.am: Regenerated. 2008-08-21 Andrew John Hughes * Makefile.in: Updated location of Configuration.java. * classpath/lib/gnu/java/locale/LocaleData.class: Regenerated. 2008-08-18 Andrew John Hughes * Makefile.in: Updated with new Java files. * classpath/configure: Regenerated. * classpath/tools/Makefile.am: Add missing use of GJDOC_EX so --disable-gjdoc works. * classpath/tools/Makefile.in: Regenerated. 2008-08-15 Matthias Klose Import GNU Classpath (libgcj-import-20080811). * Regenerate class and header files. * Regenerate auto* files. * configure.ac: Don't pass --with-fastjar to classpath, substitute new dummy value in classpath/gnu/classpath/Configuration.java.in, pass --disable-gjdoc to classpath. * scripts/makemake.tcl: * sources.am: Regenerated. * java/lang/AbstractStringBuffer.java, gnu/java/lang/VMCPStringBuilder.java: New, copied from classpath, use System instead of VMSystem. * java/lang/StringBuffer.java: Merge from classpath. * java/lang/ClassLoader.java: Merge from classpath. * gcj/javaprims.h: Update class definitions, remove _Jv_jobjectRefType, jobjectRefType definitions. libjava/classpath/ChangeLog.gcj: 2008-10-21 Matthias Klose * classpath/tools/gnu/classpath/tools/gjdoc/expr/Java*: Move from ... * classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/ ... here. * Update .class files. 2008-10-21 Andrew John Hughes * tools/Makefile.am: Always generate parser in the srcdir. 2008-10-21 Matthias Klose * doc/Makefile.am (MAINTAINERCLEANFILES): Add gjdoc.1. * doc/Makefile.in: Regenerate. 2008-10-20 Matthias Klose * configure.ac: Don't check for working java, if not configured with --enable-java-maintainer-mode. * configure: Regenerate. 2008-10-19 Matthias Klose * m4/ac_prog_java.m4: Revert previous change. * m4/ac_prog_javac.m4: Apply it here. * configure: Regenerate. 2008-10-19 Matthias Klose * m4/ac_prog_javac.m4: Don't check for working javac, if not configured with --enable-java-maintainer-mode. * configure: Regenerate. * Makefile.in, */Makefile.in: Regenerate. 2008-09-30 Matthias Klose * m4/ac_prog_antlr.m4: Check for cantlr binary as well. 2008-09-29 Matthias Klose * m4/ac_prog_antlr.m4: Check for antlr binary as well. 2008-09-28 Matthias Klose * PR libgcj/37636. Revert: 2008-02-20 Matthias Klose * tools/Makefile.am ($(TOOLS_ZIP)): Revert part of previous change, Do copy resource files in JAVA_MAINTAINER_MODE only. * tools/Makefile.in: Regenerate. 2008-09-14 Matthias Klose * m4/ac_prog_javac_works.m4, m4/ac_prog_javac.m4, m4/acinclude.m4: Revert local changes. * m4/ac_prog_antlr.m4: Check for an runantlr binary. * tools/Makefile.am, lib/Makefile.am: Revert local changes (JCOMPILER). * tools/Makefile.am: Remove USE_JAVAC_FLAGS, pass ANTLR_JAR in GLIBJ_CLASSPATH. 2008-09-14 Matthias Klose Revert: Daniel Frampton * AUTHORS: Added. * java/lang/InheritableThreadLocal.java, * java/lang/Thread.java, * java/lang/ThreadLocal.java: Modified to use java.lang.ThreadLocalMap. * java/lang/ThreadLocalMap.java: New cheaper ThreadLocal-specific WeakHashMap. 2008-08-15 Matthias Klose * m4/acinclude.m4 (CLASSPATH_JAVAC_MEM_CHECK): Remove unknown args for javac. libjava/classpath/ChangeLog: 2008-10-20 Andrew John Hughes * m4/ac_prog_antlr.m4: Remove redundant checks. * tools/Makefile.am: Use gjdoc_gendir when calling antlr. 2008-10-15 Andrew John Hughes * configure.ac: Remove superfluous AC_PROG_JAVA call. 2008-10-06 Andrew John Hughes * m4/ac_prog_antlr: Check for cantlr as well. * tools/Makefile.am: Only build GJDoc parser when both CREATE_GJDOC and CREATE_GJDOC_PARSER are on. 2008-10-02 Andrew John Hughes * configure.ac: Add regen-gjdoc-parser option, and separate antlr tests. * m4/ac_prog_antlr.m4: Turn single test into AC_LIB_ANTLR and AC_PROG_ANTLR. * m4/ac_prog_java.m4: Quote tests. * tools/Makefile.am: Support CREATE_GJDOC_PARSER option. 2008-09-14 Andrew John Hughes * examples/Makefile.am: Check lib directly as well as glibj.zip for boot classes. * m4/acinclude.m4: Only require the class files to be built to allow the tools and examples to be built, not the installation of glibj.zip. * tools/Makefile.am: Check lib directly as well as glibj.zip for boot classes. 2008-09-13 Andrew John Hughes * examples/Makefile.am, * lib/Makefile.am: Add GCJ rules. * m4/ac_prog_javac.m4: Check whether JAVAC is gcj. * m4/ac_prog_javac_works.m4: Add GCJ rules. * m4/acinclude.m4: Don't bother checking for -J if using GCJ. * tools/Makefile.am: Add GCJ rules. 2007-08-23 Daniel Frampton * AUTHORS: Added. * java/lang/InheritableThreadLocal.java, * java/lang/Thread.java, * java/lang/ThreadLocal.java: Modified to use java.lang.ThreadLocalMap. * java/lang/ThreadLocalMap.java: New cheaper ThreadLocal-specific WeakHashMap. 2008-02-07 Ian Rogers * java/util/zip/ZipEntry.java: Use byte fields instead of integer fields, store the time as well as the DOS time and don't retain a global Calendar instance. (setDOSTime(int)): Set KNOWN_DOSTIME instead of KNOWN_TIME, and unset KNOWN_TIME. (getDOSTime()): Compute DOS time from UNIX time only when needed. (clone()): Provide cloning via the ZipEntry constructor where possible. (setTime(long)): Don't compute DOS time at this point. (getCalendar()): Removed. 2008-09-09 Andrew John Hughes * tools/gnu/classpath/tools/getopt/Parser.java: (setHeader(String)): Make synchronized. (setFooter(String)): Likewise. * tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java, (reset()): Make synchronized. (name(Class)): Likewise. 2008-09-04 Robert Schuster * gnu/java/nio/charset/ByteDecodeLoopHelper: (arrayDecodeLoop): Added new break label, escape to that label. * gnu/java/nio/charset/ByteEncodeLoopHelper: (arrayDecodeLoop): Added new break label, escape to that label. 2008-09-04 Robert Schuster * java/text/DecimalFormat.java: (scanFix): Use 'i + 1' when looking at following character. (scanNegativePattern): Dito. 2008-09-02 Andrew John Hughes * tools/gnu/classpath/tools/javah/ClassWrapper.java: (makeVtable()): Populate methodNameMap. (printMethods(CniPrintStream)): Always use pre-populated methodNameMap for bridge targets. 2008-09-01 Mario Torre * gnu/java/awt/peer/x/XImage.java (XImageProducer): remove @Override annotation to allow compilation on javac < 1.6 and ecj < 3.4. 2008-09-01 Mario Torre * gnu/java/awt/peer/x/XGraphicsDevice.java (getDisplay): fix to support new Escher API. * gnu/java/awt/peer/x/XImage.java (getSource): method implemented. * gnu/java/awt/peer/x/XImage.java (XImageProducer): implement ImageProducer for getSource. 2008-09-01 Andrew John Hughes * gnu/java/util/regex/BacktrackStack.java, * gnu/java/util/regex/CharIndexed.java, * gnu/java/util/regex/CharIndexedCharArray.java, * gnu/java/util/regex/CharIndexedCharSequence.java, * gnu/java/util/regex/CharIndexedInputStream.java, * gnu/java/util/regex/CharIndexedString.java, * gnu/java/util/regex/CharIndexedStringBuffer.java, * gnu/java/util/regex/RE.java, * gnu/java/util/regex/REException.java, * gnu/java/util/regex/REFilterInputStream.java, * gnu/java/util/regex/REMatch.java, * gnu/java/util/regex/REMatchEnumeration.java, * gnu/java/util/regex/RESyntax.java, * gnu/java/util/regex/REToken.java, * gnu/java/util/regex/RETokenAny.java, * gnu/java/util/regex/RETokenBackRef.java, * gnu/java/util/regex/RETokenChar.java, * gnu/java/util/regex/RETokenEnd.java, * gnu/java/util/regex/RETokenEndOfPreviousMatch.java, * gnu/java/util/regex/RETokenEndSub.java, * gnu/java/util/regex/RETokenIndependent.java, * gnu/java/util/regex/RETokenLookAhead.java, * gnu/java/util/regex/RETokenLookBehind.java, * gnu/java/util/regex/RETokenNamedProperty.java, * gnu/java/util/regex/RETokenOneOf.java, * gnu/java/util/regex/RETokenPOSIX.java, * gnu/java/util/regex/RETokenRange.java, * gnu/java/util/regex/RETokenRepeated.java, * gnu/java/util/regex/RETokenStart.java, * gnu/java/util/regex/RETokenWordBoundary.java, * gnu/java/util/regex/UncheckedRE.java: Fix indentation. 2008-09-01 Andrew John Hughes * gnu/java/util/regex/RETokenStart.java: (getMaximumLength()): Add Override annotation. (matchThis(CharIndexed, REMatch)): Likewise. (returnsFixedLengthMatches()): Renamed from returnsFixedLengthmatches and added Override annotation. (findFixedLengthMatches(CharIndexed,REMatch,int)): Add Override annotation. (dump(CPStringBuilder)): Likewise. * gnu/javax/print/ipp/IppRequest.java: (RequestWriter.writeOperationAttributes(AttributeSet)): Throw exception, don't just create and drop it. * javax/management/MBeanServerPermission.java: (MBeanServerPermissionCollection.add(Permission)): Compare against individual Strings not the entire array, and store the result of replace. * javax/swing/text/html/StyleSheet.java: (setBaseFontSize(size)): Store result of trim(). 2008-09-01 Andrew John Hughes * javax/tools/FileObject.java: (openReader(boolean)): Document new parameter. 2008-03-27 Michael Franz PR classpath/35690: * javax/tools/FileObject.java: (toUri()): Fix case from toURI. (openReader(boolean)): Add missing boolean argument. 2008-08-26 Andrew John Hughes PR classpath/35487: * gnu/javax/management/Server.java: (beans): Change to ConcurrentHashMap. (defaultDomain): Make final. (outer): Likewise. (LazyListenersHolder): Added to wrap listeners, also now a ConcurrentHashMap, providing lazy initialisation safely. (sequenceNumber): Documented. (getBean(ObjectName)): Remove redundant cast. (addNotificationListener(ObjectName,NotificationListener, NotificationFilter,Object)): Remove map initialisation and use holder. (getObjectInstance(ObjectName)): Remove redundant cast. (registerMBean(Object,ObjectName)): Add bean atomically. (removeNotificationListener(ObjectName,NotificationListener)): Simplified. (removeNotificationListener(ObjectName,NotificationListener, NotificationFilter,Object)): Likewise. (notify(ObjectName,String)): Documented. 2008-08-26 Andrew John Hughes * gnu/javax/management/Server.java: Genericised. 2008-08-26 Andrew John Hughes * gnu/javax/management/Translator.java: Genericised. 2008-08-26 Andrew John Hughes * javax/management/DefaultLoaderRepository.java, * javax/management/JMX.java, * javax/management/MBeanAttributeInfo.java, * javax/management/MBeanConstructorInfo.java, * javax/management/MBeanOperationInfo.java, * javax/management/MBeanServerDelegate.java: Fix warnings due to generics. 2008-08-25 Andrew John Hughes * javax/management/MBeanPermission.java, * javax/management/MBeanServerDelegate.java, * javax/management/MBeanServerFactory.java, * javax/management/MBeanServerInvocationHandler.java, * javax/management/MBeanServerPermission.java: Fix warnings due to use of non-generic collections. 2008-08-25 Mario Torre * gnu/javax/rmi/CORBA/RmiUtilities.java (readValue): check if sender is null to avoid NPE. 2008-08-22 Mario Torre * gnu/CORBA/OrbFunctional.java (set_parameters): Fix NullPointerException checking when param is null. 2008-08-23 Andrew John Hughes * java/util/regex/Matcher.java: (reset()): Reset append position so we don't try and append to the end of the old input. 2008-08-22 Andrew John Hughes PR classpath/32028: * m4/acinclude.m4: Also allow versions of GJDoc from 0.8* on, as CVS is 0.8.0-pre. 2008-08-21 Andrew John Hughes PR classpath/32028: * m4/acinclude.m4: (CLASSPATH_WITH_GJDOC): Ensure version 0.7.9 is being used. 2008-08-20 Andrew John Hughes * tools/Makefile.am: Add taglets subdirectory to list of excluded paths when GJDoc is not compiled. 2008-08-19 David P Grove * scripts/check_jni_methods.sh.in: Fix build issue on AIX by splitting generation of method list. 2008-08-18 Andrew John Hughes * native/jni/gstreamer-peer/gst_native_pipeline.c: (get_free_space(int)): Use #else not #elif when there is no condition. 2008-08-17 Andrew John Hughes PR classpath/31895: * java/text/DecimalFormat.java: (setCurrency(Currency)): Update prefixes and suffixes when currency changes. * java/text/DecimalFormatSymbols.java: (DecimalFormatSymbols(Locale)): Set locale earlier so it can be used by setCurrency(Currency). (setCurrency(Currency)): Set the symbol correctly using the locale of the instance. * java/util/Currency.java: Throw error instead of just printing a message. 2008-08-17 Andrew John Hughes * javax/activation/ActivationDataFlavor.java: Suppress warnings from public API. (mimeType): Made final. (representationClass): Added generic type and made final. (normalizeMimeTypeParameter(String,String)): Use CPStringBuilder. * javax/activation/CommandInfo.java: (verb): Made final. (className): Made final. * javax/activation/DataHandler.java: (dataSource): Made final. * javax/activation/FileDataSource.java: (file): Made final. * javax/activation/MailcapCommandMap.java: Use generics on collections and CPStringBuilder instead of StringBuffer. * javax/activation/MimeType.java: (toString()): Use CPStringBuilder. (getBaseType()): Likewise. * javax/activation/MimeTypeParameterList.java: Use generics on collections and CPStringBuilder instead of StringBuffer. * javax/activation/MimeTypeParseException.java: (MimeTypeParseException(String,String)): Use CPStringBuilder. * javax/activation/MimetypesFileTypeMap.java: Use generics on collections and CPStringBuilder instead of StringBuffer. * javax/activation/URLDataSource.java: (url): Made final. 2008-08-17 Andrew John Hughes * gnu/javax/activation/viewers/ImageViewer.java, * gnu/javax/activation/viewers/TextEditor.java, * gnu/javax/activation/viewers/TextViewer.java, * javax/activation/ActivationDataFlavor.java, * javax/activation/CommandInfo.java, * javax/activation/CommandMap.java, * javax/activation/CommandObject.java, * javax/activation/DataContentHandler.java, * javax/activation/DataContentHandlerFactory.java, * javax/activation/DataHandler.java, * javax/activation/DataHandlerDataSource.java, * javax/activation/DataSource.java, * javax/activation/DataSourceDataContentHandler.java, * javax/activation/FileDataSource.java, * javax/activation/FileTypeMap.java, * javax/activation/MailcapCommandMap.java, * javax/activation/MimeType.java, * javax/activation/MimeTypeParameterList.java, * javax/activation/MimeTypeParseException.java, * javax/activation/MimetypesFileTypeMap.java, * javax/activation/ObjectDataContentHandler.java, * javax/activation/URLDataSource.java, * javax/activation/UnsupportedDataTypeException.java, * javax/activation/package.html, * resource/META-INF/mailcap.default, * resource/META-INF/mimetypes.default: Import GNU JAF CVS as of 17/08/2008. 2006-04-25 Archit Shah * javax/activation/MimeTypeParameterList.java: Insert ';' separator before parameter list. 2005-06-29 Xavier Poinsard * javax/activation/ObjectDataContentHandler.java: Fixed typo. 2005-05-28 Chris Burdess * javax/activation/CommandMap.java, * javax/activation/MailcapCommandMap.java: Updated to JAF 1.1. 2004-06-09 Chris Burdess * javax/activation/MailcapCommandMap.java: Fixed bug whereby x-java prefix was not attempted. 2008-08-17 Andrew John Hughes * AUTHORS: Added Laszlo. 2008-04-20 Andrew John Hughes PR classpath/30436: * java/util/Scanner.java: Fix package to be java.util and correct indentation. 2007-07-25 Laszlo Andras Hernadi PR classpath/30436: * java/util/Scanner.java: Initial implementation. 2008-08-17 Andrew John Hughes * java/util/regex/Matcher.java: (toMatchResult()): Implemented. 2008-08-13 Joshua Sumali * doc/Makefile.am (gjdoc.pod): Generate gjdoc pod from cp-tools.texinfo instead of invoke.texi. Remove invoke.texi from EXTRA_DIST. * doc/invoke.texi: Removed and merged into ... * doc/cp-tools.texinfo: Here 2008-08-12 Robert Schuster * native/jni/java-net/local.c (local_bind): Removed fprintf call, fixed access outside of array bounds. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@141271 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/tools/Makefile.am | 209 +- libjava/classpath/tools/Makefile.in | 251 +- .../tools/classes/com/sun/tools/javadoc/Main.class | Bin 0 -> 453 bytes .../FileSystemClassLoader$FileStreamInfo.class | Bin 0 -> 1086 bytes .../FileSystemClassLoader$JarStreamInfo.class | Bin 0 -> 1741 bytes .../tools/FileSystemClassLoader$StreamInfo.class | Bin 0 -> 446 bytes .../classpath/tools/FileSystemClassLoader.class | Bin 0 -> 6253 bytes .../classes/gnu/classpath/tools/IOToolkit.class | Bin 0 -> 3753 bytes .../gnu/classpath/tools/MalformedInputEvent.class | Bin 0 -> 1267 bytes .../classpath/tools/MalformedInputListener.class | Bin 0 -> 228 bytes .../tools/NotifyingInputStreamReader.class | Bin 0 -> 5878 bytes .../gnu/classpath/tools/StringToolkit.class | Bin 0 -> 1124 bytes .../tools/common/ClasspathToolParser.class | Bin 4028 -> 4032 bytes .../doclets/AbstractDoclet$DocletOptionGroup.class | Bin 0 -> 2075 bytes .../doclets/AbstractDoclet$DocletOptionTag.class | Bin 0 -> 3296 bytes .../AbstractDoclet$DocletOptionTaglet.class | Bin 0 -> 4359 bytes .../AbstractDoclet$DocletOptionTagletPath.class | Bin 0 -> 955 bytes .../tools/doclets/AbstractDoclet$IndexKey.class | Bin 0 -> 1129 bytes .../doclets/AbstractDoclet$InterfaceRelation.class | Bin 0 -> 663 bytes .../tools/doclets/AbstractDoclet$UsageType.class | Bin 0 -> 1848 bytes .../classpath/tools/doclets/AbstractDoclet.class | Bin 0 -> 27211 bytes .../doclets/DocletConfigurationException.class | Bin 0 -> 432 bytes .../gnu/classpath/tools/doclets/DocletOption.class | Bin 0 -> 575 bytes .../tools/doclets/DocletOptionColonSeparated.class | Bin 0 -> 1139 bytes .../classpath/tools/doclets/DocletOptionFile.class | Bin 0 -> 962 bytes .../classpath/tools/doclets/DocletOptionFlag.class | Bin 0 -> 755 bytes .../doclets/DocletOptionPackageWildcard.class | Bin 0 -> 2108 bytes .../tools/doclets/DocletOptionString.class | Bin 0 -> 776 bytes .../tools/doclets/InlineTagRenderer.class | Bin 0 -> 258 bytes .../doclets/InvalidPackageWildcardException.class | Bin 0 -> 437 bytes .../gnu/classpath/tools/doclets/PackageGroup.class | Bin 0 -> 698 bytes .../classpath/tools/doclets/PackageMatcher.class | Bin 0 -> 2907 bytes .../classpath/tools/doclets/StandardTaglet.class | Bin 0 -> 1341 bytes .../classpath/tools/doclets/TagletPrinter.class | Bin 0 -> 187 bytes .../tools/doclets/debugdoclet/DebugDoclet.class | Bin 0 -> 4081 bytes .../tools/doclets/htmldoclet/CssClass.class | Bin 0 -> 14612 bytes .../tools/doclets/htmldoclet/ExternalDocSet.class | Bin 0 -> 3836 bytes .../tools/doclets/htmldoclet/HtmlDoclet$1.class | Bin 0 -> 1205 bytes .../tools/doclets/htmldoclet/HtmlDoclet$2.class | Bin 0 -> 1207 bytes .../tools/doclets/htmldoclet/HtmlDoclet$3.class | Bin 0 -> 1401 bytes .../doclets/htmldoclet/HtmlDoclet$TreeNode.class | Bin 0 -> 1088 bytes .../tools/doclets/htmldoclet/HtmlDoclet.class | Bin 0 -> 80179 bytes .../tools/doclets/htmldoclet/HtmlPage.class | Bin 0 -> 12297 bytes .../doclets/htmldoclet/HtmlTagletContext.class | Bin 0 -> 876 bytes .../tools/doclets/xmldoclet/Driver$1.class | Bin 0 -> 935 bytes .../xmldoclet/Driver$NullErrorReporter.class | Bin 0 -> 793 bytes .../tools/doclets/xmldoclet/Driver$UsageType.class | Bin 0 -> 1537 bytes .../classpath/tools/doclets/xmldoclet/Driver.class | Bin 0 -> 51864 bytes .../tools/doclets/xmldoclet/Driver1_4.class | Bin 0 -> 955 bytes .../doclets/xmldoclet/HtmlRepairer$TagInfo.class | Bin 0 -> 1043 bytes .../tools/doclets/xmldoclet/HtmlRepairer.class | Bin 0 -> 10463 bytes .../tools/doclets/xmldoclet/TargetContext.class | Bin 0 -> 1172 bytes .../DocTranslet$DocErrorReporterOutputStream.class | Bin 0 -> 1093 bytes .../xmldoclet/doctranslet/DocTranslet.class | Bin 0 -> 14435 bytes .../DocTransletConfigurationException.class | Bin 0 -> 774 bytes .../doctranslet/DocTransletException.class | Bin 0 -> 1218 bytes .../xmldoclet/doctranslet/DocTransletOptions.class | Bin 0 -> 865 bytes .../xmldoclet/doctranslet/JarClassLoader.class | Bin 0 -> 2127 bytes .../xmldoclet/doctranslet/OutputFileInfo.class | Bin 0 -> 1467 bytes .../gnu/classpath/tools/getopt/Parser$1.class | Bin 1061 -> 1061 bytes .../gnu/classpath/tools/getopt/Parser$2.class | Bin 1119 -> 1119 bytes .../gnu/classpath/tools/getopt/Parser$3.class | Bin 904 -> 904 bytes .../gnu/classpath/tools/getopt/Parser.class | Bin 8099 -> 8255 bytes .../classpath/tools/gjdoc/AbstractTagImpl.class | Bin 0 -> 2825 bytes .../tools/gjdoc/ArrayCharacterIterator.class | Bin 0 -> 1762 bytes .../tools/gjdoc/BlockSourceComponent.class | Bin 0 -> 629 bytes .../gnu/classpath/tools/gjdoc/BracketClose.class | Bin 0 -> 862 bytes .../gnu/classpath/tools/gjdoc/ClassComponent.class | Bin 0 -> 2610 bytes .../gnu/classpath/tools/gjdoc/ClassDocImpl.class | Bin 0 -> 25782 bytes .../gnu/classpath/tools/gjdoc/ClassDocProxy.class | Bin 0 -> 7577 bytes .../tools/gjdoc/ClassDocReflectedImpl.class | Bin 0 -> 8685 bytes .../classpath/tools/gjdoc/CommentComponent.class | Bin 0 -> 1517 bytes .../classpath/tools/gjdoc/ConstructorDocImpl.class | Bin 0 -> 757 bytes .../classes/gnu/classpath/tools/gjdoc/Debug.class | Bin 0 -> 1447 bytes .../tools/gjdoc/DirectoryTree$FileNode.class | Bin 0 -> 943 bytes .../gnu/classpath/tools/gjdoc/DirectoryTree.class | Bin 0 -> 1226 bytes .../gnu/classpath/tools/gjdoc/DocImpl.class | Bin 0 -> 19116 bytes .../tools/gjdoc/EmptyStatementComponent.class | Bin 0 -> 612 bytes .../gnu/classpath/tools/gjdoc/ErrorReporter.class | Bin 0 -> 1660 bytes .../tools/gjdoc/ExecutableMemberDocImpl.class | Bin 0 -> 9289 bytes .../gnu/classpath/tools/gjdoc/FieldComponent.class | Bin 0 -> 3110 bytes .../gnu/classpath/tools/gjdoc/FieldDocImpl.class | Bin 0 -> 8266 bytes .../classpath/tools/gjdoc/FunctionComponent.class | Bin 0 -> 2992 bytes .../classpath/tools/gjdoc/GjdocPackageDoc.class | Bin 0 -> 217 bytes .../gnu/classpath/tools/gjdoc/GjdocRootDoc.class | Bin 0 -> 184 bytes .../tools/gjdoc/IgnoredFileParseException.class | Bin 0 -> 357 bytes .../classpath/tools/gjdoc/ImportComponent.class | Bin 0 -> 1226 bytes .../classpath/tools/gjdoc/InheritDocTagImpl.class | Bin 0 -> 1838 bytes .../gnu/classpath/tools/gjdoc/JavadocWrapper.class | Bin 0 -> 960 bytes .../gnu/classpath/tools/gjdoc/LinkTagImpl.class | Bin 0 -> 918 bytes .../classes/gnu/classpath/tools/gjdoc/Main$1.class | Bin 0 -> 825 bytes .../gnu/classpath/tools/gjdoc/Main$10.class | Bin 0 -> 1221 bytes .../gnu/classpath/tools/gjdoc/Main$11.class | Bin 0 -> 1728 bytes .../gnu/classpath/tools/gjdoc/Main$12.class | Bin 0 -> 1799 bytes .../gnu/classpath/tools/gjdoc/Main$13.class | Bin 0 -> 1800 bytes .../gnu/classpath/tools/gjdoc/Main$14.class | Bin 0 -> 1002 bytes .../gnu/classpath/tools/gjdoc/Main$15.class | Bin 0 -> 924 bytes .../gnu/classpath/tools/gjdoc/Main$16.class | Bin 0 -> 1715 bytes .../gnu/classpath/tools/gjdoc/Main$17.class | Bin 0 -> 828 bytes .../gnu/classpath/tools/gjdoc/Main$18.class | Bin 0 -> 809 bytes .../gnu/classpath/tools/gjdoc/Main$19.class | Bin 0 -> 809 bytes .../classes/gnu/classpath/tools/gjdoc/Main$2.class | Bin 0 -> 767 bytes .../gnu/classpath/tools/gjdoc/Main$20.class | Bin 0 -> 1382 bytes .../gnu/classpath/tools/gjdoc/Main$21.class | Bin 0 -> 1401 bytes .../gnu/classpath/tools/gjdoc/Main$22.class | Bin 0 -> 809 bytes .../gnu/classpath/tools/gjdoc/Main$23.class | Bin 0 -> 809 bytes .../gnu/classpath/tools/gjdoc/Main$24.class | Bin 0 -> 809 bytes .../gnu/classpath/tools/gjdoc/Main$25.class | Bin 0 -> 809 bytes .../classes/gnu/classpath/tools/gjdoc/Main$3.class | Bin 0 -> 767 bytes .../classes/gnu/classpath/tools/gjdoc/Main$4.class | Bin 0 -> 767 bytes .../classes/gnu/classpath/tools/gjdoc/Main$5.class | Bin 0 -> 767 bytes .../classes/gnu/classpath/tools/gjdoc/Main$6.class | Bin 0 -> 806 bytes .../classes/gnu/classpath/tools/gjdoc/Main$7.class | Bin 0 -> 825 bytes .../classes/gnu/classpath/tools/gjdoc/Main$8.class | Bin 0 -> 825 bytes .../classes/gnu/classpath/tools/gjdoc/Main$9.class | Bin 0 -> 806 bytes .../tools/gjdoc/Main$OptionProcessor.class | Bin 0 -> 727 bytes .../classes/gnu/classpath/tools/gjdoc/Main.class | Bin 0 -> 29565 bytes .../gnu/classpath/tools/gjdoc/MemberDocImpl.class | Bin 0 -> 5337 bytes .../gnu/classpath/tools/gjdoc/MethodDocImpl.class | Bin 0 -> 1247 bytes .../classpath/tools/gjdoc/PackageComponent.class | Bin 0 -> 1142 bytes .../gnu/classpath/tools/gjdoc/PackageDocImpl.class | Bin 0 -> 5798 bytes .../gnu/classpath/tools/gjdoc/ParamTagImpl.class | Bin 0 -> 1368 bytes .../gnu/classpath/tools/gjdoc/ParameterImpl.class | Bin 0 -> 1682 bytes .../gnu/classpath/tools/gjdoc/ParseException.class | Bin 0 -> 463 bytes .../gnu/classpath/tools/gjdoc/Parser$1.class | Bin 0 -> 1669 bytes .../gnu/classpath/tools/gjdoc/Parser$Context.class | Bin 0 -> 1209 bytes .../classes/gnu/classpath/tools/gjdoc/Parser.class | Bin 0 -> 13190 bytes .../tools/gjdoc/ProgramElementDocImpl.class | Bin 0 -> 3566 bytes .../tools/gjdoc/RootDocImpl$ResolvedImport.class | Bin 0 -> 403 bytes .../RootDocImpl$ResolvedImportClassFile.class | Bin 0 -> 3100 bytes .../gjdoc/RootDocImpl$ResolvedImportNotFound.class | Bin 0 -> 1664 bytes .../RootDocImpl$ResolvedImportPackageFile.class | Bin 0 -> 3932 bytes ...RootDocImpl$ResolvedImportReflectionClass.class | Bin 0 -> 1980 bytes ...otDocImpl$ResolvedImportReflectionPackage.class | Bin 0 -> 2039 bytes .../tools/gjdoc/RootDocImpl$ScheduledClass.class | Bin 0 -> 1036 bytes .../gnu/classpath/tools/gjdoc/RootDocImpl.class | Bin 0 -> 20655 bytes .../gnu/classpath/tools/gjdoc/SeeTagImpl.class | Bin 0 -> 4114 bytes .../classpath/tools/gjdoc/SerialFieldTagImpl.class | Bin 0 -> 2862 bytes .../tools/gjdoc/SlashSlashCommentComponent.class | Bin 0 -> 556 bytes .../classpath/tools/gjdoc/SourceComponent.class | Bin 0 -> 787 bytes .../classpath/tools/gjdoc/SourcePositionImpl.class | Bin 0 -> 1095 bytes .../tools/gjdoc/StaticBlockComponent.class | Bin 0 -> 1030 bytes .../gnu/classpath/tools/gjdoc/TagContainer.class | Bin 0 -> 247 bytes .../gnu/classpath/tools/gjdoc/TagImpl.class | Bin 0 -> 1350 bytes .../gnu/classpath/tools/gjdoc/TemporaryStore.class | Bin 0 -> 548 bytes .../gnu/classpath/tools/gjdoc/TextTagImpl.class | Bin 0 -> 1026 bytes .../gnu/classpath/tools/gjdoc/ThrowsTagImpl.class | Bin 0 -> 2479 bytes .../classes/gnu/classpath/tools/gjdoc/Timer.class | Bin 0 -> 2568 bytes .../gnu/classpath/tools/gjdoc/TimerDoclet$1.class | Bin 0 -> 900 bytes .../gnu/classpath/tools/gjdoc/TimerDoclet.class | Bin 0 -> 2637 bytes .../gnu/classpath/tools/gjdoc/TypeImpl.class | Bin 0 -> 2694 bytes .../classpath/tools/gjdoc/TypeVariableImpl.class | Bin 0 -> 1292 bytes .../gnu/classpath/tools/gjdoc/ValueTagImpl.class | Bin 0 -> 1032 bytes .../gnu/classpath/tools/gjdoc/Whitespace.class | Bin 0 -> 591 bytes .../gnu/classpath/tools/gjdoc/WritableType.class | Bin 0 -> 309 bytes .../tools/gjdoc/expr/AdditionExpression.class | Bin 0 -> 2306 bytes .../classpath/tools/gjdoc/expr/AndExpression.class | Bin 0 -> 756 bytes .../tools/gjdoc/expr/BinaryBitwiseExpression.class | Bin 0 -> 1711 bytes .../gjdoc/expr/BinaryComputationExpression.class | Bin 0 -> 2769 bytes .../gjdoc/expr/BinaryEqualityExpression.class | Bin 0 -> 2071 bytes .../tools/gjdoc/expr/BinaryExpression.class | Bin 0 -> 615 bytes .../tools/gjdoc/expr/BinaryLogicalExpression.class | Bin 0 -> 1593 bytes .../gjdoc/expr/BinaryRelationExpression.class | Bin 0 -> 1928 bytes .../tools/gjdoc/expr/BinaryShiftExpression.class | Bin 0 -> 1691 bytes .../tools/gjdoc/expr/BitShiftRightExpression.class | Bin 0 -> 784 bytes .../gjdoc/expr/CircularExpressionException.class | Bin 0 -> 618 bytes .../tools/gjdoc/expr/ConditionalExpression.class | Bin 0 -> 1670 bytes .../tools/gjdoc/expr/ConstantBoolean.class | Bin 0 -> 1371 bytes .../classpath/tools/gjdoc/expr/ConstantByte.class | Bin 0 -> 1082 bytes .../classpath/tools/gjdoc/expr/ConstantChar.class | Bin 0 -> 1634 bytes .../tools/gjdoc/expr/ConstantDouble.class | Bin 0 -> 1288 bytes .../tools/gjdoc/expr/ConstantExpression.class | Bin 0 -> 787 bytes .../classpath/tools/gjdoc/expr/ConstantFloat.class | Bin 0 -> 1448 bytes .../tools/gjdoc/expr/ConstantInteger.class | Bin 0 -> 1378 bytes .../classpath/tools/gjdoc/expr/ConstantLong.class | Bin 0 -> 1599 bytes .../classpath/tools/gjdoc/expr/ConstantNull.class | Bin 0 -> 829 bytes .../classpath/tools/gjdoc/expr/ConstantShort.class | Bin 0 -> 1088 bytes .../tools/gjdoc/expr/ConstantString.class | Bin 0 -> 1025 bytes .../gnu/classpath/tools/gjdoc/expr/Context.class | Bin 0 -> 818 bytes .../tools/gjdoc/expr/DivisionExpression.class | Bin 0 -> 959 bytes .../tools/gjdoc/expr/EqualExpression.class | Bin 0 -> 1067 bytes .../gnu/classpath/tools/gjdoc/expr/Evaluator.class | Bin 0 -> 3343 bytes .../tools/gjdoc/expr/EvaluatorEnvironment.class | Bin 0 -> 378 bytes .../tools/gjdoc/expr/ExclusiveOrExpression.class | Bin 0 -> 780 bytes .../classpath/tools/gjdoc/expr/Expression.class | Bin 0 -> 333 bytes .../tools/gjdoc/expr/GreaterThanExpression.class | Bin 0 -> 988 bytes .../gjdoc/expr/GreaterThanOrEqualExpression.class | Bin 0 -> 1009 bytes .../tools/gjdoc/expr/IdentifierExpression.class | Bin 0 -> 2874 bytes .../gjdoc/expr/IllegalExpressionException.class | Bin 0 -> 577 bytes .../tools/gjdoc/expr/InclusiveOrExpression.class | Bin 0 -> 773 bytes .../gnu/classpath/tools/gjdoc/expr/JavaLexer.class | Bin 0 -> 27024 bytes .../tools/gjdoc/expr/JavaRecognizer.class | Bin 0 -> 22370 bytes .../tools/gjdoc/expr/JavaTokenTypes.class | Bin 0 -> 3902 bytes .../tools/gjdoc/expr/LessThanExpression.class | Bin 0 -> 979 bytes .../gjdoc/expr/LessThanOrEqualExpression.class | Bin 0 -> 1000 bytes .../tools/gjdoc/expr/LogicalAndExpression.class | Bin 0 -> 693 bytes .../tools/gjdoc/expr/LogicalNotExpression.class | Bin 0 -> 1557 bytes .../tools/gjdoc/expr/LogicalOrExpression.class | Bin 0 -> 683 bytes .../tools/gjdoc/expr/ModuloExpression.class | Bin 0 -> 953 bytes .../gjdoc/expr/MultiplicationExpression.class | Bin 0 -> 977 bytes .../tools/gjdoc/expr/NegateExpression.class | Bin 0 -> 1696 bytes .../tools/gjdoc/expr/NotEqualExpression.class | Bin 0 -> 1071 bytes .../classpath/tools/gjdoc/expr/NotExpression.class | Bin 0 -> 1467 bytes .../tools/gjdoc/expr/ShiftLeftExpression.class | Bin 0 -> 772 bytes .../tools/gjdoc/expr/ShiftRightExpression.class | Bin 0 -> 775 bytes .../tools/gjdoc/expr/SubtractionExpression.class | Bin 0 -> 968 bytes .../gnu/classpath/tools/gjdoc/expr/Type.class | Bin 0 -> 1204 bytes .../tools/gjdoc/expr/TypeCastExpression.class | Bin 0 -> 2687 bytes .../tools/gjdoc/expr/UnaryExpression.class | Bin 0 -> 524 bytes .../gjdoc/expr/UnknownIdentifierException.class | Bin 0 -> 473 bytes .../classes/gnu/classpath/tools/jar/Creator.class | Bin 6679 -> 7304 bytes .../classes/gnu/classpath/tools/jar/Indexer.class | Bin 4234 -> 4240 bytes .../classes/gnu/classpath/tools/jar/Updater.class | Bin 2403 -> 2785 bytes .../tools/java2xhtml/Java2xhtml$State.class | Bin 0 -> 900 bytes .../classpath/tools/java2xhtml/Java2xhtml.class | Bin 0 -> 26685 bytes .../gnu/classpath/tools/javah/ClassWrapper.class | Bin 8524 -> 8529 bytes .../gnu/classpath/tools/javah/JniHelper.class | Bin 2997 -> 2909 bytes .../tools/native2ascii/Native2ASCII.class | Bin 4201 -> 4205 bytes .../classpath/tools/orbd/PersistentMap$Entry.class | Bin 2453 -> 2457 bytes .../classpath/tools/rmic/ClassRmicCompiler.class | Bin 30611 -> 30522 bytes .../gnu/classpath/tools/rmic/Generator.class | Bin 2992 -> 2904 bytes .../gnu/classpath/tools/rmic/MethodGenerator.class | Bin 5369 -> 5280 bytes .../classpath/tools/rmic/RmiMethodGenerator.class | Bin 5210 -> 5116 bytes .../tools/rmic/SourceGiopRmicCompiler.class | Bin 12415 -> 12269 bytes .../classpath/tools/rmic/SourceRmicCompiler.class | Bin 3890 -> 3894 bytes .../taglets/AuthorTaglet$EmailReplacement.class | Bin 0 -> 714 bytes .../gnu/classpath/tools/taglets/AuthorTaglet.class | Bin 0 -> 4878 bytes .../gnu/classpath/tools/taglets/CodeTaglet.class | Bin 0 -> 1529 bytes .../classpath/tools/taglets/CopyrightTaglet.class | Bin 0 -> 2366 bytes .../classpath/tools/taglets/DeprecatedTaglet.class | Bin 0 -> 2371 bytes .../classpath/tools/taglets/GenericTaglet.class | Bin 0 -> 2708 bytes .../tools/taglets/GnuExtendedTaglet.class | Bin 0 -> 381 bytes .../gnu/classpath/tools/taglets/SinceTaglet.class | Bin 0 -> 2962 bytes .../classpath/tools/taglets/TagletContext.class | Bin 0 -> 858 bytes .../gnu/classpath/tools/taglets/ValueTaglet.class | Bin 0 -> 2695 bytes .../classpath/tools/taglets/VersionTaglet.class | Bin 0 -> 2580 bytes .../tools/com/sun/tools/javadoc/Main.java | 9 + libjava/classpath/tools/gappletviewer.in | 2 +- .../gnu/classpath/tools/gjdoc/expr/JavaLexer.java | 1962 ++++++++++ .../gnu/classpath/tools/gjdoc/expr/JavaLexer.smap | 1280 +++++++ .../classpath/tools/gjdoc/expr/JavaRecognizer.java | 1406 +++++++ .../classpath/tools/gjdoc/expr/JavaRecognizer.smap | 987 +++++ .../classpath/tools/gjdoc/expr/JavaTokenTypes.java | 122 + .../classpath/tools/gjdoc/expr/JavaTokenTypes.txt | 116 + libjava/classpath/tools/gjar.in | 2 +- libjava/classpath/tools/gjarsigner.in | 2 +- libjava/classpath/tools/gjavah.in | 2 +- libjava/classpath/tools/gjdoc.in | 49 + libjava/classpath/tools/gkeytool.in | 2 +- libjava/classpath/tools/gnative2ascii.in | 2 +- .../gnu/classpath/tools/FileSystemClassLoader.java | 296 ++ .../tools/gnu/classpath/tools/IOToolkit.java | 199 + .../gnu/classpath/tools/MalformedInputEvent.java | 93 + .../classpath/tools/MalformedInputListener.java | 39 + .../tools/NotifyingInputStreamReader.java | 406 ++ .../tools/gnu/classpath/tools/StringToolkit.java | 67 + .../classpath/tools/doclets/AbstractDoclet.java | 1369 +++++++ .../doclets/DocletConfigurationException.java | 37 + .../gnu/classpath/tools/doclets/DocletOption.java | 39 + .../tools/doclets/DocletOptionColonSeparated.java | 60 + .../classpath/tools/doclets/DocletOptionFile.java | 60 + .../classpath/tools/doclets/DocletOptionFlag.java | 52 + .../tools/doclets/DocletOptionPackageWildcard.java | 108 + .../tools/doclets/DocletOptionString.java | 51 + .../classpath/tools/doclets/InlineTagRenderer.java | 29 + .../doclets/InvalidPackageWildcardException.java | 35 + .../gnu/classpath/tools/doclets/PackageGroup.java | 41 + .../classpath/tools/doclets/PackageMatcher.java | 135 + .../classpath/tools/doclets/StandardTaglet.java | 83 + .../gnu/classpath/tools/doclets/TagletPrinter.java | 30 + .../tools/doclets/debugdoclet/DebugDoclet.java | 137 + .../tools/doclets/htmldoclet/CssClass.java | 283 ++ .../tools/doclets/htmldoclet/ExternalDocSet.java | 170 + .../tools/doclets/htmldoclet/HtmlDoclet.java | 3883 ++++++++++++++++++++ .../tools/doclets/htmldoclet/HtmlPage.java | 518 +++ .../doclets/htmldoclet/HtmlTagletContext.java | 48 + .../classpath/tools/doclets/xmldoclet/Driver.java | 2434 ++++++++++++ .../tools/doclets/xmldoclet/Driver1_4.java | 67 + .../tools/doclets/xmldoclet/HtmlRepairer.java | 674 ++++ .../tools/doclets/xmldoclet/TargetContext.java | 86 + .../doclets/xmldoclet/doctranslet/DocTranslet.java | 443 +++ .../DocTransletConfigurationException.java | 36 + .../doctranslet/DocTransletException.java | 46 + .../xmldoclet/doctranslet/DocTransletOptions.java | 45 + .../xmldoclet/doctranslet/JarClassLoader.java | 74 + .../xmldoclet/doctranslet/OutputFileInfo.java | 49 + .../tools/gnu/classpath/tools/getopt/Parser.java | 32 +- .../gnu/classpath/tools/gjdoc/AbstractTagImpl.java | 90 + .../tools/gjdoc/ArrayCharacterIterator.java | 104 + .../gnu/classpath/tools/gjdoc/ClassDocImpl.java | 1244 +++++++ .../gnu/classpath/tools/gjdoc/ClassDocProxy.java | 152 + .../tools/gjdoc/ClassDocReflectedImpl.java | 202 + .../classpath/tools/gjdoc/ConstructorDocImpl.java | 42 + .../tools/gnu/classpath/tools/gjdoc/Debug.java | 50 + .../gnu/classpath/tools/gjdoc/DirectoryTree.java | 57 + .../tools/gnu/classpath/tools/gjdoc/DocImpl.java | 1074 ++++++ .../gnu/classpath/tools/gjdoc/ErrorReporter.java | 104 + .../tools/gjdoc/ExecutableMemberDocImpl.java | 411 +++ .../gnu/classpath/tools/gjdoc/FieldDocImpl.java | 392 ++ .../gnu/classpath/tools/gjdoc/GjdocPackageDoc.java | 39 + .../gnu/classpath/tools/gjdoc/GjdocRootDoc.java | 39 + .../classpath/tools/gjdoc/InheritDocTagImpl.java | 86 + .../gnu/classpath/tools/gjdoc/JavadocWrapper.java | 36 + .../gnu/classpath/tools/gjdoc/LinkTagImpl.java | 46 + .../tools/gnu/classpath/tools/gjdoc/Main.java | 1846 ++++++++++ .../gnu/classpath/tools/gjdoc/MemberDocImpl.java | 218 ++ .../gnu/classpath/tools/gjdoc/MethodDocImpl.java | 47 + .../gnu/classpath/tools/gjdoc/PackageDocImpl.java | 206 ++ .../gnu/classpath/tools/gjdoc/ParamTagImpl.java | 64 + .../gnu/classpath/tools/gjdoc/ParameterImpl.java | 52 + .../gnu/classpath/tools/gjdoc/ParseException.java | 35 + .../tools/gnu/classpath/tools/gjdoc/Parser.java | 1047 ++++++ .../tools/gjdoc/ProgramElementDocImpl.java | 161 + .../gnu/classpath/tools/gjdoc/RootDocImpl.java | 1317 +++++++ .../gnu/classpath/tools/gjdoc/SeeTagImpl.java | 198 + .../classpath/tools/gjdoc/SerialFieldTagImpl.java | 111 + .../classpath/tools/gjdoc/SourcePositionImpl.java | 60 + .../gnu/classpath/tools/gjdoc/TagContainer.java | 35 + .../tools/gnu/classpath/tools/gjdoc/TagImpl.java | 43 + .../gnu/classpath/tools/gjdoc/TemporaryStore.java | 115 + .../gnu/classpath/tools/gjdoc/TextTagImpl.java | 39 + .../gnu/classpath/tools/gjdoc/ThrowsTagImpl.java | 88 + .../tools/gnu/classpath/tools/gjdoc/Timer.java | 71 + .../gnu/classpath/tools/gjdoc/TimerDoclet.java | 87 + .../tools/gnu/classpath/tools/gjdoc/TypeImpl.java | 92 + .../classpath/tools/gjdoc/TypeVariableImpl.java | 91 + .../gnu/classpath/tools/gjdoc/ValueTagImpl.java | 48 + .../gnu/classpath/tools/gjdoc/WritableType.java | 27 + .../tools/gjdoc/expr/AdditionExpression.java | 69 + .../classpath/tools/gjdoc/expr/AndExpression.java | 40 + .../tools/gjdoc/expr/BinaryBitwiseExpression.java | 51 + .../gjdoc/expr/BinaryComputationExpression.java | 75 + .../tools/gjdoc/expr/BinaryEqualityExpression.java | 72 + .../tools/gjdoc/expr/BinaryExpression.java | 34 + .../tools/gjdoc/expr/BinaryLogicalExpression.java | 47 + .../tools/gjdoc/expr/BinaryRelationExpression.java | 65 + .../tools/gjdoc/expr/BinaryShiftExpression.java | 49 + .../tools/gjdoc/expr/BitShiftRightExpression.java | 40 + .../gjdoc/expr/CircularExpressionException.java | 35 + .../tools/gjdoc/expr/ConditionalExpression.java | 57 + .../tools/gjdoc/expr/ConstantBoolean.java | 67 + .../classpath/tools/gjdoc/expr/ConstantByte.java | 57 + .../classpath/tools/gjdoc/expr/ConstantChar.java | 81 + .../classpath/tools/gjdoc/expr/ConstantDouble.java | 62 + .../tools/gjdoc/expr/ConstantExpression.java | 35 + .../classpath/tools/gjdoc/expr/ConstantFloat.java | 62 + .../tools/gjdoc/expr/ConstantInteger.java | 62 + .../classpath/tools/gjdoc/expr/ConstantLong.java | 67 + .../classpath/tools/gjdoc/expr/ConstantNull.java | 49 + .../classpath/tools/gjdoc/expr/ConstantShort.java | 57 + .../classpath/tools/gjdoc/expr/ConstantString.java | 58 + .../gnu/classpath/tools/gjdoc/expr/Context.java | 45 + .../tools/gjdoc/expr/DivisionExpression.java | 50 + .../tools/gjdoc/expr/EqualExpression.java | 55 + .../gnu/classpath/tools/gjdoc/expr/Evaluator.java | 131 + .../tools/gjdoc/expr/EvaluatorEnvironment.java | 29 + .../tools/gjdoc/expr/ExclusiveOrExpression.java | 40 + .../gnu/classpath/tools/gjdoc/expr/Expression.java | 27 + .../tools/gjdoc/expr/GreaterThanExpression.java | 50 + .../gjdoc/expr/GreaterThanOrEqualExpression.java | 50 + .../tools/gjdoc/expr/IdentifierExpression.java | 72 + .../gjdoc/expr/IllegalExpressionException.java | 35 + .../tools/gjdoc/expr/InclusiveOrExpression.java | 40 + .../tools/gjdoc/expr/LessThanExpression.java | 50 + .../gjdoc/expr/LessThanOrEqualExpression.java | 50 + .../tools/gjdoc/expr/LogicalAndExpression.java | 35 + .../tools/gjdoc/expr/LogicalNotExpression.java | 43 + .../tools/gjdoc/expr/LogicalOrExpression.java | 35 + .../tools/gjdoc/expr/ModuloExpression.java | 50 + .../tools/gjdoc/expr/MultiplicationExpression.java | 50 + .../tools/gjdoc/expr/NegateExpression.java | 49 + .../tools/gjdoc/expr/NotEqualExpression.java | 55 + .../classpath/tools/gjdoc/expr/NotExpression.java | 43 + .../tools/gjdoc/expr/ShiftLeftExpression.java | 40 + .../tools/gjdoc/expr/ShiftRightExpression.java | 40 + .../tools/gjdoc/expr/SubtractionExpression.java | 50 + .../tools/gnu/classpath/tools/gjdoc/expr/Type.java | 43 + .../tools/gjdoc/expr/TypeCastExpression.java | 70 + .../tools/gjdoc/expr/UnaryExpression.java | 32 + .../gjdoc/expr/UnknownIdentifierException.java | 30 + .../classpath/tools/gjdoc/expr/java-expression.g | 471 +++ .../tools/gnu/classpath/tools/jar/Creator.java | 11 +- .../tools/gnu/classpath/tools/jar/Indexer.java | 4 +- .../tools/gnu/classpath/tools/jar/Updater.java | 11 +- .../gnu/classpath/tools/java2xhtml/Java2xhtml.java | 1337 +++++++ .../gnu/classpath/tools/javah/ClassWrapper.java | 26 +- .../tools/gnu/classpath/tools/javah/JniHelper.java | 2 +- .../classpath/tools/native2ascii/Native2ASCII.java | 2 +- .../gnu/classpath/tools/orbd/PersistentMap.java | 4 +- .../classpath/tools/rmic/ClassRmicCompiler.java | 4 +- .../tools/gnu/classpath/tools/rmic/Generator.java | 4 +- .../gnu/classpath/tools/rmic/MethodGenerator.java | 10 +- .../classpath/tools/rmic/RmiMethodGenerator.java | 12 +- .../tools/rmic/SourceGiopRmicCompiler.java | 16 +- .../classpath/tools/rmic/SourceRmicCompiler.java | 6 +- .../gnu/classpath/tools/taglets/AuthorTaglet.java | 276 ++ .../gnu/classpath/tools/taglets/CodeTaglet.java | 84 + .../classpath/tools/taglets/CopyrightTaglet.java | 106 + .../classpath/tools/taglets/DeprecatedTaglet.java | 115 + .../gnu/classpath/tools/taglets/GenericTaglet.java | 140 + .../classpath/tools/taglets/GnuExtendedTaglet.java | 31 + .../gnu/classpath/tools/taglets/SinceTaglet.java | 144 + .../gnu/classpath/tools/taglets/TagletContext.java | 23 + .../gnu/classpath/tools/taglets/ValueTaglet.java | 113 + .../gnu/classpath/tools/taglets/VersionTaglet.java | 136 + libjava/classpath/tools/gorbd.in | 2 +- libjava/classpath/tools/grmic.in | 2 +- libjava/classpath/tools/grmid.in | 2 +- libjava/classpath/tools/grmiregistry.in | 2 +- libjava/classpath/tools/gserialver.in | 2 +- libjava/classpath/tools/gtnameserv.in | 2 +- .../gnu/classpath/tools/common/Messages.properties | 4 +- .../tools/gjdoc/doctranslets/gjdoc_common.xsl | 54 + .../tools/gjdoc/doctranslets/html/about.xsl | 83 + .../tools/gjdoc/doctranslets/html/allclasses.xsl | 63 + .../tools/gjdoc/doctranslets/html/allpackages.xsl | 78 + .../tools/gjdoc/doctranslets/html/alphaindex.xsl | 107 + .../gjdoc/doctranslets/html/alphaindex_chunked.xsl | 112 + .../gjdoc/doctranslets/html/classdoc-source.xsl | 61 + .../gjdoc/doctranslets/html/classdoc-uses.xsl | 169 + .../tools/gjdoc/doctranslets/html/classdoc.xsl | 1070 ++++++ .../tools/gjdoc/doctranslets/html/deprecated.xsl | 261 ++ .../tools/gjdoc/doctranslets/html/descriptor.xsl | 58 + .../tools/gjdoc/doctranslets/html/doctranslet.xsl | 115 + .../tools/gjdoc/doctranslets/html/fulltree.xsl | 201 + .../tools/gjdoc/doctranslets/html/gjdoc.xsl | 240 ++ .../tools/gjdoc/doctranslets/html/help.xsl | 93 + .../tools/gjdoc/doctranslets/html/html_common.xsl | 584 +++ .../tools/gjdoc/doctranslets/html/index.xsl | 66 + .../gjdoc/doctranslets/html/index_noframes.xsl | 146 + .../gjdoc/doctranslets/html/packageclasses.xsl | 90 + .../tools/gjdoc/doctranslets/html/packagedoc.xsl | 153 + .../doctranslets/html/res/default_help_en.html | 7 + .../tools/gjdoc/doctranslets/html/res/gjdoc.js | 108 + .../doctranslets/html/res/gjdochtml-clean.css | 382 ++ .../doctranslets/html/res/gjdochtml-fixed.css | 286 ++ .../doctranslets/html/res/gjdochtml-sclara.css | 266 ++ .../gjdoc/doctranslets/html/res/gjdochtml.css | 29 + .../gnu/classpath/tools/gjdoc/dtd/dbcentx.mod | 204 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-amsa.ent | 98 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-amsb.ent | 84 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-amsc.ent | 52 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-amsn.ent | 101 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-amso.ent | 68 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-amsr.ent | 126 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-box.ent | 82 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr1.ent | 109 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr2.ent | 68 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-dia.ent | 56 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-grk1.ent | 91 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-grk2.ent | 62 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-grk3.ent | 85 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-grk4.ent | 85 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-lat1.ent | 104 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-lat2.ent | 163 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-num.ent | 118 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-pub.ent | 127 + .../gnu/classpath/tools/gjdoc/dtd/ent/iso-tech.ent | 104 + .../classpath/tools/gjdoc/dtd/gjdoc-alphaindex.dtd | 35 + .../gnu/classpath/tools/gjdoc/dtd/gjdoc.dtd | 35 + .../tools/gjdoc/htmldoclet/HtmlDoclet.properties | 32 + .../gnu/classpath/tools/gjdoc/htmldoclet/gjdoc.js | 115 + .../gjdoc/htmldoclet/gjdochtml-clean-color1.css | 80 + .../gjdoc/htmldoclet/gjdochtml-clean-layout.css | 460 +++ .../tools/gjdoc/htmldoclet/gjdochtml-vanilla.css | 21 + .../classpath/tools/gjdoc/htmldoclet/help.xhtml | 25 + .../classpath/tools/gjdoc/htmldoclet/inherit.png | Bin 0 -> 199 bytes .../tools/gjdoc/htmldoclet/xhtml11-target10.dtd | 54 + .../tools/gjdoc/java.lang-classes-1.2.txt | 78 + .../tools/gjdoc/java.lang-classes-1.3.txt | 79 + .../tools/gjdoc/java.lang-classes-1.4.txt | 82 + .../tools/gjdoc/java.lang-classes-1.5.txt | 90 + .../classpath/tools/gjdoc/rng/gjdoc-classdoc.rng | 649 ++++ .../gnu/classpath/tools/gjdoc/rng/gjdoc-common.rng | 264 ++ .../gnu/classpath/tools/gjdoc/rng/gjdoc-index.rng | 176 + 475 files changed, 43716 insertions(+), 135 deletions(-) create mode 100644 libjava/classpath/tools/classes/com/sun/tools/javadoc/Main.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$FileStreamInfo.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$JarStreamInfo.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$StreamInfo.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/IOToolkit.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputEvent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputListener.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/NotifyingInputStreamReader.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/StringToolkit.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionGroup.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTag.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTagletPath.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$IndexKey.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$InterfaceRelation.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$UsageType.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletConfigurationException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOption.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionColonSeparated.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFile.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFlag.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionString.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InlineTagRenderer.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InvalidPackageWildcardException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageGroup.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageMatcher.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/StandardTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/TagletPrinter.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/debugdoclet/DebugDoclet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/CssClass.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$1.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$2.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$3.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$TreeNode.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlPage.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$1.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$NullErrorReporter.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$UsageType.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver1_4.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer$TagInfo.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/TargetContext.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet$DocErrorReporterOutputStream.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletConfigurationException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletOptions.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/JarClassLoader.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/AbstractTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ArrayCharacterIterator.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BlockSourceComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BracketClose.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocProxy.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/CommentComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ConstructorDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Debug.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree$FileNode.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/EmptyStatementComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ErrorReporter.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FunctionComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocPackageDoc.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocRootDoc.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/IgnoredFileParseException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ImportComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/InheritDocTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/JavadocWrapper.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/LinkTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$1.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$2.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$3.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$4.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$5.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$6.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$7.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$8.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$9.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$OptionProcessor.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MemberDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MethodDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParamTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParameterImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParseException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$1.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$Context.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ProgramElementDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImport.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportClassFile.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportNotFound.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportPackageFile.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionClass.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionPackage.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ScheduledClass.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SeeTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SerialFieldTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SlashSlashCommentComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourceComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourcePositionImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/StaticBlockComponent.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagContainer.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TemporaryStore.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TextTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ThrowsTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Timer.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet$1.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeVariableImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ValueTagImpl.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Whitespace.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/WritableType.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AdditionExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AndExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantByte.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantChar.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantDouble.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantFloat.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantInteger.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantLong.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantNull.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantShort.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantString.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Context.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/DivisionExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EqualExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Evaluator.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Expression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaLexer.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ModuloExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NegateExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Type.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnaryExpression.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml$State.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet$EmailReplacement.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CodeTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CopyrightTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/DeprecatedTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GenericTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GnuExtendedTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/SinceTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/TagletContext.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/ValueTaglet.class create mode 100644 libjava/classpath/tools/classes/gnu/classpath/tools/taglets/VersionTaglet.class create mode 100644 libjava/classpath/tools/com/sun/tools/javadoc/Main.java create mode 100644 libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java create mode 100644 libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.smap create mode 100644 libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.java create mode 100644 libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.smap create mode 100644 libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.java create mode 100644 libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.txt create mode 100644 libjava/classpath/tools/gjdoc.in create mode 100644 libjava/classpath/tools/gnu/classpath/tools/FileSystemClassLoader.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/IOToolkit.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/MalformedInputEvent.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/MalformedInputListener.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/NotifyingInputStreamReader.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/StringToolkit.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/AbstractDoclet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/DocletConfigurationException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOption.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionColonSeparated.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFile.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFlag.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionString.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/InlineTagRenderer.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/InvalidPackageWildcardException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/PackageGroup.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/PackageMatcher.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/StandardTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/TagletPrinter.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/debugdoclet/DebugDoclet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/CssClass.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlPage.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/Driver.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/Driver1_4.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/TargetContext.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletConfigurationException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletOptions.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/JarClassLoader.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/AbstractTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ArrayCharacterIterator.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ConstructorDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/Debug.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/DirectoryTree.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/DocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ErrorReporter.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/GjdocPackageDoc.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/GjdocRootDoc.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/InheritDocTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/JavadocWrapper.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/LinkTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/MethodDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ParamTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ParameterImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ParseException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/Parser.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ProgramElementDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/RootDocImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/SeeTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/SerialFieldTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/SourcePositionImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/TagContainer.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/TagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/TemporaryStore.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/TextTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ThrowsTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/Timer.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/TimerDoclet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/TypeImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/TypeVariableImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/ValueTagImpl.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/WritableType.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AdditionExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AndExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantByte.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantChar.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantDouble.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantFloat.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantInteger.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantLong.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantNull.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantShort.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantString.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Context.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/DivisionExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EqualExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Expression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ModuloExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NegateExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Type.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnaryExpression.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/java-expression.g create mode 100644 libjava/classpath/tools/gnu/classpath/tools/java2xhtml/Java2xhtml.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/AuthorTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/CodeTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/CopyrightTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/DeprecatedTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/GenericTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/GnuExtendedTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/SinceTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/TagletContext.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/ValueTaglet.java create mode 100644 libjava/classpath/tools/gnu/classpath/tools/taglets/VersionTaglet.java create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/gjdoc_common.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/about.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allclasses.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allpackages.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex_chunked.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-source.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-uses.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/deprecated.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/descriptor.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/doctranslet.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/fulltree.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/gjdoc.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/help.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/html_common.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index_noframes.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packageclasses.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packagedoc.xsl create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/default_help_en.html create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdoc.js create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-clean.css create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-fixed.css create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-sclara.css create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml.css create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/dbcentx.mod create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsa.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsb.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsc.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsn.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amso.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsr.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-box.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr1.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr2.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-dia.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk1.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk2.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk3.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk4.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat1.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat2.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-num.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-pub.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-tech.ent create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc-alphaindex.dtd create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc.dtd create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/HtmlDoclet.properties create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdoc.js create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-color1.css create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-layout.css create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-vanilla.css create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/help.xhtml create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/inherit.png create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/xhtml11-target10.dtd create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.2.txt create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.3.txt create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.4.txt create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.5.txt create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-classdoc.rng create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-common.rng create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-index.rng (limited to 'libjava/classpath/tools') diff --git a/libjava/classpath/tools/Makefile.am b/libjava/classpath/tools/Makefile.am index 81953bc66ee..01c07ee9646 100755 --- a/libjava/classpath/tools/Makefile.am +++ b/libjava/classpath/tools/Makefile.am @@ -2,19 +2,35 @@ ## GCJ LOCAL: use srcdir to find core classes. GLIBJ_BOOTCLASSPATH='$(top_srcdir)/lib' -GLIBJ_CLASSPATH=.:$(srcdir)/asm +GLIBJ_CLASSPATH=.:$(srcdir)/asm:$(ANTLR_CLASSPATH) ## END GCJ LOCAL -# Setup the compiler to use the GNU Classpath library we just build -## GCJ LOCAL: don't pass $(JAVACFLAGS) -source 1.5 -target 1.5 -JCOMPILER = $(JAVAC) -g -w --encoding=UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH) +# Setup the compiler to use the GNU Classpath library we just built. +if GCJ_JAVAC +JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.5 -ftarget=1.5 --encoding=UTF-8 --bootclasspath=$(GLIBJ_BOOTCLASSPATH) --classpath=$(GLIBJ_CLASSPATH) +else +JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.5 -target 1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH) +endif + +if CREATE_GJDOC +## GCJ LOCAL: always put source files in srcdir +## if CREATE_GJDOC_PARSER +## gjdoc_gendir = ${top_builddir}/tools/generated +## else +gjdoc_gendir = ${top_srcdir}/tools/generated +## endif +## END GCJ LOCAL +ANTLR_CLASSPATH = $(ANTLR_JAR):$(gjdoc_gendir) +endif if CREATE_WRAPPERS bin_SCRIPTS = bin_PROGRAMS = gappletviewer gjarsigner gkeytool \ gjar gnative2ascii gserialver gjavah grmiregistry \ gtnameserv gorbd grmid grmic - +if CREATE_GJDOC +bin_PROGRAMS += gjdoc +endif AM_CPPFLAGS = -Wall \ -I$(top_srcdir)/include \ @@ -83,11 +99,19 @@ grmic_CFLAGS = \ -DTOOLPACKAGE="\"rmic\"" \ -DTOOLNAME="\"grmic\"" +gjdoc_SOURCES = toolwrapper.c +gjdoc_CFLAGS = \ + -DTOOLPACKAGE="\"gjdoc\"" \ + -DTOOLNAME="\"gjdoc\"" + else ## GCJ LOCAL: do not install these. noinst_SCRIPTS = gappletviewer gjarsigner gkeytool \ gjar gnative2ascii gserialver gjavah grmiregistry \ gtnameserv gorbd grmid grmic +if CREATE_GJDOC +noinst_SCRIPTS += gjdoc +endif bin_PROGRAMS = ## FIXME: remove these unneeded dependency lines once we can ## require Automake 1.11. @@ -103,17 +127,25 @@ gtnameserv: gtnameserv.in gorbd: gorbd.in grmid: grmid.in grmic: grmic.in +if CREATE_GJDOC +gjdoc: gjdoc.in +endif endif EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \ gjar.in gnative2ascii.in gserialver.in gjavah.in grmiregistry.in \ - gtnameserv.in gorbd.in grmid.in grmic.in + gtnameserv.in gorbd.in grmid.in grmic.in gjdoc.in # All our example java source files TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \ + $(srcdir)/gnu/classpath/tools/*.java \ + $(srcdir)/gnu/classpath/tools/*/*.java \ + $(srcdir)/gnu/classpath/tools/*/*/*.java \ + $(srcdir)/gnu/classpath/tools/*/*/*/*.java \ $(srcdir)/com/sun/javadoc/*.java \ $(srcdir)/com/sun/tools/doclets/*.java \ $(srcdir)/com/sun/tools/javac/*.java \ $(srcdir)/com/sun/tools/javah/*.java \ + $(srcdir)/com/sun/tools/javadoc/*.java \ $(srcdir)/sun/rmi/rmic/*.java \ $(srcdir)/external/asm/org/objectweb/asm/*.java \ $(srcdir)/external/asm/org/objectweb/asm/attrs/*.java \ @@ -147,6 +179,107 @@ PROPERTY_FILES = $(srcdir)/external/asm/org/objectweb/asm/optimizer/shrink.prope # RMIC templates that must be included in the generated zip file. RMIC_TEMPLATES = $(srcdir)/resource/gnu/classpath/tools/rmic/templates/*.jav +# gjdoc resource files. +gnu_classpath_tools_gjdoc_jar_CSS = \ + doctranslets/html/res/gjdochtml-clean.css \ + doctranslets/html/res/gjdochtml-fixed.css \ + doctranslets/html/res/gjdochtml-sclara.css \ + doctranslets/html/res/gjdochtml.css \ + htmldoclet/gjdochtml-vanilla.css \ + htmldoclet/gjdochtml-clean-layout.css \ + htmldoclet/gjdochtml-clean-color1.css + +gnu_classpath_tools_gjdoc_jar_DTDS = \ + htmldoclet/xhtml11-target10.dtd \ + dtd/gjdoc-alphaindex.dtd \ + dtd/gjdoc.dtd + +gnu_classpath_tools_gjdoc_jar_ENTS = \ + dtd/ent/iso-amsa.ent \ + dtd/ent/iso-amsb.ent \ + dtd/ent/iso-amsc.ent \ + dtd/ent/iso-amsn.ent \ + dtd/ent/iso-amso.ent \ + dtd/ent/iso-amsr.ent \ + dtd/ent/iso-box.ent \ + dtd/ent/iso-cyr1.ent \ + dtd/ent/iso-cyr2.ent \ + dtd/ent/iso-dia.ent \ + dtd/ent/iso-grk1.ent \ + dtd/ent/iso-grk2.ent \ + dtd/ent/iso-grk3.ent \ + dtd/ent/iso-grk4.ent \ + dtd/ent/iso-lat1.ent \ + dtd/ent/iso-lat2.ent \ + dtd/ent/iso-num.ent \ + dtd/ent/iso-pub.ent \ + dtd/ent/iso-tech.ent + +gnu_classpath_tools_gjdoc_jar_HTML = doctranslets/html/res/default_help_en.html + +gnu_classpath_tools_gjdoc_jar_JS = \ + doctranslets/html/res/gjdoc.js \ + htmldoclet/gjdoc.js + +gnu_classpath_tools_gjdoc_jar_PNG = \ + htmldoclet/inherit.png + +gnu_classpath_tools_gjdoc_jar_MODS = dtd/dbcentx.mod + +gnu_classpath_tools_gjdoc_jar_PROPERTIES = htmldoclet/HtmlDoclet.properties + +gnu_classpath_tools_gjdoc_jar_RNGS = \ + rng/gjdoc-classdoc.rng \ + rng/gjdoc-common.rng \ + rng/gjdoc-index.rng + +gnu_classpath_tools_gjdoc_jar_TXTS = \ + java.lang-classes-1.2.txt \ + java.lang-classes-1.3.txt \ + java.lang-classes-1.4.txt \ + java.lang-classes-1.5.txt + +gnu_classpath_tools_gjdoc_jar_XHTML = htmldoclet/help.xhtml + +gnu_classpath_tools_gjdoc_jar_XSLS = \ + doctranslets/gjdoc_common.xsl \ + doctranslets/html/about.xsl \ + doctranslets/html/allclasses.xsl \ + doctranslets/html/allpackages.xsl \ + doctranslets/html/alphaindex.xsl \ + doctranslets/html/alphaindex_chunked.xsl \ + doctranslets/html/classdoc-source.xsl \ + doctranslets/html/classdoc-uses.xsl \ + doctranslets/html/classdoc.xsl \ + doctranslets/html/deprecated.xsl \ + doctranslets/html/descriptor.xsl \ + doctranslets/html/doctranslet.xsl \ + doctranslets/html/fulltree.xsl \ + doctranslets/html/gjdoc.xsl \ + doctranslets/html/help.xsl \ + doctranslets/html/html_common.xsl \ + doctranslets/html/index_noframes.xsl \ + doctranslets/html/index.xsl \ + doctranslets/html/packageclasses.xsl \ + doctranslets/html/packagedoc.xsl + +# All our resources. +gjdoc_resources = $(gnu_classpath_tools_gjdoc_jar_CSS) $(gnu_classpath_tools_gjdoc_jar_DTDS) \ + $(gnu_classpath_tools_gjdoc_jar_ENTS) $(gnu_classpath_tools_gjdoc_jar_HTML) \ + $(gnu_classpath_tools_gjdoc_jar_JS) $(gnu_classpath_tools_gjdoc_jar_MODS) \ + $(gnu_classpath_tools_gjdoc_jar_PNG) $(gnu_classpath_tools_gjdoc_jar_PROPERTIES) \ + $(gnu_classpath_tools_gjdoc_jar_RNGS) $(gnu_classpath_tools_gjdoc_jar_TXTS) \ + $(gnu_classpath_tools_gjdoc_jar_XHTML) $(gnu_classpath_tools_gjdoc_jar_XSLS) + +if !CREATE_GJDOC +GJDOC_EX = -path '*gnu/classpath/tools/gjdoc' -prune -o \ + -path '*gnu/classpath/tools/doclets' -prune -o \ + -path '*gnu/classpath/tools/taglets' -prune -o \ + -path '*com/sun/javadoc' -prune -o \ + -path '*com/sun/tools/doclets' -prune -o \ + -path '*com/sun/tools/javadoc' -prune -o +endif + # The zip files with classes we want to produce. TOOLS_ZIP = tools.zip @@ -154,7 +287,9 @@ TOOLS_ZIP = tools.zip BUILT_SOURCES = $(TOOLS_ZIP) # All the files we find "interesting" -ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(RMIC_TEMPLATES) $(PROPERTY_FILES) +ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(RMIC_TEMPLATES) $(PROPERTY_FILES) \ + $(addprefix $(srcdir)/resource/gnu/classpath/tools/gjdoc/,$(gjdoc_resources))\ + $(srcdir)/gnu/classpath/tools/gjdoc/expr/java-expression.g # Some architecture independent data to be installed. # GCJ LOCAL: do not install this. @@ -184,14 +319,17 @@ dist-hook: $(TOOLS_ZIP): $(ALL_TOOLS_FILES) ## GCJ LOCAL: put classes in srcdir ## @rm -rf classes asm -## mkdir classes asm +## @mkdir_p@ classes asm +## Compile ASM separately as it is latin-1 encoded. find $(srcdir)/external/asm -name '*.java' -print > asm.lst find $(srcdir)/gnu/classpath/tools \ $(srcdir)/com/sun/javadoc \ $(srcdir)/com/sun/tools/doclets \ + $(srcdir)/com/sun/tools/javadoc \ $(srcdir)/com/sun/tools/javac \ $(srcdir)/com/sun/tools/javah \ $(srcdir)/sun/rmi/rmic \ + $(GJDOC_EX) \ -name '*.java' -print > classes.lst if [ -f $(top_builddir)/../vm-tools-packages ]; then \ : > vm-tools.lst; \ @@ -203,46 +341,65 @@ $(TOOLS_ZIP): $(ALL_TOOLS_FILES) fi cat classes.lst asm.lst vm-tools.lst > all-classes.lst if JAVA_MAINTAINER_MODE +if CREATE_GJDOC +if CREATE_GJDOC_PARSER +## Generate antlr sources. + @mkdir_p@ $(gjdoc_gendir)/gnu/classpath/tools/gjdoc/expr + $(ANTLR) -o $(gjdoc_gendir)/gnu/classpath/tools/gjdoc/expr \ + $(srcdir)/gnu/classpath/tools/gjdoc/expr/java-expression.g +endif +endif ## Compile ASM separately as it is latin-1 encoded. AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \ $$AC -g -w -d $(srcdir)/asm @asm.lst - $(JCOMPILER) -g -w -d $(srcdir)/classes @classes.lst @vm-tools.lst + $(JCOMPILER) $(USE_JAVAC_FLAGS) -g -d $(srcdir)/classes @classes.lst @vm-tools.lst +endif +## END GCJ LOCAL ## Copy over tools resource files. @list=`cd $(srcdir)/resource && find gnu/classpath/tools com/sun/tools/javac \ - sun/rmi/rmic -name \*.properties -print -o -name \*.jav -print`; \ + sun/rmi/rmic $(GJDOC_EX) -name \*.properties -print -o -name \*.jav -print`; \ for p in $$list; do \ dirname=classes/`dirname $$p`; \ - if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \ - echo " cp $(srcdir)resource/$$p classes/$$p"; \ + if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \ + echo " cp $(srcdir)/resource/$$p classes/$$p"; \ cp $(srcdir)/resource/$$p classes/$$p; \ done -endif -## Copy over rmic template files. - @list=`cd $(srcdir) && find gnu/classpath/tools -name \*.jav -print`; \ - for p in $$list; do \ - dirname=classes/`dirname $$p`; \ - if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \ - echo " cp $(srcdir)/$$p classes/$$p"; \ - cp $(srcdir)/$$p classes/$$p; \ - done cp -pR $(srcdir)/asm . cp -pR $(srcdir)/classes . -## END GCJ LOCAL +if CREATE_GJDOC +## Copy over gjdoc resource files. + for res in $(gjdoc_resources); do \ + dir=classes/`dirname $$res`; \ + if ! test -d "$$dir"; then @mkdir_p@ "$$dir"; fi; \ + echo " cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res"; \ + cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res; \ + done +endif + +if WITH_JAR +CREATE_TOOLS_ZIP=$(JAR) cf ../$(TOOLS_ZIP) . +UPDATE_TOOLS_ZIP=$(JAR) uf ../$(TOOLS_ZIP) . +else +CREATE_TOOLS_ZIP=$(ZIP) -r ../$(TOOLS_ZIP) . +UPDATE_TOOLS_ZIP=$(ZIP) -u -r ../$(TOOLS_ZIP) . +endif + ## First add classpath tools stuff. (cd classes; \ - if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \ - if test "$(FASTJAR)" != ""; then "$(FASTJAR)" cf ../$(TOOLS_ZIP) .; fi; \ + $(CREATE_TOOLS_ZIP); \ cd ..) ## Now add ASM classes. (cd asm; \ - if test "$(ZIP)" != ""; then $(ZIP) -u -r ../$(TOOLS_ZIP) .; fi; \ - if test "$(FASTJAR)" != ""; then "$(FASTJAR)" uf ../$(TOOLS_ZIP) .; fi; \ + $(UPDATE_TOOLS_ZIP); \ cd ..) rm -rf asm classes classes.lst asm.lst # Zip file be gone! (and make sure the classes are gone too) clean-local: rm -rf $(TOOLS_ZIP) classes classes.lst asm asm.lst all-classes.lst +if CREATE_GJDOC_PARSER + rm -rf $(gjdoc_gendir) +endif # FIXME: remove this when GNU Classpath includes a bootstrap VM. installcheck-binSCRIPTS: diff --git a/libjava/classpath/tools/Makefile.in b/libjava/classpath/tools/Makefile.in index 4204dd0438d..cf52853cc32 100644 --- a/libjava/classpath/tools/Makefile.in +++ b/libjava/classpath/tools/Makefile.in @@ -45,11 +45,14 @@ target_triplet = @target@ @CREATE_WRAPPERS_TRUE@ gserialver$(EXEEXT) gjavah$(EXEEXT) \ @CREATE_WRAPPERS_TRUE@ grmiregistry$(EXEEXT) \ @CREATE_WRAPPERS_TRUE@ gtnameserv$(EXEEXT) gorbd$(EXEEXT) \ -@CREATE_WRAPPERS_TRUE@ grmid$(EXEEXT) grmic$(EXEEXT) +@CREATE_WRAPPERS_TRUE@ grmid$(EXEEXT) grmic$(EXEEXT) \ +@CREATE_WRAPPERS_TRUE@ $(am__EXEEXT_1) +@CREATE_GJDOC_TRUE@@CREATE_WRAPPERS_TRUE@am__append_1 = gjdoc +@CREATE_GJDOC_TRUE@@CREATE_WRAPPERS_FALSE@am__append_2 = gjdoc subdir = tools DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/gappletviewer.in $(srcdir)/gjar.in \ - $(srcdir)/gjarsigner.in $(srcdir)/gjavah.in \ + $(srcdir)/gjarsigner.in $(srcdir)/gjavah.in $(srcdir)/gjdoc.in \ $(srcdir)/gkeytool.in $(srcdir)/gnative2ascii.in \ $(srcdir)/gorbd.in $(srcdir)/grmic.in $(srcdir)/grmid.in \ $(srcdir)/grmiregistry.in $(srcdir)/gserialver.in \ @@ -66,6 +69,9 @@ am__aclocal_m4_deps = $(top_srcdir)/../../config/depstand.m4 \ $(top_srcdir)/../../ltsugar.m4 \ $(top_srcdir)/../../ltversion.m4 \ $(top_srcdir)/../../lt~obsolete.m4 \ + $(top_srcdir)/m4/ac_prog_antlr.m4 \ + $(top_srcdir)/m4/ac_prog_java.m4 \ + $(top_srcdir)/m4/ac_prog_java_works.m4 \ $(top_srcdir)/m4/ac_prog_javac.m4 \ $(top_srcdir)/m4/ac_prog_javac_works.m4 \ $(top_srcdir)/m4/acattribute.m4 $(top_srcdir)/m4/accross.m4 \ @@ -82,7 +88,9 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = gappletviewer gjarsigner gkeytool gjar \ gnative2ascii gserialver grmiregistry gtnameserv gorbd grmid \ - grmic gjavah + grmic gjavah gjdoc +@CREATE_GJDOC_TRUE@@CREATE_WRAPPERS_TRUE@am__EXEEXT_1 = \ +@CREATE_GJDOC_TRUE@@CREATE_WRAPPERS_TRUE@ gjdoc$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) @@ -105,6 +113,10 @@ am__gjavah_SOURCES_DIST = toolwrapper.c @CREATE_WRAPPERS_TRUE@ gjavah-toolwrapper.$(OBJEXT) gjavah_OBJECTS = $(am_gjavah_OBJECTS) gjavah_LDADD = $(LDADD) +am__gjdoc_SOURCES_DIST = toolwrapper.c +@CREATE_WRAPPERS_TRUE@am_gjdoc_OBJECTS = gjdoc-toolwrapper.$(OBJEXT) +gjdoc_OBJECTS = $(am_gjdoc_OBJECTS) +gjdoc_LDADD = $(LDADD) am__gkeytool_SOURCES_DIST = toolwrapper.c @CREATE_WRAPPERS_TRUE@am_gkeytool_OBJECTS = \ @CREATE_WRAPPERS_TRUE@ gkeytool-toolwrapper.$(OBJEXT) @@ -156,16 +168,16 @@ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(gappletviewer_SOURCES) $(gjar_SOURCES) \ - $(gjarsigner_SOURCES) $(gjavah_SOURCES) $(gkeytool_SOURCES) \ - $(gnative2ascii_SOURCES) $(gorbd_SOURCES) $(grmic_SOURCES) \ - $(grmid_SOURCES) $(grmiregistry_SOURCES) $(gserialver_SOURCES) \ - $(gtnameserv_SOURCES) + $(gjarsigner_SOURCES) $(gjavah_SOURCES) $(gjdoc_SOURCES) \ + $(gkeytool_SOURCES) $(gnative2ascii_SOURCES) $(gorbd_SOURCES) \ + $(grmic_SOURCES) $(grmid_SOURCES) $(grmiregistry_SOURCES) \ + $(gserialver_SOURCES) $(gtnameserv_SOURCES) DIST_SOURCES = $(am__gappletviewer_SOURCES_DIST) \ $(am__gjar_SOURCES_DIST) $(am__gjarsigner_SOURCES_DIST) \ - $(am__gjavah_SOURCES_DIST) $(am__gkeytool_SOURCES_DIST) \ - $(am__gnative2ascii_SOURCES_DIST) $(am__gorbd_SOURCES_DIST) \ - $(am__grmic_SOURCES_DIST) $(am__grmid_SOURCES_DIST) \ - $(am__grmiregistry_SOURCES_DIST) \ + $(am__gjavah_SOURCES_DIST) $(am__gjdoc_SOURCES_DIST) \ + $(am__gkeytool_SOURCES_DIST) $(am__gnative2ascii_SOURCES_DIST) \ + $(am__gorbd_SOURCES_DIST) $(am__grmic_SOURCES_DIST) \ + $(am__grmid_SOURCES_DIST) $(am__grmiregistry_SOURCES_DIST) \ $(am__gserialver_SOURCES_DIST) $(am__gtnameserv_SOURCES_DIST) DATA = $(noinst_DATA) ETAGS = etags @@ -175,6 +187,8 @@ ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ +ANTLR = @ANTLR@ +ANTLR_JAR = @ANTLR_JAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -206,6 +220,12 @@ CREATE_DSSI_LIBRARIES_FALSE = @CREATE_DSSI_LIBRARIES_FALSE@ CREATE_DSSI_LIBRARIES_TRUE = @CREATE_DSSI_LIBRARIES_TRUE@ CREATE_GCONF_PEER_LIBRARIES_FALSE = @CREATE_GCONF_PEER_LIBRARIES_FALSE@ CREATE_GCONF_PEER_LIBRARIES_TRUE = @CREATE_GCONF_PEER_LIBRARIES_TRUE@ +CREATE_GJDOC_FALSE = @CREATE_GJDOC_FALSE@ +CREATE_GJDOC_PARSER_FALSE = @CREATE_GJDOC_PARSER_FALSE@ +CREATE_GJDOC_PARSER_TRUE = @CREATE_GJDOC_PARSER_TRUE@ +CREATE_GJDOC_TRUE = @CREATE_GJDOC_TRUE@ +CREATE_GMPBI_LIBRARY_FALSE = @CREATE_GMPBI_LIBRARY_FALSE@ +CREATE_GMPBI_LIBRARY_TRUE = @CREATE_GMPBI_LIBRARY_TRUE@ CREATE_GSTREAMER_PEER_LIBRARIES_FALSE = @CREATE_GSTREAMER_PEER_LIBRARIES_FALSE@ CREATE_GSTREAMER_PEER_LIBRARIES_TRUE = @CREATE_GSTREAMER_PEER_LIBRARIES_TRUE@ CREATE_GTK_PEER_LIBRARIES_FALSE = @CREATE_GTK_PEER_LIBRARIES_FALSE@ @@ -244,11 +264,12 @@ ERROR_CFLAGS = @ERROR_CFLAGS@ EXAMPLESDIR = @EXAMPLESDIR@ EXEEXT = @EXEEXT@ EXTRA_CFLAGS = @EXTRA_CFLAGS@ -FASTJAR = @FASTJAR@ FGREP = @FGREP@ FIND = @FIND@ FREETYPE2_CFLAGS = @FREETYPE2_CFLAGS@ FREETYPE2_LIBS = @FREETYPE2_LIBS@ +GCJ_JAVAC_FALSE = @GCJ_JAVAC_FALSE@ +GCJ_JAVAC_TRUE = @GCJ_JAVAC_TRUE@ GCONF_CFLAGS = @GCONF_CFLAGS@ GCONF_LIBS = @GCONF_LIBS@ GDK_CFLAGS = @GDK_CFLAGS@ @@ -258,6 +279,8 @@ GENINSRC_TRUE = @GENINSRC_TRUE@ GJDOC = @GJDOC@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ +GMP_CFLAGS = @GMP_CFLAGS@ +GMP_LIBS = @GMP_LIBS@ GREP = @GREP@ GSTREAMER_BASE_CFLAGS = @GSTREAMER_BASE_CFLAGS@ GSTREAMER_BASE_LIBS = @GSTREAMER_BASE_LIBS@ @@ -279,7 +302,10 @@ INSTALL_GLIBJ_ZIP_TRUE = @INSTALL_GLIBJ_ZIP_TRUE@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JAR = @JAR@ +JAVA = @JAVA@ JAVAC = @JAVAC@ +JAVAC_IS_GCJ = @JAVAC_IS_GCJ@ JAVAC_MEM_OPT = @JAVAC_MEM_OPT@ JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION = @JAVA_LANG_SYSTEM_EXPLICIT_INITIALIZATION@ JAVA_MAINTAINER_MODE_FALSE = @JAVA_MAINTAINER_MODE_FALSE@ @@ -345,8 +371,10 @@ USE_ESCHER_TRUE = @USE_ESCHER_TRUE@ USE_PREBUILT_GLIBJ_ZIP_FALSE = @USE_PREBUILT_GLIBJ_ZIP_FALSE@ USE_PREBUILT_GLIBJ_ZIP_TRUE = @USE_PREBUILT_GLIBJ_ZIP_TRUE@ VERSION = @VERSION@ -VM_BINARY = @VM_BINARY@ +WANT_NATIVE_BIG_INTEGER = @WANT_NATIVE_BIG_INTEGER@ WARNING_CFLAGS = @WARNING_CFLAGS@ +WITH_JAR_FALSE = @WITH_JAR_FALSE@ +WITH_JAR_TRUE = @WITH_JAR_TRUE@ XML_CFLAGS = @XML_CFLAGS@ XML_LIBS = @XML_LIBS@ XSLT_CFLAGS = @XSLT_CFLAGS@ @@ -357,6 +385,7 @@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ ZIP = @ZIP@ +ac_ct_ANTLR = @ac_ct_ANTLR@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ @@ -416,12 +445,16 @@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ toolexeclibdir = @toolexeclibdir@ +uudecode = @uudecode@ vm_classes = @vm_classes@ GLIBJ_BOOTCLASSPATH = '$(top_srcdir)/lib' -GLIBJ_CLASSPATH = .:$(srcdir)/asm +GLIBJ_CLASSPATH = .:$(srcdir)/asm:$(ANTLR_CLASSPATH) +@GCJ_JAVAC_FALSE@JCOMPILER = $(JAVAC) $(JAVACFLAGS) -source 1.5 -target 1.5 -encoding UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH) -# Setup the compiler to use the GNU Classpath library we just build -JCOMPILER = $(JAVAC) -g -w --encoding=UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH) -classpath $(GLIBJ_CLASSPATH) +# Setup the compiler to use the GNU Classpath library we just built. +@GCJ_JAVAC_TRUE@JCOMPILER = $(JAVAC) $(JAVACFLAGS) -fsource=1.5 -ftarget=1.5 --encoding=UTF-8 --bootclasspath=$(GLIBJ_BOOTCLASSPATH) --classpath=$(GLIBJ_CLASSPATH) +@CREATE_GJDOC_TRUE@gjdoc_gendir = ${top_srcdir}/tools/generated +@CREATE_GJDOC_TRUE@ANTLR_CLASSPATH = $(ANTLR_JAR):$(gjdoc_gendir) @CREATE_WRAPPERS_TRUE@bin_SCRIPTS = @CREATE_WRAPPERS_TRUE@AM_CPPFLAGS = -Wall \ @CREATE_WRAPPERS_TRUE@ -I$(top_srcdir)/include \ @@ -490,21 +523,31 @@ JCOMPILER = $(JAVAC) -g -w --encoding=UTF-8 -bootclasspath $(GLIBJ_BOOTCLASSPATH @CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"rmic\"" \ @CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"grmic\"" -@CREATE_WRAPPERS_FALSE@noinst_SCRIPTS = gappletviewer gjarsigner gkeytool \ -@CREATE_WRAPPERS_FALSE@ gjar gnative2ascii gserialver gjavah grmiregistry \ -@CREATE_WRAPPERS_FALSE@ gtnameserv gorbd grmid grmic +@CREATE_WRAPPERS_TRUE@gjdoc_SOURCES = toolwrapper.c +@CREATE_WRAPPERS_TRUE@gjdoc_CFLAGS = \ +@CREATE_WRAPPERS_TRUE@ -DTOOLPACKAGE="\"gjdoc\"" \ +@CREATE_WRAPPERS_TRUE@ -DTOOLNAME="\"gjdoc\"" +@CREATE_WRAPPERS_FALSE@noinst_SCRIPTS = gappletviewer gjarsigner \ +@CREATE_WRAPPERS_FALSE@ gkeytool gjar gnative2ascii gserialver \ +@CREATE_WRAPPERS_FALSE@ gjavah grmiregistry gtnameserv gorbd \ +@CREATE_WRAPPERS_FALSE@ grmid grmic $(am__append_2) EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \ gjar.in gnative2ascii.in gserialver.in gjavah.in grmiregistry.in \ - gtnameserv.in gorbd.in grmid.in grmic.in + gtnameserv.in gorbd.in grmid.in grmic.in gjdoc.in # All our example java source files TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \ + $(srcdir)/gnu/classpath/tools/*.java \ + $(srcdir)/gnu/classpath/tools/*/*.java \ + $(srcdir)/gnu/classpath/tools/*/*/*.java \ + $(srcdir)/gnu/classpath/tools/*/*/*/*.java \ $(srcdir)/com/sun/javadoc/*.java \ $(srcdir)/com/sun/tools/doclets/*.java \ $(srcdir)/com/sun/tools/javac/*.java \ $(srcdir)/com/sun/tools/javah/*.java \ + $(srcdir)/com/sun/tools/javadoc/*.java \ $(srcdir)/sun/rmi/rmic/*.java \ $(srcdir)/external/asm/org/objectweb/asm/*.java \ $(srcdir)/external/asm/org/objectweb/asm/attrs/*.java \ @@ -540,6 +583,103 @@ PROPERTY_FILES = $(srcdir)/external/asm/org/objectweb/asm/optimizer/shrink.prope # RMIC templates that must be included in the generated zip file. RMIC_TEMPLATES = $(srcdir)/resource/gnu/classpath/tools/rmic/templates/*.jav +# gjdoc resource files. +gnu_classpath_tools_gjdoc_jar_CSS = \ + doctranslets/html/res/gjdochtml-clean.css \ + doctranslets/html/res/gjdochtml-fixed.css \ + doctranslets/html/res/gjdochtml-sclara.css \ + doctranslets/html/res/gjdochtml.css \ + htmldoclet/gjdochtml-vanilla.css \ + htmldoclet/gjdochtml-clean-layout.css \ + htmldoclet/gjdochtml-clean-color1.css + +gnu_classpath_tools_gjdoc_jar_DTDS = \ + htmldoclet/xhtml11-target10.dtd \ + dtd/gjdoc-alphaindex.dtd \ + dtd/gjdoc.dtd + +gnu_classpath_tools_gjdoc_jar_ENTS = \ + dtd/ent/iso-amsa.ent \ + dtd/ent/iso-amsb.ent \ + dtd/ent/iso-amsc.ent \ + dtd/ent/iso-amsn.ent \ + dtd/ent/iso-amso.ent \ + dtd/ent/iso-amsr.ent \ + dtd/ent/iso-box.ent \ + dtd/ent/iso-cyr1.ent \ + dtd/ent/iso-cyr2.ent \ + dtd/ent/iso-dia.ent \ + dtd/ent/iso-grk1.ent \ + dtd/ent/iso-grk2.ent \ + dtd/ent/iso-grk3.ent \ + dtd/ent/iso-grk4.ent \ + dtd/ent/iso-lat1.ent \ + dtd/ent/iso-lat2.ent \ + dtd/ent/iso-num.ent \ + dtd/ent/iso-pub.ent \ + dtd/ent/iso-tech.ent + +gnu_classpath_tools_gjdoc_jar_HTML = doctranslets/html/res/default_help_en.html +gnu_classpath_tools_gjdoc_jar_JS = \ + doctranslets/html/res/gjdoc.js \ + htmldoclet/gjdoc.js + +gnu_classpath_tools_gjdoc_jar_PNG = \ + htmldoclet/inherit.png + +gnu_classpath_tools_gjdoc_jar_MODS = dtd/dbcentx.mod +gnu_classpath_tools_gjdoc_jar_PROPERTIES = htmldoclet/HtmlDoclet.properties +gnu_classpath_tools_gjdoc_jar_RNGS = \ + rng/gjdoc-classdoc.rng \ + rng/gjdoc-common.rng \ + rng/gjdoc-index.rng + +gnu_classpath_tools_gjdoc_jar_TXTS = \ + java.lang-classes-1.2.txt \ + java.lang-classes-1.3.txt \ + java.lang-classes-1.4.txt \ + java.lang-classes-1.5.txt + +gnu_classpath_tools_gjdoc_jar_XHTML = htmldoclet/help.xhtml +gnu_classpath_tools_gjdoc_jar_XSLS = \ + doctranslets/gjdoc_common.xsl \ + doctranslets/html/about.xsl \ + doctranslets/html/allclasses.xsl \ + doctranslets/html/allpackages.xsl \ + doctranslets/html/alphaindex.xsl \ + doctranslets/html/alphaindex_chunked.xsl \ + doctranslets/html/classdoc-source.xsl \ + doctranslets/html/classdoc-uses.xsl \ + doctranslets/html/classdoc.xsl \ + doctranslets/html/deprecated.xsl \ + doctranslets/html/descriptor.xsl \ + doctranslets/html/doctranslet.xsl \ + doctranslets/html/fulltree.xsl \ + doctranslets/html/gjdoc.xsl \ + doctranslets/html/help.xsl \ + doctranslets/html/html_common.xsl \ + doctranslets/html/index_noframes.xsl \ + doctranslets/html/index.xsl \ + doctranslets/html/packageclasses.xsl \ + doctranslets/html/packagedoc.xsl + + +# All our resources. +gjdoc_resources = $(gnu_classpath_tools_gjdoc_jar_CSS) $(gnu_classpath_tools_gjdoc_jar_DTDS) \ + $(gnu_classpath_tools_gjdoc_jar_ENTS) $(gnu_classpath_tools_gjdoc_jar_HTML) \ + $(gnu_classpath_tools_gjdoc_jar_JS) $(gnu_classpath_tools_gjdoc_jar_MODS) \ + $(gnu_classpath_tools_gjdoc_jar_PNG) $(gnu_classpath_tools_gjdoc_jar_PROPERTIES) \ + $(gnu_classpath_tools_gjdoc_jar_RNGS) $(gnu_classpath_tools_gjdoc_jar_TXTS) \ + $(gnu_classpath_tools_gjdoc_jar_XHTML) $(gnu_classpath_tools_gjdoc_jar_XSLS) + +@CREATE_GJDOC_FALSE@GJDOC_EX = -path '*gnu/classpath/tools/gjdoc' -prune -o \ +@CREATE_GJDOC_FALSE@ -path '*gnu/classpath/tools/doclets' -prune -o \ +@CREATE_GJDOC_FALSE@ -path '*gnu/classpath/tools/taglets' -prune -o \ +@CREATE_GJDOC_FALSE@ -path '*com/sun/javadoc' -prune -o \ +@CREATE_GJDOC_FALSE@ -path '*com/sun/tools/doclets' -prune -o \ +@CREATE_GJDOC_FALSE@ -path '*com/sun/tools/javadoc' -prune -o + + # The zip files with classes we want to produce. TOOLS_ZIP = tools.zip @@ -547,7 +687,10 @@ TOOLS_ZIP = tools.zip BUILT_SOURCES = $(TOOLS_ZIP) # All the files we find "interesting" -ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(RMIC_TEMPLATES) $(PROPERTY_FILES) +ALL_TOOLS_FILES = $(TOOLS_JAVA_FILES) $(RMIC_TEMPLATES) $(PROPERTY_FILES) \ + $(addprefix $(srcdir)/resource/gnu/classpath/tools/gjdoc/,$(gjdoc_resources))\ + $(srcdir)/gnu/classpath/tools/gjdoc/expr/java-expression.g + # Some architecture independent data to be installed. # GCJ LOCAL: do not install this. @@ -555,6 +698,10 @@ noinst_DATA = $(TOOLS_ZIP) # Where we want these data files installed. TOOLSdir = $(pkgdatadir) +@WITH_JAR_FALSE@CREATE_TOOLS_ZIP = $(ZIP) -r ../$(TOOLS_ZIP) . +@WITH_JAR_TRUE@CREATE_TOOLS_ZIP = $(JAR) cf ../$(TOOLS_ZIP) . +@WITH_JAR_FALSE@UPDATE_TOOLS_ZIP = $(ZIP) -u -r ../$(TOOLS_ZIP) . +@WITH_JAR_TRUE@UPDATE_TOOLS_ZIP = $(JAR) uf ../$(TOOLS_ZIP) . all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -613,6 +760,8 @@ grmic: $(top_builddir)/config.status $(srcdir)/grmic.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gjavah: $(top_builddir)/config.status $(srcdir)/gjavah.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +gjdoc: $(top_builddir)/config.status $(srcdir)/gjdoc.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @@ -669,6 +818,12 @@ installcheck-binPROGRAMS: $(bin_PROGRAMS) @CREATE_WRAPPERS_TRUE@gjavah$(EXEEXT): $(gjavah_OBJECTS) $(gjavah_DEPENDENCIES) @CREATE_WRAPPERS_TRUE@ @rm -f gjavah$(EXEEXT) @CREATE_WRAPPERS_TRUE@ $(LINK) $(gjavah_LDFLAGS) $(gjavah_OBJECTS) $(gjavah_LDADD) $(LIBS) +@CREATE_GJDOC_FALSE@gjdoc$(EXEEXT): $(gjdoc_OBJECTS) $(gjdoc_DEPENDENCIES) +@CREATE_GJDOC_FALSE@ @rm -f gjdoc$(EXEEXT) +@CREATE_GJDOC_FALSE@ $(LINK) $(gjdoc_LDFLAGS) $(gjdoc_OBJECTS) $(gjdoc_LDADD) $(LIBS) +@CREATE_WRAPPERS_TRUE@gjdoc$(EXEEXT): $(gjdoc_OBJECTS) $(gjdoc_DEPENDENCIES) +@CREATE_WRAPPERS_TRUE@ @rm -f gjdoc$(EXEEXT) +@CREATE_WRAPPERS_TRUE@ $(LINK) $(gjdoc_LDFLAGS) $(gjdoc_OBJECTS) $(gjdoc_LDADD) $(LIBS) @CREATE_WRAPPERS_TRUE@gkeytool$(EXEEXT): $(gkeytool_OBJECTS) $(gkeytool_DEPENDENCIES) @CREATE_WRAPPERS_TRUE@ @rm -f gkeytool$(EXEEXT) @CREATE_WRAPPERS_TRUE@ $(LINK) $(gkeytool_LDFLAGS) $(gkeytool_OBJECTS) $(gkeytool_LDADD) $(LIBS) @@ -723,6 +878,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjar-toolwrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjarsigner-toolwrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjavah-toolwrapper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gjdoc-toolwrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gkeytool-toolwrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gnative2ascii-toolwrapper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gorbd-toolwrapper.Po@am__quote@ @@ -809,6 +965,20 @@ gjavah-toolwrapper.obj: toolwrapper.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjavah_CFLAGS) $(CFLAGS) -c -o gjavah-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi` +gjdoc-toolwrapper.o: toolwrapper.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjdoc_CFLAGS) $(CFLAGS) -MT gjdoc-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gjdoc-toolwrapper.Tpo" -c -o gjdoc-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjdoc-toolwrapper.Tpo" "$(DEPDIR)/gjdoc-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjdoc-toolwrapper.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjdoc-toolwrapper.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjdoc_CFLAGS) $(CFLAGS) -c -o gjdoc-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c + +gjdoc-toolwrapper.obj: toolwrapper.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjdoc_CFLAGS) $(CFLAGS) -MT gjdoc-toolwrapper.obj -MD -MP -MF "$(DEPDIR)/gjdoc-toolwrapper.Tpo" -c -o gjdoc-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gjdoc-toolwrapper.Tpo" "$(DEPDIR)/gjdoc-toolwrapper.Po"; else rm -f "$(DEPDIR)/gjdoc-toolwrapper.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='toolwrapper.c' object='gjdoc-toolwrapper.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gjdoc_CFLAGS) $(CFLAGS) -c -o gjdoc-toolwrapper.obj `if test -f 'toolwrapper.c'; then $(CYGPATH_W) 'toolwrapper.c'; else $(CYGPATH_W) '$(srcdir)/toolwrapper.c'; fi` + gkeytool-toolwrapper.o: toolwrapper.c @am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gkeytool_CFLAGS) $(CFLAGS) -MT gkeytool-toolwrapper.o -MD -MP -MF "$(DEPDIR)/gkeytool-toolwrapper.Tpo" -c -o gkeytool-toolwrapper.o `test -f 'toolwrapper.c' || echo '$(srcdir)/'`toolwrapper.c; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gkeytool-toolwrapper.Tpo" "$(DEPDIR)/gkeytool-toolwrapper.Po"; else rm -f "$(DEPDIR)/gkeytool-toolwrapper.Tpo"; exit 1; fi @@ -1121,6 +1291,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ @CREATE_WRAPPERS_FALSE@gorbd: gorbd.in @CREATE_WRAPPERS_FALSE@grmid: grmid.in @CREATE_WRAPPERS_FALSE@grmic: grmic.in +@CREATE_GJDOC_TRUE@@CREATE_WRAPPERS_FALSE@gjdoc: gjdoc.in # Make sure everything is included in the distribution. dist-hook: @@ -1145,9 +1316,11 @@ $(TOOLS_ZIP): $(ALL_TOOLS_FILES) find $(srcdir)/gnu/classpath/tools \ $(srcdir)/com/sun/javadoc \ $(srcdir)/com/sun/tools/doclets \ + $(srcdir)/com/sun/tools/javadoc \ $(srcdir)/com/sun/tools/javac \ $(srcdir)/com/sun/tools/javah \ $(srcdir)/sun/rmi/rmic \ + $(GJDOC_EX) \ -name '*.java' -print > classes.lst if [ -f $(top_builddir)/../vm-tools-packages ]; then \ : > vm-tools.lst; \ @@ -1158,39 +1331,41 @@ $(TOOLS_ZIP): $(ALL_TOOLS_FILES) echo -n > vm-tools.lst; \ fi cat classes.lst asm.lst vm-tools.lst > all-classes.lst +@CREATE_GJDOC_PARSER_TRUE@@CREATE_GJDOC_TRUE@@JAVA_MAINTAINER_MODE_TRUE@ @mkdir_p@ $(gjdoc_gendir)/gnu/classpath/tools/gjdoc/expr +@CREATE_GJDOC_PARSER_TRUE@@CREATE_GJDOC_TRUE@@JAVA_MAINTAINER_MODE_TRUE@ $(ANTLR) -o $(gjdoc_gendir)/gnu/classpath/tools/gjdoc/expr \ +@CREATE_GJDOC_PARSER_TRUE@@CREATE_GJDOC_TRUE@@JAVA_MAINTAINER_MODE_TRUE@ $(srcdir)/gnu/classpath/tools/gjdoc/expr/java-expression.g @JAVA_MAINTAINER_MODE_TRUE@ AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \ @JAVA_MAINTAINER_MODE_TRUE@ $$AC -g -w -d $(srcdir)/asm @asm.lst -@JAVA_MAINTAINER_MODE_TRUE@ $(JCOMPILER) -g -w -d $(srcdir)/classes @classes.lst @vm-tools.lst -@JAVA_MAINTAINER_MODE_TRUE@ @list=`cd $(srcdir)/resource && find gnu/classpath/tools com/sun/tools/javac \ -@JAVA_MAINTAINER_MODE_TRUE@ sun/rmi/rmic -name \*.properties -print -o -name \*.jav -print`; \ -@JAVA_MAINTAINER_MODE_TRUE@ for p in $$list; do \ -@JAVA_MAINTAINER_MODE_TRUE@ dirname=classes/`dirname $$p`; \ -@JAVA_MAINTAINER_MODE_TRUE@ if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \ -@JAVA_MAINTAINER_MODE_TRUE@ echo " cp $(srcdir)resource/$$p classes/$$p"; \ -@JAVA_MAINTAINER_MODE_TRUE@ cp $(srcdir)/resource/$$p classes/$$p; \ -@JAVA_MAINTAINER_MODE_TRUE@ done - @list=`cd $(srcdir) && find gnu/classpath/tools -name \*.jav -print`; \ +@JAVA_MAINTAINER_MODE_TRUE@ $(JCOMPILER) $(USE_JAVAC_FLAGS) -g -d $(srcdir)/classes @classes.lst @vm-tools.lst + @list=`cd $(srcdir)/resource && find gnu/classpath/tools com/sun/tools/javac \ + sun/rmi/rmic $(GJDOC_EX) -name \*.properties -print -o -name \*.jav -print`; \ for p in $$list; do \ dirname=classes/`dirname $$p`; \ - if ! test -d "$$dirname"; then mkdir -p "$$dirname"; fi; \ - echo " cp $(srcdir)/$$p classes/$$p"; \ - cp $(srcdir)/$$p classes/$$p; \ + if ! test -d "$$dirname"; then @mkdir_p@ "$$dirname"; fi; \ + echo " cp $(srcdir)/resource/$$p classes/$$p"; \ + cp $(srcdir)/resource/$$p classes/$$p; \ done cp -pR $(srcdir)/asm . cp -pR $(srcdir)/classes . +@CREATE_GJDOC_TRUE@ for res in $(gjdoc_resources); do \ +@CREATE_GJDOC_TRUE@ dir=classes/`dirname $$res`; \ +@CREATE_GJDOC_TRUE@ if ! test -d "$$dir"; then @mkdir_p@ "$$dir"; fi; \ +@CREATE_GJDOC_TRUE@ echo " cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res"; \ +@CREATE_GJDOC_TRUE@ cp $(srcdir)/resource/gnu/classpath/tools/gjdoc/$$res classes/$$res; \ +@CREATE_GJDOC_TRUE@ done + (cd classes; \ - if test "$(ZIP)" != ""; then $(ZIP) -r ../$(TOOLS_ZIP) .; fi; \ - if test "$(FASTJAR)" != ""; then "$(FASTJAR)" cf ../$(TOOLS_ZIP) .; fi; \ + $(CREATE_TOOLS_ZIP); \ cd ..) (cd asm; \ - if test "$(ZIP)" != ""; then $(ZIP) -u -r ../$(TOOLS_ZIP) .; fi; \ - if test "$(FASTJAR)" != ""; then "$(FASTJAR)" uf ../$(TOOLS_ZIP) .; fi; \ + $(UPDATE_TOOLS_ZIP); \ cd ..) rm -rf asm classes classes.lst asm.lst # Zip file be gone! (and make sure the classes are gone too) clean-local: rm -rf $(TOOLS_ZIP) classes classes.lst asm asm.lst all-classes.lst +@CREATE_GJDOC_PARSER_TRUE@ rm -rf $(gjdoc_gendir) # FIXME: remove this when GNU Classpath includes a bootstrap VM. installcheck-binSCRIPTS: diff --git a/libjava/classpath/tools/classes/com/sun/tools/javadoc/Main.class b/libjava/classpath/tools/classes/com/sun/tools/javadoc/Main.class new file mode 100644 index 00000000000..f2822a6e266 Binary files /dev/null and b/libjava/classpath/tools/classes/com/sun/tools/javadoc/Main.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$FileStreamInfo.class b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$FileStreamInfo.class new file mode 100644 index 00000000000..83a757fb1bb Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$FileStreamInfo.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$JarStreamInfo.class b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$JarStreamInfo.class new file mode 100644 index 00000000000..4e4d39268c8 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$JarStreamInfo.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$StreamInfo.class b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$StreamInfo.class new file mode 100644 index 00000000000..85f53ae2e40 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader$StreamInfo.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader.class b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader.class new file mode 100644 index 00000000000..7b65b829c1e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/FileSystemClassLoader.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/IOToolkit.class b/libjava/classpath/tools/classes/gnu/classpath/tools/IOToolkit.class new file mode 100644 index 00000000000..d5f72fb6c6d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/IOToolkit.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputEvent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputEvent.class new file mode 100644 index 00000000000..445a1f307d1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputEvent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputListener.class b/libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputListener.class new file mode 100644 index 00000000000..6a90af53eb1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/MalformedInputListener.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/NotifyingInputStreamReader.class b/libjava/classpath/tools/classes/gnu/classpath/tools/NotifyingInputStreamReader.class new file mode 100644 index 00000000000..fc7d1349f43 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/NotifyingInputStreamReader.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/StringToolkit.class b/libjava/classpath/tools/classes/gnu/classpath/tools/StringToolkit.class new file mode 100644 index 00000000000..bef494c89ef Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/StringToolkit.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class index 36bc25fb198..2c8a74dc3b5 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionGroup.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionGroup.class new file mode 100644 index 00000000000..5b3b3d91452 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionGroup.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTag.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTag.class new file mode 100644 index 00000000000..2aee2cfd564 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTag.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTaglet.class new file mode 100644 index 00000000000..b88206bf8ad Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTagletPath.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTagletPath.class new file mode 100644 index 00000000000..c16cb5a7d25 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$DocletOptionTagletPath.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$IndexKey.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$IndexKey.class new file mode 100644 index 00000000000..7247ed826b7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$IndexKey.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$InterfaceRelation.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$InterfaceRelation.class new file mode 100644 index 00000000000..28d360b4d6e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$InterfaceRelation.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$UsageType.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$UsageType.class new file mode 100644 index 00000000000..e06dc5f523b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet$UsageType.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet.class new file mode 100644 index 00000000000..268778d8b99 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/AbstractDoclet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletConfigurationException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletConfigurationException.class new file mode 100644 index 00000000000..f8f42878876 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletConfigurationException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOption.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOption.class new file mode 100644 index 00000000000..2b2bf916578 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOption.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionColonSeparated.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionColonSeparated.class new file mode 100644 index 00000000000..b51e16779fa Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionColonSeparated.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFile.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFile.class new file mode 100644 index 00000000000..ff961e93568 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFile.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFlag.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFlag.class new file mode 100644 index 00000000000..da98b73013e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionFlag.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.class new file mode 100644 index 00000000000..72b2822fdfd Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionString.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionString.class new file mode 100644 index 00000000000..39529c2667c Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/DocletOptionString.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InlineTagRenderer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InlineTagRenderer.class new file mode 100644 index 00000000000..d938d6131fc Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InlineTagRenderer.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InvalidPackageWildcardException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InvalidPackageWildcardException.class new file mode 100644 index 00000000000..c2cfa70b874 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/InvalidPackageWildcardException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageGroup.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageGroup.class new file mode 100644 index 00000000000..a046a58a9c1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageGroup.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageMatcher.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageMatcher.class new file mode 100644 index 00000000000..6370bc4a1ef Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/PackageMatcher.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/StandardTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/StandardTaglet.class new file mode 100644 index 00000000000..711c57ef370 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/StandardTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/TagletPrinter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/TagletPrinter.class new file mode 100644 index 00000000000..ac908c910b4 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/TagletPrinter.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/debugdoclet/DebugDoclet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/debugdoclet/DebugDoclet.class new file mode 100644 index 00000000000..70bd890c263 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/debugdoclet/DebugDoclet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/CssClass.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/CssClass.class new file mode 100644 index 00000000000..9fe21945a26 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/CssClass.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.class new file mode 100644 index 00000000000..125649f93ef Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$1.class new file mode 100644 index 00000000000..5bcba7c4e0a Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$2.class new file mode 100644 index 00000000000..cfecc2eeb96 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$2.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$3.class new file mode 100644 index 00000000000..620bb15c3b6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$3.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$TreeNode.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$TreeNode.class new file mode 100644 index 00000000000..f0d1ad7d836 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet$TreeNode.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class new file mode 100644 index 00000000000..6e9981b5ee7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlPage.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlPage.class new file mode 100644 index 00000000000..c8fef270e8a Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlPage.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.class new file mode 100644 index 00000000000..9c422cac9e5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$1.class new file mode 100644 index 00000000000..29ff94020f7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$NullErrorReporter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$NullErrorReporter.class new file mode 100644 index 00000000000..fdaf194670b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$NullErrorReporter.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$UsageType.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$UsageType.class new file mode 100644 index 00000000000..bc7fc363d33 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver$UsageType.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver.class new file mode 100644 index 00000000000..e4c9da6c117 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver1_4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver1_4.class new file mode 100644 index 00000000000..7c022b493a5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/Driver1_4.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer$TagInfo.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer$TagInfo.class new file mode 100644 index 00000000000..0afc368b04b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer$TagInfo.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.class new file mode 100644 index 00000000000..32d55684c97 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/TargetContext.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/TargetContext.class new file mode 100644 index 00000000000..de769e90d95 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/TargetContext.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet$DocErrorReporterOutputStream.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet$DocErrorReporterOutputStream.class new file mode 100644 index 00000000000..949aaf4113c Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet$DocErrorReporterOutputStream.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.class new file mode 100644 index 00000000000..9f45994f2e7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletConfigurationException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletConfigurationException.class new file mode 100644 index 00000000000..9cfc10e7151 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletConfigurationException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletException.class new file mode 100644 index 00000000000..7c2a5bce084 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletOptions.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletOptions.class new file mode 100644 index 00000000000..b0dc3a67685 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTransletOptions.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/JarClassLoader.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/JarClassLoader.class new file mode 100644 index 00000000000..7fcd83c3b70 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/JarClassLoader.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.class new file mode 100644 index 00000000000..a5491d4f458 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.class index bfc4834cd13..76076443610 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.class index ffdb2ec3daf..f2ecf979f1b 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$2.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.class index 7167f6c6d84..56fd358a6b7 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser$3.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.class index 7725dd8ed82..1e0586d28cc 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Parser.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/AbstractTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/AbstractTagImpl.class new file mode 100644 index 00000000000..15810faee9e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/AbstractTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ArrayCharacterIterator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ArrayCharacterIterator.class new file mode 100644 index 00000000000..66c1f8a0430 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ArrayCharacterIterator.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BlockSourceComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BlockSourceComponent.class new file mode 100644 index 00000000000..164d5f38094 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BlockSourceComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BracketClose.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BracketClose.class new file mode 100644 index 00000000000..4a6a51783a1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/BracketClose.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassComponent.class new file mode 100644 index 00000000000..aa31f74426d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocImpl.class new file mode 100644 index 00000000000..ce8fb482022 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocProxy.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocProxy.class new file mode 100644 index 00000000000..62185a01725 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocProxy.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.class new file mode 100644 index 00000000000..a9b7f63119d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/CommentComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/CommentComponent.class new file mode 100644 index 00000000000..063715191ee Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/CommentComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ConstructorDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ConstructorDocImpl.class new file mode 100644 index 00000000000..774e33c0dad Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ConstructorDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Debug.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Debug.class new file mode 100644 index 00000000000..849e68707a8 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Debug.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree$FileNode.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree$FileNode.class new file mode 100644 index 00000000000..c1c373f8715 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree$FileNode.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree.class new file mode 100644 index 00000000000..1c1abd549f5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DirectoryTree.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DocImpl.class new file mode 100644 index 00000000000..1b09a317531 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/DocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/EmptyStatementComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/EmptyStatementComponent.class new file mode 100644 index 00000000000..e25d162ccd6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/EmptyStatementComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ErrorReporter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ErrorReporter.class new file mode 100644 index 00000000000..3fda481956a Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ErrorReporter.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.class new file mode 100644 index 00000000000..34503125fc5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldComponent.class new file mode 100644 index 00000000000..32fb32e415c Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldDocImpl.class new file mode 100644 index 00000000000..4479e84f767 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FieldDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FunctionComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FunctionComponent.class new file mode 100644 index 00000000000..4a8a340e4b9 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/FunctionComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocPackageDoc.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocPackageDoc.class new file mode 100644 index 00000000000..0932db26e79 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocPackageDoc.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocRootDoc.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocRootDoc.class new file mode 100644 index 00000000000..7ad3e40818b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/GjdocRootDoc.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/IgnoredFileParseException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/IgnoredFileParseException.class new file mode 100644 index 00000000000..f0cf14df720 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/IgnoredFileParseException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ImportComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ImportComponent.class new file mode 100644 index 00000000000..7f30dacd1c6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ImportComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/InheritDocTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/InheritDocTagImpl.class new file mode 100644 index 00000000000..5d56604eefd Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/InheritDocTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/JavadocWrapper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/JavadocWrapper.class new file mode 100644 index 00000000000..df1abf1ac37 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/JavadocWrapper.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/LinkTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/LinkTagImpl.class new file mode 100644 index 00000000000..5f1ca92d6d1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/LinkTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$1.class new file mode 100644 index 00000000000..93de99ad907 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class new file mode 100644 index 00000000000..691c53ce0c2 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$10.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class new file mode 100644 index 00000000000..e8bb15f993e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$11.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class new file mode 100644 index 00000000000..1479d587a83 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$12.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class new file mode 100644 index 00000000000..c47a836074b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$13.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class new file mode 100644 index 00000000000..5bb6c725956 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$14.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class new file mode 100644 index 00000000000..13f7e77a530 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$15.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class new file mode 100644 index 00000000000..bee8820c2f8 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$16.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class new file mode 100644 index 00000000000..da2e873908d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$17.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class new file mode 100644 index 00000000000..9402410a7d6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$18.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class new file mode 100644 index 00000000000..c2bfa2d442a Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$19.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$2.class new file mode 100644 index 00000000000..d294d3c25c5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$2.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class new file mode 100644 index 00000000000..390bd1b7929 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$20.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class new file mode 100644 index 00000000000..5977dc8d8e9 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$21.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class new file mode 100644 index 00000000000..46f194b653e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$22.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class new file mode 100644 index 00000000000..1b14a4118b5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$23.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class new file mode 100644 index 00000000000..d38eff9a626 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$24.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class new file mode 100644 index 00000000000..a812e147cd5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$25.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$3.class new file mode 100644 index 00000000000..00817dab00b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$3.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$4.class new file mode 100644 index 00000000000..a789799d231 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$4.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$5.class new file mode 100644 index 00000000000..09dfcbb61cb Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$5.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$6.class new file mode 100644 index 00000000000..634155f58af Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$6.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$7.class new file mode 100644 index 00000000000..91e10b27c7a Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$7.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$8.class new file mode 100644 index 00000000000..f1118b613f7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$8.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$9.class new file mode 100644 index 00000000000..2c84fff5925 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$9.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$OptionProcessor.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$OptionProcessor.class new file mode 100644 index 00000000000..15840c0c1bf Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main$OptionProcessor.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class new file mode 100644 index 00000000000..48b5bc82371 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MemberDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MemberDocImpl.class new file mode 100644 index 00000000000..7b5557571a7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MemberDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MethodDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MethodDocImpl.class new file mode 100644 index 00000000000..743f0be560c Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/MethodDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageComponent.class new file mode 100644 index 00000000000..60e378fe2d5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageDocImpl.class new file mode 100644 index 00000000000..4542752a5dd Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/PackageDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParamTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParamTagImpl.class new file mode 100644 index 00000000000..25ea5872faf Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParamTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParameterImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParameterImpl.class new file mode 100644 index 00000000000..2940fc08bf1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParameterImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParseException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParseException.class new file mode 100644 index 00000000000..716b5681f6d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ParseException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$1.class new file mode 100644 index 00000000000..9c05a9048aa Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$Context.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$Context.class new file mode 100644 index 00000000000..18360502620 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser$Context.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser.class new file mode 100644 index 00000000000..149bd7eb656 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Parser.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ProgramElementDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ProgramElementDocImpl.class new file mode 100644 index 00000000000..27aaa1a194d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ProgramElementDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImport.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImport.class new file mode 100644 index 00000000000..803eb60e8c9 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImport.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportClassFile.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportClassFile.class new file mode 100644 index 00000000000..75ef96cb9ec Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportClassFile.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportNotFound.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportNotFound.class new file mode 100644 index 00000000000..6f6faf537f3 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportNotFound.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportPackageFile.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportPackageFile.class new file mode 100644 index 00000000000..e6f0bde1536 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportPackageFile.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionClass.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionClass.class new file mode 100644 index 00000000000..4a29649dde1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionClass.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionPackage.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionPackage.class new file mode 100644 index 00000000000..e956768707e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ResolvedImportReflectionPackage.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ScheduledClass.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ScheduledClass.class new file mode 100644 index 00000000000..92ddaf87af7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl$ScheduledClass.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl.class new file mode 100644 index 00000000000..f06d76f79d6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/RootDocImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SeeTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SeeTagImpl.class new file mode 100644 index 00000000000..9fa4c15cfe2 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SeeTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SerialFieldTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SerialFieldTagImpl.class new file mode 100644 index 00000000000..e83396669f4 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SerialFieldTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SlashSlashCommentComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SlashSlashCommentComponent.class new file mode 100644 index 00000000000..751f5b6b6f3 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SlashSlashCommentComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourceComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourceComponent.class new file mode 100644 index 00000000000..ec9e789dc43 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourceComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourcePositionImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourcePositionImpl.class new file mode 100644 index 00000000000..da0e63f6c44 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/SourcePositionImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/StaticBlockComponent.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/StaticBlockComponent.class new file mode 100644 index 00000000000..75640c84a52 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/StaticBlockComponent.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagContainer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagContainer.class new file mode 100644 index 00000000000..6ff3032e42d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagContainer.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagImpl.class new file mode 100644 index 00000000000..e51bbf4f2f7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TemporaryStore.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TemporaryStore.class new file mode 100644 index 00000000000..661f49305cc Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TemporaryStore.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TextTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TextTagImpl.class new file mode 100644 index 00000000000..494a09e0933 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TextTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ThrowsTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ThrowsTagImpl.class new file mode 100644 index 00000000000..d86084caa70 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ThrowsTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Timer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Timer.class new file mode 100644 index 00000000000..1d448e37d10 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Timer.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet$1.class new file mode 100644 index 00000000000..41b7e2c2faa Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet.class new file mode 100644 index 00000000000..ea6cb557f6e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TimerDoclet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeImpl.class new file mode 100644 index 00000000000..e2e630a5c6b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeVariableImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeVariableImpl.class new file mode 100644 index 00000000000..24ba68dc90a Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/TypeVariableImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ValueTagImpl.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ValueTagImpl.class new file mode 100644 index 00000000000..94302c2ebbb Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/ValueTagImpl.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Whitespace.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Whitespace.class new file mode 100644 index 00000000000..d7051519d56 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Whitespace.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/WritableType.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/WritableType.class new file mode 100644 index 00000000000..8c61a4ab723 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/WritableType.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AdditionExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AdditionExpression.class new file mode 100644 index 00000000000..fe0b4828dd9 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AdditionExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AndExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AndExpression.class new file mode 100644 index 00000000000..fe4733472ff Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/AndExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.class new file mode 100644 index 00000000000..ea024cf257e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.class new file mode 100644 index 00000000000..7aa1b436037 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.class new file mode 100644 index 00000000000..5c4aa307295 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryExpression.class new file mode 100644 index 00000000000..fc81485e5a6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.class new file mode 100644 index 00000000000..96a1dee963e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.class new file mode 100644 index 00000000000..06e07c2f26c Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.class new file mode 100644 index 00000000000..090c9d9ec3b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.class new file mode 100644 index 00000000000..d0abe9d17af Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.class new file mode 100644 index 00000000000..26c14ed4f60 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.class new file mode 100644 index 00000000000..56050b9f28f Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.class new file mode 100644 index 00000000000..ebba4c8e490 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantByte.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantByte.class new file mode 100644 index 00000000000..07a85b1702e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantByte.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantChar.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantChar.class new file mode 100644 index 00000000000..6d44b80c873 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantChar.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantDouble.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantDouble.class new file mode 100644 index 00000000000..e5b4f83f02f Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantDouble.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantExpression.class new file mode 100644 index 00000000000..791aae005ed Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantFloat.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantFloat.class new file mode 100644 index 00000000000..0fe33bd94e1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantFloat.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantInteger.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantInteger.class new file mode 100644 index 00000000000..1fc0bf38f12 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantInteger.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantLong.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantLong.class new file mode 100644 index 00000000000..32af351937b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantLong.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantNull.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantNull.class new file mode 100644 index 00000000000..aabd3f5786d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantNull.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantShort.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantShort.class new file mode 100644 index 00000000000..082f9f06f76 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantShort.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantString.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantString.class new file mode 100644 index 00000000000..605278d10ca Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ConstantString.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Context.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Context.class new file mode 100644 index 00000000000..3afc14603fe Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Context.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/DivisionExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/DivisionExpression.class new file mode 100644 index 00000000000..3543f00ac8a Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/DivisionExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EqualExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EqualExpression.class new file mode 100644 index 00000000000..222c6e40ef6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EqualExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Evaluator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Evaluator.class new file mode 100644 index 00000000000..4cf131ade81 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Evaluator.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.class new file mode 100644 index 00000000000..5ff7b190298 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.class new file mode 100644 index 00000000000..9b3655780f7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Expression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Expression.class new file mode 100644 index 00000000000..52b5f932245 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Expression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.class new file mode 100644 index 00000000000..eef127e4523 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.class new file mode 100644 index 00000000000..5a8dcc22bc0 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.class new file mode 100644 index 00000000000..10ab5740d36 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.class new file mode 100644 index 00000000000..7c9b52e78f3 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.class new file mode 100644 index 00000000000..b54b51b2d68 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaLexer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaLexer.class new file mode 100644 index 00000000000..a61433cb968 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaLexer.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.class new file mode 100644 index 00000000000..91e156a3d27 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.class new file mode 100644 index 00000000000..39e584d685e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanExpression.class new file mode 100644 index 00000000000..08f71e49970 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.class new file mode 100644 index 00000000000..97e19b3995e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.class new file mode 100644 index 00000000000..d031ae37df1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.class new file mode 100644 index 00000000000..0fec9ca8c04 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.class new file mode 100644 index 00000000000..c9a6dbf87b6 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ModuloExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ModuloExpression.class new file mode 100644 index 00000000000..e005b639647 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ModuloExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.class new file mode 100644 index 00000000000..f5c4efed22e Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NegateExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NegateExpression.class new file mode 100644 index 00000000000..d136821a917 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NegateExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.class new file mode 100644 index 00000000000..57c8943c23c Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotExpression.class new file mode 100644 index 00000000000..85b5aa5e3e7 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/NotExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.class new file mode 100644 index 00000000000..07e417c9cbf Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.class new file mode 100644 index 00000000000..92a2cde79d5 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.class new file mode 100644 index 00000000000..7d53d1ef2b1 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Type.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Type.class new file mode 100644 index 00000000000..c0ec6073961 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/Type.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.class new file mode 100644 index 00000000000..018024d6f0f Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnaryExpression.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnaryExpression.class new file mode 100644 index 00000000000..b4a86d1b503 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnaryExpression.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.class new file mode 100644 index 00000000000..97557e03664 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class index 0460b3f4dfb..cd3602b366f 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Creator.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.class index 6b8d25876ab..cc51ad435f5 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Indexer.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.class b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.class index 8fbd26661ad..e9f19b75b24 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/jar/Updater.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml$State.class b/libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml$State.class new file mode 100644 index 00000000000..71875ab874b Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml$State.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml.class b/libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml.class new file mode 100644 index 00000000000..e3db4992675 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/java2xhtml/Java2xhtml.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class index da5ddebe53b..5c20124acbb 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/ClassWrapper.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class index 938789b9556..8f09f16e2fa 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.class b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.class index fdfa2fb5f17..3a2bd54afa5 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/native2ascii/Native2ASCII.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.class index c37eee13d18..843d741274f 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/PersistentMap$Entry.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.class index 8d1e58f5acc..b4ffcaedec2 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/ClassRmicCompiler.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.class index 5a5fec49ca5..95f7c77598e 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/Generator.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.class index 272018323c8..ab9c27ea79a 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/MethodGenerator.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.class index 731f27a5da7..d914461f723 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/RmiMethodGenerator.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class index 810ce356a03..955983bf135 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.class b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.class index 1c267c9ae5e..b0e41604be1 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/rmic/SourceRmicCompiler.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet$EmailReplacement.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet$EmailReplacement.class new file mode 100644 index 00000000000..22248a243d2 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet$EmailReplacement.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet.class new file mode 100644 index 00000000000..53a734a8b11 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/AuthorTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CodeTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CodeTaglet.class new file mode 100644 index 00000000000..7fc603cbe03 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CodeTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CopyrightTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CopyrightTaglet.class new file mode 100644 index 00000000000..84f93434d11 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/CopyrightTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/DeprecatedTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/DeprecatedTaglet.class new file mode 100644 index 00000000000..3c9e77c20d0 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/DeprecatedTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GenericTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GenericTaglet.class new file mode 100644 index 00000000000..50ab7c08ca2 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GenericTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GnuExtendedTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GnuExtendedTaglet.class new file mode 100644 index 00000000000..b05eabb185d Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/GnuExtendedTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/SinceTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/SinceTaglet.class new file mode 100644 index 00000000000..2b99746265f Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/SinceTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/TagletContext.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/TagletContext.class new file mode 100644 index 00000000000..2e6377b0659 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/TagletContext.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/ValueTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/ValueTaglet.class new file mode 100644 index 00000000000..aae85fb4604 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/ValueTaglet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/VersionTaglet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/VersionTaglet.class new file mode 100644 index 00000000000..28bb7c98c90 Binary files /dev/null and b/libjava/classpath/tools/classes/gnu/classpath/tools/taglets/VersionTaglet.class differ diff --git a/libjava/classpath/tools/com/sun/tools/javadoc/Main.java b/libjava/classpath/tools/com/sun/tools/javadoc/Main.java new file mode 100644 index 00000000000..28930301356 --- /dev/null +++ b/libjava/classpath/tools/com/sun/tools/javadoc/Main.java @@ -0,0 +1,9 @@ +package com.sun.tools.javadoc; + +public class Main +{ + public static void main(String[] args) + { + gnu.classpath.tools.gjdoc.Main.main(args); + } +} diff --git a/libjava/classpath/tools/gappletviewer.in b/libjava/classpath/tools/gappletviewer.in index 721078bb79c..d957e45648a 100644 --- a/libjava/classpath/tools/gappletviewer.in +++ b/libjava/classpath/tools/gappletviewer.in @@ -44,4 +44,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.appletviewer.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.appletviewer.Main "$@" diff --git a/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java new file mode 100644 index 00000000000..053f122f0b6 --- /dev/null +++ b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.java @@ -0,0 +1,1962 @@ +// $ANTLR 2.7.7 (20080530): "java-expression.g" -> "JavaLexer.java"$ + + package gnu.classpath.tools.gjdoc.expr; + +import java.io.InputStream; +import antlr.TokenStreamException; +import antlr.TokenStreamIOException; +import antlr.TokenStreamRecognitionException; +import antlr.CharStreamException; +import antlr.CharStreamIOException; +import antlr.ANTLRException; +import java.io.Reader; +import java.util.Hashtable; +import antlr.CharScanner; +import antlr.InputBuffer; +import antlr.ByteBuffer; +import antlr.CharBuffer; +import antlr.Token; +import antlr.CommonToken; +import antlr.RecognitionException; +import antlr.NoViableAltForCharException; +import antlr.MismatchedCharException; +import antlr.TokenStream; +import antlr.ANTLRHashString; +import antlr.LexerSharedInputState; +import antlr.collections.impl.BitSet; +import antlr.SemanticException; + +public class JavaLexer extends antlr.CharScanner implements JavaTokenTypes, TokenStream + { +public JavaLexer(InputStream in) { + this(new ByteBuffer(in)); +} +public JavaLexer(Reader in) { + this(new CharBuffer(in)); +} +public JavaLexer(InputBuffer ib) { + this(new LexerSharedInputState(ib)); +} +public JavaLexer(LexerSharedInputState state) { + super(state); + caseSensitiveLiterals = true; + setCaseSensitive(true); + literals = new Hashtable(); + literals.put(new ANTLRHashString("String", this), new Integer(55)); + literals.put(new ANTLRHashString("final", this), new Integer(39)); + literals.put(new ANTLRHashString("false", this), new Integer(84)); + literals.put(new ANTLRHashString("true", this), new Integer(83)); + literals.put(new ANTLRHashString("void", this), new Integer(46)); + literals.put(new ANTLRHashString("float", this), new Integer(52)); + literals.put(new ANTLRHashString("boolean", this), new Integer(47)); + literals.put(new ANTLRHashString("long", this), new Integer(53)); + literals.put(new ANTLRHashString("null", this), new Integer(85)); + literals.put(new ANTLRHashString("short", this), new Integer(50)); + literals.put(new ANTLRHashString("char", this), new Integer(49)); + literals.put(new ANTLRHashString("abstract", this), new Integer(40)); + literals.put(new ANTLRHashString("byte", this), new Integer(48)); + literals.put(new ANTLRHashString("int", this), new Integer(51)); + literals.put(new ANTLRHashString("double", this), new Integer(54)); + literals.put(new ANTLRHashString("strictfp", this), new Integer(41)); +} + +public Token nextToken() throws TokenStreamException { + Token theRetToken=null; +tryAgain: + for (;;) { + Token _token = null; + int _ttype = Token.INVALID_TYPE; + resetText(); + try { // for char stream error handling + try { // for lexical error handling + switch ( LA(1)) { + case '?': + { + mQUESTION(true); + theRetToken=_returnToken; + break; + } + case '(': + { + mLPAREN(true); + theRetToken=_returnToken; + break; + } + case ')': + { + mRPAREN(true); + theRetToken=_returnToken; + break; + } + case '[': + { + mLBRACK(true); + theRetToken=_returnToken; + break; + } + case ']': + { + mRBRACK(true); + theRetToken=_returnToken; + break; + } + case '{': + { + mLCURLY(true); + theRetToken=_returnToken; + break; + } + case '}': + { + mRCURLY(true); + theRetToken=_returnToken; + break; + } + case ':': + { + mCOLON(true); + theRetToken=_returnToken; + break; + } + case ',': + { + mCOMMA(true); + theRetToken=_returnToken; + break; + } + case '~': + { + mBNOT(true); + theRetToken=_returnToken; + break; + } + case ';': + { + mSEMI(true); + theRetToken=_returnToken; + break; + } + case '\t': case '\n': case '\u000c': case '\r': + case ' ': + { + mWS(true); + theRetToken=_returnToken; + break; + } + case '\'': + { + mCHAR_LITERAL(true); + theRetToken=_returnToken; + break; + } + case '"': + { + mSTRING_LITERAL(true); + theRetToken=_returnToken; + break; + } + case '$': case 'A': case 'B': case 'C': + case 'D': case 'E': case 'F': case 'G': + case 'H': case 'I': case 'J': case 'K': + case 'L': case 'M': case 'N': case 'O': + case 'P': case 'Q': case 'R': case 'S': + case 'T': case 'U': case 'V': case 'W': + case 'X': case 'Y': case 'Z': case '_': + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': case 'g': case 'h': + case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': + case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + { + mIDENT(true); + theRetToken=_returnToken; + break; + } + case '.': case '0': case '1': case '2': + case '3': case '4': case '5': case '6': + case '7': case '8': case '9': + { + mNUM_INT(true); + theRetToken=_returnToken; + break; + } + default: + if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (LA(4)=='=')) { + mBSR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='=')) { + mSR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='>') && (LA(3)=='>') && (true)) { + mBSR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='<') && (LA(3)=='=')) { + mSL_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='=') && (LA(2)=='=')) { + mEQUAL(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='!') && (LA(2)=='=')) { + mNOT_EQUAL(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='=')) { + mDIV_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (LA(2)=='=')) { + mPLUS_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (LA(2)=='+')) { + mINC(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='=')) { + mMINUS_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (LA(2)=='-')) { + mDEC(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='*') && (LA(2)=='=')) { + mSTAR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='%') && (LA(2)=='=')) { + mMOD_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='>') && (true)) { + mSR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (LA(2)=='=')) { + mGE(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='<') && (true)) { + mSL(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (LA(2)=='=')) { + mLE(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='^') && (LA(2)=='=')) { + mBXOR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (LA(2)=='=')) { + mBOR_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (LA(2)=='|')) { + mLOR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (LA(2)=='=')) { + mBAND_ASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (LA(2)=='&')) { + mLAND(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='/')) { + mSL_COMMIT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (LA(2)=='*')) { + mML_COMMENT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='=') && (true)) { + mASSIGN(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='!') && (true)) { + mLNOT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='/') && (true)) { + mDIV(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='+') && (true)) { + mPLUS(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='-') && (true)) { + mMINUS(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='*') && (true)) { + mSTAR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='%') && (true)) { + mMOD(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='>') && (true)) { + mGT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='<') && (true)) { + mLT(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='^') && (true)) { + mBXOR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='|') && (true)) { + mBOR(true); + theRetToken=_returnToken; + } + else if ((LA(1)=='&') && (true)) { + mBAND(true); + theRetToken=_returnToken; + } + else { + if (LA(1)==EOF_CHAR) {uponEOF(); _returnToken = makeToken(Token.EOF_TYPE);} + else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + if ( _returnToken==null ) continue tryAgain; // found SKIP token + _ttype = _returnToken.getType(); + _returnToken.setType(_ttype); + return _returnToken; + } + catch (RecognitionException e) { + throw new TokenStreamRecognitionException(e); + } + } + catch (CharStreamException cse) { + if ( cse instanceof CharStreamIOException ) { + throw new TokenStreamIOException(((CharStreamIOException)cse).io); + } + else { + throw new TokenStreamException(cse.getMessage()); + } + } + } +} + + public final void mQUESTION(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = QUESTION; + int _saveIndex; + + match('?'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LPAREN; + int _saveIndex; + + match('('); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRPAREN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RPAREN; + int _saveIndex; + + match(')'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LBRACK; + int _saveIndex; + + match('['); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRBRACK(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RBRACK; + int _saveIndex; + + match(']'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LCURLY; + int _saveIndex; + + match('{'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mRCURLY(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = RCURLY; + int _saveIndex; + + match('}'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCOLON(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = COLON; + int _saveIndex; + + match(':'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCOMMA(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = COMMA; + int _saveIndex; + + match(','); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = ASSIGN; + int _saveIndex; + + match('='); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mEQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = EQUAL; + int _saveIndex; + + match("=="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LNOT; + int _saveIndex; + + match('!'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBNOT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BNOT; + int _saveIndex; + + match('~'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mNOT_EQUAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = NOT_EQUAL; + int _saveIndex; + + match("!="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDIV(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DIV; + int _saveIndex; + + match('/'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDIV_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DIV_ASSIGN; + int _saveIndex; + + match("/="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPLUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PLUS; + int _saveIndex; + + match('+'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mPLUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = PLUS_ASSIGN; + int _saveIndex; + + match("+="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mINC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = INC; + int _saveIndex; + + match("++"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMINUS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MINUS; + int _saveIndex; + + match('-'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMINUS_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MINUS_ASSIGN; + int _saveIndex; + + match("-="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mDEC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = DEC; + int _saveIndex; + + match("--"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSTAR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = STAR; + int _saveIndex; + + match('*'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSTAR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = STAR_ASSIGN; + int _saveIndex; + + match("*="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMOD(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MOD; + int _saveIndex; + + match('%'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mMOD_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = MOD_ASSIGN; + int _saveIndex; + + match("%="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SR; + int _saveIndex; + + match(">>"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SR_ASSIGN; + int _saveIndex; + + match(">>="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBSR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BSR; + int _saveIndex; + + match(">>>"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBSR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BSR_ASSIGN; + int _saveIndex; + + match(">>>="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mGE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = GE; + int _saveIndex; + + match(">="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mGT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = GT; + int _saveIndex; + + match(">"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SL; + int _saveIndex; + + match("<<"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSL_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SL_ASSIGN; + int _saveIndex; + + match("<<="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLE(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LE; + int _saveIndex; + + match("<="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LT; + int _saveIndex; + + match('<'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBXOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BXOR; + int _saveIndex; + + match('^'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBXOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BXOR_ASSIGN; + int _saveIndex; + + match("^="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BOR; + int _saveIndex; + + match('|'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBOR_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BOR_ASSIGN; + int _saveIndex; + + match("|="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLOR(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LOR; + int _saveIndex; + + match("||"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BAND; + int _saveIndex; + + match('&'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mBAND_ASSIGN(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = BAND_ASSIGN; + int _saveIndex; + + match("&="); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mLAND(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = LAND; + int _saveIndex; + + match("&&"); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSEMI(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SEMI; + int _saveIndex; + + match(';'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mWS(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = WS; + int _saveIndex; + + { + int _cnt105=0; + _loop105: + do { + switch ( LA(1)) { + case ' ': + { + match(' '); + break; + } + case '\t': + { + match('\t'); + break; + } + case '\u000c': + { + match('\f'); + break; + } + case '\n': case '\r': + { + { + if ((LA(1)=='\r') && (LA(2)=='\n') && (true) && (true)) { + match("\r\n"); + } + else if ((LA(1)=='\r') && (true) && (true) && (true)) { + match('\r'); + } + else if ((LA(1)=='\n')) { + match('\n'); + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + if ( inputState.guessing==0 ) { + newline(); + } + break; + } + default: + { + if ( _cnt105>=1 ) { break _loop105; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + } + _cnt105++; + } while (true); + } + if ( inputState.guessing==0 ) { + _ttype = Token.SKIP; + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSL_COMMIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = SL_COMMIT; + int _saveIndex; + + match("//"); + { + _loop109: + do { + if ((_tokenSet_0.member(LA(1)))) { + { + match(_tokenSet_0); + } + } + else { + break _loop109; + } + + } while (true); + } + { + switch ( LA(1)) { + case '\n': + { + match('\n'); + break; + } + case '\r': + { + match('\r'); + { + if ((LA(1)=='\n')) { + match('\n'); + } + else { + } + + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + _ttype = Token.SKIP; newline(); + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mML_COMMENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = ML_COMMENT; + int _saveIndex; + + match("/*"); + { + _loop115: + do { + if ((LA(1)=='\r') && (LA(2)=='\n') && ((LA(3) >= '\u0003' && LA(3) <= '\uffff')) && ((LA(4) >= '\u0003' && LA(4) <= '\uffff'))) { + match('\r'); + match('\n'); + if ( inputState.guessing==0 ) { + newline(); + } + } + else if (((LA(1)=='*') && ((LA(2) >= '\u0003' && LA(2) <= '\uffff')) && ((LA(3) >= '\u0003' && LA(3) <= '\uffff')))&&( LA(2)!='/' )) { + match('*'); + } + else if ((LA(1)=='\r') && ((LA(2) >= '\u0003' && LA(2) <= '\uffff')) && ((LA(3) >= '\u0003' && LA(3) <= '\uffff')) && (true)) { + match('\r'); + if ( inputState.guessing==0 ) { + newline(); + } + } + else if ((LA(1)=='\n')) { + match('\n'); + if ( inputState.guessing==0 ) { + newline(); + } + } + else if ((_tokenSet_1.member(LA(1)))) { + { + match(_tokenSet_1); + } + } + else { + break _loop115; + } + + } while (true); + } + match("*/"); + if ( inputState.guessing==0 ) { + _ttype = Token.SKIP; + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mCHAR_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = CHAR_LITERAL; + int _saveIndex; + + match('\''); + { + if ((LA(1)=='\\')) { + mESC(false); + } + else if ((_tokenSet_2.member(LA(1)))) { + { + match(_tokenSet_2); + } + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + match('\''); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mESC(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = ESC; + int _saveIndex; + + match('\\'); + { + switch ( LA(1)) { + case 'n': + { + match('n'); + break; + } + case 'r': + { + match('r'); + break; + } + case 't': + { + match('t'); + break; + } + case 'b': + { + match('b'); + break; + } + case 'f': + { + match('f'); + break; + } + case '"': + { + match('"'); + break; + } + case '\'': + { + match('\''); + break; + } + case '\\': + { + match('\\'); + break; + } + case 'u': + { + { + int _cnt126=0; + _loop126: + do { + if ((LA(1)=='u')) { + match('u'); + } + else { + if ( _cnt126>=1 ) { break _loop126; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt126++; + } while (true); + } + mHEX_DIGIT(false); + mHEX_DIGIT(false); + mHEX_DIGIT(false); + mHEX_DIGIT(false); + break; + } + case '0': case '1': case '2': case '3': + { + matchRange('0','3'); + { + if (((LA(1) >= '0' && LA(1) <= '7')) && (_tokenSet_0.member(LA(2))) && (true) && (true)) { + matchRange('0','7'); + { + if (((LA(1) >= '0' && LA(1) <= '7')) && (_tokenSet_0.member(LA(2))) && (true) && (true)) { + matchRange('0','7'); + } + else if ((_tokenSet_0.member(LA(1))) && (true) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + } + else if ((_tokenSet_0.member(LA(1))) && (true) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + break; + } + case '4': case '5': case '6': case '7': + { + matchRange('4','7'); + { + if (((LA(1) >= '0' && LA(1) <= '7')) && (_tokenSet_0.member(LA(2))) && (true) && (true)) { + matchRange('0','7'); + } + else if ((_tokenSet_0.member(LA(1))) && (true) && (true) && (true)) { + } + else { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mSTRING_LITERAL(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = STRING_LITERAL; + int _saveIndex; + + match('"'); + { + _loop122: + do { + if ((LA(1)=='\\')) { + mESC(false); + } + else if ((_tokenSet_3.member(LA(1)))) { + { + match(_tokenSet_3); + } + } + else { + break _loop122; + } + + } while (true); + } + match('"'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mHEX_DIGIT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = HEX_DIGIT; + int _saveIndex; + + { + switch ( LA(1)) { + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + matchRange('0','9'); + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': + { + matchRange('A','F'); + break; + } + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': + { + matchRange('a','f'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mVOCAB(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = VOCAB; + int _saveIndex; + + matchRange('\3','\377'); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mIDENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = IDENT; + int _saveIndex; + + { + switch ( LA(1)) { + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': case 'g': case 'h': + case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': + case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + { + matchRange('a','z'); + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': case 'G': case 'H': + case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': + case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + { + matchRange('A','Z'); + break; + } + case '_': + { + match('_'); + break; + } + case '$': + { + match('$'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + _loop136: + do { + switch ( LA(1)) { + case 'a': case 'b': case 'c': case 'd': + case 'e': case 'f': case 'g': case 'h': + case 'i': case 'j': case 'k': case 'l': + case 'm': case 'n': case 'o': case 'p': + case 'q': case 'r': case 's': case 't': + case 'u': case 'v': case 'w': case 'x': + case 'y': case 'z': + { + matchRange('a','z'); + break; + } + case 'A': case 'B': case 'C': case 'D': + case 'E': case 'F': case 'G': case 'H': + case 'I': case 'J': case 'K': case 'L': + case 'M': case 'N': case 'O': case 'P': + case 'Q': case 'R': case 'S': case 'T': + case 'U': case 'V': case 'W': case 'X': + case 'Y': case 'Z': + { + matchRange('A','Z'); + break; + } + case '_': + { + match('_'); + break; + } + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + matchRange('0','9'); + break; + } + case '$': + { + match('$'); + break; + } + default: + { + break _loop136; + } + } + } while (true); + } + _ttype = testLiteralsTable(_ttype); + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + public final void mNUM_INT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = NUM_INT; + int _saveIndex; + Token f1=null; + Token f2=null; + Token f3=null; + Token f4=null; + boolean isDecimal=false; Token t=null; + + switch ( LA(1)) { + case '.': + { + match('.'); + if ( inputState.guessing==0 ) { + _ttype = DOT; + } + { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + { + int _cnt140=0; + _loop140: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + matchRange('0','9'); + } + else { + if ( _cnt140>=1 ) { break _loop140; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt140++; + } while (true); + } + { + if ((LA(1)=='E'||LA(1)=='e')) { + mEXPONENT(false); + } + else { + } + + } + { + if ((LA(1)=='D'||LA(1)=='F'||LA(1)=='d'||LA(1)=='f')) { + mFLOAT_SUFFIX(true); + f1=_returnToken; + if ( inputState.guessing==0 ) { + t=f1; + } + } + else { + } + + } + if ( inputState.guessing==0 ) { + + if (t != null && t.getText().toUpperCase().indexOf('F')>=0) { + _ttype = NUM_FLOAT; + } + else { + _ttype = NUM_DOUBLE; // assume double + } + + } + } + else { + } + + } + break; + } + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + { + switch ( LA(1)) { + case '0': + { + match('0'); + if ( inputState.guessing==0 ) { + isDecimal = true; + } + { + if ((LA(1)=='X'||LA(1)=='x')) { + { + switch ( LA(1)) { + case 'x': + { + match('x'); + break; + } + case 'X': + { + match('X'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt147=0; + _loop147: + do { + if ((_tokenSet_4.member(LA(1))) && (true) && (true) && (true)) { + mHEX_DIGIT(false); + } + else { + if ( _cnt147>=1 ) { break _loop147; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt147++; + } while (true); + } + } + else { + boolean synPredMatched152 = false; + if ((((LA(1) >= '0' && LA(1) <= '9')) && (true) && (true) && (true))) { + int _m152 = mark(); + synPredMatched152 = true; + inputState.guessing++; + try { + { + { + int _cnt150=0; + _loop150: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + matchRange('0','9'); + } + else { + if ( _cnt150>=1 ) { break _loop150; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt150++; + } while (true); + } + { + switch ( LA(1)) { + case '.': + { + match('.'); + break; + } + case 'E': case 'e': + { + mEXPONENT(false); + break; + } + case 'D': case 'F': case 'd': case 'f': + { + mFLOAT_SUFFIX(false); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + } + } + catch (RecognitionException pe) { + synPredMatched152 = false; + } + rewind(_m152); +inputState.guessing--; + } + if ( synPredMatched152 ) { + { + int _cnt154=0; + _loop154: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + matchRange('0','9'); + } + else { + if ( _cnt154>=1 ) { break _loop154; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt154++; + } while (true); + } + } + else if (((LA(1) >= '0' && LA(1) <= '7')) && (true) && (true) && (true)) { + { + int _cnt156=0; + _loop156: + do { + if (((LA(1) >= '0' && LA(1) <= '7'))) { + matchRange('0','7'); + } + else { + if ( _cnt156>=1 ) { break _loop156; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt156++; + } while (true); + } + } + else { + } + } + } + break; + } + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': + case '9': + { + { + matchRange('1','9'); + } + { + _loop159: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + matchRange('0','9'); + } + else { + break _loop159; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + isDecimal=true; + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + if ((LA(1)=='L'||LA(1)=='l')) { + { + switch ( LA(1)) { + case 'l': + { + match('l'); + break; + } + case 'L': + { + match('L'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + _ttype = NUM_LONG; + } + } + else if (((LA(1)=='.'||LA(1)=='D'||LA(1)=='E'||LA(1)=='F'||LA(1)=='d'||LA(1)=='e'||LA(1)=='f'))&&(isDecimal)) { + { + switch ( LA(1)) { + case '.': + { + match('.'); + { + _loop164: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + matchRange('0','9'); + } + else { + break _loop164; + } + + } while (true); + } + { + if ((LA(1)=='E'||LA(1)=='e')) { + mEXPONENT(false); + } + else { + } + + } + { + if ((LA(1)=='D'||LA(1)=='F'||LA(1)=='d'||LA(1)=='f')) { + mFLOAT_SUFFIX(true); + f2=_returnToken; + if ( inputState.guessing==0 ) { + t=f2; + } + } + else { + } + + } + break; + } + case 'E': case 'e': + { + mEXPONENT(false); + { + if ((LA(1)=='D'||LA(1)=='F'||LA(1)=='d'||LA(1)=='f')) { + mFLOAT_SUFFIX(true); + f3=_returnToken; + if ( inputState.guessing==0 ) { + t=f3; + } + } + else { + } + + } + break; + } + case 'D': case 'F': case 'd': case 'f': + { + mFLOAT_SUFFIX(true); + f4=_returnToken; + if ( inputState.guessing==0 ) { + t=f4; + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + if ( inputState.guessing==0 ) { + + if (t != null && t.getText().toUpperCase() .indexOf('F') >= 0) { + _ttype = NUM_FLOAT; + } + else { + _ttype = NUM_DOUBLE; // assume double + } + + } + } + else { + } + + } + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mEXPONENT(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = EXPONENT; + int _saveIndex; + + { + switch ( LA(1)) { + case 'e': + { + match('e'); + break; + } + case 'E': + { + match('E'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + switch ( LA(1)) { + case '+': + { + match('+'); + break; + } + case '-': + { + match('-'); + break; + } + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + case '8': case '9': + { + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + } + { + int _cnt172=0; + _loop172: + do { + if (((LA(1) >= '0' && LA(1) <= '9'))) { + matchRange('0','9'); + } + else { + if ( _cnt172>=1 ) { break _loop172; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());} + } + + _cnt172++; + } while (true); + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + protected final void mFLOAT_SUFFIX(boolean _createToken) throws RecognitionException, CharStreamException, TokenStreamException { + int _ttype; Token _token=null; int _begin=text.length(); + _ttype = FLOAT_SUFFIX; + int _saveIndex; + + switch ( LA(1)) { + case 'f': + { + match('f'); + break; + } + case 'F': + { + match('F'); + break; + } + case 'd': + { + match('d'); + break; + } + case 'D': + { + match('D'); + break; + } + default: + { + throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn()); + } + } + if ( _createToken && _token==null && _ttype!=Token.SKIP ) { + _token = makeToken(_ttype); + _token.setText(new String(text.getBuffer(), _begin, text.length()-_begin)); + } + _returnToken = _token; + } + + + private static final long[] mk_tokenSet_0() { + long[] data = new long[2048]; + data[0]=-9224L; + for (int i = 1; i<=1023; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = new long[2048]; + data[0]=-4398046520328L; + for (int i = 1; i<=1023; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + private static final long[] mk_tokenSet_2() { + long[] data = new long[2048]; + data[0]=-549755823112L; + data[1]=-268435457L; + for (int i = 2; i<=1023; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_2 = new BitSet(mk_tokenSet_2()); + private static final long[] mk_tokenSet_3() { + long[] data = new long[2048]; + data[0]=-17179878408L; + data[1]=-268435457L; + for (int i = 2; i<=1023; i++) { data[i]=-1L; } + return data; + } + public static final BitSet _tokenSet_3 = new BitSet(mk_tokenSet_3()); + private static final long[] mk_tokenSet_4() { + long[] data = new long[1025]; + data[0]=287948901175001088L; + data[1]=541165879422L; + return data; + } + public static final BitSet _tokenSet_4 = new BitSet(mk_tokenSet_4()); + + } diff --git a/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.smap b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.smap new file mode 100644 index 00000000000..045e3e308ea --- /dev/null +++ b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaLexer.smap @@ -0,0 +1,1280 @@ +SMAP +JavaLexer.java +G +*S G +*F ++ 0 java-expression.g +java-expression.g +*L +0:75 +0:81 +0:87 +0:93 +0:99 +0:105 +0:111 +0:117 +0:123 +0:129 +0:135 +0:142 +0:148 +0:154 +0:173 +0:181 +0:187 +0:191 +0:195 +0:199 +0:203 +0:207 +0:211 +0:215 +0:219 +0:223 +0:227 +0:231 +0:235 +0:239 +0:243 +0:247 +0:251 +0:255 +0:259 +0:263 +0:267 +0:271 +0:275 +0:279 +0:283 +0:287 +0:291 +0:295 +0:299 +0:303 +0:307 +0:311 +0:315 +0:319 +0:323 +0:327 +19:3 +231:355 +231:356 +231:357 +231:358 +231:360 +231:361 +231:362 +231:363 +231:364 +231:365 +231:366 +232:368 +232:369 +232:370 +232:371 +232:373 +232:374 +232:375 +232:376 +232:377 +232:378 +232:379 +233:381 +233:382 +233:383 +233:384 +233:386 +233:387 +233:388 +233:389 +233:390 +233:391 +233:392 +234:394 +234:395 +234:396 +234:397 +234:399 +234:400 +234:401 +234:402 +234:403 +234:404 +234:405 +235:407 +235:408 +235:409 +235:410 +235:412 +235:413 +235:414 +235:415 +235:416 +235:417 +235:418 +236:420 +236:421 +236:422 +236:423 +236:425 +236:426 +236:427 +236:428 +236:429 +236:430 +236:431 +237:433 +237:434 +237:435 +237:436 +237:438 +237:439 +237:440 +237:441 +237:442 +237:443 +237:444 +238:446 +238:447 +238:448 +238:449 +238:451 +238:452 +238:453 +238:454 +238:455 +238:456 +238:457 +239:459 +239:460 +239:461 +239:462 +239:464 +239:465 +239:466 +239:467 +239:468 +239:469 +239:470 +241:472 +241:473 +241:474 +241:475 +241:477 +241:478 +241:479 +241:480 +241:481 +241:482 +241:483 +242:485 +242:486 +242:487 +242:488 +242:490 +242:491 +242:492 +242:493 +242:494 +242:495 +242:496 +243:498 +243:499 +243:500 +243:501 +243:503 +243:504 +243:505 +243:506 +243:507 +243:508 +243:509 +244:511 +244:512 +244:513 +244:514 +244:516 +244:517 +244:518 +244:519 +244:520 +244:521 +244:522 +245:524 +245:525 +245:526 +245:527 +245:529 +245:530 +245:531 +245:532 +245:533 +245:534 +245:535 +246:537 +246:538 +246:539 +246:540 +246:542 +246:543 +246:544 +246:545 +246:546 +246:547 +246:548 +247:550 +247:551 +247:552 +247:553 +247:555 +247:556 +247:557 +247:558 +247:559 +247:560 +247:561 +248:563 +248:564 +248:565 +248:566 +248:568 +248:569 +248:570 +248:571 +248:572 +248:573 +248:574 +249:576 +249:577 +249:578 +249:579 +249:581 +249:582 +249:583 +249:584 +249:585 +249:586 +249:587 +250:589 +250:590 +250:591 +250:592 +250:594 +250:595 +250:596 +250:597 +250:598 +250:599 +250:600 +251:602 +251:603 +251:604 +251:605 +251:607 +251:608 +251:609 +251:610 +251:611 +251:612 +251:613 +252:615 +252:616 +252:617 +252:618 +252:620 +252:621 +252:622 +252:623 +252:624 +252:625 +252:626 +253:628 +253:629 +253:630 +253:631 +253:633 +253:634 +253:635 +253:636 +253:637 +253:638 +253:639 +254:641 +254:642 +254:643 +254:644 +254:646 +254:647 +254:648 +254:649 +254:650 +254:651 +254:652 +255:654 +255:655 +255:656 +255:657 +255:659 +255:660 +255:661 +255:662 +255:663 +255:664 +255:665 +256:667 +256:668 +256:669 +256:670 +256:672 +256:673 +256:674 +256:675 +256:676 +256:677 +256:678 +257:680 +257:681 +257:682 +257:683 +257:685 +257:686 +257:687 +257:688 +257:689 +257:690 +257:691 +258:693 +258:694 +258:695 +258:696 +258:698 +258:699 +258:700 +258:701 +258:702 +258:703 +258:704 +259:706 +259:707 +259:708 +259:709 +259:711 +259:712 +259:713 +259:714 +259:715 +259:716 +259:717 +260:719 +260:720 +260:721 +260:722 +260:724 +260:725 +260:726 +260:727 +260:728 +260:729 +260:730 +261:732 +261:733 +261:734 +261:735 +261:737 +261:738 +261:739 +261:740 +261:741 +261:742 +261:743 +262:745 +262:746 +262:747 +262:748 +262:750 +262:751 +262:752 +262:753 +262:754 +262:755 +262:756 +263:758 +263:759 +263:760 +263:761 +263:763 +263:764 +263:765 +263:766 +263:767 +263:768 +263:769 +264:771 +264:772 +264:773 +264:774 +264:776 +264:777 +264:778 +264:779 +264:780 +264:781 +264:782 +265:784 +265:785 +265:786 +265:787 +265:789 +265:790 +265:791 +265:792 +265:793 +265:794 +265:795 +266:797 +266:798 +266:799 +266:800 +266:802 +266:803 +266:804 +266:805 +266:806 +266:807 +266:808 +267:810 +267:811 +267:812 +267:813 +267:815 +267:816 +267:817 +267:818 +267:819 +267:820 +267:821 +268:823 +268:824 +268:825 +268:826 +268:828 +268:829 +268:830 +268:831 +268:832 +268:833 +268:834 +269:836 +269:837 +269:838 +269:839 +269:841 +269:842 +269:843 +269:844 +269:845 +269:846 +269:847 +270:849 +270:850 +270:851 +270:852 +270:854 +270:855 +270:856 +270:857 +270:858 +270:859 +270:860 +271:862 +271:863 +271:864 +271:865 +271:867 +271:868 +271:869 +271:870 +271:871 +271:872 +271:873 +272:875 +272:876 +272:877 +272:878 +272:880 +272:881 +272:882 +272:883 +272:884 +272:885 +272:886 +273:888 +273:889 +273:890 +273:891 +273:893 +273:894 +273:895 +273:896 +273:897 +273:898 +273:899 +274:901 +274:902 +274:903 +274:904 +274:906 +274:907 +274:908 +274:909 +274:910 +274:911 +274:912 +275:914 +275:915 +275:916 +275:917 +275:919 +275:920 +275:921 +275:922 +275:923 +275:924 +275:925 +276:927 +276:928 +276:929 +276:930 +276:932 +276:933 +276:934 +276:935 +276:936 +276:937 +276:938 +280:940 +280:941 +280:942 +280:943 +280:946 +280:947 +280:948 +280:949 +280:950 +280:951 +280:952 +280:987 +280:988 +280:989 +280:990 +280:991 +280:992 +280:993 +280:994 +280:998 +280:999 +280:1000 +280:1001 +280:1002 +280:1003 +281:955 +281:956 +281:957 +282:960 +282:961 +282:962 +284:965 +284:966 +284:970 +284:973 +284:976 +284:977 +284:978 +284:979 +285:968 +285:969 +286:971 +286:972 +287:974 +287:975 +289:982 +289:983 +291:995 +291:996 +295:1005 +295:1006 +295:1007 +295:1008 +295:1054 +295:1055 +295:1056 +295:1057 +295:1058 +295:1059 +296:1010 +297:1011 +297:1012 +297:1013 +297:1014 +297:1016 +297:1018 +297:1019 +297:1020 +297:1021 +297:1023 +297:1024 +297:1026 +297:1027 +297:1028 +297:1029 +297:1032 +297:1033 +297:1034 +297:1036 +297:1037 +297:1038 +297:1040 +297:1045 +297:1046 +297:1047 +297:1048 +297:1049 +298:1051 +298:1052 +302:1061 +302:1062 +302:1063 +302:1064 +302:1107 +302:1108 +302:1109 +302:1110 +302:1111 +302:1112 +303:1066 +304:1067 +304:1068 +304:1069 +304:1076 +304:1079 +304:1085 +304:1091 +304:1096 +304:1097 +304:1098 +304:1099 +304:1101 +304:1102 +315:1077 +315:1078 +316:1070 +316:1071 +316:1072 +316:1073 +316:1074 +317:1080 +317:1081 +317:1082 +317:1083 +318:1086 +318:1087 +318:1088 +318:1089 +319:1092 +319:1094 +321:1103 +322:1104 +322:1105 +327:1114 +327:1115 +327:1116 +327:1117 +327:1135 +327:1136 +327:1137 +327:1138 +327:1139 +327:1140 +328:1119 +328:1121 +328:1122 +328:1123 +328:1124 +328:1126 +328:1128 +328:1129 +328:1130 +328:1131 +328:1134 +332:1268 +332:1269 +332:1270 +332:1271 +332:1292 +332:1293 +332:1294 +332:1295 +332:1296 +332:1297 +333:1273 +333:1274 +333:1275 +333:1276 +333:1277 +333:1278 +333:1279 +333:1280 +333:1282 +333:1284 +333:1285 +333:1286 +333:1287 +333:1289 +333:1290 +333:1291 +346:1142 +346:1143 +346:1144 +346:1145 +346:1261 +346:1262 +346:1263 +346:1264 +346:1265 +346:1266 +347:1147 +348:1149 +348:1150 +348:1151 +348:1152 +348:1255 +348:1256 +348:1257 +348:1258 +348:1259 +349:1155 +349:1156 +349:1157 +350:1160 +350:1161 +350:1162 +351:1165 +351:1166 +351:1167 +352:1170 +352:1171 +352:1172 +353:1175 +353:1176 +353:1177 +354:1180 +354:1181 +354:1182 +355:1185 +355:1186 +355:1187 +356:1190 +356:1191 +356:1193 +356:1194 +356:1195 +356:1196 +356:1197 +356:1198 +356:1199 +356:1200 +356:1201 +356:1203 +356:1204 +356:1205 +356:1206 +356:1207 +356:1208 +356:1209 +357:1212 +357:1213 +357:1214 +358:1229 +358:1231 +358:1232 +358:1233 +358:1234 +362:1216 +362:1217 +363:1221 +363:1223 +363:1224 +363:1225 +363:1226 +367:1219 +367:1220 +370:1239 +370:1240 +370:1241 +371:1245 +371:1247 +371:1248 +371:1249 +371:1250 +375:1243 +375:1244 +383:1299 +383:1300 +383:1301 +383:1302 +383:1331 +383:1332 +383:1333 +383:1334 +383:1335 +383:1336 +384:1305 +384:1306 +384:1307 +384:1308 +384:1309 +384:1310 +384:1313 +384:1314 +384:1315 +384:1316 +384:1319 +384:1320 +384:1321 +384:1322 +384:1325 +384:1326 +384:1327 +384:1328 +384:1329 +391:1338 +391:1339 +391:1340 +391:1341 +391:1344 +391:1345 +391:1346 +391:1347 +391:1348 +391:1349 +392:1343 +399:1351 +399:1352 +399:1353 +399:1354 +399:1446 +399:1447 +399:1448 +399:1449 +399:1450 +399:1451 +399:1452 +401:1357 +401:1358 +401:1359 +401:1360 +401:1361 +401:1362 +401:1363 +401:1364 +401:1365 +401:1366 +401:1369 +401:1370 +401:1371 +401:1372 +401:1373 +401:1374 +401:1375 +401:1376 +401:1377 +401:1380 +401:1381 +401:1382 +401:1385 +401:1386 +401:1387 +401:1390 +401:1391 +401:1392 +401:1393 +401:1394 +401:1396 +401:1397 +401:1398 +401:1399 +401:1400 +401:1401 +401:1402 +401:1403 +401:1404 +401:1405 +401:1406 +401:1407 +401:1408 +401:1411 +401:1412 +401:1413 +401:1414 +401:1415 +401:1416 +401:1417 +401:1418 +401:1419 +401:1422 +401:1423 +401:1424 +401:1427 +401:1428 +401:1429 +401:1430 +401:1431 +401:1434 +401:1435 +401:1436 +401:1439 +401:1440 +401:1441 +401:1442 +401:1443 +401:1444 +401:1445 +406:1454 +406:1455 +406:1456 +406:1457 +406:1462 +406:1464 +406:1805 +406:1806 +406:1807 +406:1808 +406:1809 +406:1810 +406:1811 +406:1812 +406:1813 +406:1814 +406:1815 +408:1465 +408:1466 +408:1467 +408:1468 +408:1469 +409:1458 +409:1472 +409:1474 +409:1475 +409:1476 +409:1477 +409:1478 +409:1479 +409:1480 +409:1481 +409:1482 +409:1484 +409:1485 +409:1486 +409:1488 +409:1489 +409:1490 +409:1492 +409:1496 +409:1497 +409:1498 +409:1499 +409:1500 +409:1502 +409:1504 +409:1517 +409:1519 +410:1507 +411:1509 +412:1510 +413:1511 +414:1512 +415:1513 +416:1514 +420:1524 +420:1525 +420:1526 +420:1527 +420:1529 +420:1530 +420:1531 +420:1532 +420:1533 +420:1534 +420:1686 +420:1687 +420:1688 +420:1689 +420:1690 +421:1537 +421:1539 +421:1540 +421:1541 +421:1542 +421:1545 +421:1546 +421:1547 +421:1550 +421:1551 +421:1552 +421:1553 +421:1554 +421:1570 +421:1639 +421:1655 +421:1657 +421:1658 +422:1557 +422:1558 +422:1559 +422:1562 +422:1563 +422:1564 +422:1565 +422:1567 +422:1568 +422:1569 +431:1560 +431:1561 +435:1571 +435:1572 +435:1573 +435:1574 +435:1575 +435:1576 +435:1577 +435:1580 +435:1581 +435:1582 +435:1583 +435:1584 +435:1585 +435:1586 +435:1587 +435:1588 +435:1590 +435:1591 +435:1592 +435:1594 +435:1595 +435:1596 +435:1597 +435:1600 +435:1601 +435:1602 +435:1605 +435:1606 +435:1607 +435:1610 +435:1611 +435:1612 +435:1613 +435:1614 +435:1617 +435:1618 +435:1619 +435:1620 +435:1621 +435:1622 +435:1623 +435:1624 +435:1626 +435:1627 +435:1628 +435:1629 +435:1630 +435:1631 +435:1632 +435:1633 +435:1634 +435:1636 +435:1637 +435:1638 +437:1640 +437:1642 +437:1643 +437:1644 +437:1645 +437:1646 +437:1647 +437:1648 +437:1649 +437:1650 +437:1652 +437:1653 +437:1654 +439:1662 +439:1663 +439:1664 +439:1665 +439:1667 +439:1669 +439:1670 +439:1671 +439:1672 +439:1673 +439:1674 +439:1675 +439:1676 +439:1677 +439:1679 +439:1680 +439:1681 +439:1682 +441:1693 +441:1695 +441:1696 +441:1697 +441:1698 +441:1701 +441:1702 +441:1703 +441:1706 +441:1707 +441:1708 +441:1709 +441:1710 +441:1712 +441:1713 +441:1715 +441:1798 +441:1800 +445:1459 +445:1716 +445:1718 +445:1719 +445:1720 +445:1721 +445:1722 +445:1723 +445:1724 +445:1725 +445:1726 +445:1727 +445:1728 +445:1729 +445:1730 +445:1732 +445:1733 +445:1735 +445:1736 +445:1737 +445:1739 +445:1743 +445:1744 +445:1745 +445:1746 +445:1747 +445:1749 +445:1751 +445:1782 +445:1783 +445:1784 +445:1785 +445:1786 +446:1460 +446:1756 +446:1757 +446:1758 +446:1760 +446:1761 +446:1762 +446:1763 +446:1764 +446:1766 +446:1768 +447:1461 +447:1773 +447:1774 +447:1775 +447:1776 +447:1777 +447:1778 +449:1788 +450:1790 +451:1791 +452:1792 +453:1793 +454:1794 +455:1795 +463:1817 +463:1818 +463:1819 +463:1820 +463:1878 +463:1879 +463:1880 +463:1881 +463:1882 +463:1883 +464:1823 +464:1824 +464:1825 +464:1826 +464:1829 +464:1830 +464:1831 +464:1834 +464:1835 +464:1836 +464:1837 +464:1838 +464:1841 +464:1842 +464:1843 +464:1844 +464:1847 +464:1848 +464:1849 +464:1858 +464:1859 +464:1860 +464:1861 +464:1862 +464:1865 +464:1866 +464:1867 +464:1868 +464:1869 +464:1870 +464:1871 +464:1872 +464:1873 +464:1875 +464:1876 +464:1877 +469:1885 +469:1886 +469:1887 +469:1888 +469:1890 +469:1911 +469:1912 +469:1913 +469:1914 +469:1915 +469:1916 +469:1917 +469:1918 +469:1919 +469:1920 +469:1921 +470:1891 +470:1892 +470:1893 +470:1896 +470:1897 +470:1898 +470:1901 +470:1902 +470:1903 +470:1906 +470:1907 +470:1908 +*E diff --git a/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.java b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.java new file mode 100644 index 00000000000..9dfc9db38a5 --- /dev/null +++ b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.java @@ -0,0 +1,1406 @@ +// $ANTLR 2.7.7 (20080530): "java-expression.g" -> "JavaRecognizer.java"$ + + package gnu.classpath.tools.gjdoc.expr; + +import antlr.TokenBuffer; +import antlr.TokenStreamException; +import antlr.TokenStreamIOException; +import antlr.ANTLRException; +import antlr.LLkParser; +import antlr.Token; +import antlr.TokenStream; +import antlr.RecognitionException; +import antlr.NoViableAltException; +import antlr.MismatchedTokenException; +import antlr.SemanticException; +import antlr.ParserSharedInputState; +import antlr.collections.impl.BitSet; +import antlr.collections.AST; +import java.util.Hashtable; +import antlr.ASTFactory; +import antlr.ASTPair; +import antlr.collections.impl.ASTArray; + +public class JavaRecognizer extends antlr.LLkParser implements JavaTokenTypes + { + +protected JavaRecognizer(TokenBuffer tokenBuf, int k) { + super(tokenBuf,k); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + +public JavaRecognizer(TokenBuffer tokenBuf) { + this(tokenBuf,2); +} + +protected JavaRecognizer(TokenStream lexer, int k) { + super(lexer,k); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + +public JavaRecognizer(TokenStream lexer) { + this(lexer,2); +} + +public JavaRecognizer(ParserSharedInputState state) { + super(state,2); + tokenNames = _tokenNames; + buildTokenTypeASTClassMap(); + astFactory = new ASTFactory(getTokenTypeToASTClassMap()); +} + + public final Type builtInTypeSpec( + boolean addImagNode + ) throws RecognitionException, TokenStreamException { + Type t = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST builtInTypeSpec_AST = null; + Token lb = null; + AST lb_AST = null; + + t=builtInType(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop3: + do { + if ((LA(1)==LBRACK)) { + lb = LT(1); + lb_AST = astFactory.create(lb); + astFactory.makeASTRoot(currentAST, lb_AST); + match(LBRACK); + if ( inputState.guessing==0 ) { + lb_AST.setType(ARRAY_DECLARATOR); + } + match(RBRACK); + } + else { + break _loop3; + } + + } while (true); + } + if ( inputState.guessing==0 ) { + builtInTypeSpec_AST = (AST)currentAST.root; + + if ( addImagNode ) { + builtInTypeSpec_AST = (AST)astFactory.make( (new ASTArray(2)).add(astFactory.create(TYPE,"TYPE")).add(builtInTypeSpec_AST)); + } + + currentAST.root = builtInTypeSpec_AST; + currentAST.child = builtInTypeSpec_AST!=null &&builtInTypeSpec_AST.getFirstChild()!=null ? + builtInTypeSpec_AST.getFirstChild() : builtInTypeSpec_AST; + currentAST.advanceChildToEnd(); + } + builtInTypeSpec_AST = (AST)currentAST.root; + returnAST = builtInTypeSpec_AST; + return t; + } + + public final Type builtInType() throws RecognitionException, TokenStreamException { + Type t = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST builtInType_AST = null; + + switch ( LA(1)) { + case LITERAL_void: + { + AST tmp2_AST = null; + tmp2_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp2_AST); + match(LITERAL_void); + if ( inputState.guessing==0 ) { + t=Type.VOID; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_boolean: + { + AST tmp3_AST = null; + tmp3_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp3_AST); + match(LITERAL_boolean); + if ( inputState.guessing==0 ) { + t=Type.BOOLEAN; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_byte: + { + AST tmp4_AST = null; + tmp4_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp4_AST); + match(LITERAL_byte); + if ( inputState.guessing==0 ) { + t=Type.BYTE; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_char: + { + AST tmp5_AST = null; + tmp5_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp5_AST); + match(LITERAL_char); + if ( inputState.guessing==0 ) { + t=Type.CHAR; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_short: + { + AST tmp6_AST = null; + tmp6_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp6_AST); + match(LITERAL_short); + if ( inputState.guessing==0 ) { + t=Type.SHORT; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_int: + { + AST tmp7_AST = null; + tmp7_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp7_AST); + match(LITERAL_int); + if ( inputState.guessing==0 ) { + t=Type.INTEGER; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_float: + { + AST tmp8_AST = null; + tmp8_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp8_AST); + match(LITERAL_float); + if ( inputState.guessing==0 ) { + t=Type.FLOAT; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_long: + { + AST tmp9_AST = null; + tmp9_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp9_AST); + match(LITERAL_long); + if ( inputState.guessing==0 ) { + t=Type.LONG; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_double: + { + AST tmp10_AST = null; + tmp10_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp10_AST); + match(LITERAL_double); + if ( inputState.guessing==0 ) { + t=Type.DOUBLE; + } + builtInType_AST = (AST)currentAST.root; + break; + } + case LITERAL_String: + { + AST tmp11_AST = null; + tmp11_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp11_AST); + match(LITERAL_String); + if ( inputState.guessing==0 ) { + t=Type.STRING; + } + builtInType_AST = (AST)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = builtInType_AST; + return t; + } + + public final Type type() throws RecognitionException, TokenStreamException { + Type t; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST type_AST = null; + + t=builtInType(); + astFactory.addASTChild(currentAST, returnAST); + type_AST = (AST)currentAST.root; + returnAST = type_AST; + return t; + } + + public final String identifier() throws RecognitionException, TokenStreamException { + String s = null;; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST identifier_AST = null; + Token i = null; + AST i_AST = null; + Token i2 = null; + AST i2_AST = null; + + i = LT(1); + i_AST = astFactory.create(i); + astFactory.addASTChild(currentAST, i_AST); + match(IDENT); + if ( inputState.guessing==0 ) { + s=i.getText(); + } + { + _loop8: + do { + if ((LA(1)==DOT)) { + AST tmp12_AST = null; + tmp12_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp12_AST); + match(DOT); + i2 = LT(1); + i2_AST = astFactory.create(i2); + astFactory.addASTChild(currentAST, i2_AST); + match(IDENT); + if ( inputState.guessing==0 ) { + s+="."+i2.getText(); + } + } + else { + break _loop8; + } + + } while (true); + } + identifier_AST = (AST)currentAST.root; + returnAST = identifier_AST; + return s; + } + + public final Expression expression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST expression_AST = null; + + e=conditionalExpression(); + astFactory.addASTChild(currentAST, returnAST); + match(Token.EOF_TYPE); + expression_AST = (AST)currentAST.root; + returnAST = expression_AST; + return e; + } + + public final Expression conditionalExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST conditionalExpression_AST = null; + Expression a,b,c; + + e=logicalOrExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + switch ( LA(1)) { + case QUESTION: + { + AST tmp14_AST = null; + tmp14_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp14_AST); + match(QUESTION); + b=conditionalExpression(); + astFactory.addASTChild(currentAST, returnAST); + match(COLON); + c=conditionalExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new ConditionalExpression(e,b,c); + } + break; + } + case EOF: + case COLON: + case RPAREN: + { + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + conditionalExpression_AST = (AST)currentAST.root; + returnAST = conditionalExpression_AST; + return e; + } + + public final Expression logicalOrExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST logicalOrExpression_AST = null; + Expression a,b; + + e=logicalAndExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop14: + do { + if ((LA(1)==LOR)) { + AST tmp16_AST = null; + tmp16_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp16_AST); + match(LOR); + b=logicalAndExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new LogicalOrExpression(e,b); + } + } + else { + break _loop14; + } + + } while (true); + } + logicalOrExpression_AST = (AST)currentAST.root; + returnAST = logicalOrExpression_AST; + return e; + } + + public final Expression logicalAndExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST logicalAndExpression_AST = null; + Expression a,b; + + e=inclusiveOrExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop17: + do { + if ((LA(1)==LAND)) { + AST tmp17_AST = null; + tmp17_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp17_AST); + match(LAND); + b=inclusiveOrExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new LogicalAndExpression(e,b); + } + } + else { + break _loop17; + } + + } while (true); + } + logicalAndExpression_AST = (AST)currentAST.root; + returnAST = logicalAndExpression_AST; + return e; + } + + public final Expression inclusiveOrExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST inclusiveOrExpression_AST = null; + Expression a,b; + + e=exclusiveOrExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop20: + do { + if ((LA(1)==BOR)) { + AST tmp18_AST = null; + tmp18_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp18_AST); + match(BOR); + b=exclusiveOrExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new InclusiveOrExpression(e,b); + } + } + else { + break _loop20; + } + + } while (true); + } + inclusiveOrExpression_AST = (AST)currentAST.root; + returnAST = inclusiveOrExpression_AST; + return e; + } + + public final Expression exclusiveOrExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST exclusiveOrExpression_AST = null; + Expression a,b; + + e=andExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop23: + do { + if ((LA(1)==BXOR)) { + AST tmp19_AST = null; + tmp19_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp19_AST); + match(BXOR); + b=andExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new ExclusiveOrExpression(e,b); + } + } + else { + break _loop23; + } + + } while (true); + } + exclusiveOrExpression_AST = (AST)currentAST.root; + returnAST = exclusiveOrExpression_AST; + return e; + } + + public final Expression andExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST andExpression_AST = null; + Expression a,b; + + e=equalityExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop26: + do { + if ((LA(1)==BAND)) { + AST tmp20_AST = null; + tmp20_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp20_AST); + match(BAND); + b=equalityExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new AndExpression(e,b); + } + } + else { + break _loop26; + } + + } while (true); + } + andExpression_AST = (AST)currentAST.root; + returnAST = andExpression_AST; + return e; + } + + public final Expression equalityExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST equalityExpression_AST = null; + Expression a,b; + + e=relationalExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop30: + do { + if ((LA(1)==NOT_EQUAL||LA(1)==EQUAL)) { + { + switch ( LA(1)) { + case NOT_EQUAL: + { + AST tmp21_AST = null; + tmp21_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp21_AST); + match(NOT_EQUAL); + a=relationalExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new NotEqualExpression(e,a); + } + break; + } + case EQUAL: + { + AST tmp22_AST = null; + tmp22_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp22_AST); + match(EQUAL); + a=relationalExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new EqualExpression(e,a); + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + break _loop30; + } + + } while (true); + } + equalityExpression_AST = (AST)currentAST.root; + returnAST = equalityExpression_AST; + return e; + } + + public final Expression relationalExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST relationalExpression_AST = null; + Expression a,b; + + e=shiftExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + { + _loop35: + do { + if (((LA(1) >= LT && LA(1) <= GE))) { + { + switch ( LA(1)) { + case LT: + { + AST tmp23_AST = null; + tmp23_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp23_AST); + match(LT); + a=shiftExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new LessThanExpression(e,a); + } + break; + } + case GT: + { + AST tmp24_AST = null; + tmp24_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp24_AST); + match(GT); + a=shiftExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new GreaterThanExpression(e,a); + } + break; + } + case LE: + { + AST tmp25_AST = null; + tmp25_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp25_AST); + match(LE); + a=shiftExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new LessThanOrEqualExpression(e,a); + } + break; + } + case GE: + { + AST tmp26_AST = null; + tmp26_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp26_AST); + match(GE); + a=shiftExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new GreaterThanOrEqualExpression(e,a); + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + break _loop35; + } + + } while (true); + } + } + relationalExpression_AST = (AST)currentAST.root; + returnAST = relationalExpression_AST; + return e; + } + + public final Expression shiftExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST shiftExpression_AST = null; + Expression a,b; + + e=additiveExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop39: + do { + if (((LA(1) >= SL && LA(1) <= BSR))) { + { + switch ( LA(1)) { + case SL: + { + AST tmp27_AST = null; + tmp27_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp27_AST); + match(SL); + a=additiveExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new ShiftLeftExpression(e,a); + } + break; + } + case SR: + { + AST tmp28_AST = null; + tmp28_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp28_AST); + match(SR); + a=additiveExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new ShiftRightExpression(e,a); + } + break; + } + case BSR: + { + AST tmp29_AST = null; + tmp29_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp29_AST); + match(BSR); + a=additiveExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new BitShiftRightExpression(e,a); + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + break _loop39; + } + + } while (true); + } + shiftExpression_AST = (AST)currentAST.root; + returnAST = shiftExpression_AST; + return e; + } + + public final Expression additiveExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST additiveExpression_AST = null; + Expression a,b; + + e=multiplicativeExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop43: + do { + if ((LA(1)==PLUS||LA(1)==MINUS)) { + { + switch ( LA(1)) { + case PLUS: + { + AST tmp30_AST = null; + tmp30_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp30_AST); + match(PLUS); + a=multiplicativeExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new AdditionExpression(e,a); + } + break; + } + case MINUS: + { + AST tmp31_AST = null; + tmp31_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp31_AST); + match(MINUS); + a=multiplicativeExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new SubtractionExpression(e,a); + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + break _loop43; + } + + } while (true); + } + additiveExpression_AST = (AST)currentAST.root; + returnAST = additiveExpression_AST; + return e; + } + + public final Expression multiplicativeExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST multiplicativeExpression_AST = null; + Expression a,b; + + e=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + { + _loop47: + do { + if (((LA(1) >= STAR && LA(1) <= MOD))) { + { + switch ( LA(1)) { + case STAR: + { + AST tmp32_AST = null; + tmp32_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp32_AST); + match(STAR); + a=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new MultiplicationExpression(e,a); + } + break; + } + case DIV: + { + AST tmp33_AST = null; + tmp33_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp33_AST); + match(DIV); + a=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new DivisionExpression(e,a); + } + break; + } + case MOD: + { + AST tmp34_AST = null; + tmp34_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp34_AST); + match(MOD); + a=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new ModuloExpression(e,a); + } + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + } + } + else { + break _loop47; + } + + } while (true); + } + multiplicativeExpression_AST = (AST)currentAST.root; + returnAST = multiplicativeExpression_AST; + return e; + } + + public final Expression unaryExpression() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST unaryExpression_AST = null; + Expression a,b; + + switch ( LA(1)) { + case MINUS: + { + AST tmp35_AST = null; + tmp35_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp35_AST); + match(MINUS); + if ( inputState.guessing==0 ) { + tmp35_AST.setType(UNARY_MINUS); + } + a=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new NegateExpression(a); + } + unaryExpression_AST = (AST)currentAST.root; + break; + } + case PLUS: + { + AST tmp36_AST = null; + tmp36_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp36_AST); + match(PLUS); + if ( inputState.guessing==0 ) { + tmp36_AST.setType(UNARY_PLUS); + } + e=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpression_AST = (AST)currentAST.root; + break; + } + case IDENT: + case BNOT: + case LNOT: + case LPAREN: + case LITERAL_true: + case LITERAL_false: + case LITERAL_null: + case NUM_INT: + case CHAR_LITERAL: + case STRING_LITERAL: + case NUM_FLOAT: + case NUM_LONG: + case NUM_DOUBLE: + { + e=unaryExpressionNotPlusMinus(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpression_AST = (AST)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = unaryExpression_AST; + return e; + } + + public final Expression unaryExpressionNotPlusMinus() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST unaryExpressionNotPlusMinus_AST = null; + Token lpb = null; + AST lpb_AST = null; + Expression a; Type t; + + switch ( LA(1)) { + case BNOT: + { + AST tmp37_AST = null; + tmp37_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp37_AST); + match(BNOT); + a=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new NotExpression(a); + } + unaryExpressionNotPlusMinus_AST = (AST)currentAST.root; + break; + } + case LNOT: + { + AST tmp38_AST = null; + tmp38_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp38_AST); + match(LNOT); + a=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new LogicalNotExpression(a); + } + unaryExpressionNotPlusMinus_AST = (AST)currentAST.root; + break; + } + default: + boolean synPredMatched51 = false; + if (((LA(1)==LPAREN) && ((LA(2) >= LITERAL_void && LA(2) <= LITERAL_String)))) { + int _m51 = mark(); + synPredMatched51 = true; + inputState.guessing++; + try { + { + match(LPAREN); + builtInTypeSpec(true); + match(RPAREN); + } + } + catch (RecognitionException pe) { + synPredMatched51 = false; + } + rewind(_m51); +inputState.guessing--; + } + if ( synPredMatched51 ) { + lpb = LT(1); + lpb_AST = astFactory.create(lpb); + astFactory.makeASTRoot(currentAST, lpb_AST); + match(LPAREN); + if ( inputState.guessing==0 ) { + lpb_AST.setType(TYPECAST); + } + t=builtInTypeSpec(true); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + a=unaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new TypeCastExpression(t,a); + } + unaryExpressionNotPlusMinus_AST = (AST)currentAST.root; + } + else if ((_tokenSet_0.member(LA(1))) && (_tokenSet_1.member(LA(2)))) { + e=primaryExpression(); + astFactory.addASTChild(currentAST, returnAST); + unaryExpressionNotPlusMinus_AST = (AST)currentAST.root; + } + else { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = unaryExpressionNotPlusMinus_AST; + return e; + } + + public final Expression primaryExpression() throws RecognitionException, TokenStreamException { + Expression e = null; String i = null;; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST primaryExpression_AST = null; + + switch ( LA(1)) { + case NUM_INT: + case CHAR_LITERAL: + case STRING_LITERAL: + case NUM_FLOAT: + case NUM_LONG: + case NUM_DOUBLE: + { + e=constant(); + astFactory.addASTChild(currentAST, returnAST); + primaryExpression_AST = (AST)currentAST.root; + break; + } + case IDENT: + { + i=identifier(); + astFactory.addASTChild(currentAST, returnAST); + if ( inputState.guessing==0 ) { + e=new IdentifierExpression(i); + } + primaryExpression_AST = (AST)currentAST.root; + break; + } + case LITERAL_true: + { + AST tmp40_AST = null; + tmp40_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp40_AST); + match(LITERAL_true); + if ( inputState.guessing==0 ) { + e=new ConstantBoolean(true); + } + primaryExpression_AST = (AST)currentAST.root; + break; + } + case LITERAL_false: + { + AST tmp41_AST = null; + tmp41_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp41_AST); + match(LITERAL_false); + if ( inputState.guessing==0 ) { + e=new ConstantBoolean(false); + } + primaryExpression_AST = (AST)currentAST.root; + break; + } + case LITERAL_null: + { + AST tmp42_AST = null; + tmp42_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp42_AST); + match(LITERAL_null); + if ( inputState.guessing==0 ) { + e=new ConstantNull(); + } + primaryExpression_AST = (AST)currentAST.root; + break; + } + case LPAREN: + { + match(LPAREN); + e=conditionalExpression(); + astFactory.addASTChild(currentAST, returnAST); + match(RPAREN); + primaryExpression_AST = (AST)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = primaryExpression_AST; + return e; + } + + public final Expression constant() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST constant_AST = null; + Token l1 = null; + AST l1_AST = null; + Token l2 = null; + AST l2_AST = null; + Token l3 = null; + AST l3_AST = null; + Token l4 = null; + AST l4_AST = null; + Token l5 = null; + AST l5_AST = null; + Token l6 = null; + AST l6_AST = null; + + switch ( LA(1)) { + case NUM_INT: + { + l1 = LT(1); + l1_AST = astFactory.create(l1); + astFactory.addASTChild(currentAST, l1_AST); + match(NUM_INT); + if ( inputState.guessing==0 ) { + e=new ConstantInteger(l1.getText()); + } + constant_AST = (AST)currentAST.root; + break; + } + case CHAR_LITERAL: + { + l2 = LT(1); + l2_AST = astFactory.create(l2); + astFactory.addASTChild(currentAST, l2_AST); + match(CHAR_LITERAL); + if ( inputState.guessing==0 ) { + e=new ConstantChar(l2.getText()); + } + constant_AST = (AST)currentAST.root; + break; + } + case STRING_LITERAL: + { + l3 = LT(1); + l3_AST = astFactory.create(l3); + astFactory.addASTChild(currentAST, l3_AST); + match(STRING_LITERAL); + if ( inputState.guessing==0 ) { + e=new ConstantString(l3.getText().substring(1, l3.getText().length()-1)); + } + constant_AST = (AST)currentAST.root; + break; + } + case NUM_FLOAT: + { + l4 = LT(1); + l4_AST = astFactory.create(l4); + astFactory.addASTChild(currentAST, l4_AST); + match(NUM_FLOAT); + if ( inputState.guessing==0 ) { + e=new ConstantFloat(l4.getText()); + } + constant_AST = (AST)currentAST.root; + break; + } + case NUM_LONG: + { + l5 = LT(1); + l5_AST = astFactory.create(l5); + astFactory.addASTChild(currentAST, l5_AST); + match(NUM_LONG); + if ( inputState.guessing==0 ) { + e=new ConstantLong(l5.getText()); + } + constant_AST = (AST)currentAST.root; + break; + } + case NUM_DOUBLE: + { + l6 = LT(1); + l6_AST = astFactory.create(l6); + astFactory.addASTChild(currentAST, l6_AST); + match(NUM_DOUBLE); + if ( inputState.guessing==0 ) { + e=new ConstantDouble(l6.getText()); + } + constant_AST = (AST)currentAST.root; + break; + } + default: + { + throw new NoViableAltException(LT(1), getFilename()); + } + } + returnAST = constant_AST; + return e; + } + +/** Match a, a.b.c refs + */ + public final Expression identPrimary() throws RecognitionException, TokenStreamException { + Expression e = null; + + returnAST = null; + ASTPair currentAST = new ASTPair(); + AST identPrimary_AST = null; + + AST tmp45_AST = null; + tmp45_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp45_AST); + match(IDENT); + { + _loop55: + do { + if ((LA(1)==DOT)) { + AST tmp46_AST = null; + tmp46_AST = astFactory.create(LT(1)); + astFactory.makeASTRoot(currentAST, tmp46_AST); + match(DOT); + AST tmp47_AST = null; + tmp47_AST = astFactory.create(LT(1)); + astFactory.addASTChild(currentAST, tmp47_AST); + match(IDENT); + } + else { + break _loop55; + } + + } while (true); + } + identPrimary_AST = (AST)currentAST.root; + returnAST = identPrimary_AST; + return e; + } + + + public static final String[] _tokenNames = { + "<0>", + "EOF", + "<2>", + "NULL_TREE_LOOKAHEAD", + "BLOCK", + "MODIFIERS", + "OBJBLOCK", + "SLIST", + "CTOR_DEF", + "METHOD_DEF", + "VARIABLE_DEF", + "INSTANCE_INIT", + "STATIC_INIT", + "TYPE", + "CLASS_DEF", + "INTERFACE_DEF", + "PACKAGE_DEF", + "ARRAY_DECLARATOR", + "EXTENDS_CLAUSE", + "IMPLEMENTS_CLAUSE", + "PARAMETERS", + "PARAMETER_DEF", + "LABELED_STAT", + "TYPECAST", + "INDEX_OP", + "POST_INC", + "POST_DEC", + "METHOD_CALL", + "EXPR", + "ARRAY_INIT", + "IMPORT", + "UNARY_MINUS", + "UNARY_PLUS", + "CASE_GROUP", + "ELIST", + "FOR_INIT", + "FOR_CONDITION", + "FOR_ITERATOR", + "EMPTY_STAT", + "\"final\"", + "\"abstract\"", + "\"strictfp\"", + "SUPER_CTOR_CALL", + "CTOR_CALL", + "LBRACK", + "RBRACK", + "\"void\"", + "\"boolean\"", + "\"byte\"", + "\"char\"", + "\"short\"", + "\"int\"", + "\"float\"", + "\"long\"", + "\"double\"", + "\"String\"", + "IDENT", + "DOT", + "QUESTION", + "COLON", + "LOR", + "LAND", + "BOR", + "BXOR", + "BAND", + "NOT_EQUAL", + "EQUAL", + "LT", + "GT", + "LE", + "GE", + "SL", + "SR", + "BSR", + "PLUS", + "MINUS", + "STAR", + "DIV", + "MOD", + "BNOT", + "LNOT", + "LPAREN", + "RPAREN", + "\"true\"", + "\"false\"", + "\"null\"", + "NUM_INT", + "CHAR_LITERAL", + "STRING_LITERAL", + "NUM_FLOAT", + "NUM_LONG", + "NUM_DOUBLE", + "LCURLY", + "RCURLY", + "COMMA", + "ASSIGN", + "DIV_ASSIGN", + "PLUS_ASSIGN", + "INC", + "MINUS_ASSIGN", + "DEC", + "STAR_ASSIGN", + "MOD_ASSIGN", + "SR_ASSIGN", + "BSR_ASSIGN", + "SL_ASSIGN", + "BXOR_ASSIGN", + "BOR_ASSIGN", + "BAND_ASSIGN", + "SEMI", + "WS", + "SL_COMMIT", + "ML_COMMENT", + "ESC", + "HEX_DIGIT", + "VOCAB", + "EXPONENT", + "FLOAT_SUFFIX" + }; + + protected void buildTokenTypeASTClassMap() { + tokenTypeToASTClassMap=null; + }; + + private static final long[] mk_tokenSet_0() { + long[] data = { 72057594037927936L, 268042240L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_0 = new BitSet(mk_tokenSet_0()); + private static final long[] mk_tokenSet_1() { + long[] data = { -72057594037927934L, 268435455L, 0L, 0L}; + return data; + } + public static final BitSet _tokenSet_1 = new BitSet(mk_tokenSet_1()); + + } diff --git a/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.smap b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.smap new file mode 100644 index 00000000000..667caad55ff --- /dev/null +++ b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.smap @@ -0,0 +1,987 @@ +SMAP +JavaRecognizer.java +G +*S G +*F ++ 0 java-expression.g +java-expression.g +*L +19:3 +46:56 +46:57 +46:58 +46:59 +46:61 +46:62 +46:63 +46:101 +46:102 +46:103 +47:64 +47:65 +47:67 +47:68 +47:69 +47:70 +47:71 +47:72 +47:73 +47:74 +47:75 +47:76 +47:77 +47:78 +47:80 +47:81 +47:82 +47:83 +47:84 +47:86 +47:87 +48:88 +48:89 +48:95 +48:97 +48:98 +49:91 +49:100 +50:92 +51:93 +57:242 +57:243 +57:245 +57:246 +57:247 +57:252 +57:253 +57:254 +58:249 +58:250 +58:251 +62:105 +62:106 +62:108 +62:109 +62:110 +62:112 +62:233 +62:234 +62:235 +62:236 +62:237 +62:238 +62:239 +62:240 +63:113 +63:114 +63:115 +63:116 +63:117 +63:118 +63:119 +63:120 +64:125 +64:126 +64:127 +64:128 +64:129 +64:130 +64:131 +64:132 +65:137 +65:138 +65:139 +65:140 +65:141 +65:142 +65:143 +65:144 +66:122 +66:149 +66:150 +66:151 +66:152 +66:153 +66:154 +66:155 +66:156 +67:134 +67:161 +67:162 +67:163 +67:164 +67:165 +67:166 +67:167 +67:168 +68:146 +68:173 +68:174 +68:175 +68:176 +68:177 +68:178 +68:179 +68:180 +69:158 +69:185 +69:186 +69:187 +69:188 +69:189 +69:190 +69:191 +69:192 +70:170 +70:197 +70:198 +70:199 +70:200 +70:201 +70:202 +70:203 +70:204 +71:182 +71:209 +71:210 +71:211 +71:212 +71:213 +71:214 +71:215 +71:216 +72:194 +72:221 +72:222 +72:223 +72:224 +72:225 +72:226 +72:227 +72:228 +73:206 +74:218 +75:230 +77:256 +77:257 +77:259 +77:260 +77:261 +77:297 +77:298 +77:299 +78:262 +78:263 +78:264 +78:265 +78:267 +78:268 +78:269 +78:270 +78:271 +78:272 +78:274 +78:275 +78:276 +78:277 +78:278 +78:279 +78:280 +78:281 +78:282 +78:283 +78:284 +78:285 +78:286 +78:287 +78:289 +78:290 +78:291 +78:292 +78:294 +78:295 +78:296 +81:301 +81:302 +81:304 +81:305 +81:306 +81:312 +81:313 +81:314 +82:308 +82:309 +82:310 +84:311 +86:316 +86:317 +86:319 +86:320 +86:321 +86:322 +86:357 +86:358 +86:359 +87:324 +87:325 +88:327 +88:328 +88:329 +88:330 +88:331 +88:332 +88:333 +88:334 +88:335 +88:336 +88:337 +88:338 +88:339 +88:340 +88:350 +88:351 +88:352 +88:353 +88:354 +89:356 +93:361 +93:362 +93:364 +93:365 +93:366 +93:367 +93:392 +93:393 +93:394 +94:369 +94:370 +94:371 +94:372 +94:373 +94:374 +94:375 +94:376 +94:377 +94:378 +94:379 +94:380 +94:381 +94:382 +94:384 +94:385 +94:386 +94:387 +94:389 +94:390 +94:391 +99:396 +99:397 +99:399 +99:400 +99:401 +99:402 +99:427 +99:428 +99:429 +100:404 +100:405 +100:406 +100:407 +100:408 +100:409 +100:410 +100:411 +100:412 +100:413 +100:414 +100:415 +100:416 +100:417 +100:419 +100:420 +100:421 +100:422 +100:424 +100:425 +100:426 +105:431 +105:432 +105:434 +105:435 +105:436 +105:437 +105:462 +105:463 +105:464 +106:439 +106:440 +106:441 +106:442 +106:443 +106:444 +106:445 +106:446 +106:447 +106:448 +106:449 +106:450 +106:451 +106:452 +106:454 +106:455 +106:456 +106:457 +106:459 +106:460 +106:461 +111:466 +111:467 +111:469 +111:470 +111:471 +111:472 +111:497 +111:498 +111:499 +112:474 +112:475 +112:476 +112:477 +112:478 +112:479 +112:480 +112:481 +112:482 +112:483 +112:484 +112:485 +112:486 +112:487 +112:489 +112:490 +112:491 +112:492 +112:494 +112:495 +112:496 +117:501 +117:502 +117:504 +117:505 +117:506 +117:507 +117:532 +117:533 +117:534 +118:509 +118:510 +118:511 +118:512 +118:513 +118:514 +118:515 +118:516 +118:517 +118:518 +118:519 +118:520 +118:521 +118:522 +118:524 +118:525 +118:526 +118:527 +118:529 +118:530 +118:531 +123:536 +123:537 +123:539 +123:540 +123:541 +123:542 +123:592 +123:593 +123:594 +124:544 +124:545 +124:546 +124:547 +124:548 +124:549 +124:551 +124:552 +124:553 +124:554 +124:555 +124:556 +124:557 +124:558 +124:559 +124:560 +124:561 +124:565 +124:566 +124:567 +124:568 +124:569 +124:570 +124:571 +124:572 +124:573 +124:574 +124:578 +124:579 +124:580 +124:581 +124:582 +124:584 +124:585 +124:586 +124:587 +124:589 +124:590 +124:591 +129:596 +129:597 +129:599 +129:600 +129:601 +129:602 +129:680 +129:681 +129:682 +130:604 +130:605 +131:607 +131:608 +131:609 +131:610 +131:612 +131:613 +131:614 +131:615 +131:616 +131:617 +131:618 +131:619 +131:620 +131:621 +131:622 +131:665 +131:666 +131:667 +131:668 +131:669 +131:671 +131:672 +131:673 +131:674 +131:676 +131:677 +132:626 +132:627 +132:628 +132:629 +132:630 +132:631 +132:632 +132:633 +132:634 +132:635 +132:679 +133:639 +133:640 +133:641 +133:642 +133:643 +133:644 +133:645 +133:646 +133:647 +133:648 +134:652 +134:653 +134:654 +134:655 +134:656 +134:657 +134:658 +134:659 +134:660 +134:661 +143:684 +143:685 +143:687 +143:688 +143:689 +143:690 +143:753 +143:754 +143:755 +144:692 +144:693 +144:694 +144:695 +144:696 +144:697 +144:699 +144:700 +144:701 +144:702 +144:703 +144:704 +144:705 +144:706 +144:707 +144:708 +144:709 +144:713 +144:714 +144:715 +144:716 +144:717 +144:718 +144:719 +144:720 +144:721 +144:722 +144:726 +144:727 +144:728 +144:729 +144:730 +144:731 +144:732 +144:733 +144:734 +144:735 +144:739 +144:740 +144:741 +144:742 +144:743 +144:745 +144:746 +144:747 +144:748 +144:750 +144:751 +144:752 +149:757 +149:758 +149:760 +149:761 +149:762 +149:763 +149:813 +149:814 +149:815 +150:765 +150:766 +150:767 +150:768 +150:769 +150:770 +150:772 +150:773 +150:774 +150:775 +150:776 +150:777 +150:778 +150:779 +150:780 +150:781 +150:782 +150:786 +150:787 +150:788 +150:789 +150:790 +150:791 +150:792 +150:793 +150:794 +150:795 +150:799 +150:800 +150:801 +150:802 +150:803 +150:805 +150:806 +150:807 +150:808 +150:810 +150:811 +150:812 +155:817 +155:818 +155:820 +155:821 +155:822 +155:823 +155:886 +155:887 +155:888 +156:825 +156:826 +156:827 +156:828 +156:829 +156:830 +156:832 +156:833 +156:834 +156:835 +156:836 +156:837 +156:838 +156:839 +156:840 +156:841 +156:842 +156:846 +156:847 +156:848 +156:849 +156:850 +156:851 +156:852 +156:853 +156:854 +156:855 +156:859 +156:860 +156:861 +156:862 +156:863 +156:864 +156:865 +156:866 +156:867 +156:868 +156:872 +156:873 +156:874 +156:875 +156:876 +156:878 +156:879 +156:880 +156:881 +156:883 +156:884 +156:885 +160:890 +160:891 +160:893 +160:894 +160:895 +160:896 +160:898 +160:949 +160:950 +160:951 +160:952 +160:953 +160:954 +160:955 +160:956 +161:899 +161:900 +161:901 +161:902 +161:903 +161:904 +161:905 +161:906 +161:908 +161:909 +161:910 +161:911 +162:916 +162:917 +162:918 +162:919 +162:920 +162:921 +162:922 +162:923 +162:925 +162:926 +162:927 +163:930 +163:931 +163:932 +163:933 +163:934 +163:935 +163:936 +163:937 +163:938 +163:939 +163:940 +163:941 +163:942 +163:943 +163:944 +163:945 +163:946 +164:913 +166:958 +166:959 +166:961 +166:962 +166:963 +166:966 +166:968 +166:997 +166:1033 +166:1038 +166:1039 +166:1040 +166:1041 +166:1042 +166:1043 +166:1044 +166:1045 +167:969 +167:970 +167:971 +167:972 +167:973 +167:974 +167:975 +167:976 +167:977 +167:978 +168:983 +168:984 +168:985 +168:986 +168:987 +168:988 +168:989 +168:990 +168:991 +168:992 +170:980 +171:994 +171:998 +171:999 +171:1000 +171:1001 +171:1002 +171:1003 +171:1005 +171:1006 +171:1007 +171:1009 +171:1010 +171:1011 +171:1012 +171:1013 +171:1014 +171:1015 +171:1016 +172:964 +172:965 +172:1017 +172:1018 +172:1019 +172:1020 +172:1021 +172:1022 +172:1024 +172:1025 +172:1026 +173:1027 +173:1028 +173:1029 +173:1030 +175:1034 +175:1035 +175:1036 +175:1037 +176:1032 +179:1047 +179:1048 +179:1050 +179:1051 +179:1052 +179:1054 +179:1122 +179:1123 +179:1124 +179:1125 +179:1126 +179:1127 +179:1128 +179:1129 +180:1055 +180:1056 +180:1057 +180:1058 +180:1059 +180:1060 +180:1061 +180:1062 +180:1063 +180:1064 +181:1067 +181:1068 +181:1069 +181:1070 +181:1071 +181:1072 +182:1077 +182:1078 +182:1079 +182:1080 +182:1081 +182:1082 +182:1083 +182:1084 +183:1089 +183:1090 +183:1091 +183:1092 +183:1093 +183:1094 +183:1095 +183:1096 +184:1074 +184:1101 +184:1102 +184:1103 +184:1104 +184:1105 +184:1106 +184:1107 +184:1108 +185:1086 +185:1113 +185:1114 +185:1115 +185:1116 +185:1117 +185:1118 +186:1098 +187:1110 +187:1119 +190:1232 +190:1234 +190:1235 +190:1237 +190:1238 +190:1239 +190:1265 +190:1266 +190:1267 +191:1233 +191:1241 +191:1242 +191:1243 +191:1244 +192:1245 +192:1246 +192:1247 +192:1257 +192:1258 +192:1259 +192:1260 +192:1262 +192:1263 +192:1264 +198:1248 +198:1249 +198:1250 +198:1251 +198:1252 +198:1253 +198:1254 +198:1255 +198:1256 +202:1131 +202:1132 +202:1134 +202:1135 +202:1136 +202:1150 +202:1223 +202:1224 +202:1225 +202:1226 +202:1227 +202:1228 +202:1229 +202:1230 +203:1137 +203:1138 +203:1151 +203:1152 +203:1153 +203:1154 +203:1155 +203:1156 +203:1157 +203:1158 +204:1139 +204:1140 +204:1163 +204:1164 +204:1165 +204:1166 +204:1167 +204:1168 +204:1169 +204:1170 +205:1141 +205:1142 +205:1175 +205:1176 +205:1177 +205:1178 +205:1179 +205:1180 +205:1181 +205:1182 +206:1143 +206:1144 +206:1160 +206:1187 +206:1188 +206:1189 +206:1190 +206:1191 +206:1192 +206:1193 +206:1194 +207:1145 +207:1146 +207:1172 +207:1199 +207:1200 +207:1201 +207:1202 +207:1203 +207:1204 +207:1205 +207:1206 +208:1147 +208:1148 +208:1184 +208:1211 +208:1212 +208:1213 +208:1214 +208:1215 +208:1216 +208:1217 +208:1218 +209:1196 +210:1208 +211:1220 +*E diff --git a/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.java b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.java new file mode 100644 index 00000000000..2962388f402 --- /dev/null +++ b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.java @@ -0,0 +1,122 @@ +// $ANTLR 2.7.7 (20080530): "java-expression.g" -> "JavaLexer.java"$ + + package gnu.classpath.tools.gjdoc.expr; + +public interface JavaTokenTypes { + int EOF = 1; + int NULL_TREE_LOOKAHEAD = 3; + int BLOCK = 4; + int MODIFIERS = 5; + int OBJBLOCK = 6; + int SLIST = 7; + int CTOR_DEF = 8; + int METHOD_DEF = 9; + int VARIABLE_DEF = 10; + int INSTANCE_INIT = 11; + int STATIC_INIT = 12; + int TYPE = 13; + int CLASS_DEF = 14; + int INTERFACE_DEF = 15; + int PACKAGE_DEF = 16; + int ARRAY_DECLARATOR = 17; + int EXTENDS_CLAUSE = 18; + int IMPLEMENTS_CLAUSE = 19; + int PARAMETERS = 20; + int PARAMETER_DEF = 21; + int LABELED_STAT = 22; + int TYPECAST = 23; + int INDEX_OP = 24; + int POST_INC = 25; + int POST_DEC = 26; + int METHOD_CALL = 27; + int EXPR = 28; + int ARRAY_INIT = 29; + int IMPORT = 30; + int UNARY_MINUS = 31; + int UNARY_PLUS = 32; + int CASE_GROUP = 33; + int ELIST = 34; + int FOR_INIT = 35; + int FOR_CONDITION = 36; + int FOR_ITERATOR = 37; + int EMPTY_STAT = 38; + int FINAL = 39; + int ABSTRACT = 40; + int STRICTFP = 41; + int SUPER_CTOR_CALL = 42; + int CTOR_CALL = 43; + int LBRACK = 44; + int RBRACK = 45; + int LITERAL_void = 46; + int LITERAL_boolean = 47; + int LITERAL_byte = 48; + int LITERAL_char = 49; + int LITERAL_short = 50; + int LITERAL_int = 51; + int LITERAL_float = 52; + int LITERAL_long = 53; + int LITERAL_double = 54; + int LITERAL_String = 55; + int IDENT = 56; + int DOT = 57; + int QUESTION = 58; + int COLON = 59; + int LOR = 60; + int LAND = 61; + int BOR = 62; + int BXOR = 63; + int BAND = 64; + int NOT_EQUAL = 65; + int EQUAL = 66; + int LT = 67; + int GT = 68; + int LE = 69; + int GE = 70; + int SL = 71; + int SR = 72; + int BSR = 73; + int PLUS = 74; + int MINUS = 75; + int STAR = 76; + int DIV = 77; + int MOD = 78; + int BNOT = 79; + int LNOT = 80; + int LPAREN = 81; + int RPAREN = 82; + int LITERAL_true = 83; + int LITERAL_false = 84; + int LITERAL_null = 85; + int NUM_INT = 86; + int CHAR_LITERAL = 87; + int STRING_LITERAL = 88; + int NUM_FLOAT = 89; + int NUM_LONG = 90; + int NUM_DOUBLE = 91; + int LCURLY = 92; + int RCURLY = 93; + int COMMA = 94; + int ASSIGN = 95; + int DIV_ASSIGN = 96; + int PLUS_ASSIGN = 97; + int INC = 98; + int MINUS_ASSIGN = 99; + int DEC = 100; + int STAR_ASSIGN = 101; + int MOD_ASSIGN = 102; + int SR_ASSIGN = 103; + int BSR_ASSIGN = 104; + int SL_ASSIGN = 105; + int BXOR_ASSIGN = 106; + int BOR_ASSIGN = 107; + int BAND_ASSIGN = 108; + int SEMI = 109; + int WS = 110; + int SL_COMMIT = 111; + int ML_COMMENT = 112; + int ESC = 113; + int HEX_DIGIT = 114; + int VOCAB = 115; + int EXPONENT = 116; + int FLOAT_SUFFIX = 117; +} diff --git a/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.txt b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.txt new file mode 100644 index 00000000000..b9983e22f48 --- /dev/null +++ b/libjava/classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.txt @@ -0,0 +1,116 @@ +// $ANTLR 2.7.7 (20080530): java-expression.g -> JavaTokenTypes.txt$ +Java // output token vocab name +BLOCK=4 +MODIFIERS=5 +OBJBLOCK=6 +SLIST=7 +CTOR_DEF=8 +METHOD_DEF=9 +VARIABLE_DEF=10 +INSTANCE_INIT=11 +STATIC_INIT=12 +TYPE=13 +CLASS_DEF=14 +INTERFACE_DEF=15 +PACKAGE_DEF=16 +ARRAY_DECLARATOR=17 +EXTENDS_CLAUSE=18 +IMPLEMENTS_CLAUSE=19 +PARAMETERS=20 +PARAMETER_DEF=21 +LABELED_STAT=22 +TYPECAST=23 +INDEX_OP=24 +POST_INC=25 +POST_DEC=26 +METHOD_CALL=27 +EXPR=28 +ARRAY_INIT=29 +IMPORT=30 +UNARY_MINUS=31 +UNARY_PLUS=32 +CASE_GROUP=33 +ELIST=34 +FOR_INIT=35 +FOR_CONDITION=36 +FOR_ITERATOR=37 +EMPTY_STAT=38 +FINAL="final"=39 +ABSTRACT="abstract"=40 +STRICTFP="strictfp"=41 +SUPER_CTOR_CALL=42 +CTOR_CALL=43 +LBRACK=44 +RBRACK=45 +LITERAL_void="void"=46 +LITERAL_boolean="boolean"=47 +LITERAL_byte="byte"=48 +LITERAL_char="char"=49 +LITERAL_short="short"=50 +LITERAL_int="int"=51 +LITERAL_float="float"=52 +LITERAL_long="long"=53 +LITERAL_double="double"=54 +LITERAL_String="String"=55 +IDENT=56 +DOT=57 +QUESTION=58 +COLON=59 +LOR=60 +LAND=61 +BOR=62 +BXOR=63 +BAND=64 +NOT_EQUAL=65 +EQUAL=66 +LT=67 +GT=68 +LE=69 +GE=70 +SL=71 +SR=72 +BSR=73 +PLUS=74 +MINUS=75 +STAR=76 +DIV=77 +MOD=78 +BNOT=79 +LNOT=80 +LPAREN=81 +RPAREN=82 +LITERAL_true="true"=83 +LITERAL_false="false"=84 +LITERAL_null="null"=85 +NUM_INT=86 +CHAR_LITERAL=87 +STRING_LITERAL=88 +NUM_FLOAT=89 +NUM_LONG=90 +NUM_DOUBLE=91 +LCURLY=92 +RCURLY=93 +COMMA=94 +ASSIGN=95 +DIV_ASSIGN=96 +PLUS_ASSIGN=97 +INC=98 +MINUS_ASSIGN=99 +DEC=100 +STAR_ASSIGN=101 +MOD_ASSIGN=102 +SR_ASSIGN=103 +BSR_ASSIGN=104 +SL_ASSIGN=105 +BXOR_ASSIGN=106 +BOR_ASSIGN=107 +BAND_ASSIGN=108 +SEMI=109 +WS=110 +SL_COMMIT=111 +ML_COMMENT=112 +ESC=113 +HEX_DIGIT=114 +VOCAB=115 +EXPONENT=116 +FLOAT_SUFFIX=117 diff --git a/libjava/classpath/tools/gjar.in b/libjava/classpath/tools/gjar.in index da7581167e0..e3dcea21b64 100644 --- a/libjava/classpath/tools/gjar.in +++ b/libjava/classpath/tools/gjar.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.jar.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.jar.Main "$@" diff --git a/libjava/classpath/tools/gjarsigner.in b/libjava/classpath/tools/gjarsigner.in index e3abc6ce674..d515418159e 100644 --- a/libjava/classpath/tools/gjarsigner.in +++ b/libjava/classpath/tools/gjarsigner.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.jarsigner.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.jarsigner.Main "$@" diff --git a/libjava/classpath/tools/gjavah.in b/libjava/classpath/tools/gjavah.in index 797721b9550..d6f3ab1e3b3 100644 --- a/libjava/classpath/tools/gjavah.in +++ b/libjava/classpath/tools/gjavah.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.javah.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.javah.Main "$@" diff --git a/libjava/classpath/tools/gjdoc.in b/libjava/classpath/tools/gjdoc.in new file mode 100644 index 00000000000..1fb6ca6576c --- /dev/null +++ b/libjava/classpath/tools/gjdoc.in @@ -0,0 +1,49 @@ +#!/bin/sh + +## Copyright (C) 2006 Free Software Foundation, Inc. +## +## This file is a part of GNU Classpath. +## +## GNU Classpath 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 2 of the License, or (at +## your option) any later version. +## +## GNU Classpath 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 GNU Classpath; if not, write to the Free Software +## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 +## USA. +## +## Linking this library statically or dynamically with other modules is +## making a combined work based on this library. Thus, the terms and +## conditions of the GNU General Public License cover the whole +## combination. +## +## As a special exception, the copyright holders of this library give you +## permission to link this library with independent modules to produce an +## executable, regardless of the license terms of these independent +## modules, and to copy and distribute the resulting executable under +## terms of your choice, provided that you also meet, for each linked +## independent module, the terms and conditions of the license of that +## module. An independent module is a module which is not derived from +## or based on this library. If you modify this library, you may extend +## this exception to your version of the library, but you are not +## obligated to do so. If you do not wish to do so, delete this +## exception statement from your version. +## +## +## A simple shell script to launch the GNU Classpath javadoc tool. +## + +prefix=@prefix@ +datarootdir=@datarootdir@ +tools_dir=@datadir@/@PACKAGE@ +tools_cp=${tools_dir}/tools.zip +antlr_jar=@ANTLR_JAR@ + +exec @JAVA@ -classpath "${tools_cp}:${antlr_jar}" gnu.classpath.tools.gjdoc.Main "$@" diff --git a/libjava/classpath/tools/gkeytool.in b/libjava/classpath/tools/gkeytool.in index 59516efe803..3c886f89c5b 100644 --- a/libjava/classpath/tools/gkeytool.in +++ b/libjava/classpath/tools/gkeytool.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.keytool.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.keytool.Main "$@" diff --git a/libjava/classpath/tools/gnative2ascii.in b/libjava/classpath/tools/gnative2ascii.in index 17d7cd7e006..52d8f692613 100644 --- a/libjava/classpath/tools/gnative2ascii.in +++ b/libjava/classpath/tools/gnative2ascii.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.native2ascii.Native2ASCII "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.native2ascii.Native2ASCII "$@" diff --git a/libjava/classpath/tools/gnu/classpath/tools/FileSystemClassLoader.java b/libjava/classpath/tools/gnu/classpath/tools/FileSystemClassLoader.java new file mode 100644 index 00000000000..0ec243d5639 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/FileSystemClassLoader.java @@ -0,0 +1,296 @@ +/* gnu.classpath.tools.FileSystemClassLoader + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.IOException; +import java.io.StreamTokenizer; +import java.io.StringReader; + +import java.net.MalformedURLException; +import java.net.URL; + +import java.util.LinkedList; +import java.util.List; +import java.util.ArrayList; +import java.util.StringTokenizer; + +import java.util.jar.JarEntry; +import java.util.jar.JarFile; +import java.util.jar.Manifest; +import java.util.jar.Attributes; + +/** + * A ClassLoader implementation which looks for classes + * on the local filesystem given a standard search path. + */ +public class FileSystemClassLoader extends ClassLoader { + + private File[] pathComponents; + + /** + * Initialize the class loader with a normal path string. The path + * string should contain path components separated by {@link + * File.pathSeparator}. Each path component should either denote a + * directory or a .jar or .zip file. + */ + public FileSystemClassLoader(String path) + { + List components = new ArrayList(); + for (StringTokenizer st = new StringTokenizer(path, File.pathSeparator); st.hasMoreTokens(); ) { + File pathComponent = new File(st.nextToken()); + components.add(pathComponent); + if (pathComponent.exists() && !pathComponent.isDirectory()) { + List subComponents = tryGetJarFileClassPathComponents(pathComponent); + if (null != subComponents) { + components.addAll(subComponents); + } + } + } + File[] componentArray = new File[components.size()]; + this.pathComponents = (File[])components.toArray(componentArray); + } + + /** + * Initialize the class loader with an array of path + * components. Each path component should either denote a + * directory or a .jar or .zip file. + */ + public FileSystemClassLoader(File[] pathComponents) + { + this.pathComponents = pathComponents; + for (int i = 0; i < pathComponents.length; ++i) { + if (!pathComponents[i].exists()) { + System.err.println("WARNING: Path component '" + pathComponents[i] + "' not found."); + } + } + } + + public Class loadClass(String name) + throws ClassNotFoundException { + + return super.loadClass(name); + } + + public Class findClass(String name) + throws ClassNotFoundException { + + byte[] b = loadClassData(name); + return defineClass(name, b, 0, b.length); + } + + public URL findResource(String name) + { + StreamInfo streamInfo = getResourceStream(name); + if (null == streamInfo) { + return super.findResource(name); + } + else { + try { + return streamInfo.getURL(); + } + catch (MalformedURLException e) { + System.err.println("WARNING: In FileSystemClassLoader: could not derive URL from file or jar entry: " + e.toString()); + return null; + } + } + } + + private byte[] readFromStream(InputStream in, long size) + throws IOException + { + byte[] result = new byte[(int)size]; + int nread = 0; + int offset = 0; + while (offset < size && (nread = in.read(result, offset, (int)(size - offset))) >= 0) { + offset += nread; + } + in.close(); + return result; + } + + private byte[] readFromStream(StreamInfo streamInfo) + throws IOException + { + InputStream in = streamInfo.openStream(); + long size = streamInfo.getSize(); + + byte[] result = new byte[(int)size]; + int nread = 0; + int offset = 0; + while (offset < size && (nread = in.read(result, offset, (int)(size - offset))) >= 0) { + offset += nread; + } + in.close(); + return result; + } + + private static interface StreamInfo + { + public InputStream openStream() + throws IOException; + public long getSize(); + public URL getURL() + throws MalformedURLException; + } + + private static class FileStreamInfo + implements StreamInfo + { + File file; + + FileStreamInfo(File file) + { + this.file = file; + } + + public InputStream openStream() + throws IOException + { + return new FileInputStream(file); + } + + public long getSize() + { + return file.length(); + } + + public URL getURL() + throws MalformedURLException + { + return file.toURL(); + } + } + + private static class JarStreamInfo + implements StreamInfo + { + private File file; + private JarFile jarFile; + private JarEntry jarEntry; + + JarStreamInfo(File file, JarFile jarFile, JarEntry jarEntry) + { + this.file = file; + this.jarFile = jarFile; + this.jarEntry = jarEntry; + } + + public InputStream openStream() + throws IOException + { + return jarFile.getInputStream(jarEntry); + } + + public long getSize() + { + return jarEntry.getSize(); + } + + public URL getURL() + throws MalformedURLException + { + String urlString = "jar:" + file.toURL() + "!/" + jarEntry.getName(); + return new URL(urlString); + } + } + + private StreamInfo getResourceStream(String path) + { + for (int i = 0; i < pathComponents.length; ++i) { + try { + File parent = pathComponents[i]; + if (parent.isDirectory()) { + File file = new File(parent, path); + if (file.exists()) { + return new FileStreamInfo(file); + } + } + else { + JarFile jarFile = new JarFile(parent, false, JarFile.OPEN_READ); + JarEntry jarEntry = jarFile.getJarEntry(path); + if (null != jarEntry) { + return new JarStreamInfo(parent, jarFile, jarEntry); + } + } + } + catch (IOException ignore) { + } + } + return null; + } + + private byte[] loadClassData(String className) + throws ClassNotFoundException + { + String classFileName = className.replace('.', File.separatorChar) + ".class"; + StreamInfo streamInfo = getResourceStream(classFileName); + + try { + if (null != streamInfo) { + return readFromStream(streamInfo); + } + } + catch (IOException ignore) { + } + + throw new ClassNotFoundException(className); + } + + private static List tryGetJarFileClassPathComponents(File file) + { + try { + JarFile jarFile = new JarFile(file, false, JarFile.OPEN_READ); + Manifest manifest = jarFile.getManifest(); + if (null != manifest) { + Attributes mainAttributes = manifest.getMainAttributes(); + if (null != mainAttributes) { + String classPath = mainAttributes.getValue(Attributes.Name.CLASS_PATH); + if (null != classPath) { + List result = new LinkedList(); + StreamTokenizer tokenizer = new StreamTokenizer(new StringReader(classPath)); + tokenizer.resetSyntax(); + tokenizer.wordChars(0, Integer.MAX_VALUE); + tokenizer.whitespaceChars(9, 9); // tab + tokenizer.whitespaceChars(10, 10); // lf + tokenizer.whitespaceChars(13, 13); // cr + tokenizer.whitespaceChars(32, 32); // space + tokenizer.quoteChar('"'); + int token; + while ((token = tokenizer.nextToken()) != StreamTokenizer.TT_EOF) { + if (StreamTokenizer.TT_WORD == token) { + result.add(new File(file.getParentFile(), tokenizer.sval)); + } + } + return result; + } + } + } + } + catch (IOException ignore) { + } + return null; + } +} + diff --git a/libjava/classpath/tools/gnu/classpath/tools/IOToolkit.java b/libjava/classpath/tools/gnu/classpath/tools/IOToolkit.java new file mode 100644 index 00000000000..4e222d26777 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/IOToolkit.java @@ -0,0 +1,199 @@ +/* gnu.classpath.tools.IOToolkit + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.StringWriter; +import java.io.Writer; + +import java.util.Set; + +/** + * Provides various I/O-related helper methods. + * + * @author Julian Scheid + */ +public class IOToolkit +{ + /** + * Prevents instantiation. + */ + private IOToolkit() {} + + /** + * Read all binary data from the given InputStream and write it to + * the given OutputStream. This method doesn't close either + * stream. + * + * @param in the stream from which to read data + * @param out the stream to which to write data + */ + public static void copyStream(InputStream in, OutputStream out) + throws IOException + { + byte[] buf = new byte[256]; + int nread; + + while ((nread = in.read(buf)) >= 0) { + out.write(buf, 0, nread); + } + } + + /** + * Read all character data from the given Reader and write it to + * the given Writer. This method doesn't close either stream. + * + * @param in the Reader from which to read character data + * @param out the Writer to which to write character data + */ + public static void copyStream(Reader in, Writer out) + throws IOException + { + char[] buf = new char[256]; + int nread; + + while ((nread = in.read(buf)) >= 0) { + out.write(buf, 0, nread); + } + } + + /** + * Recursively copy the contents of the input directory to the + * output directory. The output directory is created if it doesn't + * exist. If the output directory doesn't exist and can't be + * created, an IOException is thrown. + * + * @param sourceDir source directory from which to copy files + * @param targetDir target directory to which to copy files + * @param recursive if true, recursively copy subdirectoryies + * @param excludeDirs if non null, must be a Set of String. Each + * element from the set specifies the name of a direct + * subdirectory of the source directory which should be excluded + * from recursive copying. + */ + public static void copyDirectory(File sourceDir, File targetDir, + boolean recursive, + Set excludeDirs) + throws IOException + { + if (!targetDir.exists() && !targetDir.mkdirs()) { + throw new IOException("Cannot create directory " + targetDir); + } + + File[] sourceFiles = sourceDir.listFiles(); + for (int i=0; i= 0) { + out.write(buf, 0, nread); + } + in.close(); + out.close(); + } + + /** + * Read the (remaining) contents of the given reader into a char + * array. This method doesn't close the reader when it is done. + * + * @param reader the Reader to read characters from + * @return an array with the contents of the Reader + */ + public static char[] readFully(Reader reader) + throws IOException + { + StringWriter writer = new StringWriter(); + final int readBufferSize = 256; + char[] chunk = new char[readBufferSize]; + int nread; + while ((nread=reader.read(chunk))>=0) { + writer.write(chunk,0,nread); + } + StringBuffer buffer = writer.getBuffer(); + char[] result = new char[buffer.length()]; + buffer.getChars(0, buffer.length(), result, 0); + return result; + } + + public static String getLineFromFile(File file, int line) + throws IOException + { + FileReader reader = new FileReader(file); + BufferedReader bufferedReader = new BufferedReader(reader); + while (line > 1) { + bufferedReader.readLine(); + -- line; + } + String result = bufferedReader.readLine(); + reader.close(); + return result; + } + + public static String getColumnDisplayLine(int column) + { + StringBuffer result = new StringBuffer(); + while (column > 0) { + result.append(' '); + --column; + } + result.append('^'); + return result.toString(); + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/MalformedInputEvent.java b/libjava/classpath/tools/gnu/classpath/tools/MalformedInputEvent.java new file mode 100644 index 00000000000..b2ac3ce6cf6 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/MalformedInputEvent.java @@ -0,0 +1,93 @@ +/* gnu.classpath.tools.MalformedInputEvent + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools; + +import java.util.EventObject; + +/** + * Encapsulates information about malformed input encountered by a + * {@link NotifyingInputStreamReader}. + * + * You can use {@link getSource()} to fetch a reference to the + * NotifyingInputStreamReader which encountered the + * malformed input. + * + * @author Julian Scheid + */ +public class MalformedInputEvent + extends EventObject +{ + private int lineNumber; + private int columnNumber; + private int length; + + MalformedInputEvent(NotifyingInputStreamReader source, + int lineNumber, + int columnNumber, + int length) + { + super(source); + this.columnNumber = columnNumber; + this.lineNumber = lineNumber; + this.length = length; + } + + /** + * Return the 1-based line number where the malformed input begins + * in the stream read by the + * NotifyingInputStreamReader. + */ + public int getLineNumber() + { + return lineNumber; + } + + /** + * Return the 0-based column number where the malformed input + * begins in the stream read by the + * NotifyingInputStreamReader. + */ + public int getColumnNumber() + { + return columnNumber; + } + + /** + * Return the length (in bytes) of the malformed input encountered + * by the NotifyingInputStreamReader. Note that a + * consecutive run of malformed input isn't necessarily reported + * as a whole; depending on the Charset and + * implementation details of CharsetDecoder, the run + * could be reported in chunks down to individual bytes. + */ + public int getLength() + { + return length; + } + + public String toString() + { + return "MalformedInputEvent{line=" + lineNumber + + ",column=" + columnNumber + + ",length=" + length + + "}"; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/MalformedInputListener.java b/libjava/classpath/tools/gnu/classpath/tools/MalformedInputListener.java new file mode 100644 index 00000000000..66ab1282400 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/MalformedInputListener.java @@ -0,0 +1,39 @@ +/* gnu.classpath.tools.MalformedInputListener + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools; + +/** + * Classes implementing this interface can be notified when a {@link + * NotifyingInputStreamReader} encounters malformed input. + * + * @author Julian Scheid + */ +public interface MalformedInputListener +{ + /** + * Invoked when a NotifyingInputStreamReader this + * listener is registered with encounters malformed input. + * + * @param MalformedInputEvent contains detailed information about + * the event. + */ + public void malformedInputEncountered(MalformedInputEvent event); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/NotifyingInputStreamReader.java b/libjava/classpath/tools/gnu/classpath/tools/NotifyingInputStreamReader.java new file mode 100644 index 00000000000..8c35c257312 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/NotifyingInputStreamReader.java @@ -0,0 +1,406 @@ +/* gnu.classpath.tools.NotifyingInputStreamReader + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Reader; + +import java.nio.ByteBuffer; +import java.nio.CharBuffer; + +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CoderResult; +import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.UnsupportedCharsetException; + +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.Set; + +/** + * Similar to {@link java.io.InputStreamReader}, but can give + * notification when malformed input is encountered. + * + *

Users of this class can register interest in the event of + * malformed input by calling {@link + * #addMalformedInputListener}. Each time a run of malformed input + * data is encountered, all listener objects are notified. For + * instance, this allows the calling code to inform the user about + * problems in the input stream.

+ * + *

Background: The default + * InputStreamReader implementation will ignore + * malformed input, silently replacing it with the default + * replacement string (usually the question mark). Alternatively, you + * can configure a CharsetDecoder for the default + * InputStreamReader implementation, instructing it to + * ignore malformed input without replacing it; to replace it with a + * different string; or to throw an exception when malformed input is + * encountered. However, you cannot configure an + * InputStreamReader to gracefully handle malformed data + * but notify the client code about such + * problems. NotifyingInputStreamReader fills this + * gap.

+ * + * @author Julian Scheid + */ +public class NotifyingInputStreamReader + extends Reader +{ + /** + * The default size (in bytes) for byteBuf, i.e. the size of data + * chunks read from the underlying input stream. + */ + private static final int DEFAULT_INPUT_BUFFER_SIZE = 64; + + /** + * The default size (in chars) for charBuf. This should be large + * enough to hold a decoded chunk of input data for the Charset + * with the minimum number of bytes per character. Since the + * minimum number of bytes per character for usual Charsets is + * one, this number should be identical to + * DEFAULT_INPUT_BUFFER_SIZE. + */ + private static final int DEFAULT_OUTPUT_BUFFER_SIZE = 64; + + /** + * The underlying InputStream. + */ + private InputStream in; + + /** + * The CharsetDecoder used to decode the underlying stream. + */ + private CharsetDecoder decoder; + + /** + * Holds bytes already read from the underlying stream, but not + * yet decoded. + */ + private ByteBuffer byteBuffer; + + /** + * Holds characters already decoded, but not yet fetched via + * read(). + */ + private CharBuffer charBuffer; + + /** + * This is the primitive byte array wrapped in byteBuffer for + * passing to to InputStream.read(). + */ + private byte[] readBuffer; + + /** + * Keeps track of the current line number (1-based). + */ + private int lineNumber = 1; + + /** + * Keeps track of the current column number (0-based). + */ + private int columnNumber = 0; + + /** + * Becomes true as soon as EOF has been reached in the underlying + * InputStream. At this point, byteBuffer contains the last chunk + * of data from the underlying InputStream. + */ + private boolean allInputConsumed = false; + + /** + * Becomes true as soon as the decoder has been supplied with the + * last chunk of data from the InputStream after EOF has been + * reached. At this point, the last chunk of data has been drained + * from the byteBuffer. + */ + private boolean decodingFinished = false; + + /** + * Becomes true as soon as the decoder has been flushed. At this + * point, the last chunk of character data has been written to the + * charBuffer. + */ + private boolean flushed = false; + + /** + * Stores all registered MalformedInputListeners. + */ + private Set listeners = new LinkedHashSet(); + + /** + * Initializes a new instance for reading from the given + * InputStream using the default encoding. The default encoding is + * currently determined by looking at the system property + * file.encoding. If this property isn't set, + * ISO-8859-1 is used as a fallback. + * + *

This method should use {@link Charset.defaultCharset()} + * instead, but this isn't implemented in Classpath at the + * moment.

+ * + * @param in the InputStream to read from. + */ + public NotifyingInputStreamReader(InputStream in) + { + this(in, System.getProperty("file.encoding", "ISO-8859-1")); + } + + /** + * Initializes a new instance for reading from the given + * InputStream using the specified charset. + * + * @param in the InputStream to read from. + * @param charsetName the canonical name or an alias of a + * Charset. + * + * @throws IllegalCharsetNameException if there is no + * Charset with the given canonical name or alias. + * + * @throws UnsupportedCharsetException if there is no support for + * the specified Charset in the runtime environment. + */ + public NotifyingInputStreamReader(InputStream in, String charsetName) + throws IllegalCharsetNameException, UnsupportedCharsetException + { + this(in, Charset.forName(charsetName)); + } + + /** + * Initializes a new instance for reading from the given + * InputStream using the specified charset. + * + * @param in the InputStream to read from. + * @param charset the Charset to use for decoding + * characters. + */ + public NotifyingInputStreamReader(InputStream in, Charset charset) + { + this(in, charset.newDecoder()); + } + + /** + * Initializes a new instance for reading from the given + * InputStream using the specified charset decoder. + * + * Note: the + * NotifyingInputStreamReader will not exhibit the + * advertised behaviour if you changed the action to take on + * malformed input in the specified + * CharsetDecoder. In other words, you should not + * call {@link CharsetDecoder.onMalformedInput(CodingErrorAction)} + * on the specified decoder before or while this reader is being + * used unless you know what you're doing. + * + * @param in the InputStream to read from. + * @param charset the CharsetDecoder to use for + * decoding characters. + */ + public NotifyingInputStreamReader(InputStream in, CharsetDecoder decoder) + { + this.in = in; + this.decoder = decoder; + this.charBuffer = CharBuffer.wrap(new char[DEFAULT_INPUT_BUFFER_SIZE]); + this.charBuffer.position(charBuffer.limit()); + this.readBuffer = new byte[DEFAULT_OUTPUT_BUFFER_SIZE]; + this.byteBuffer = ByteBuffer.wrap(readBuffer); + this.byteBuffer.position(byteBuffer.limit()); + } + + public void close() + throws IOException + { + in.close(); + } + + /** + * Fill charBuffer with new character data. This method returns if + * either the charBuffer has been filled completely with decoded + * character data, or if EOF is reached in the underlying + * InputStream. When this method returns, charBuffer is flipped + * and ready to be read from. + */ + private void fillCharBuf() + throws IOException + { + charBuffer.clear(); + outer: + while (!flushed) { + CoderResult coderResult; + int charBufferPositionBefore = charBuffer.position(); + if (!decodingFinished) { + coderResult = decoder.decode(byteBuffer, charBuffer, allInputConsumed); + if (allInputConsumed) { + decodingFinished = true; + } + } + else { + coderResult = decoder.flush(charBuffer); + flushed = coderResult.isUnderflow(); + } + + int charBufferPositionAfter = charBuffer.position(); + for (int i=charBufferPositionBefore; i 0) { + nRemainingBytes = Math.max(0, byteBuffer.limit() - byteBuffer.position()); + } + if (nRemainingBytes > 0) { + byteBuffer.get(readBuffer, 0, nRemainingBytes); + } + byteBuffer.rewind(); + int nread = in.read(readBuffer, nRemainingBytes, + readBuffer.length - nRemainingBytes); + if (nread < 0) { + allInputConsumed = true; + } + byteBuffer.limit(nRemainingBytes + Math.max(0, nread)); + } + else { + break; + } + } + else if (coderResult.isMalformed()) { + fireMalformedInputEncountered(coderResult.length()); + String replacement = decoder.replacement(); + for (int i=0; i replacement.length()) { + charBuffer.put(replacement); + byteBuffer.position(byteBuffer.position() + 1); + columnNumber ++; + } + else { + break outer; + } + } + } + else if (coderResult.isUnmappable()) { + // This should not happen, since unmappable input bytes + // trigger a "malformed" event instead. + coderResult.throwException(); + } + else { + // This should only happen if run in a future environment + // where additional events apart from underflow, overflow, + // malformed and unmappable can be generated. + coderResult.throwException(); + } + } + charBuffer.flip(); + } + + /** + * Fire a MalformedInputEvent, notifying all registered listeners. + */ + private void fireMalformedInputEncountered(int length) + { + MalformedInputEvent event + = new MalformedInputEvent(this, lineNumber, columnNumber, length); + Iterator it = listeners.iterator(); + while (it.hasNext()) { + MalformedInputListener listener + = (MalformedInputListener)it.next(); + listener.malformedInputEncountered(event); + } + } + + public int read(char[] cbuf, int offset, int length) + throws IOException + { + if (flushed) { + return -1; + } + else { + int nread = 0; + while (nread < length && !flushed) { + while (charBuffer.hasRemaining() && nread < length) { + int copyLen = Math.min(length - nread, + charBuffer.remaining()); + charBuffer.get(cbuf, offset + nread, copyLen); + nread += copyLen; + } + if (nread < length) { + fillCharBuf(); + } + } + return nread; + } + } + + public int read() + throws IOException + { + while (!flushed) { + if (charBuffer.hasRemaining()) { + return charBuffer.get(); + } + else { + fillCharBuf(); + } + } + return -1; + } + + /** + * Returns whether this reader is ready. The reader is ready if + * there is data in the internal buffer, or if additional data can + * be read from the underlying InputStream. + */ + public boolean ready() + { + return charBuffer.hasRemaining() || !flushed; + } + + /** + * Register a MalformedInputListener which should be + * notified when malformed input is encountered. + */ + public void addMalformedInputListener(MalformedInputListener listener) + { + this.listeners.add(listener); + } + + /** + * Unregister a previously registered + * MalformedInputListener if it should no longer be + * notified when malformed input is encountered. + */ + public void removeMalformedInputListener(MalformedInputListener listener) + { + this.listeners.remove(listener); + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/StringToolkit.java b/libjava/classpath/tools/gnu/classpath/tools/StringToolkit.java new file mode 100644 index 00000000000..214dc1b6609 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/StringToolkit.java @@ -0,0 +1,67 @@ +/* gnu.classpath.tools.StringToolkit + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools; + +/** + * Provides various String-related helper methods. + * + * @author Julian Scheid + */ +public class StringToolkit +{ + /** + * Prevents instantiation. + */ + private StringToolkit() {} + + /** + * Return haystack with all occurrences of + * needle replaced by replacement. + * + * @param haystack the string to replace occurrences of needle in + * @param needle the substring to replace + * @param replacement the substring to replace needle with + * + * @return haystack with all occurrences of + * needle replaced by replacement. + */ + public static String replace(String haystack, String needle, String replacement) + { + int ndx = haystack.indexOf(needle); + if (ndx < 0) { + return haystack; + } + else { + StringBuffer result = new StringBuffer(); + result.append(haystack.substring(0, ndx)); + result.append(replacement); + ndx += needle.length(); + int ndx2; + while ((ndx2 = haystack.indexOf(needle, ndx)) >= 0) { + result.append(haystack.substring(ndx, ndx2)); + result.append(replacement); + ndx = ndx2 + needle.length(); + } + result.append(haystack.substring(ndx)); + return result.toString(); + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/AbstractDoclet.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/AbstractDoclet.java new file mode 100644 index 00000000000..87772077ec2 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/AbstractDoclet.java @@ -0,0 +1,1369 @@ +/* gnu.classpath.tools.doclets.AbstractDoclet + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets; + +import com.sun.javadoc.ClassDoc; +import com.sun.javadoc.ConstructorDoc; +import com.sun.javadoc.Doc; +import com.sun.javadoc.Doclet; +import com.sun.javadoc.ExecutableMemberDoc; +import com.sun.javadoc.FieldDoc; +import com.sun.javadoc.MethodDoc; +import com.sun.javadoc.PackageDoc; +import com.sun.javadoc.Parameter; +import com.sun.javadoc.RootDoc; +import com.sun.javadoc.Tag; +import com.sun.javadoc.Type; + +import com.sun.tools.doclets.Taglet; + +import gnu.classpath.tools.taglets.GnuExtendedTaglet; +import gnu.classpath.tools.taglets.AuthorTaglet; +import gnu.classpath.tools.taglets.CodeTaglet; +import gnu.classpath.tools.taglets.DeprecatedTaglet; +import gnu.classpath.tools.taglets.GenericTaglet; +import gnu.classpath.tools.taglets.SinceTaglet; +import gnu.classpath.tools.taglets.ValueTaglet; +import gnu.classpath.tools.taglets.VersionTaglet; +import gnu.classpath.tools.taglets.TagletContext; + +import gnu.classpath.tools.IOToolkit; +import gnu.classpath.tools.FileSystemClassLoader; + +import java.io.File; +import java.io.IOException; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.InvocationTargetException; + +import java.text.MessageFormat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.ResourceBundle; +import java.util.Set; +import java.util.SortedSet; +import java.util.StringTokenizer; +import java.util.TreeMap; +import java.util.TreeSet; + +/** + * An abstract Doclet implementation with helpers for common tasks + * performed by Doclets. + */ +public abstract class AbstractDoclet +{ + /** + * Mapping from tag type to Taglet for user Taglets specified on + * the command line. + */ + protected Map tagletMap = new LinkedHashMap(); + + /** + * Stores the package groups specified in the user + * options. Contains objects of type PackageGroup. + */ + private List packageGroups = new LinkedList(); + + /** + * The current classpath for loading taglet classes. + */ + private String tagletPath; + + /** + * Keeps track of the tags mentioned by the user during option + * processiong so that an error can be emitted if a tag is + * mentioned more than once. + */ + private List mentionedTags = new LinkedList(); + + public static int optionLength(String option) { + return instance.getOptionLength(option); + } + + public static boolean validOptions(String[][] options) { + return true; + } + + private static AbstractDoclet instance; + + protected static void setInstance(AbstractDoclet instance) + { + AbstractDoclet.instance = instance; + } + + protected abstract void run() + throws DocletConfigurationException, IOException; + + public static boolean start(RootDoc rootDoc) + { + try { + + instance.startInstance(rootDoc); + return true; + } + catch (DocletConfigurationException e) { + instance.printError(e.getMessage()); + return false; + } + catch (Exception e) { + e.printStackTrace(); + return false; + } + } + + protected RootDoc getRootDoc() + { + return this.rootDoc; + } + + private RootDoc rootDoc; + + protected abstract InlineTagRenderer getInlineTagRenderer(); + + private void startInstance(RootDoc rootDoc) + throws DocletConfigurationException, IOException + { + this.rootDoc = rootDoc; + + // Set the default Taglet order + + registerTaglet(new VersionTaglet()); + registerTaglet(new AuthorTaglet()); + registerTaglet(new SinceTaglet(getInlineTagRenderer())); + registerTaglet(new StandardTaglet("serial")); + registerTaglet(new StandardTaglet("deprecated")); + registerTaglet(new StandardTaglet("see")); + registerTaglet(new StandardTaglet("param")); + registerTaglet(new StandardTaglet("return")); + + registerTaglet(new ValueTaglet()); + registerTaglet(new CodeTaglet()); + + // Process command line options + + for (int i=0, ilim=rootDoc.options().length; i 0) { + printError("Taglet class '" + optionArr[1] + "' found, but register method contains throws clause."); + } + else if ((registerTagletMethod.getModifiers() & (Modifier.STATIC | Modifier.PUBLIC | Modifier.ABSTRACT)) != (Modifier.STATIC | Modifier.PUBLIC)) { + printError("Taglet class '" + optionArr[1] + "' found, but register method isn't public static, or is abstract.."); + } + else { + Map tempMap = new HashMap(); + registerTagletMethod.invoke(null, new Object[] { tempMap }); + tagletLoaded = true; + String name = (String)tempMap.keySet().iterator().next(); + Taglet taglet = (Taglet)tempMap.get(name); + tagletMap.put(name, taglet); + mentionedTags.add(taglet); + } + } + catch (NoSuchMethodException e) { + printError("Taglet class '" + optionArr[1] + "' found, but doesn't contain the register method."); + } + catch (SecurityException e) { + printError("Taglet class '" + optionArr[1] + "' cannot be loaded: " + e.getMessage()); + } + catch (InvocationTargetException e) { + printError("Taglet class '" + optionArr[1] + "' found, but register method throws exception: " + e.toString()); + } + catch (IllegalAccessException e) { + printError("Taglet class '" + optionArr[1] + "' found, but there was a problem when accessing the register method: " + e.toString()); + } + catch (IllegalArgumentException e) { + printError("Taglet class '" + optionArr[1] + "' found, but there was a problem when accessing the register method: " + e.toString()); + } + catch (ClassNotFoundException e) { + printError("Taglet class '" + optionArr[1] + "' cannot be found."); + } + return tagletLoaded; + } + } + + private class DocletOptionGroup + extends DocletOption + { + DocletOptionGroup(String optionName) + { + super(optionName); + } + + public int getLength() + { + return 3; + } + + public boolean set(String[] optionArr) + { + try { + PackageMatcher packageMatcher = new PackageMatcher(); + + StringTokenizer tokenizer = new StringTokenizer(optionArr[2], ":"); + while (tokenizer.hasMoreTokens()) { + String packageWildcard = tokenizer.nextToken(); + packageMatcher.addWildcard(packageWildcard); + } + + SortedSet groupPackages = packageMatcher.filter(rootDoc.specifiedPackages()); + + packageGroups.add(new PackageGroup(optionArr[1], groupPackages)); + + return true; + } + catch (InvalidPackageWildcardException e) { + return false; + } + } + } + + + private class DocletOptionTagletPath + extends DocletOption + { + DocletOptionTagletPath(String optionName) + { + super(optionName); + } + + public int getLength() + { + return 2; + } + + public boolean set(String[] optionArr) + { + AbstractDoclet.this.tagletPath = optionArr[1]; + return true; + } + } + + private class DocletOptionTag + extends DocletOption + { + DocletOptionTag(String optionName) + { + super(optionName); + } + + public int getLength() + { + return 2; + } + + public boolean set(String[] optionArr) + { + String tagSpec = optionArr[1]; + boolean validTagSpec = false; + int ndx1 = tagSpec.indexOf(':'); + if (ndx1 < 0) { + Taglet taglet = (Taglet)tagletMap.get(tagSpec); + if (null == taglet) { + printError("There is no standard tag '" + tagSpec + "'."); + } + else { + if (mentionedTags.contains(taglet)) { + printError("Tag '" + tagSpec + "' has been added or moved before."); + } + else { + mentionedTags.add(taglet); + + // re-append taglet + tagletMap.remove(tagSpec); + tagletMap.put(tagSpec, taglet); + } + } + } + else { + int ndx2 = tagSpec.indexOf(':', ndx1 + 1); + if (ndx2 > ndx1 && ndx2 < tagSpec.length() - 1) { + String tagName = tagSpec.substring(0, ndx1); + String tagHead = null; + if (tagSpec.charAt(ndx2 + 1) == '\"') { + if (tagSpec.charAt(tagSpec.length() - 1) == '\"') { + tagHead = tagSpec.substring(ndx2 + 2, tagSpec.length() - 1); + validTagSpec = true; + } + } + else { + tagHead = tagSpec.substring(ndx2 + 1); + validTagSpec = true; + } + + boolean tagScopeOverview = false; + boolean tagScopePackages = false; + boolean tagScopeTypes = false; + boolean tagScopeConstructors = false; + boolean tagScopeMethods = false; + boolean tagScopeFields = false; + boolean tagDisabled = false; + + tag_option_loop: + for (int n=ndx1+1; n:Xaoptcmf:\"."); + } + return validTagSpec; + } + } + + private DocletOption[] commonOptions = + { + optionTargetDirectory, + optionAuthor, + optionVersion, + optionNoSince, + optionNoDeprecated, + optionGroup, + optionDocFilesSubDirs, + optionExcludeDocFilesSubDir, + optionTagletPath, + optionTaglet, + optionTag, + }; + + private void registerOptions() + { + if (!optionsRegistered) { + for (int i=0; i 0) { + indexByName.put(new IndexKey(c.name()), c); + } + } + + // Add classes, fields and methods to index + + ClassDoc[] sumclasses = rootDoc.classes(); + for (int i=0, ilim=sumclasses.length; iAbstractDoclet members or members of + * AbstractDoclet subclasses when a problem caused by + * user-specified options is detected. + * + * @see AbstractDoclet + */ +public class DocletConfigurationException + extends Exception +{ + public DocletConfigurationException(String message) + { + super(message); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOption.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOption.java new file mode 100644 index 00000000000..fec2c7ac749 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOption.java @@ -0,0 +1,39 @@ +/* gnu.classpath.tools.doclets.DocletOption + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets; + +public abstract class DocletOption +{ + private String optionName; + + protected DocletOption(String optionName) + { + this.optionName = optionName; + } + + public String getName() + { + return this.optionName; + } + + public abstract int getLength(); + public abstract boolean set(String[] optionArr); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionColonSeparated.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionColonSeparated.java new file mode 100644 index 00000000000..b33519fd231 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionColonSeparated.java @@ -0,0 +1,60 @@ +/* gnu.classpath.tools.doclets.DocletOptionColonSeparated + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets; + +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.StringTokenizer; + +/** + * Processes a doclet option whose value consists of a + * colon-separated list of strings. + */ +public class DocletOptionColonSeparated + extends DocletOption +{ + private Set components = new LinkedHashSet(); + + DocletOptionColonSeparated(String optionName) + { + super(optionName); + } + + public int getLength() + { + return 2; + } + + public boolean set(String[] optionArr) + { + StringTokenizer st = new StringTokenizer(":"); + while (st.hasMoreTokens()) { + components.add(st.nextToken()); + } + return true; + } + + public Set getComponents() + { + return components; + } +} + diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFile.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFile.java new file mode 100644 index 00000000000..c1f1c3c6323 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFile.java @@ -0,0 +1,60 @@ +/* gnu.classpath.tools.doclets.DocletOptionFile + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets; + +import java.io.File; + +/** + * Processes a doclet option whose value denotes an existing or + * non-existing file in the local file system. + */ +public class DocletOptionFile + extends DocletOption +{ + private File value; + + public DocletOptionFile(String optionName) + { + this(optionName, null); + } + + public DocletOptionFile(String optionName, File defaultFile) + { + super(optionName); + this.value = defaultFile; + } + + public File getValue() + { + return this.value; + } + + public int getLength() + { + return 2; + } + + public boolean set(String[] optionArr) + { + this.value = new File(optionArr[1]); + return true; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFlag.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFlag.java new file mode 100644 index 00000000000..0909a86fc63 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionFlag.java @@ -0,0 +1,52 @@ +/* gnu.classpath.tools.doclets.DocletOptionFlag + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets; + +/** + * Processes a doclet option without a value whose existance denotes + * that a specific feature should be enabled or disabled. + */ +public class DocletOptionFlag + extends DocletOption +{ + private boolean value = false; + + public DocletOptionFlag(String optionName) + { + super(optionName); + } + + public boolean getValue() + { + return this.value; + } + + public int getLength() + { + return 1; + } + + public boolean set(String[] optionArr) + { + value = true; + return true; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.java new file mode 100644 index 00000000000..261c676c380 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/DocletOptionPackageWildcard.java @@ -0,0 +1,108 @@ +/* gnu.classpath.tools.doclets.DocletOptionPackageWildcard + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets; + +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.SortedSet; +import java.util.StringTokenizer; +import java.util.TreeSet; + +import com.sun.javadoc.PackageDoc; + +/** + * Processes a doclet option whose value consists of a + * colon-separated list of package wildcards, or - optionally - + * equals the string "all", denoting that all packages should match. + */ +public class DocletOptionPackageWildcard + extends DocletOption +{ + private PackageMatcher packageMatcher; + private boolean allowAll; + private boolean specified; + + DocletOptionPackageWildcard(String optionName, boolean allowAll) + { + super(optionName); + this.allowAll = allowAll; + } + + public int getLength() + { + return 2; + } + + public boolean isSpecified() + { + return specified; + } + + public boolean set(String[] optionArr) + { + this.specified = true; + try { + if (allowAll && "all".equals(optionArr[2])) { + packageMatcher = null; + } + else { + packageMatcher = new PackageMatcher(); + + StringTokenizer tokenizer = new StringTokenizer(optionArr[2], ":"); + while (tokenizer.hasMoreTokens()) { + String packageWildcard = tokenizer.nextToken(); + packageMatcher.addWildcard(packageWildcard); + } + } + return true; + } + catch (InvalidPackageWildcardException e) { + // FIXME: output problem description here, better throw + // DocletConfigurationException + return false; + } + } + + public SortedSet filter(PackageDoc[] packages) + { + if (null != packageMatcher) { + return packageMatcher.filter(packages); + } + else { + SortedSet result = new TreeSet(); + for (int i=0; i0) { out.print(", "); } + out.print(thrownExceptions[k].qualifiedTypeName()); + } + out.println(); + } + + printSub2Header("Fields"); + + FieldDoc[] fields = classes[i].fields(); + + for (int j=0; jdiv and span tags by more + * specialized HTML tags. + */ +public class CssClass +{ + public static final CssClass BODY_MENU_PACKAGES = new CssClass("menu packages"); + public static final CssClass BODY_MENU_CLASSES = new CssClass("menu classes"); + public static final CssClass BODY_CONTENT_CLASS = new CssClass("content class"); + public static final CssClass BODY_CONTENT_DEPRECATED = new CssClass("content deprecated"); + public static final CssClass BODY_CONTENT_PACKAGE = new CssClass("content package"); + public static final CssClass BODY_CONTENT_OVERVIEW = new CssClass("content overview"); + public static final CssClass BODY_CONTENT_ABOUT = new CssClass("content about"); + public static final CssClass BODY_CONTENT_HELP = new CssClass("content help"); + public static final CssClass BODY_CONTENT_PACKAGE_TREE = new CssClass("content packagetree"); + public static final CssClass BODY_CONTENT_FULL_TREE = new CssClass("content fulltree"); + public static final CssClass BODY_CONTENT_INDEX = new CssClass("content index"); + public static final CssClass BODY_CONTENT_USES = new CssClass("content uses"); + public static final CssClass BODY_CONTENT_SOURCE = new CssClass("content source"); + + public static final CssClass OVERVIEW_TITLE = new CssClass("overview title", "h1"); + public static final CssClass OVERVIEW_SUMMARY = new CssClass("overview summary"); + public static final CssClass OVERVIEW_SUMMARY_LEFT = new CssClass("left"); + public static final CssClass OVERVIEW_SUMMARY_RIGHT = new CssClass("right"); + public static final CssClass OVERVIEW_DESCRIPTION_TOP = new CssClass("overview description top"); + public static final CssClass OVERVIEW_DESCRIPTION_FULL = new CssClass("overview description full"); + + public static final CssClass DEPRECATION_TITLE = new CssClass("deprecation title", "h1"); + public static final CssClass DEPRECATION_SUMMARY = new CssClass("summary"); + public static final CssClass DEPRECATION_SUMMARY_LEFT = new CssClass("left"); + public static final CssClass DEPRECATION_SUMMARY_DESCRIPTION = new CssClass("description"); + public static final CssClass DEPRECATION_TOC = new CssClass("dep-toc"); + public static final CssClass DEPRECATION_TOC_HEADER = new CssClass("header", "h3"); + public static final CssClass DEPRECATION_TOC_LIST = new CssClass("list", "ul"); + public static final CssClass DEPRECATION_TOC_ENTRY = new CssClass("entry", "li"); + public static final CssClass DEPRECATION_EMPTY = new CssClass("dep-empty", "p"); + public static final CssClass DEPRECATION_LIST = new CssClass("dep-list", "div"); + + public static final CssClass SERIALIZED_TITLE = new CssClass("serialized title", "h1"); + public static final CssClass SERIALIZED_PACKAGE_HEADER = new CssClass("serialized package header", "h2"); + public static final CssClass SERIALIZED_CLASS_HEADER = new CssClass("serialized class header", "h3"); + public static final CssClass SERIALIZED_SVUID_OUTER = new CssClass("serialized svuid outer", "p"); + public static final CssClass SERIALIZED_SVUID_HEADER = new CssClass("serialized svuid header", "b"); + public static final CssClass SERIALIZED_SVUID_VALUE = new CssClass("serialized svuid header"); + public static final CssClass SERIALIZED_SECTION = new CssClass("serialized section"); + public static final CssClass SERIALIZED_SECTION_HEADER = new CssClass("serialized section header", "h4"); + + public static final CssClass PACKAGE_TITLE = new CssClass("package title", "h1"); + public static final CssClass PACKAGE_SUMMARY = new CssClass("package summary"); + public static final CssClass PACKAGE_SUMMARY_LEFT = new CssClass("left"); + public static final CssClass PACKAGE_SUMMARY_RIGHT = new CssClass("right"); + public static final CssClass PACKAGE_DESCRIPTION_TOP = new CssClass("package description top"); + public static final CssClass PACKAGE_DESCRIPTION_FULL = new CssClass("package description full"); + public static final CssClass PACKAGE_TREE_TITLE = new CssClass("package tree title", "h1"); + public static final CssClass PACKAGE_TREE_SECTION_TITLE = new CssClass("package tree section title", "h2"); + public static final CssClass PACKAGE_TREE = new CssClass("tree", "ul"); + + public static final CssClass TREE_LINK = new CssClass("tree link", "b"); + + public static final CssClass FULL_TREE_PACKAGELIST = new CssClass("fulltree package list", "dl"); + public static final CssClass FULL_TREE_PACKAGELIST_HEADER = new CssClass("fulltree package header", "dt", "b"); + public static final CssClass FULL_TREE_PACKAGELIST_ITEM = new CssClass("fulltree package item", "dd"); + + public static final CssClass PACKAGE_MENU_LIST = new CssClass("package menu-list", "div"); + public static final CssClass PACKAGE_MENU_ENTRY = new CssClass("package menu-entry"); + public static final CssClass PACKAGE_MENU_TITLE = new CssClass("package menu-title", "h4"); + + public static final CssClass CLASS_MENU_LIST = new CssClass("classes menu-list", "div"); + public static final CssClass CLASS_MENU_TITLE = new CssClass("classes menu-title", "h4"); + public static final CssClass CLASS_MENU_SUBTITLE = new CssClass("classes menu-subtitle", "p"); + public static final CssClass CLASS_MENU_ENTRY_CLASS = new CssClass("classes menu-entry class"); + public static final CssClass CLASS_MENU_ENTRY_INTERFACE = new CssClass("classes menu-entry interface", "i"); + + public static final CssClass INDEX_TITLE = new CssClass("index title", "h1"); + public static final CssClass INDEX_CATEGORY = new CssClass("index category"); + public static final CssClass INDEX_CATEGORY_HEADER = new CssClass("index category header", "h2"); + public static final CssClass INDEX_ENTRY = new CssClass("index entry"); + public static final CssClass INDEX_ENTRY_DESCRIPTION = new CssClass("description"); + public static final CssClass INDEX_ENTRY_KEY = new CssClass("key"); + public static final CssClass INDEX_LETTERS = new CssClass("index letters"); + public static final CssClass INDEX_LETTER = new CssClass("index letter"); + public static final CssClass INDEX_LETTER_SPACER = new CssClass("index letter spacer"); + + public static final CssClass CLASS_TITLE = new CssClass("class title outer"); + public static final CssClass CLASS_TITLE_PACKAGE = new CssClass("class title-package", "h3"); + public static final CssClass CLASS_TITLE_CLASS = new CssClass("class title-class", "h1"); + public static final CssClass CLASS_SUBCLASSES = new CssClass("class subclasses", "dl"); + public static final CssClass CLASS_SUBCLASSES_HEADER = new CssClass("class subclasses header", "dt", "b"); + public static final CssClass CLASS_SUBCLASSES_ITEM = new CssClass("class subclasses header", "dd"); + public static final CssClass CLASS_ENCLOSINGCLASS = new CssClass("class enclosing", "dl"); + public static final CssClass CLASS_ENCLOSINGCLASS_HEADER = new CssClass("class enclosing header", "dt", "b"); + public static final CssClass CLASS_ENCLOSINGCLASS_ITEM = new CssClass("class enclosing item", "dd"); + public static final CssClass CLASS_KNOWNIMPLEMENTING = new CssClass("class knownimplementing", "dl"); + public static final CssClass CLASS_KNOWNIMPLEMENTING_HEADER = new CssClass("header", "dt", "b"); + public static final CssClass CLASS_KNOWNIMPLEMENTING_ITEM = new CssClass("item", "dd"); + public static final CssClass CLASS_INHERITANCETREE = new CssClass("class inheritance-tree"); + public static final CssClass CLASS_SYNOPSIS = new CssClass("class synopsis outer"); + public static final CssClass CLASS_SYNOPSIS_NAME = new CssClass("class synopsis name", "b"); + public static final CssClass CLASS_SYNOPSIS_DECLARATION = new CssClass("class synopsis declaration", "div", "code"); + public static final CssClass CLASS_SYNOPSIS_SUPERCLASS = new CssClass("class synopsis superclass", "div", "code"); + public static final CssClass CLASS_SYNOPSIS_IMPLEMENTS = new CssClass("class synopsis implements", "div", "code"); + public static final CssClass CLASS_DESCRIPTION = new CssClass("class description"); + public static final CssClass CLASS_SUMMARY = new CssClass("class summary"); + public static final CssClass CLASS_SUMMARY_LEFT = new CssClass("left", new String[] { "valign" }, new String[] { "top" }); + public static final CssClass CLASS_SUMMARY_LEFT_SYNOPSIS = new CssClass("synopsis", "code"); + public static final CssClass CLASS_SUMMARY_RIGHT = new CssClass("right"); + public static final CssClass CLASS_SUMMARY_RIGHT_LIST = new CssClass("list", "dl"); + public static final CssClass CLASS_SUMMARY_RIGHT_SYNOPSIS = new CssClass("synopsis", "dt", "code"); + public static final CssClass CLASS_SUMMARY_RIGHT_DESCRIPTION = new CssClass("description", "dd"); + public static final CssClass CLASS_SUMMARY_INHERITED = new CssClass("inherited"); + public static final CssClass CLASS_SUMMARY_INHERITED_MEMBER = new CssClass("member", "code"); + public static final CssClass CLASS_BOILERPLATE = new CssClass("boilerplate", "pre", new String[] { "style" }, new String[] { "font-size: x-small;" }); + + public static final CssClass USAGE_TITLE = new CssClass("usage title", "h1"); + public static final CssClass USAGE_PACKAGE_TITLE = new CssClass("usage package title", "h2"); + public static final CssClass USAGE_USAGE_TITLE = new CssClass("usage usage title", "h3"); + public static final CssClass USAGE_SUMMARY = new CssClass("usage summary"); + public static final CssClass USAGE_SUMMARY_LEFT = new CssClass("left"); + public static final CssClass USAGE_SUMMARY_RIGHT = new CssClass("right"); + public static final CssClass USAGE_SUMMARY_SYNOPSIS = new CssClass("synopsis"); + public static final CssClass USAGE_SUMMARY_DESCRIPTION = new CssClass("description"); + public static final CssClass USAGE_TABLE_HEADER = new CssClass("table header", "h3"); + public static final CssClass USAGE_EMPTY = new CssClass("usage empty", "p"); + + public static final CssClass MEMBER_DETAIL = new CssClass("member detail outer"); + public static final CssClass MEMBER_DETAIL_NAME = new CssClass("member detail name", "h3"); + public static final CssClass MEMBER_DETAIL_BODY = new CssClass("member detail name", "blockquote"); + public static final CssClass MEMBER_DETAIL_SYNOPSIS = new CssClass("member detail synopsis", "pre"); + public static final CssClass MEMBER_DETAIL_DESCRIPTION = new CssClass("member detail description"); + public static final CssClass MEMBER_DETAIL_SPECIFIED_BY_LIST = new CssClass("member detail specified by list", "dl"); + public static final CssClass MEMBER_DETAIL_SPECIFIED_BY_HEADER = new CssClass("member detail specified by header", "dt", "b"); + public static final CssClass MEMBER_DETAIL_SPECIFIED_BY_ITEM = new CssClass("member detail specified by item", "dd"); + public static final CssClass MEMBER_DETAIL_OVERRIDDEN_LIST = new CssClass("member detail overridden list", "dl"); + public static final CssClass MEMBER_DETAIL_OVERRIDDEN_HEADER = new CssClass("member detail overridden header", "dt", "b"); + public static final CssClass MEMBER_DETAIL_OVERRIDDEN_ITEM = new CssClass("member detail overridden item", "dd"); + public static final CssClass MEMBER_DETAIL_PARAMETER_LIST = new CssClass("parameter", "div", "dl"); + public static final CssClass MEMBER_DETAIL_PARAMETER_HEADER = new CssClass("header", "dt", "b"); + public static final CssClass MEMBER_DETAIL_PARAMETER_ITEM = new CssClass("item", "dd"); + public static final CssClass MEMBER_DETAIL_PARAMETER_ITEM_NAME = new CssClass("name", "code"); + public static final CssClass MEMBER_DETAIL_PARAMETER_ITEM_SEPARATOR = new CssClass("separator"); + public static final CssClass MEMBER_DETAIL_PARAMETER_ITEM_DESCRIPTION = new CssClass("description"); + public static final CssClass MEMBER_DETAIL_RETURN_LIST = new CssClass("member detail return list", "div", "dl"); + public static final CssClass MEMBER_DETAIL_RETURN_HEADER = new CssClass("member detail return header", "dt", "b"); + public static final CssClass MEMBER_DETAIL_RETURN_ITEM = new CssClass("member detail return item", "dd"); + public static final CssClass MEMBER_DETAIL_THROWN_LIST = new CssClass("member detail thrown list", "div", "dl"); + public static final CssClass MEMBER_DETAIL_THROWN_HEADER = new CssClass("member detail thrown header", "dt", "b"); + public static final CssClass MEMBER_DETAIL_THROWN_ITEM = new CssClass("member detail thrown item", "dd"); + public static final CssClass MEMBER_DETAIL_THROWN_ITEM_NAME = new CssClass("name", "code"); + public static final CssClass MEMBER_DETAIL_THROWN_ITEM_SEPARATOR = new CssClass("separator"); + public static final CssClass MEMBER_DETAIL_THROWN_ITEM_DESCRIPTION = new CssClass("description"); + + public static final CssClass TABLE_HEADER = new CssClass("table header", "h2"); + public static final CssClass TABLE_SUB_HEADER = new CssClass("table sub header", "h3"); + public static final CssClass TABLE_CONTAINER = new CssClass("table container", "dl", "dd"); + + public static final CssClass SECTION = new CssClass("section", "div"); + public static final CssClass SECTION_HEADER = new CssClass("section header", "h2"); + + public static final CssClass NAVBAR_TOP = new CssClass("navbar div top"); + public static final CssClass NAVBAR_TOP_NAVI = new CssClass("navi"); + public static final CssClass NAVBAR_TOP_HEADER = new CssClass("header", new String[] { "rowspan" }, new String[] { "2" }); + public static final CssClass NAVBAR_BOTTOM = new CssClass("navbar div bottom"); + public static final CssClass NAVBAR_BOTTOM_SPACER = new CssClass("navbar bottom spacer", "p"); + public static final CssClass NAVBAR_ITEM_ENABLED = new CssClass("navbar item enabled"); + public static final CssClass NAVBAR_ITEM_DISABLED = new CssClass("navbar item disabled"); + public static final CssClass NAVBAR_ITEM_ACTIVE = new CssClass("navbar item active"); + + public static final CssClass TAGLET = new CssClass("taglet", "div"); + + public static final CssClass ABOUT_TITLE = new CssClass("about title", "h1"); + public static final CssClass ABOUT_GENERATOR = new CssClass("about generator", "p"); + + public static final CssClass SOURCE = new CssClass("source body"); + public static final CssClass SOURCE_TITLE = new CssClass("source title", "h1"); + + public static final CssClass DEPRECATED = new CssClass("deprecated", "span"); + public static final CssClass DEPRECATED_INLINE = new CssClass("deprecated", "p"); + public static final CssClass DEPRECATED_HEADER = new CssClass("deprecated header", "b"); + public static final CssClass DEPRECATED_BODY = new CssClass("deprecated", "i"); + + private String name; + private String elementName; + private String innerElementName; + private String[] attributeNames; + private String[] attributeValues; + + private CssClass(String name) + { + this(name, null); + } + + private CssClass(String name, String elementName) + { + this(name, elementName, null); + } + + private CssClass(String name, String elementName, String innerElementName) + { + this(name, elementName, innerElementName, null, null); + } + + private CssClass(String name, String elementName, String[] attributeNames, String[] attributeValues) + { + this(name, null, null, attributeNames, attributeValues); + } + + private CssClass(String name, String[] attributeNames, String[] attributeValues) + { + this(name, null, null, attributeNames, attributeValues); + } + + private CssClass(String name, String elementName, String innerElementName, String[] attributeNames, String[] attributeValues) + { + this.name = name; + this.elementName = elementName; + this.innerElementName = innerElementName; + this.attributeNames = attributeNames; + this.attributeValues = attributeValues; + } + + public String getSpanElementName() + { + if (null != this.elementName) { + return this.elementName; + } + else { + return "span"; + } + } + + public String getDivElementName() + { + if (null != this.elementName) { + return this.elementName; + } + else { + return "div"; + } + } + + public String getInnerElementName() + { + return this.innerElementName; + } + + public String[] getAttributeNames() + { + return this.attributeNames; + } + + public String[] getAttributeValues() + { + return this.attributeValues; + } + + public String getName() + { + return name; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java new file mode 100644 index 00000000000..7fd2fa0624d --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/ExternalDocSet.java @@ -0,0 +1,170 @@ +/* gnu.classpath.tools.doclets.htmldoclet.ExternalDocSet + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.htmldoclet; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +import java.net.MalformedURLException; +import java.net.URL; + +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; + +import com.sun.javadoc.ClassDoc; + +public class ExternalDocSet +{ + private String url; + private String packageListDir; + private URL docSetDirectoryURL; + + public String getPackageListDir() + { + return packageListDir; + } + + public ExternalDocSet(String url, + String packageListDir) + { + this.url = url; + this.packageListDir = packageListDir; + } + + private Set packageNames = new HashSet(); + private boolean javadocCompatible; + + public void load(File targetDirectory) + throws IOException, MalformedURLException + { + if (!url.endsWith("/")) { + url += "/"; + } + + this.docSetDirectoryURL = new URL(targetDirectory.toURL(), + url); + + URL packageListDirURL; + if (null != packageListDir) { + if (!packageListDir.endsWith("/")) { + packageListDir += "/"; + } + packageListDirURL = new URL(new File(System.getProperty("user.dir")).toURL(), + packageListDir); + } + else { + packageListDirURL = docSetDirectoryURL; + } + + URL packageListURL = new URL(packageListDirURL, + "package-list"); + InputStream in = packageListURL.openStream(); + if (null != in) { + readPackages(in); + in.close(); + } + else { + throw new FileNotFoundException(packageListURL.toString()); + } + + URL gjdocPropertiesURL = new URL(packageListDirURL, + "gjdoc.properties"); + try { + InputStream propertiesIn = gjdocPropertiesURL.openStream(); + if (null != in) { + Properties properties = new Properties(); + properties.load(propertiesIn); + propertiesIn.close(); + + String gjdocCompatProperty = properties.getProperty("gjdoc.compat"); + if (null != gjdocCompatProperty) { + javadocCompatible = "true".equals(properties.getProperty("gjdoc.compat")); + } + else { + javadocCompatible = true; + } + } + else { + javadocCompatible = true; + } + } + catch (FileNotFoundException e) { + javadocCompatible = true; + } + } + + public String getPackageDocURL(String packageName) + { + try { + URL packageURL = new URL(docSetDirectoryURL, + packageName.replace('.', '/')); + return packageURL.toString(); + } + catch (MalformedURLException e) { + // This should not happen since we know that packageName is a + // proper Java identifiers, so the resulting URL can't be + // invalid + throw new RuntimeException(e); + } + } + + public String getClassDocURL(String packageName, String typeName) + { + try { + URL fileURL = new URL(docSetDirectoryURL, + packageName.replace('.', '/') + "/" + typeName + ".html"); + return fileURL.toString(); + } + catch (MalformedURLException e) { + // This should not happen since we know that packageName and + // typeName are proper Java identifiers, so the resulting URL + // can't be invalid + throw new RuntimeException(e); + } + } + + protected void readPackages(InputStream in) + throws IOException + { + BufferedReader reader + = new BufferedReader(new InputStreamReader(in, "UTF-8")); + String line; + while ((line = reader.readLine()) != null) { + line = line.trim(); + packageNames.add(line); + } + } + + public Set getPackageNames() + { + return packageNames; + } + + public boolean isJavadocCompatible() + { + return javadocCompatible; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java new file mode 100644 index 00000000000..837333ddf0f --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.java @@ -0,0 +1,3883 @@ +/* gnu.classpath.tools.doclets.htmldoclet.HtmlDoclet + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.htmldoclet; + +import gnu.classpath.tools.IOToolkit; + +import gnu.classpath.tools.doclets.AbstractDoclet; +import gnu.classpath.tools.doclets.DocletConfigurationException; +import gnu.classpath.tools.doclets.DocletOption; +import gnu.classpath.tools.doclets.DocletOptionFile; +import gnu.classpath.tools.doclets.DocletOptionFlag; +import gnu.classpath.tools.doclets.DocletOptionString; +import gnu.classpath.tools.doclets.PackageGroup; +import gnu.classpath.tools.doclets.TagletPrinter; +import gnu.classpath.tools.doclets.InlineTagRenderer; + +import gnu.classpath.tools.doclets.xmldoclet.HtmlRepairer; + +import gnu.classpath.tools.taglets.GnuExtendedTaglet; +import gnu.classpath.tools.taglets.TagletContext; + +import gnu.classpath.tools.java2xhtml.Java2xhtml; + +import gnu.classpath.tools.StringToolkit; + +import com.sun.javadoc.*; +import com.sun.tools.doclets.Taglet; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.io.StringWriter; + +import java.net.MalformedURLException; + +import java.nio.charset.Charset; + +import java.text.DateFormat; +import java.text.MessageFormat; + +import java.util.Arrays; +import java.util.Calendar; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.ListIterator; +import java.util.Locale; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.SortedSet; +import java.util.TimeZone; +import java.util.TreeSet; + +public class HtmlDoclet + extends AbstractDoclet + implements InlineTagRenderer +{ + private static String filenameExtension = ".html"; + + /** + * Contains ExternalDocSet. + */ + private List externalDocSets = new LinkedList(); + + /** + * Contains String->ExternalDocSet. + */ + private Map packageNameToDocSet = new HashMap(); + + /** + * Cache for version string from resource /version.properties + */ + private String docletVersion; + + /** + * For now, do not output a help page. + */ + private static final boolean outputHelpPage = false; + + /** + * Stores the output encoding (either the one specified using + * -charset, or the platform default encoding). + */ + private String outputCharset; + + private void printNavBar(HtmlPage output, String currentPage, ClassDoc currentClass) + { + output.beginDiv(CssClass.NAVBAR_TOP); + + boolean overviewLevel + = ("overview".equals(currentPage) + || "full-tree".equals(currentPage) + || "index".equals(currentPage) + || "split-index".equals(currentPage) + || "serialized".equals(currentPage) + || "deprecated".equals(currentPage) + || "about".equals(currentPage) + ); + + if (!isSinglePackage()) { + if ("overview".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Overview"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + output.beginAnchor(output.getPathToRoot() + "/overview-summary" + filenameExtension); + output.print("Overview"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + + output.print(" "); + } + + if (!overviewLevel || isSinglePackage()) { + if ("package".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Package"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + String packageHref; + if (isSinglePackage()) { + packageHref = output.getPathToRoot() + "/" + getPackageURL(getSinglePackage()) + "package-summary" + filenameExtension; + } + else { + packageHref = "package-summary" + filenameExtension; + } + output.beginAnchor(packageHref); + output.print("Package"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_DISABLED); + output.print("Package"); + output.endSpan(CssClass.NAVBAR_ITEM_DISABLED); + } + + if (optionUse.getValue() || optionLinkSource.getValue()) { + output.print(" "); + + if (null != currentClass) { + if ("class".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Class"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + output.beginAnchor(currentClass.name() + filenameExtension); + output.print("Class"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_DISABLED); + output.print("Class"); + output.endSpan(CssClass.NAVBAR_ITEM_DISABLED); + } + + if (optionUse.getValue()) { + output.print(" "); + + if (null != currentClass) { + if ("uses".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Use"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + output.beginAnchor(currentClass.name() + "-uses" + filenameExtension); + output.print("Use"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_DISABLED); + output.print("Use"); + output.endSpan(CssClass.NAVBAR_ITEM_DISABLED); + } + } + + if (optionLinkSource.getValue()) { + output.print(" "); + + + if ("source".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Source"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + + if (null != currentClass) { + + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + String targetClassName = currentClass.name(); + String targetAnchor = ""; + if (null != currentClass.containingClass()) { + targetClassName = getOuterClassDoc(currentClass).name(); + targetAnchor = "#line." + currentClass.position().line(); + } + output.beginAnchor(targetClassName + "-source" + filenameExtension + targetAnchor); + output.print("Source"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_DISABLED); + output.print("Source"); + output.endSpan(CssClass.NAVBAR_ITEM_DISABLED); + } + } + } + } + + + if (!optionNoTree.getValue()) { + output.print(" "); + + if ("full-tree".equals(currentPage) + || "package-tree".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Tree"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + String treeHref; + if (isSinglePackage() && overviewLevel) { + treeHref = getPackageURL(getSinglePackage()) + "tree" + filenameExtension; + } + else { + treeHref = "tree" + filenameExtension; + } + + output.beginAnchor(treeHref); + output.print("Tree"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + } + + output.print(" "); + + String indexName; + if (optionSplitIndex.getValue()) { + indexName = "alphaindex-1"; + } + else { + indexName = "alphaindex"; + } + + if ("index".equals(currentPage) || "split-index".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Index"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + output.beginAnchor(output.getPathToRoot() + "/" + indexName + filenameExtension); + output.print("Index"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + + if (!optionNoDeprecatedList.getValue()) { + output.print(" "); + + if ("deprecated".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Deprecated"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + output.beginAnchor(output.getPathToRoot() + "/deprecated" + filenameExtension); + output.print("Deprecated"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + } + + if (outputHelpPage) { + if (!optionNoHelp.getValue()) { + output.print(" "); + + if ("help".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("Help"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + output.beginAnchor(output.getPathToRoot() + "/help" + filenameExtension); + output.print("Help"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + } + } + + output.print(" "); + + if ("about".equals(currentPage)) { + output.beginSpan(CssClass.NAVBAR_ITEM_ACTIVE); + output.print("About"); + output.endSpan(CssClass.NAVBAR_ITEM_ACTIVE); + } + else { + output.beginSpan(CssClass.NAVBAR_ITEM_ENABLED); + output.beginAnchor(output.getPathToRoot() + "/about" + filenameExtension); + output.print("About"); + output.endAnchor(); + output.endSpan(CssClass.NAVBAR_ITEM_ENABLED); + } + + output.endDiv(CssClass.NAVBAR_TOP); + } + + private void printNavBarTopRow(HtmlPage output, String currentPage, ClassDoc currentClass) + { + output.beginRow(); + output.beginCell(CssClass.NAVBAR_TOP); + printNavBar(output, currentPage, currentClass); + output.endCell(); + if (null != optionHeader.getValue()) { + output.beginCell(CssClass.NAVBAR_TOP_HEADER); + output.print(replaceDocRoot(output, optionHeader.getValue())); + output.endCell(); + } + output.endRow(); + } + + private void printNavBarTopNaviCell(HtmlPage output) + { + output.beginCell(CssClass.NAVBAR_TOP_NAVI); + output.beginAnchor(output.getPathToRoot() + "/index" + filenameExtension, "Show in a frameset", "_top"); + output.print("Frames"); + output.endAnchor(); + output.print(" | "); + + output.beginAnchor(output.getFile().getName(), "Show without frames", "_top"); + output.print("No Frames"); + output.endAnchor(); + output.print(" "); + + output.endCell(); + } + + private void printNavBarTop(HtmlPage output, String currentPage) + { + printNavBarTop(output, currentPage, null, null, null); + } + + private void printNavBarTop(HtmlPage output, String currentPage, + ClassDoc currentClass, Object prev, Object next) + { + if (!optionNoNavBar.getValue()) { + output.beginTable(CssClass.NAVBAR_TOP); + printNavBarTopRow(output, currentPage, currentClass); + output.beginRow(); + if ("class".equals(currentPage)) { + output.beginCell(CssClass.NAVBAR_TOP_NAVI); + ClassDoc prevClass = (ClassDoc)prev; + ClassDoc nextClass = (ClassDoc)next; + if (null != prevClass) { + output.anchor(getClassDocURL(output, prevClass), "Prev Class"); + } + else { + output.print("Prev Class"); + } + output.print(" | "); + if (null != nextClass) { + output.anchor(getClassDocURL(output, nextClass), "Next Class"); + } + else { + output.print("Next Class"); + } + output.endCell(); + } + else if ("split-index".equals(currentPage)) { + output.beginCell(CssClass.NAVBAR_TOP_NAVI); + Integer prevLetter = (Integer)prev; + Integer nextLetter = (Integer)next; + if (null != prevLetter) { + output.anchor("alphaindex-" + prevLetter + filenameExtension, "Prev Letter"); + } + else { + output.print("Prev Letter"); + } + output.print(" | "); + if (null != nextLetter) { + output.anchor("alphaindex-" + nextLetter + filenameExtension, "Next Letter"); + } + else { + output.print("Next Letter"); + } + output.endCell(); + } + else { + output.beginCell(CssClass.NAVBAR_TOP_NAVI); + output.endCell(); + } + + printNavBarTopNaviCell(output); + output.endRow(); + + if ("class".equals(currentPage)) { + output.beginRow(); + + output.beginCell(CssClass.NAVBAR_TOP_NAVI); + output.print("Summary: "); + + if (currentClass.innerClasses().length > 0) { + output.anchor("#summary-inner", "Nested"); + } + else { + output.print("Nested"); + } + + output.print(" | "); + + if (currentClass.fields().length > 0) { + output.anchor("#summary-fields", "Field"); + } + else { + output.print("Field"); + } + + output.print(" | "); + + if (currentClass.methods().length > 0) { + output.anchor("#summary-methods", "Method"); + } + else { + output.print("Method"); + } + + output.print(" | "); + + if (currentClass.constructors().length > 0) { + output.anchor("#summary-constructors", "Constr"); + } + else { + output.print("Constr"); + } + + output.endCell(); + + output.beginCell(CssClass.NAVBAR_TOP_NAVI); + output.print("Detail: "); + + if (currentClass.innerClasses().length > 0) { + output.anchor("#detail-inner", "Nested"); + } + else { + output.print("Nested"); + } + + output.print(" | "); + + if (currentClass.fields().length > 0) { + output.anchor("#detail-fields", "Field"); + } + else { + output.print("Field"); + } + + output.print(" | "); + + if (currentClass.methods().length > 0) { + output.anchor("#detail-methods", "Method"); + } + else { + output.print("Method"); + } + + output.print(" | "); + + if (currentClass.constructors().length > 0) { + output.anchor("#detail-constructors", "Constr"); + } + else { + output.print("Constr"); + } + + output.endCell(); + output.endRow(); + } + output.endTable(); + } + } + + private void printNavBarTopPackage(HtmlPage output, String currentPage, + PackageDoc prevPackage, PackageDoc nextPackage) + { + if (!optionNoNavBar.getValue()) { + output.beginTable(CssClass.NAVBAR_TOP); + printNavBarTopRow(output, currentPage, null); + + output.beginRow(); + output.beginCell(CssClass.NAVBAR_TOP_NAVI); + if (null != prevPackage) { + output.anchor(output.getPathToRoot() + "/" + getPackageURL(prevPackage) + "package-summary" + filenameExtension, "Prev Package"); + } + else { + output.print("Prev Package"); + } + output.print(" | "); + if (null != nextPackage) { + output.anchor(output.getPathToRoot() + "/" + getPackageURL(nextPackage) + "package-summary" + filenameExtension, "Next Package"); + } + else { + output.print("Next Package"); + } + output.endCell(); + + printNavBarTopNaviCell(output); + output.endRow(); + + output.endTable(); + } + } + + private void printNavBarBottom(HtmlPage output, String currentPage) + { + printNavBarBottom(output, currentPage, null); + } + + private void printNavBarBottom(HtmlPage output, String currentPage, ClassDoc currentClass) + { + if ("class".equals(currentPage)) { + String boilerplate = null; + Tag[] boilerplateTags = getOuterClassDoc(currentClass).tags("@boilerplate"); + if (boilerplateTags.length > 0) { + boilerplate = boilerplateTags[0].text(); + } + if (null != boilerplate) { + output.hr(); + output.beginDiv(CssClass.CLASS_BOILERPLATE); + output.print(boilerplate); + output.endDiv(CssClass.CLASS_BOILERPLATE); + output.hr(); + } + } + + if (!optionNoNavBar.getValue()) { + output.beginDiv(CssClass.NAVBAR_BOTTOM_SPACER); + output.print(" "); + output.endDiv(CssClass.NAVBAR_BOTTOM_SPACER); + output.beginTable(CssClass.NAVBAR_BOTTOM); + output.beginRow(); + output.beginCell(); + printNavBar(output, currentPage, currentClass); + output.endCell(); + if (null != optionFooter.getValue()) { + output.beginCell(); + output.print(replaceDocRoot(output, optionFooter.getValue())); + output.endCell(); + } + output.endRow(); + output.endTable(); + } + + if (null != optionBottom.getValue()) { + output.hr(); + output.print(replaceDocRoot(output, optionBottom.getValue())); + } + } + + private void printPackagePageClasses(HtmlPage output, ClassDoc[] classDocs, String header) + { + if (classDocs.length > 0) { + output.beginDiv(CssClass.TABLE_CONTAINER); + output.beginTable(CssClass.PACKAGE_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); + output.rowDiv(CssClass.TABLE_HEADER, header); + + for (int i=0; i 0) { + out.println(packageName); + } + } + + out.close(); + } + + private void printPackagePage(File packageDir, String pathToRoot, + PackageDoc packageDoc, + PackageDoc prevPackageDoc, + PackageDoc nextPackageDoc) + throws IOException + { + HtmlPage output = newHtmlPage(new File(packageDir, "package-summary" + filenameExtension), + pathToRoot); + + Set keywords = new LinkedHashSet(); + keywords.add(packageDoc.name() + " packages"); + + output.beginPage(getPageTitle(packageDoc.name()), getOutputCharset(), + keywords, getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_PACKAGE); + printNavBarTopPackage(output, "package", prevPackageDoc, nextPackageDoc); + + output.beginDiv(CssClass.PACKAGE_TITLE); + output.print("Package "); + if (packageDoc.name().length() > 0) { + output.print(packageDoc.name()); + } + else { + output.print("<Unnamed>"); + } + output.endDiv(CssClass.PACKAGE_TITLE); + + output.beginDiv(CssClass.PACKAGE_DESCRIPTION_TOP); + printTags(output, packageDoc, packageDoc.firstSentenceTags(), true); + output.endDiv(CssClass.PACKAGE_DESCRIPTION_TOP); + + printPackagePageClasses(output, packageDoc.interfaces(), + "Interface Summary"); + printPackagePageClasses(output, packageDoc.ordinaryClasses(), + "Class Summary"); + printPackagePageClasses(output, packageDoc.exceptions(), + "Exception Summary"); + printPackagePageClasses(output, packageDoc.errors(), + "Error Summary"); + + output.anchorName("description"); + output.beginDiv(CssClass.PACKAGE_DESCRIPTION_FULL); + printTags(output, packageDoc, packageDoc.inlineTags(), false); + output.endDiv(CssClass.PACKAGE_DESCRIPTION_FULL); + + printNavBarBottom(output, "package"); + output.endBody(); + output.endPage(); + output.close(); + } + + static class TreeNode + implements Comparable + { + ClassDoc classDoc; + SortedSet children = new TreeSet(); + + TreeNode(ClassDoc classDoc) { + TreeNode.this.classDoc = classDoc; + } + + public boolean equals(Object other) + { + return classDoc.equals(((TreeNode)other).classDoc); + } + + public int compareTo(Object other) + { + return classDoc.compareTo(((TreeNode)other).classDoc); + } + + public int hashCode() + { + return classDoc.hashCode(); + } + } + + private TreeNode addClassTreeNode(Map treeMap, ClassDoc classDoc) + { + TreeNode node = (TreeNode)treeMap.get(classDoc.qualifiedName()); + if (null == node) { + node = new TreeNode(classDoc); + treeMap.put(classDoc.qualifiedName(), node); + + ClassDoc superClassDoc = (ClassDoc)classDoc.superclass(); + if (null != superClassDoc) { + TreeNode parentNode = addClassTreeNode(treeMap, superClassDoc); + parentNode.children.add(node); + } + } + return node; + } + + private TreeNode addInterfaceTreeNode(Map treeMap, ClassDoc classDoc) + { + TreeNode node = (TreeNode)treeMap.get(classDoc.qualifiedName()); + if (null == node) { + node = new TreeNode(classDoc); + treeMap.put(classDoc.qualifiedName(), node); + + ClassDoc[] superInterfaces = classDoc.interfaces(); + if (null != superInterfaces && superInterfaces.length > 0) { + for (int i=0; i"); + if (null == rootNode) { + rootNode = new TreeNode(null); + treeMap.put("", rootNode); + } + rootNode.children.add(node); + } + } + return node; + } + + private void printPackageTreeRec(HtmlPage output, TreeNode node, TreeNode parentNode) + { + output.beginElement("li", "class", "node"); + output.beginElement("div"); + if (node.classDoc.isIncluded()) { + String packageName = node.classDoc.containingPackage().name(); + if (packageName.length() > 0) { + output.print(packageName); + output.print("."); + } + output.beginSpan(CssClass.TREE_LINK); + printType(output, node.classDoc); + output.endSpan(CssClass.TREE_LINK); + } + else { + output.print(possiblyQualifiedName(node.classDoc)); + } + ClassDoc[] interfaces = node.classDoc.interfaces(); + ClassDoc parentClassDoc = null; + if (null != parentNode) { + parentClassDoc = parentNode.classDoc; + } + if (interfaces.length > 0 + && !(interfaces.length == 1 && interfaces[0].equals(parentClassDoc))) { + if (node.classDoc.isInterface()) { + output.print(" (also implements "); + } + else { + output.print(" (implements "); + } + + boolean firstItem = true; + for (int i=0; i"); + if (null != interfaceRoot) { + Iterator it = interfaceRoot.children.iterator(); + if (it.hasNext()) { + output.div(CssClass.PACKAGE_TREE_SECTION_TITLE, "Interface Hierarchy"); + output.beginDiv(CssClass.PACKAGE_TREE); + while (it.hasNext()) { + TreeNode node = (TreeNode)it.next(); + printPackageTreeRec(output, node, null); + } + output.endDiv(CssClass.PACKAGE_TREE); + } + } + + } + + private void printPackageTreePage(File packageDir, String pathToRoot, PackageDoc packageDoc) + throws IOException + { + HtmlPage output = newHtmlPage(new File(packageDir, + "tree" + filenameExtension), + pathToRoot); + output.beginPage(getPageTitle(packageDoc.name() + " Hierarchy"), + getOutputCharset(), + getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_PACKAGE_TREE); + printNavBarTop(output, "package-tree"); + + output.div(CssClass.PACKAGE_TREE_TITLE, "Hierarchy for Package " + packageDoc.name()); + + ClassDoc[] classDocs = packageDoc.allClasses(); + printClassTree(output, classDocs); + printInterfaceTree(output, classDocs); + + printNavBarBottom(output, "package-tree"); + output.endBody(); + output.endPage(); + output.close(); + } + + private void printFullTreePage() + throws IOException + { + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + "tree" + filenameExtension), + "."); + output.beginPage(getPageTitle("Hierarchy"), + getOutputCharset(), + getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_FULL_TREE); + printNavBarTop(output, "full-tree"); + + output.div(CssClass.PACKAGE_TREE_TITLE, "Hierarchy for All Packages"); + + output.beginDiv(CssClass.FULL_TREE_PACKAGELIST); + output.div(CssClass.FULL_TREE_PACKAGELIST_HEADER, "Package Hierarchies:"); + output.beginDiv(CssClass.FULL_TREE_PACKAGELIST_ITEM); + Set allPackages = getAllPackages(); + Iterator it = allPackages.iterator(); + while (it.hasNext()) { + PackageDoc packageDoc = (PackageDoc)it.next(); + output.beginAnchor(getPackageURL(packageDoc) + "tree" + filenameExtension); + output.print(packageDoc.name()); + output.endAnchor(); + if (it.hasNext()) { + output.print(", "); + } + } + output.endDiv(CssClass.FULL_TREE_PACKAGELIST_ITEM); + output.endDiv(CssClass.FULL_TREE_PACKAGELIST); + + ClassDoc[] classDocs = getRootDoc().classes(); + printClassTree(output, classDocs); + printInterfaceTree(output, classDocs); + + printNavBarBottom(output, "full-tree"); + output.endBody(); + output.endPage(); + output.close(); + } + + private void printIndexEntry(HtmlPage output, Doc entry) + { + output.beginDiv(CssClass.INDEX_ENTRY); + output.beginDiv(CssClass.INDEX_ENTRY_KEY); + String anchor = null; + String description = null; + if (entry instanceof PackageDoc) { + output.beginAnchor(getPackageURL((PackageDoc)entry) + "package-summary" + filenameExtension); + output.print(entry.name()); + output.endAnchor(); + output.print(" - package"); + } + else if (entry instanceof ClassDoc) { + ClassDoc classDoc = (ClassDoc)entry; + output.beginAnchor(getClassURL(classDoc)); + output.print(entry.name() + getTypeParameters(classDoc)); + output.endAnchor(); + output.print(" - "); + if (entry.isInterface()) { + output.print("interface "); + } + else if (entry.isException()) { + output.print("exception "); + } + else if (entry.isError()) { + output.print("error "); + } + else { + output.print("class "); + } + String packageName = classDoc.containingPackage().name(); + if (packageName.length() > 0) { + output.print(packageName); + output.print("."); + } + printType(output, classDoc); + } + else { + ProgramElementDoc memberDoc = (ProgramElementDoc)entry; + output.beginAnchor(getMemberDocURL(output, memberDoc)); + output.print(entry.name()); + if (memberDoc instanceof ExecutableMemberDoc) { + output.print(((ExecutableMemberDoc)memberDoc).signature()); + } + output.endAnchor(); + output.print(" - "); + + if (memberDoc.isStatic()) { + output.print("static "); + } + + if (entry.isConstructor()) { + output.print("constructor for class "); + } + else if (entry.isMethod()) { + output.print("method in class "); + } + else if (entry.isField()) { + output.print("field in class "); + } + ClassDoc containingClass = memberDoc.containingClass(); + String packageName = containingClass.containingPackage().name(); + if (packageName.length() > 0) { + output.print(packageName); + output.print("."); + } + printType(output, containingClass); + } + output.endDiv(CssClass.INDEX_ENTRY_KEY); + output.beginDiv(CssClass.INDEX_ENTRY_DESCRIPTION); + printTags(output, entry, entry.firstSentenceTags(), true); + output.endDiv(CssClass.INDEX_ENTRY_DESCRIPTION); + output.endDiv(CssClass.INDEX_ENTRY); + } + + private void printFrameSetPage() + throws IOException + { + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + "index" + filenameExtension), + ".", + HtmlPage.DOCTYPE_FRAMESET); + + String title = getWindowTitle(); + output.beginPage(title, getOutputCharset(), getStylesheets()); + output.beginElement("frameset", "cols", "20%,80%"); + + String contentURL; + if (isSinglePackage()) { + output.atomicElement("frame", + new String[] { "src", "name" }, + new String[] { getPackageURL(getSinglePackage()) + "classes" + filenameExtension, "classes" }); + contentURL = getPackageURL(getSinglePackage()) + "package-summary.html"; + } + else { + output.beginElement("frameset", "rows", "25%,75%"); + output.atomicElement("frame", + new String[] { "src", "name" }, + new String[] { "all-packages" + filenameExtension, "packages" }); + output.atomicElement("frame", + new String[] { "src", "name" }, + new String[] { "all-classes" + filenameExtension, "classes" }); + output.endElement("frameset"); + contentURL = "overview-summary" + filenameExtension; + } + output.atomicElement("frame", + new String[] { "src", "name" }, + new String[] { contentURL, "content" }); + output.endElement("frameset"); + output.endPage(); + output.close(); + } + + private void printPackagesMenuPage() + throws IOException + { + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + "all-packages" + filenameExtension), + "."); + output.beginPage(getPageTitle("Package Menu"), getOutputCharset(), getStylesheets()); + output.beginBody(CssClass.BODY_MENU_PACKAGES, false); + + output.beginSpan(CssClass.PACKAGE_MENU_ENTRY); + output.beginAnchor("all-classes" + filenameExtension, + null, + "classes"); + output.print("All Classes"); + output.endAnchor(); + output.endSpan(CssClass.PACKAGE_MENU_ENTRY); + + output.div(CssClass.PACKAGE_MENU_TITLE, "Packages"); + + output.beginDiv(CssClass.PACKAGE_MENU_LIST); + + Set packageDocs = getAllPackages(); + Iterator it = packageDocs.iterator(); + while (it.hasNext()) { + PackageDoc packageDoc = (PackageDoc)it.next(); + output.beginSpan(CssClass.PACKAGE_MENU_ENTRY); + output.beginAnchor(getPackageURL(packageDoc) + "classes" + filenameExtension, + null, + "classes"); + if (packageDoc.name().length() > 0) { + output.print(packageDoc.name()); + } + else { + output.print("<unnamed package>"); + } + output.endAnchor(); + output.endSpan(CssClass.PACKAGE_MENU_ENTRY); + output.br(); + } + + output.endDiv(CssClass.PACKAGE_MENU_LIST); + output.endBody(); + output.endPage(); + output.close(); + } + + private void printClassMenuEntry(HtmlPage output, ClassDoc classDoc) + { + CssClass entryClass; + if (classDoc.isInterface()) { + entryClass = CssClass.CLASS_MENU_ENTRY_INTERFACE; + } + else { + entryClass = CssClass.CLASS_MENU_ENTRY_CLASS; + } + output.beginSpan(entryClass); + output.beginAnchor(getClassDocURL(output, classDoc), + classDoc.qualifiedTypeName(), + "content"); + output.print(classDoc.name()); + output.endAnchor(); + output.endSpan(entryClass); + output.br(); + } + + private void printClassMenuSection(HtmlPage output, Collection classDocs, String header) + { + if (!classDocs.isEmpty()) { + output.div(CssClass.CLASS_MENU_SUBTITLE, header); + Iterator it = classDocs.iterator(); + while (it.hasNext()) { + ClassDoc classDoc = (ClassDoc)it.next(); + printClassMenuEntry(output, classDoc); + } + } + } + + private void printClassMenuList(HtmlPage output, ClassDoc[] classDocs, boolean categorized) + { + output.beginDiv(CssClass.CLASS_MENU_LIST); + + if (categorized) { + Set classes = new TreeSet(); + Set interfaces = new TreeSet(); + Set exceptions = new TreeSet(); + Set errors = new TreeSet(); + + for (int i=0; i 0) { + output.print(packageDoc.name()); + } + else { + output.print("<Unnamed>"); + } + output.endAnchor(); + output.endDiv(CssClass.CLASS_MENU_TITLE); + + printClassMenuList(output, packageDoc.allClasses(), true); + + output.endBody(); + output.endPage(); + output.close(); + } + + private void printSplitIndex() + throws IOException + { + Map categorizedIndex = getCategorizedIndex(); + Iterator it = categorizedIndex.keySet().iterator(); + int n = 1; + int count = categorizedIndex.size(); + while (it.hasNext()) { + Character c = (Character)it.next(); + List classList = (List)categorizedIndex.get(c); + printIndexPage(n++, count, c, classList); + } + } + + private void printIndexPage() + throws IOException + { + printIndexPage(0, 0, null, null); + } + + private void printIndexPage(int index, int maxIndex, Character letter, List classList) + throws IOException + { + String pageName = "alphaindex"; + if (null != letter) { + pageName += "-" + index; + } + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + pageName + filenameExtension), + "."); + output.beginPage(getPageTitle("Alphabetical Index"), + getOutputCharset(), + getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_INDEX); + if (null == letter) { + printNavBarTop(output, "index"); + } + else { + printNavBarTop(output, "split-index", null, + (index > 1) ? new Integer(index - 1) : null, + (index < maxIndex) ? new Integer(index + 1) : null); + } + + { + String title; + if (null == letter) { + title = "Alphabetical Index"; + } + else { + title = "Alphabetical Index: " + letter; + } + output.div(CssClass.INDEX_TITLE, title); + + if (null != letter || getCategorizedIndex().keySet().size() > 1) { + output.beginDiv(CssClass.INDEX_LETTERS); + + Iterator it = getCategorizedIndex().keySet().iterator(); + int n = 1; + while (it.hasNext()) { + Character c = (Character)it.next(); + output.beginSpan(CssClass.INDEX_LETTER); + if (letter != null) { + output.beginAnchor("alphaindex-" + n + filenameExtension); + } + else { + output.beginAnchor("#" + c); + } + output.print(c.toString()); + output.endAnchor(); + output.endSpan(CssClass.INDEX_LETTER); + output.beginSpan(CssClass.INDEX_LETTER_SPACER); + output.print(" "); + output.endSpan(CssClass.INDEX_LETTER_SPACER); + ++n; + } + } + + output.endDiv(CssClass.INDEX_LETTERS); + } + + if (null != letter) { + printIndexCategory(output, letter, classList); + } + else { + Map categorizedIndex = getCategorizedIndex(); + Iterator categoryIt = categorizedIndex.keySet().iterator(); + + while (categoryIt.hasNext()) { + letter = (Character)categoryIt.next(); + classList = (List)categorizedIndex.get(letter); + output.anchorName(letter.toString()); + printIndexCategory(output, letter, classList); + } + } + + printNavBarBottom(output, "index"); + output.endBody(); + output.endPage(); + output.close(); + } + + private void printIndexCategory(HtmlPage output, Character letter, List classList) + { + Iterator it = classList.iterator(); + + output.div(CssClass.INDEX_CATEGORY_HEADER, letter.toString()); + output.beginDiv(CssClass.INDEX_CATEGORY); + while (it.hasNext()) { + Doc entry = (Doc)it.next(); + printIndexEntry(output, entry); + } + output.endDiv(CssClass.INDEX_CATEGORY); + } + + private void printDeprecationSummary(HtmlPage output, List docs, String header) + { + if (!docs.isEmpty()) { + output.beginDiv(CssClass.TABLE_CONTAINER); + output.beginTable(CssClass.DEPRECATION_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); + output.rowDiv(CssClass.TABLE_HEADER, header); + + Iterator it = docs.iterator(); + while (it.hasNext()) { + Doc doc = (Doc)it.next(); + output.beginRow(); + + output.beginCell(CssClass.DEPRECATION_SUMMARY_LEFT); + if (doc instanceof Type) { + printType(output, (Type)doc); + } + else { + ProgramElementDoc memberDoc = (ProgramElementDoc)doc; + output.beginAnchor(getMemberDocURL(output, memberDoc)); + output.print(memberDoc.containingClass().qualifiedName()); + output.print("."); + output.print(memberDoc.name()); + if (memberDoc instanceof ExecutableMemberDoc) { + output.print(((ExecutableMemberDoc)memberDoc).flatSignature()); + } + output.endAnchor(); + } + output.beginDiv(CssClass.DEPRECATION_SUMMARY_DESCRIPTION); + printTags(output, doc, doc.tags("deprecated")[0].firstSentenceTags(), true); + output.endDiv(CssClass.DEPRECATION_SUMMARY_DESCRIPTION); + + output.endCell(); + + output.endRow(); + } + output.endTable(); + output.endDiv(CssClass.TABLE_CONTAINER); + output.print("\n"); + } + } + + + private void printSerializationPage() + throws IOException + { + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + "serialized-form" + filenameExtension), + "."); + output.beginPage(getPageTitle("Serialized Form"), + getOutputCharset(), + getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_DEPRECATED); + printNavBarTop(output, "serialized"); + + output.div(CssClass.SERIALIZED_TITLE, "Serialized Form"); + + Iterator it = getAllPackages().iterator(); + + while (it.hasNext()) { + + PackageDoc packageDoc = (PackageDoc)it.next(); + + List serializableClasses = new LinkedList(); + ClassDoc[] classes = packageDoc.allClasses(); + for (int i=0; i 0) { + if (classDoc.isInterface()) { + deprecatedInterfaces.add(classDoc); + } + else if (classDoc.isException()) { + deprecatedExceptions.add(classDoc); + } + else if (classDoc.isError()) { + deprecatedErrors.add(classDoc); + } + else { + deprecatedClasses.add(classDoc); + } + } + } + ConstructorDoc[] constructors = classDoc.constructors(); + for (int j=0; j 0) { + deprecatedConstructors.add(constructors[j]); + } + } + MethodDoc[] methods = classDoc.methods(); + for (int j=0; j 0) { + deprecatedMethods.add(methods[j]); + } + } + FieldDoc[] fields = classDoc.fields(); + for (int j=0; j 0) { + deprecatedFields.add(fields[j]); + } + } + } + + if (!deprecatedInterfaces.isEmpty() + || !deprecatedClasses.isEmpty() + || !deprecatedExceptions.isEmpty() + || !deprecatedErrors.isEmpty() + || !deprecatedFields.isEmpty() + || !deprecatedMethods.isEmpty() + || !deprecatedConstructors.isEmpty()) { + + output.beginDiv(CssClass.DEPRECATION_TOC); + output.div(CssClass.DEPRECATION_TOC_HEADER, "Contents"); + output.beginDiv(CssClass.DEPRECATION_TOC_LIST); + if (!deprecatedInterfaces.isEmpty()) { + output.beginDiv(CssClass.DEPRECATION_TOC_ENTRY); + output.anchor("#interfaces", "Deprecated Interfaces"); + output.endDiv(CssClass.DEPRECATION_TOC_ENTRY); + } + if (!deprecatedClasses.isEmpty()) { + output.beginDiv(CssClass.DEPRECATION_TOC_ENTRY); + output.anchor("#classes", "Deprecated Classes"); + output.endDiv(CssClass.DEPRECATION_TOC_ENTRY); + } + if (!deprecatedExceptions.isEmpty()) { + output.beginDiv(CssClass.DEPRECATION_TOC_ENTRY); + output.anchor("#exceptions", "Deprecated Exceptions"); + output.endDiv(CssClass.DEPRECATION_TOC_ENTRY); + } + if (!deprecatedErrors.isEmpty()) { + output.beginDiv(CssClass.DEPRECATION_TOC_ENTRY); + output.anchor("#errors", "Deprecated Errors"); + output.endDiv(CssClass.DEPRECATION_TOC_ENTRY); + } + if (!deprecatedFields.isEmpty()) { + output.beginDiv(CssClass.DEPRECATION_TOC_ENTRY); + output.anchor("#fields", "Deprecated Fields"); + output.endDiv(CssClass.DEPRECATION_TOC_ENTRY); + } + if (!deprecatedMethods.isEmpty()) { + output.beginDiv(CssClass.DEPRECATION_TOC_ENTRY); + output.anchor("#methods", "Deprecated Methods"); + output.endDiv(CssClass.DEPRECATION_TOC_ENTRY); + } + if (!deprecatedConstructors.isEmpty()) { + output.beginDiv(CssClass.DEPRECATION_TOC_ENTRY); + output.anchor("#constructors", "Deprecated Constructors"); + output.endDiv(CssClass.DEPRECATION_TOC_ENTRY); + } + output.endDiv(CssClass.DEPRECATION_TOC_LIST); + output.endDiv(CssClass.DEPRECATION_TOC); + output.beginDiv(CssClass.DEPRECATION_LIST); + + output.anchorName("interfaces"); + printDeprecationSummary(output, deprecatedInterfaces, "Deprecated Interfaces"); + + output.anchorName("classes"); + printDeprecationSummary(output, deprecatedClasses, "Deprecated Classes"); + + output.anchorName("exceptions"); + printDeprecationSummary(output, deprecatedExceptions, "Deprecated Exceptions"); + + output.anchorName("errors"); + printDeprecationSummary(output, deprecatedErrors, "Deprecated Errors"); + + output.anchorName("fields"); + printDeprecationSummary(output, deprecatedFields, "Deprecated Fields"); + + output.anchorName("methods"); + printDeprecationSummary(output, deprecatedMethods, "Deprecated Methods"); + + output.anchorName("constructors"); + printDeprecationSummary(output, deprecatedConstructors, "Deprecated Constructors"); + + output.endDiv(CssClass.DEPRECATION_LIST); + } + else { + output.beginDiv(CssClass.DEPRECATION_EMPTY); + output.print("No deprecated classes or class members in this API."); + output.endDiv(CssClass.DEPRECATION_EMPTY); + + } + + printNavBarBottom(output, "deprecated"); + output.endBody(); + output.endPage(); + output.close(); + } + + private void printAboutPage() + throws IOException + { + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + "about" + filenameExtension), + "."); + output.beginPage(getPageTitle("About"), + getOutputCharset(), + getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_ABOUT); + + printNavBarTop(output, "about"); + + output.div(CssClass.ABOUT_TITLE, "About"); + + output.beginDiv(CssClass.ABOUT_GENERATOR); + output.print("Generated by "); + output.print("Gjdoc"); + output.print(" HtmlDoclet "); + output.print(getDocletVersion()); + output.print(", part of "); + output.beginAnchor("http://www.gnu.org/software/classpath/cp-tools/", "", "_top"); + output.print("GNU Classpath Tools"); + output.endAnchor(); + output.print(", on "); + DateFormat format = DateFormat.getDateTimeInstance(DateFormat.LONG, + DateFormat.LONG, + Locale.US); + Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"), + Locale.US); + format.setCalendar(cal); + output.print(format.format(new Date())); + output.print("."); + output.endDiv(CssClass.ABOUT_GENERATOR); + + printNavBarBottom(output, "about"); + + output.endBody(); + output.endPage(); + output.close(); + } + + private void printSourcePage(File packageDir, ClassDoc classDoc, String sourceXhtml) + throws IOException + { + HtmlPage output = newHtmlPage(new File(packageDir, + classDoc.name() + "-source" + filenameExtension), + getPathToRoot(packageDir, getTargetDirectory())); + output.beginPage(getPageTitle("Source for " + classDoc.qualifiedTypeName()), + getOutputCharset(), + getStylesheets()); + + output.beginBody(CssClass.BODY_CONTENT_SOURCE); + + printNavBarTop(output, "source", classDoc, null, null); + + output.div(CssClass.SOURCE_TITLE, "Source for " + classDoc.qualifiedTypeName()); + output.beginDiv(CssClass.SOURCE); + output.print(sourceXhtml); + output.endDiv(CssClass.SOURCE); + + printNavBarBottom(output, "source", classDoc); + + output.endBody(); + output.endPage(); + + output.close(); + } + + private void printHelpPage() + throws IOException + { + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + "help" + filenameExtension), + "."); + output.beginPage(getPageTitle("Help"), + getOutputCharset(), + getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_HELP); + + printNavBarTop(output, "help"); + + InputStream helpIn; + if (null != optionHelpFile.getValue()){ + helpIn = new FileInputStream(optionHelpFile.getValue()); + } + else { + helpIn = getClass().getResourceAsStream("/htmldoclet/help.xhtml"); + } + output.insert(new InputStreamReader(helpIn, "utf-8")); + helpIn.close(); + + printNavBarBottom(output, "help"); + + output.endBody(); + output.endPage(); + output.close(); + } + + private void printOverviewPage() + throws IOException + { + HtmlPage output = newHtmlPage(new File(getTargetDirectory(), + "overview-summary" + filenameExtension), + "."); + output.beginPage(getWindowTitle(), + getOutputCharset(), + getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_OVERVIEW); + + printNavBarTop(output, "overview"); + + String overviewHeader; + if (null != optionDocTitle.getValue()) { + overviewHeader = optionDocTitle.getValue(); + } + else if (null != optionTitle.getValue()) { + overviewHeader = optionTitle.getValue(); + } + else { + overviewHeader = null; + } + + if (null != overviewHeader) { + output.div(CssClass.OVERVIEW_TITLE, overviewHeader); + } + + output.beginDiv(CssClass.OVERVIEW_DESCRIPTION_TOP); + printTags(output, getRootDoc(), getRootDoc().firstSentenceTags(), true); + output.endDiv(CssClass.OVERVIEW_DESCRIPTION_TOP); + + List packageGroups = getPackageGroups(); + + if (packageGroups.isEmpty()) { + + printOverviewPackages(output, getAllPackages(), + "All Packages"); + } + else { + Set otherPackages = new LinkedHashSet(); + otherPackages.addAll(getAllPackages()); + + Iterator it = packageGroups.iterator(); + while (it.hasNext()) { + PackageGroup packageGroup = (PackageGroup)it.next(); + printOverviewPackages(output, + packageGroup.getPackages(), + packageGroup.getName()); + otherPackages.removeAll(packageGroup.getPackages()); + } + + if (!otherPackages.isEmpty()) { + printOverviewPackages(output, + otherPackages, + "Other Packages"); + } + } + + output.anchorName("description"); + output.beginDiv(CssClass.OVERVIEW_DESCRIPTION_FULL); + printTags(output, getRootDoc(), getRootDoc().inlineTags(), false); + output.endDiv(CssClass.OVERVIEW_DESCRIPTION_FULL); + + printNavBarBottom(output, "overview"); + output.endBody(); + output.endPage(); + output.close(); + } + + private void printOverviewPackages(HtmlPage output, Collection packageDocs, String header) + { + output.beginDiv(CssClass.TABLE_CONTAINER); + output.beginTable(CssClass.OVERVIEW_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); + output.rowDiv(CssClass.TABLE_HEADER, header); + + Iterator it = packageDocs.iterator(); + while (it.hasNext()) { + PackageDoc packageDoc = (PackageDoc)it.next(); + output.beginRow(); + + output.beginCell(CssClass.OVERVIEW_SUMMARY_LEFT); + output.beginAnchor(getPackageURL(packageDoc) + "package-summary" + filenameExtension); + output.print(packageDoc.name()); + output.endAnchor(); + output.endCell(); + + output.beginCell(CssClass.OVERVIEW_SUMMARY_RIGHT); + printTags(output, packageDoc, packageDoc.firstSentenceTags(), true); + output.endCell(); + output.endRow(); + } + output.endTable(); + output.endDiv(CssClass.TABLE_CONTAINER); + } + + private void printClassUsagePage(File packageDir, String pathToRoot, ClassDoc classDoc) + throws IOException + { + HtmlPage output = newHtmlPage(new File(packageDir, + classDoc.name() + "-uses" + filenameExtension), + pathToRoot); + output.beginPage(getPageTitle(classDoc.name()), getOutputCharset(), getStylesheets()); + output.beginBody(CssClass.BODY_CONTENT_USES); + printNavBarTop(output, "uses", classDoc, null, null); + + output.div(CssClass.USAGE_TITLE, + "Uses of " + getClassTypeName(classDoc) + + " " + classDoc.qualifiedName()); + + Map packageToUsageTypeMap = getUsageOfClass(classDoc); + if (null != packageToUsageTypeMap && !packageToUsageTypeMap.isEmpty()) { + + Iterator packagesIterator = packageToUsageTypeMap.keySet().iterator(); + while (packagesIterator.hasNext()) { + PackageDoc packageDoc = (PackageDoc)packagesIterator.next(); + + output.div(CssClass.USAGE_PACKAGE_TITLE, "Uses in package " + packageDoc.name()); + + Map usageTypeToUsersMap = (Map)packageToUsageTypeMap.get(packageDoc); + Iterator usageTypeIterator = usageTypeToUsersMap.keySet().iterator(); + while (usageTypeIterator.hasNext()) { + UsageType usageType = (UsageType)usageTypeIterator.next(); + + output.beginTable(CssClass.USAGE_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); + output.rowDiv(CssClass.USAGE_TABLE_HEADER, format("usagetype." + usageType.getId(), + classDoc.qualifiedName())); + + Set users = (Set)usageTypeToUsersMap.get(usageType); + Iterator userIterator = users.iterator(); + while (userIterator.hasNext()) { + Doc user = (Doc)userIterator.next(); + + output.beginRow(); + + if (user instanceof ClassDoc) { + output.beginCell(CssClass.USAGE_SUMMARY_LEFT); + output.print("class"); + output.endCell(); + + output.beginCell(CssClass.USAGE_SUMMARY_RIGHT); + output.beginDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + printType(output, ((ClassDoc)user)); + output.endDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + output.beginDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + printTags(output, ((ClassDoc)user), ((ClassDoc)user).firstSentenceTags(), true); + output.endDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + output.endCell(); + } + else if (user instanceof FieldDoc) { + FieldDoc fieldDoc = (FieldDoc)user; + + output.beginCell(CssClass.USAGE_SUMMARY_LEFT); + printType(output, ((FieldDoc)user).type()); + output.endCell(); + + output.beginCell(CssClass.USAGE_SUMMARY_RIGHT); + output.beginDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + printType(output, ((FieldDoc)user).containingClass()); + output.print("."); + output.beginAnchor(getMemberDocURL(output, (FieldDoc)user)); + output.print(((FieldDoc)user).name()); + output.endAnchor(); + output.endDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + output.beginDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + printTags(output, ((FieldDoc)user), ((FieldDoc)user).firstSentenceTags(), true); + output.endDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + output.endCell(); + } + else if (user instanceof MethodDoc) { + MethodDoc methodDoc = (MethodDoc)user; + + output.beginCell(CssClass.USAGE_SUMMARY_LEFT); + printType(output, ((MethodDoc)user).returnType()); + output.endCell(); + + output.beginCell(CssClass.USAGE_SUMMARY_RIGHT); + output.beginDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + printType(output, ((MethodDoc)user).containingClass()); + output.print("."); + output.beginAnchor(getMemberDocURL(output, (MethodDoc)user)); + output.print(((MethodDoc)user).name()); + output.endAnchor(); + printParameters(output, (ExecutableMemberDoc)user); + output.endDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + output.beginDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + printTags(output, ((MethodDoc)user), ((MethodDoc)user).firstSentenceTags(), true); + output.endDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + output.endCell(); + } + else if (user instanceof ConstructorDoc) { + ConstructorDoc constructorDoc = (ConstructorDoc)user; + + output.beginCell(CssClass.USAGE_SUMMARY_RIGHT); + output.beginDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + printType(output, ((ConstructorDoc)user).containingClass()); + output.print("."); + output.beginAnchor(getMemberDocURL(output, (ConstructorDoc)user)); + output.print(((ConstructorDoc)user).name()); + output.endAnchor(); + printParameters(output, (ExecutableMemberDoc)user); + output.endDiv(CssClass.USAGE_SUMMARY_SYNOPSIS); + output.beginDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + printTags(output, ((ConstructorDoc)user), + ((ConstructorDoc)user).firstSentenceTags(), true); + output.endDiv(CssClass.USAGE_SUMMARY_DESCRIPTION); + output.endCell(); + } + + output.endRow(); + } + output.endTable(); + } + } + } + else { + output.div(CssClass.USAGE_EMPTY, + getClassTypeName(classDoc) + + " " + classDoc.qualifiedName() + " is not used by any class in this documentation set."); + } + printNavBarBottom(output, "uses", classDoc); + output.endBody(); + output.endPage(); + output.close(); + } + + private void printSuperTreeRec(HtmlPage output, ListIterator it, int level) + { + if (it.hasPrevious()) { + ClassDoc cd = (ClassDoc)it.previous(); + output.beginElement("li", new String[] { "class" }, new String[] { "inheritance " + level }); + output.beginElement("code"); + if (it.hasPrevious()) { + printType(output, cd, true); + } + else { + output.print(cd.qualifiedName() + getTypeParameters(cd)); + } + output.endElement("code"); + output.endElement("li"); + + output.beginElement("li"); + + if (it.hasPrevious()) { + output.beginElement("ul", new String[] { "class" }, new String[] { "inheritance " + (level + 1) }); + printSuperTreeRec(output, it, level + 1); + output.endElement("ul"); + } + + output.endElement("li"); + } + } + + private static boolean isSubInterface(ClassDoc classDoc, ClassDoc otherClassDoc) + { + ClassDoc[] interfaces = otherClassDoc.interfaces(); + for (int i=0; i 0) { + output.beginDiv(CssClass.CLASS_SYNOPSIS_IMPLEMENTS); + if (!classDoc.isInterface()) { + output.print("implements "); + } + else { + output.print("extends "); + } + for (int i=0; i0) { + output.print(", "); + } + printType(output, interfaces[i]); + } + output.endDiv(CssClass.CLASS_SYNOPSIS_IMPLEMENTS); + } + output.endDiv(CssClass.CLASS_SYNOPSIS); + + output.hr(); + + if (!optionNoComment.getValue()) { + output.beginDiv(CssClass.CLASS_DESCRIPTION); + printTags(output, classDoc, classDoc.inlineTags(), false); + output.endDiv(CssClass.CLASS_DESCRIPTION); + + printTaglets(output, classDoc.tags(), new HtmlTagletContext(classDoc, output, false)); + } + + + Set implementedInterfaces = getImplementedInterfaces(classDoc); + + boolean haveInheritedFields = false; + boolean haveInheritedMethods = false; + boolean haveInheritedClasses = false; + { + if (!classDoc.isInterface()) { + ClassDoc superClassDoc = classDoc.superclass(); + while (null != superClassDoc + && (!haveInheritedFields + || !haveInheritedMethods + || !haveInheritedClasses)) { + if (superClassDoc.fields().length > 0) { + haveInheritedFields = true; + } + if (superClassDoc.methods().length > 0) { + haveInheritedMethods = true; + } + if (superClassDoc.innerClasses().length > 0) { + haveInheritedClasses = true; + } + superClassDoc = superClassDoc.superclass(); + } + } + } + + printProgramElementDocs(output, getSortedInnerClasses(classDoc), + "Nested Class Summary", haveInheritedClasses, + "summary-inner"); + + { + ClassDoc superClassDoc = classDoc.superclass(); + while (null != superClassDoc) { + printInheritedMembers(output, getSortedInnerClasses(superClassDoc), + "Nested classes/interfaces inherited from class {0}", + superClassDoc); + superClassDoc = superClassDoc.superclass(); + } + } + + printProgramElementDocs(output, getSortedFields(classDoc), + "Field Summary", haveInheritedFields, + "summary-fields"); + + { + ClassDoc superClassDoc = classDoc.superclass(); + while (null != superClassDoc) { + printInheritedMembers(output, getSortedFields(superClassDoc), + "Fields inherited from class {0}", + superClassDoc); + superClassDoc = superClassDoc.superclass(); + } + } + + { + Iterator it = implementedInterfaces.iterator(); + while (it.hasNext()) { + ClassDoc implementedInterface + = (ClassDoc)it.next(); + if (!"java.io.Serializable".equals(implementedInterface.qualifiedName()) + && !"java.io.Externalizable".equals(implementedInterface.qualifiedName())) { + printInheritedMembers(output, getSortedFields(implementedInterface), + "Fields inherited from interface {0}", + implementedInterface); + } + } + } + + printProgramElementDocs(output, getSortedConstructors(classDoc), + "Constructor Summary", false, + "summary-constructors"); + printProgramElementDocs(output, getSortedMethods(classDoc), + "Method Summary", haveInheritedMethods, + "summary-methods"); + + if (classDoc.isInterface()) { + InterfaceRelation relation + = (InterfaceRelation)getInterfaceRelations().get(classDoc); + Iterator it = relation.superInterfaces.iterator(); + while (it.hasNext()) { + ClassDoc superClassDoc = (ClassDoc)it.next(); + printInheritedMembers(output, getSortedMethods(superClassDoc), + "Methods inherited from interface {0}", + superClassDoc); + } + } + else { + ClassDoc superClassDoc = classDoc.superclass(); + while (null != superClassDoc) { + printInheritedMembers(output, getSortedMethods(superClassDoc), + "Methods inherited from class {0}", + superClassDoc); + superClassDoc = superClassDoc.superclass(); + } + } + + printMemberDetails(output, getSortedFields(classDoc), + "Field Details", false, "detail-fields"); + printMemberDetails(output, getSortedConstructors(classDoc), + "Constructor Details", false, "detail-constructors"); + printMemberDetails(output, getSortedMethods(classDoc), + "Method Details", false, "detail-methods"); + + printNavBarBottom(output, "class", classDoc); + + output.endBody(); + output.endPage(); + output.close(); + } + + private void printInheritedMembers(HtmlPage output, + ProgramElementDoc[] memberDocs, + String headerFormat, + ClassDoc superclass) + { + if (memberDocs.length > 0) { + + output.beginDiv(CssClass.TABLE_CONTAINER); + output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); + String superclassLink; + if (superclass.isIncluded()) { + superclassLink = superclass.containingPackage().name() + + "." + createTypeHref(output, superclass, false); + } + else { + superclassLink = createTypeHref(output, superclass, true); + } + output.rowDiv(CssClass.TABLE_SUB_HEADER, + new MessageFormat(headerFormat).format(new Object[] { + superclassLink + })); + + output.beginRow(); + output.beginCell(CssClass.CLASS_SUMMARY_INHERITED); + for (int i=0; i 0) { + output.print(", "); + } + String title = null; + if (memberDoc.isMethod()) { + title = memberDoc.name() + ((MethodDoc)memberDoc).flatSignature(); + } + else if (memberDoc.isInterface()) { + title = "interface " + ((ClassDoc)memberDoc).qualifiedName(); + } + else if (memberDoc.isClass()) { + title = "class " + ((ClassDoc)memberDoc).qualifiedName(); + } + output.beginAnchor(getMemberDocURL(output, memberDoc), title); + output.beginSpan(CssClass.CLASS_SUMMARY_INHERITED_MEMBER); + output.print(memberDoc.name()); + output.endSpan(CssClass.CLASS_SUMMARY_INHERITED_MEMBER); + output.endAnchor(); + } + output.endCell(); + output.endRow(); + output.endTable(); + output.endDiv(CssClass.TABLE_CONTAINER); + } + } + + private void collectSpecifiedByRecursive(Set specifyingInterfaces, + ClassDoc classDoc, + MethodDoc methodDoc) + { + ClassDoc[] interfaces = classDoc.interfaces(); + for (int i=0; i 0) { + + if (null != anchor) { + output.anchorName(anchor); + } + + CssClass sectionClass; + CssClass headerClass; + if (isOnSerializedPage) { + sectionClass = CssClass.SERIALIZED_SECTION; + headerClass = CssClass.SERIALIZED_SECTION_HEADER; + } + else { + sectionClass = CssClass.SECTION; + headerClass = CssClass.SECTION_HEADER; + } + output.div(headerClass, header); + output.beginDiv(sectionClass); + + for (int i=0; i0) { + output.hr(); + } + + ProgramElementDoc memberDoc = memberDocs[i]; + + output.anchorName(getMemberAnchor(memberDoc)); + + output.beginDiv(CssClass.MEMBER_DETAIL); + output.div(CssClass.MEMBER_DETAIL_NAME, memberDoc.name()); + + StringBuffer synopsis = new StringBuffer(); + int synopsisLength = 0; + + if (!isOnSerializedPage || !memberDoc.isField()) { + String fullModifiers = getFullModifiers(memberDoc); + synopsis.append(fullModifiers); + synopsisLength += fullModifiers.length(); + + } + if (memberDoc.isMethod() || memberDoc.isField()) { + Type type; + if (memberDoc.isMethod()) { + type = ((MethodDoc)memberDoc).returnType(); + } + else { + type = ((FieldDoc)memberDoc).type(); + } + + synopsis.append(" "); + synopsisLength ++; + synopsis.append(createTypeHref(output, type, false)); + if (null != type.asClassDoc() && type.asClassDoc().isIncluded()) { + synopsisLength += type.asClassDoc().name().length(); + } + else { + synopsisLength += type.qualifiedTypeName().length(); + } + synopsisLength += type.dimension().length(); + } + + synopsis.append(" "); + synopsisLength ++; + + if (optionLinkSource.getValue() && null != memberDoc.position()) { + ClassDoc containingClass = memberDoc.containingClass(); + while (null != containingClass.containingClass()) { + containingClass = containingClass.containingClass(); + } + String href = containingClass.name() + "-source" + filenameExtension + "#line." + memberDoc.position().line(); + synopsis.append(output.createHrefString(href, memberDoc.name())); + } + else { + synopsis.append(memberDoc.name()); + } + synopsisLength += memberDoc.name().length(); + + if (memberDoc.isConstructor() || memberDoc.isMethod()) { + //printParameters(output, (ExecutableMemberDoc)memberDoc); + synopsis.append("("); + ++ synopsisLength; + StringBuffer paddingLeft = new StringBuffer(); + for (int j=0; j 0) { + synopsis.append("\n throws "); + for (int j=0; j 0) { + output.beginDiv(CssClass.DEPRECATED_INLINE); + output.beginSpan(CssClass.DEPRECATED_HEADER); + output.print("Deprecated. "); + output.endSpan(CssClass.DEPRECATED_HEADER); + output.beginSpan(CssClass.DEPRECATED_BODY); + } + for (int j=0; j 0) { + output.endSpan(CssClass.DEPRECATED_BODY); + output.beginDiv(CssClass.DEPRECATED_INLINE); + } + + output.beginDiv(CssClass.MEMBER_DETAIL_DESCRIPTION); + printTags(output, memberDoc, memberDoc.inlineTags(), false); + output.endDiv(CssClass.MEMBER_DETAIL_DESCRIPTION); + + if (memberDoc.isConstructor() || memberDoc.isMethod()) { + + if (memberDoc.isMethod()) { + Set specifyingInterfaces = new LinkedHashSet(); + if (memberDoc.containingClass().isInterface()) { + collectSpecifiedByRecursive(specifyingInterfaces, + memberDoc.containingClass(), + (MethodDoc)memberDoc); + } + else { + for (ClassDoc cd = memberDoc.containingClass(); + null != cd; cd = cd.superclass()) { + collectSpecifiedByRecursive(specifyingInterfaces, + cd, + (MethodDoc)memberDoc); + } + } + + if (!specifyingInterfaces.isEmpty() + && !isOnSerializedPage) { + output.beginDiv(CssClass.MEMBER_DETAIL_SPECIFIED_BY_LIST); + output.div(CssClass.MEMBER_DETAIL_SPECIFIED_BY_HEADER, "Specified by:"); + Iterator it = specifyingInterfaces.iterator(); + while (it.hasNext()) { + MethodDoc specifyingInterfaceMethod = (MethodDoc)it.next(); + output.beginDiv(CssClass.MEMBER_DETAIL_SPECIFIED_BY_ITEM); + output.beginAnchor(getMemberDocURL(output, + specifyingInterfaceMethod)); + output.print(memberDoc.name()); + output.endAnchor(); + output.print(" in interface "); + printType(output, specifyingInterfaceMethod.containingClass()); + output.endDiv(CssClass.MEMBER_DETAIL_SPECIFIED_BY_ITEM); + } + output.endDiv(CssClass.MEMBER_DETAIL_SPECIFIED_BY_LIST); + } + + ClassDoc overriddenClassDoc = null; + MemberDoc specifyingSuperMethod = null; + + for (ClassDoc superclassDoc = memberDoc.containingClass().superclass(); + null != superclassDoc && null == overriddenClassDoc; + superclassDoc = superclassDoc.superclass()) { + + MethodDoc[] methods = superclassDoc.methods(); + for (int j=0; j 0) { + output.beginDiv(CssClass.MEMBER_DETAIL_PARAMETER_LIST); + output.div(CssClass.MEMBER_DETAIL_PARAMETER_HEADER, "Parameters:"); + Parameter[] parameters = execMemberDoc.parameters(); + for (int j=0; j 0) { + Tag returnTag = returnTags[0]; + + output.beginDiv(CssClass.MEMBER_DETAIL_RETURN_LIST); + output.div(CssClass.MEMBER_DETAIL_RETURN_HEADER, "Returns:"); + output.beginDiv(CssClass.MEMBER_DETAIL_RETURN_ITEM); + + printTags(output, execMemberDoc, returnTag.inlineTags(), false); + + output.endDiv(CssClass.MEMBER_DETAIL_RETURN_ITEM); + output.endDiv(CssClass.MEMBER_DETAIL_RETURN_LIST); + } + } + + Set thrownExceptions = getThrownExceptions(execMemberDoc); + boolean haveThrowsInfo = false; + ThrowsTag[] throwsTags = execMemberDoc.throwsTags(); + for (int k=0; k 0) { + output.print(", "); + } + printType(output, parameters[j].type()); + output.print(" "); + output.print(parameters[j].name()); + } + output.print(")"); + } + + private void printProgramElementDocs(HtmlPage output, + ProgramElementDoc[] memberDocs, + String header, + boolean forceOutputHeader, + String anchor) + { + if (memberDocs.length > 0 || forceOutputHeader) { + output.anchorName(anchor); + output.beginDiv(CssClass.TABLE_CONTAINER); + output.beginTable(CssClass.CLASS_SUMMARY, new String[] { "border", "width" }, new String[] { "1", "100%" }); + output.rowDiv(CssClass.TABLE_HEADER, header); + + for (int i=0; i 0) { + firstSentenceTags = deprecatedTags[0].firstSentenceTags(); + } + else { + firstSentenceTags = memberDoc.firstSentenceTags(); + } + + if (null != firstSentenceTags && firstSentenceTags.length > 0) { + output.beginDiv(CssClass.CLASS_SUMMARY_RIGHT_DESCRIPTION); + if (deprecatedTags.length > 0) { + output.beginDiv(CssClass.DEPRECATED); + output.beginSpan(CssClass.DEPRECATED_HEADER); + output.print("Deprecated. "); + output.endSpan(CssClass.DEPRECATED_HEADER); + output.beginSpan(CssClass.DEPRECATED_BODY); + } + printTags(output, memberDoc, firstSentenceTags, true); + if (deprecatedTags.length > 0) { + output.endSpan(CssClass.DEPRECATED_BODY); + output.beginDiv(CssClass.DEPRECATED); + } + output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_DESCRIPTION); + } + output.endDiv(CssClass.CLASS_SUMMARY_RIGHT_LIST); + output.endCell(); + output.endRow(); + } + output.endTable(); + output.endDiv(CssClass.TABLE_CONTAINER); + } + } + + private void printTag(final HtmlPage output, + HtmlRepairer repairer, + Tag tag, boolean firstSentence, + boolean inline, + Doc contextDoc) + { + TagletContext context = new HtmlTagletContext(contextDoc, output, false); + if (firstSentence) { + output.print(renderInlineTags(tag.firstSentenceTags(), context)); + } + else { + output.print(renderInlineTags(tag.inlineTags(), context)); + } + } + + private void printTags(HtmlPage output, Doc contextDoc, Tag[] tags, boolean firstSentence) + { + printTags(output, contextDoc, tags, firstSentence, false); + } + + private void printTags(HtmlPage output, Doc contextDoc, Tag[] tags, boolean firstSentence, boolean inline) + { + if (!optionNoComment.getValue()) { + output.print(renderInlineTags(tags, new HtmlTagletContext(contextDoc, output, false))); + } + + /* + if (!optionNoComment.getValue()) { + output.print(renderInlineTags(tag.firstSentenceTags(), output)); + HtmlRepairer repairer = new HtmlRepairer(getRootDoc(), + true, false, + null, null, + true); + for (int i=0; i 0) { + externalDocSet = (ExternalDocSet)packageNameToDocSet.get(packageDoc.name()); + } + StringBuffer result = new StringBuffer(); + result.append(getClassDocURL(output, classDoc)); + result.append('#'); + if (null == externalDocSet) { + result.append(getMemberAnchor(memberDoc)); + } + else { + result.append(getMemberAnchor(memberDoc, externalDocSet.isJavadocCompatible())); + } + return result.toString(); + } + + private void printType(HtmlPage output, Type type) + { + printType(output, type, false); + } + + private void printType(HtmlPage output, Type type, boolean fullyQualified) + { + output.print(createTypeHref(output, type, fullyQualified)); + } + + private String createTypeHref(HtmlPage output, Type type, boolean fullyQualified) + { + ClassDoc asClassDoc = type.asClassDoc(); + String url = null; + if (null != asClassDoc && asClassDoc.isIncluded()) { + url = getClassDocURL(output, asClassDoc); + } + else if (!type.isPrimitive()) { + if (type.qualifiedTypeName().length() > type.typeName().length()) { + String packageName = type.qualifiedTypeName(); + packageName = packageName.substring(0, packageName.length() - type.typeName().length() - 1); + + ExternalDocSet externalDocSet + = (ExternalDocSet)packageNameToDocSet.get(packageName); + if (null != externalDocSet) { + url = externalDocSet.getClassDocURL(packageName, type.typeName()); + } + } + } + + StringBuffer result = new StringBuffer(); + + if (null != url && null != asClassDoc) { + String parameters = getTypeParameters(asClassDoc); + if (fullyQualified) { + result.append(output.createHrefString(url,possiblyQualifiedName(asClassDoc) + parameters)); + } + else { + StringBuffer title = new StringBuffer(); + title.append(getClassTypeName(asClassDoc)); + title.append(" in "); + title.append(asClassDoc.containingPackage().name()); + result.append(output.createHrefString(url, asClassDoc.name() + parameters, title.toString())); + } + } + else { + result.append(possiblyQualifiedName(type)); + } + result.append(type.dimension()); + return result.toString(); + } + + private void printTaglets(final HtmlPage output, Tag[] tags, TagletContext context) + { + super.printMainTaglets(tags, context, new TagletPrinter() { + public void printTagletString(String tagletString) { + output.beginDiv(CssClass.TAGLET); + output.print(tagletString); + output.endDiv(CssClass.TAGLET); + } + }); + } + + private String getPackageURL(PackageDoc packageDoc) + { + if (packageDoc.name().length() > 0) { + ExternalDocSet externalDocSet = (ExternalDocSet)packageNameToDocSet.get(packageDoc.name()); + String url; + if (null != externalDocSet) { + url = externalDocSet.getPackageDocURL(packageDoc.name()); + } + else { + url = packageDoc.name().replace('.', '/'); + } + if (!url.endsWith("/")) { + return url + '/'; + } + else { + return url; + } + } + else { + return ""; + } + } + + private String getClassURL(ClassDoc classDoc) + { + ExternalDocSet externalDocSet = null; + if (classDoc.containingPackage().name().length() > 0) { + externalDocSet = (ExternalDocSet)packageNameToDocSet.get(classDoc.containingPackage().name()); + } + if (null != externalDocSet) { + return externalDocSet.getClassDocURL(classDoc.containingPackage().name(), + classDoc.name()); + } + else { + return getPackageURL(classDoc.containingPackage()) + classDoc.name() + filenameExtension; + } + } + + protected void run() + throws DocletConfigurationException, IOException + { + if (optionSerialWarn.getValue()) { + printWarning("Option -serialwarn is currently ignored."); + } + + if (null != optionTitle.getValue()) { + printWarning("Option -title is deprecated."); + } + + if (!optionValidHtml.getValue()) { + printWarning("Option -validhtml hasn't been specified. Generated HTML will not validate."); + } + + + { + boolean warningEmitted = false; + Iterator it = externalDocSets.iterator(); + while (it.hasNext()) { + ExternalDocSet externalDocSet = (ExternalDocSet)it.next(); + printNotice("Fetching package list for external documentation set."); + try { + externalDocSet.load(getTargetDirectory()); + if (!isJavadocCompatibleNames() && externalDocSet.isJavadocCompatible() + && !warningEmitted) { + printWarning("Linking to javadoc-compatible documentation. Generated HTML will not validate "); + warningEmitted = true; + } + } + catch (FileNotFoundException e) { + printWarning("Cannot fetch package list from " + externalDocSet.getPackageListDir()); + } + Iterator pit = externalDocSet.getPackageNames().iterator(); + while (pit.hasNext()) { + String packageName = (String)pit.next(); + packageNameToDocSet.put(packageName, externalDocSet); + } + } + } + printNotice("Building cross-reference information..."); + getInterfaceRelations(); + getAllSubClasses(); + + printNotice("Writing overview files..."); + printFrameSetPage(); + if (!isSinglePackage()) { + printPackagesMenuPage(); + printAllClassesMenuPage(); + printOverviewPage(); + if (!optionNoTree.getValue()) { + printNotice("Writing full tree..."); + printFullTreePage(); + } + } + printPackagesListFile(); + printAboutPage(); + if (!optionNoIndex.getValue()) { + printNotice("Writing index..."); + if (!optionSplitIndex.getValue()) { + printIndexPage(); + } + else { + printSplitIndex(); + } + } + if (outputHelpPage && !optionNoHelp.getValue()) { + printHelpPage(); + } + + // Copy resources + + File resourcesDir = new File(getTargetDirectory(), + "resources"); + + if ((resourcesDir.exists() && !resourcesDir.isDirectory()) + || (!resourcesDir.exists() && !resourcesDir.mkdirs())) { + throw new IOException("Cannot create directory " + resourcesDir); + } + + // Copy resources + + String[] resourceNames = { + "gjdoc.js", + "gjdochtml-clean-layout.css", + "gjdochtml-clean-color1.css", + "inherit.png", + "xhtml11-target10.dtd", + }; + + for (int i=0; i 0) ? packageDocs[i - 1] : null, + (i < packageDocs.length - 1) ? packageDocs[i + 1] : null); + if (!optionNoTree.getValue()) { + printPackageTreePage(packageDir, pathToRoot, packageDoc); + } + printPackageClassesMenuPage(packageDir, pathToRoot, packageDoc); + ClassDoc[] classDocs = packageDoc.allClasses(); + for (int j=0; j 0) ? classDocs[j - 1] : null, + (j < classDocs.length - 1) ? classDocs[j + 1] : null + ); + if (optionUse.getValue()) { + printClassUsagePage(packageDir, pathToRoot, classDocs[j]); + } + if (optionLinkSource.getValue() && null == classDoc.containingClass()) { + try { + File sourceFile = getSourceFile(classDoc); + + Java2xhtml java2xhtml = new Java2xhtml(); + Properties properties = new Properties(); + properties.setProperty("isCodeSnippet", "true"); + properties.setProperty("hasLineNumbers", "true"); + java2xhtml.setProperties(properties); + + StringWriter sourceBuffer = new StringWriter(); + FileReader sourceReader = new FileReader(sourceFile); + IOToolkit.copyStream(sourceReader, sourceBuffer); + sourceReader.close(); + String result = java2xhtml.makeHTML(sourceBuffer.getBuffer(), sourceFile.getName()); + + printSourcePage(packageDir, + classDoc, + result); + } + catch (IOException e) { + printWarning("Cannot locate source file for class " + classDoc.qualifiedTypeName()); + } + } + } + } + } + } + + private String getPathToRoot(File subDir, File rootDir) + { + StringBuffer result = new StringBuffer(); + while (!subDir.equals(rootDir)) { + if (result.length() > 0) { + result.append("/"); + } + subDir = subDir.getParentFile(); + result.append(".."); + } + if (0 == result.length()) { + result.append("."); + } + return result.toString(); + } + + private String getClassTypeName(ClassDoc classDoc) + { + if (classDoc.isInterface()) { + return "Interface"; + } + else { + return "Class"; + } + } + + private String getClassTypeKeyword(ClassDoc classDoc) + { + if (classDoc.isInterface()) { + return "interface"; + } + else { + return "class"; + } + } + + private String getMemberAnchor(ProgramElementDoc memberDoc) + { + return getMemberAnchor(memberDoc, isJavadocCompatibleNames()); + } + + private String getMemberAnchor(ProgramElementDoc memberDoc, boolean javadocCompatibility) + { + StringBuffer anchor = new StringBuffer(); + anchor.append(memberDoc.name()); + if (memberDoc.isConstructor() || memberDoc.isMethod()) { + if (javadocCompatibility) { + anchor.append(((ExecutableMemberDoc)memberDoc).signature()); + } + else { + anchor.append(':'); + Parameter[] parameters = ((ExecutableMemberDoc)memberDoc).parameters(); + for (int i=0; i referencedPackageName.length()) + && referencedClassName.startsWith(packageName + '.')) { + referencedPackageName = packageName; + } + } + + if (null != referencedPackageName) { + ExternalDocSet externalDocSet + = (ExternalDocSet)packageNameToDocSet.get(referencedPackageName); + + String className = referencedClassName.substring(referencedPackageName.length() + 1); + href = externalDocSet.getClassDocURL(referencedPackageName, + className); + label = className; + + String referencedMemberName = seeTag.referencedMemberName(); + + if (null != referencedMemberName) { + label += '.'; + label += referencedMemberName; + href += '#' + transformReferencedMemberName(referencedMemberName, + externalDocSet.isJavadocCompatible()); + } + else if (null != seeTag.referencedMemberName()) { + href = null; + } + } + } + } + + if (null != seeTag.label() + && seeTag.label().length() > 0) { + label = seeTag.label(); + } + + if (null == label) { + label = seeTag.text(); + if (label.startsWith("#")) { + label = label.substring(1); + } + else { + label = label.replace('#', '.'); + } + label.trim(); + } + + if (null != href) { + result.append(""); + if (!plainFont) { + result.append(""); + } + result.append(label); + if (!plainFont) { + result.append(""); + } + result.append(""); + } + else { + if (!plainFont) { + result.append(""); + } + result.append(label); + if (!plainFont) { + result.append(""); + } + } + + return result.toString(); + } + + protected String renderTag(String tagName, Tag[] tags, TagletContext context) + { + Doc doc = context.getDoc(); + + if ("see".equals(tagName) + && ((tags.length > 0) + || (doc.isClass() + && (((ClassDoc)doc).isSerializable() + || ((ClassDoc)doc).isExternalizable())))) { + + StringBuffer result = new StringBuffer(); + result.append("
"); + result.append("
"); + result.append("See Also:"); + result.append("
"); + + boolean oneLine = true; + + if (oneLine) { + result.append("
"); + } + + for (int i = 0; i < tags.length; ++i) { + if (oneLine) { + if (i > 0) { + result.append(", "); + } + } + else { + result.append("
"); + } + result.append(renderSeeTag((SeeTag)tags[i], context, false)); + if (!oneLine) { + result.append("
"); + } + } + + if ((doc instanceof ClassDoc) + && (((ClassDoc)doc).isSerializable() || ((ClassDoc)doc).isExternalizable())) { + if (tags.length > 0) { + result.append(", "); + } + HtmlPage output = ((HtmlTagletContext)context).getOutput(); + result.append("Serialized Form"); + } + + if (oneLine) { + result.append(""); + } + result.append("
"); + return result.toString(); + } + else if (tags.length > 0 + && "serial".equals(tagName) + && ((HtmlTagletContext)context).isOnSerializedPage()) { + + return renderInlineTags(tags[0].inlineTags(), context); + } + else { + return ""; + } + } + + private String getWindowTitle() + { + if (null == optionWindowTitle.getValue()) { + return "Generated API Documentation"; + } + else { + return optionWindowTitle.getValue(); + } + } + + private String getPageTitle(String title) + { + if (null == optionWindowTitle.getValue()) { + return title; + } + else { + return title + " (" + optionWindowTitle.getValue() + ")"; + } + } + + protected String getDocletVersion() + { + if (null == docletVersion) { + try { + Properties versionProperties = new Properties(); + InputStream in = getClass().getResourceAsStream("/version.properties"); + if (in == null) { + in = new FileInputStream("src/resources/version.properties"); + } + versionProperties.load(in); + docletVersion = versionProperties.getProperty("gjdoc.version"); + } + catch (IOException ignore) { + } + if (null == docletVersion) { + docletVersion = "unknown"; + } + } + return docletVersion; + } + + private Map getStylesheets() + { + Map sheets = new HashMap(); + if (null != optionStylesheetFile.getValue()) { + sheets.put("User-specified", new String[] { + "resources/user.css" + }); + } + else { + List cleanSheets = new LinkedList(); + cleanSheets.add("resources/gjdochtml-clean-layout.css"); + cleanSheets.add("resources/gjdochtml-clean-color1.css"); + if (null != optionAddStylesheet.getValue()) { + cleanSheets.add("resources/user.css"); + } + sheets.put("GNU Clean", cleanSheets.toArray(new String[0])); + } + return sheets; + } + + protected boolean isSinglePackage() + { + if (getRootDoc().firstSentenceTags().length > 0) { + return false; + } + else if (null != optionDocTitle.getValue() + || null != optionTitle.getValue()) { + return false; + } + else { + return super.isSinglePackage(); + } + } + + private String getTypeParameters(ClassDoc classDoc) + { + String parameters = ""; + TypeVariable[] params = classDoc.typeParameters(); + if (params != null && params.length > 0) + { + parameters = "<"; + for (int a = 0; a < params.length; ++a) + { + parameters += params[a].typeName(); + Type[] bounds = params[a].bounds(); + if (bounds != null) + { + parameters += " extends "; + for (int b = 0; a < bounds.length; ++b) + { + parameters += bounds[a]; + if (b != bounds.length - 1) + parameters += " & "; + } + } + if (a != params.length - 1) + parameters += ","; + } + parameters += ">"; + } + return parameters; + } + + private String transformReferencedMemberName(String referencedMemberName, + boolean javadocCompatibility) + { + if (!javadocCompatibility) { + StringBuffer result = new StringBuffer(); + for (int i=0; i"; + + public HtmlPage(File file, String pathToRoot, String encoding, String baseUrl, File rootDir) + throws IOException + { + this(file, pathToRoot, encoding, baseUrl, rootDir, ""); + } + + public HtmlPage(File file, String pathToRoot, String encoding, String baseUrl, File rootDir, String docType) + throws IOException + { + this.file = file; + OutputStream fileOut = new FileOutputStream(file); + Writer writer; + if (null != encoding) { + writer = new OutputStreamWriter(fileOut, + encoding); + } + else { + writer = new OutputStreamWriter(fileOut); + } + this.out = new PrintWriter(new BufferedWriter(writer)); + this.pathToRoot = pathToRoot; + this.docType = docType; + this.baseUrl = baseUrl; + this.rootDir = rootDir; + } + + public void beginElement(String elementName) + { + print('<'); + print(elementName); + print('>'); + } + + public void beginElement(String elementName, String attributeName, String attributeValue) + { + print('<'); + print(elementName); + print(' '); + print(attributeName); + print('='); + print('\"'); + print(attributeValue); + print('\"'); + print('>'); + } + + public void beginElement(String elementName, String[] attributeNames, String[] attributeValues) + { + print('<'); + print(elementName); + for (int i=0; i'); + } + + public void beginElement(String elementName, String attributeName, String attributeValue, String[] attributeNames, String[] attributeValues) + { + print('<'); + print(elementName); + print(' '); + print(attributeName); + print('='); + print('\"'); + print(attributeValue); + print('\"'); + if (null != attributeNames) { + for (int i=0; i'); + } + + public void atomicElement(String elementName) + { + print('<'); + print(elementName); + print("/>"); + } + + public void atomicElement(String elementName, String attributeName, String attributeValue) + { + print('<'); + print(elementName); + print(' '); + print(attributeName); + print('='); + print('\"'); + print(attributeValue); + print('\"'); + print("/>"); + } + + public void atomicElement(String elementName, String[] attributeNames, String[] attributeValues) + { + print('<'); + print(elementName); + for (int i=0; i"); + } + + + public void endElement(String elementName) + { + print("'); + } + + + public void beginDiv(CssClass cssClass) + { + String[] divAttributeNames = cssClass.getAttributeNames(); + String[] divAttributeValues = cssClass.getAttributeValues(); + if (null == divAttributeNames) { + divAttributeNames = new String[0]; + } + if (null == divAttributeValues) { + divAttributeValues = new String[0]; + } + + String[] attributeNames = new String[1 + divAttributeNames.length]; + String[] attributeValues = new String[1 + divAttributeValues.length]; + + System.arraycopy(divAttributeNames, 0, attributeNames, 1, divAttributeNames.length); + System.arraycopy(divAttributeValues, 0, attributeValues, 1, divAttributeNames.length); + + attributeNames[0] = "class"; + attributeValues[0] = cssClass.getName(); + + beginElement(cssClass.getDivElementName(), attributeNames, attributeValues); + if (null != cssClass.getInnerElementName()) { + beginElement(cssClass.getInnerElementName()); + } + } + + public void endDiv(CssClass cssClass) + { + if (null != cssClass.getInnerElementName()) { + endElement(cssClass.getInnerElementName()); + } + endElement(cssClass.getDivElementName()); + } + + public void beginSpan(CssClass cssClass) + { + beginElement(cssClass.getSpanElementName(), "class", cssClass.getName()); + } + + public void endSpan(CssClass cssClass) + { + endElement(cssClass.getSpanElementName()); + } + + public void hr() + { + atomicElement("hr"); + } + + public void br() + { + atomicElement("br"); + } + + public void print(String text) + { + out.print(text); + } + + public void print(char c) + { + out.print(c); + } + + public void div(CssClass cssClass, String contents) + { + beginDiv(cssClass); + print(contents); + endDiv(cssClass); + } + + public void span(CssClass cssClass, String contents) + { + beginSpan(cssClass); + print(contents); + endSpan(cssClass); + } + + public void beginPage(String title, String charset, Map stylesheets) + throws IOException + { + beginPage(title, charset, Collections.EMPTY_SET, stylesheets); + } + + public void beginPage(String title, String charset, + Collection keywords, Map stylesheets) + throws IOException + { + print("\n"); + print(docType); + print(""); + beginElement("head"); + beginElement("title"); + print(title); + endElement("title"); + if (null != baseUrl && baseUrl.length() > 0) { + StringBuffer url = new StringBuffer(); + url.append(baseUrl); + if ('/' == url.charAt(url.length() - 1)) { + url.delete(url.length() - 1, url.length()); + } + url.append(file.getCanonicalPath().substring(rootDir.getCanonicalPath().length())); + atomicElement("base", + new String[] { "href" }, + new String[] { url.toString() }); + } + beginElement("script", + new String[] { "src", "type" }, + new String[] { pathToRoot + "/resources/gjdoc.js", "text/javascript" }); + print(""); + endElement("script"); + atomicElement("meta", + new String[] { "http-equiv", "content" }, + new String[] { "Content-Type", "text/html; charset=" + charset }); + atomicElement("meta", + new String[] { "name", "content" }, + new String[] { "generator", "GNU Gjdoc Standard Doclet" }); + Iterator keywordIt = keywords.iterator(); + while (keywordIt.hasNext()) { + String keyword = (String)keywordIt.next(); + atomicElement("meta", + new String[] { "name", "content" }, + new String[] { "keywords", keyword }); + } + + Iterator cssIt = stylesheets.keySet().iterator(); + while (cssIt.hasNext()) { + String sheetName = (String)cssIt.next(); + String[] sheetFiles = (String[])stylesheets.get(sheetName); + + for (int i=0; i"); + result.append(content); + result.append(""); + return result.toString(); + } + + public File getFile() + { + return this.file; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.java new file mode 100644 index 00000000000..5c6e84913d0 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/htmldoclet/HtmlTagletContext.java @@ -0,0 +1,48 @@ +/* gnu.classpath.tools.doclets.htmldoclet.HtmlTagletContext + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.htmldoclet; + +import com.sun.javadoc.Doc; +import gnu.classpath.tools.taglets.TagletContext; + +public class HtmlTagletContext + extends TagletContext +{ + private HtmlPage output; + private boolean isOnSerializedPage; + + public HtmlTagletContext(Doc doc, HtmlPage output, boolean isOnSerializedPage) + { + super(doc); + this.output = output; + this.isOnSerializedPage = isOnSerializedPage; + } + + public HtmlPage getOutput() + { + return output; + } + + public boolean isOnSerializedPage() + { + return isOnSerializedPage; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/Driver.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/Driver.java new file mode 100644 index 00000000000..6f90338b2af --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/Driver.java @@ -0,0 +1,2434 @@ +/* gnu.classpath.tools.doclets.xmldoclet.Driver + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.xmldoclet; + +import com.sun.javadoc.*; +import java.io.*; + +import com.sun.tools.doclets.Taglet; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import java.text.DateFormat; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashSet; +import java.util.TreeSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; +import java.util.Properties; +import java.util.Set; +import java.util.SortedSet; +import java.util.StringTokenizer; +import java.util.TreeMap; + +import gnu.classpath.tools.gjdoc.TemporaryStore; +import gnu.classpath.tools.gjdoc.GjdocPackageDoc; + +import gnu.classpath.tools.doclets.PackageGroup; +import gnu.classpath.tools.doclets.PackageMatcher; +import gnu.classpath.tools.doclets.InvalidPackageWildcardException; + +import gnu.classpath.tools.doclets.xmldoclet.doctranslet.DocTranslet; +import gnu.classpath.tools.doclets.xmldoclet.doctranslet.DocTransletOptions; + +import gnu.classpath.tools.taglets.AuthorTaglet; +import gnu.classpath.tools.taglets.VersionTaglet; +import gnu.classpath.tools.taglets.SinceTaglet; +import gnu.classpath.tools.taglets.DeprecatedTaglet; +import gnu.classpath.tools.taglets.GenericTaglet; +import gnu.classpath.tools.doclets.StandardTaglet; + +import gnu.classpath.tools.java2xhtml.Java2xhtml; + +import gnu.classpath.tools.IOToolkit; +import gnu.classpath.tools.FileSystemClassLoader; + +/** + * A Doclet which retrieves all information presented by the Doclet + * API, dumping it to stdout in XML format. + * + * @author Julian Scheid + */ +public class Driver { + + public static final String XMLDOCLET_VERSION = "0.6.1"; + + /** + * Used for redirecting error messages to /dev/null. + */ + private static class NullErrorReporter implements DocErrorReporter { + public void printError(String ignore) {} + public void printWarning(String ignore) {} + public void printNotice(String ignore) {} + } + + /* + * Taglet context constants. + */ + private static final int CONTEXT_CONSTRUCTOR = 1; + private static final int CONTEXT_FIELD = 2; + private static final int CONTEXT_METHOD = 3; + private static final int CONTEXT_OVERVIEW = 4; + private static final int CONTEXT_PACKAGE = 5; + private static final int CONTEXT_TYPE = 6; + + /** + * All XML output will go to this stream. + */ + private PrintWriter out; + + /** + * How many spaces to indent each XML node level, + * i.e. Tab size for output. + */ + private static int indentStep = 1; + + /** + * Won't output superfluous spaces if set to true. + * If set to false, output will be more legible. + */ + private boolean compress = false; + + /** + * Won't output warning messages while fixing + * HTML code if set to true. + */ + private boolean noHTMLWarn = false; + + /** + * Won't output warning messages when encountering tags + * that look like an email address if set to true. + */ + private boolean noEmailWarn = false; + + /** + * Will fix HTML if necessary so that each comment + * contains valid XML code if set to true. If set + * to false, HTML code will not be modified and + * instead encapsulated in a CDATA section. + */ + private boolean fixHTML = true; + + /** + * User-specified name of the directory where the final version of + * the generated files will be written to. + * + * If no XSLT sheet is given, the XML output will go directly into + * this directory. Otherwise, XML output will go to a temporary + * directory and XSLT output will go to this directory. + */ + private File targetDirectory = null; + + /** + * Directory where XML output will be written to. If no XSLT + * sheet was given, this is the target directory specified + * by the user. Otherwise, this is a temporary directory. + */ + private File xmlTargetDirectory; + + /** + * Contains a number of TargetContexts which describe which XSLT + * sheet to apply to the output of this doclet, to what directory + * the XSLT output is written, and which postprocess driver to use + * to process XSLT output. + */ + private List targets = new ArrayList(); + + /** + * XML text to include at the end of every generated page. Read + * from the file specified on the command line using -bottomnote. + * If present, this will be written to the main output file + * (index.xml) in node /gjdoc:rootDoc/gjdoc:bottomnote. + */ + private String bottomNote; + + /** + * Brief description of the package set. Can be specified on the + * command line using -title. This will be written to the main + * output file (index.xml) in node + * /gjdoc:rootDoc/gjdoc:title. The HTML generating XSLT sheet + * uses this for example in window titles. + */ + private String title; + + /** + * Path to the directory where temporary files should be stored. + * Defaults to system tempdir, but can be overridden by user + * with -workpath. + */ + private String workingPath = System.getProperty("java.io.tmpdir"); + + /** + * Temporary directory created by this doclet where all + * temporary files will be stored in. If no temporary + * files are needed (i.e. no XSLT postprocessing stage + * specified by user), this is null. + */ + private File workingDirectory; + + /** + * Whether to deep-copy the doc-files subdirectory. + */ + private boolean docFilesSubdirsEnabled = false; + + /** + * Which direct subdirectories of the doc-files directories to exclude. + * Set of String. + */ + private Set excludeDocFilesSubDirs = new HashSet(); + + /** + * Stores the Doclet API RootDoc we are operating on. + */ + private RootDoc rootDoc; + + /** + * XML namespace prefix used for all tags, except for HTML + * tags copied from Javadoc comments. Excluding colon. + */ + public static final String tagPrefix = "gjdoc"; + + /** + * Classpath for loading Taglet classes. + */ + private String tagletPath = null; + + /** + * The current class that is being processed. + * Set in outputClassDoc(). + */ + private ClassDoc currentClass; + + /** + * The current member that is being processed. + * Set in outputMemberDoc(). + */ + private MemberDoc currentMember; + + /** + * The current constructor/method that is being processed. + * Set in outputExecutableMemberDoc(). + */ + private ExecutableMemberDoc currentExecMember; + + /** + * Mapping from tag type to Taglet for user Taglets specified on + * the command line. + */ + private Map tagletMap = new LinkedHashMap(); + + /** + * Keeps track of the tags mentioned by the user during option + * processiong so that an error can be emitted if a tag is + * mentioned more than once. + */ + private List mentionedTags = new LinkedList(); + + /** + * Stores options to be passed to the DocTranslet. + */ + private DocTransletOptions docTransletOptions = new DocTransletOptions(); + + /** + * Stores the package groups specified in the user + * options. Contains objects of type PackageGroup. + */ + private List packageGroups = new LinkedList(); + + private HtmlRepairer htmlRepairer; + + public static boolean start(TemporaryStore _rootDocWrapper) { + return new Driver().instanceStart((RootDoc)_rootDocWrapper.getAndClear()); + } + + /** + * Official Doclet entry point. + */ + public static boolean start(RootDoc _rootDoc) { + + // Create a new XmlDoclet instance and delegate control. + TemporaryStore tstore = new TemporaryStore(_rootDoc); + _rootDoc = null; + return new Driver().instanceStart((RootDoc)tstore.getAndClear()); + } + + /** + * Output an XML tag describing a com.sun.javadoc.Type object. + * Assumes that the tag does not have subtags. + * + * @param level Level of indentation. Will be multiplied by + * indentStep to yield actual amount + * of whitespace inserted at start of line. + * @param tag Identifier for the XML tag being output. + * @param type The Javadoc Type to be output. + */ + protected void outputType(int level, String tag, Type type) { + outputType(level, tag, type, true); + } + + protected void outputType(int level, String tag, Type type, boolean atomic) { + + boolean isIncluded = false; + ClassDoc typeAsClassDoc = type.asClassDoc(); + String packageName = null; + if (null != typeAsClassDoc) { + isIncluded = typeAsClassDoc.isIncluded(); + packageName = typeAsClassDoc.containingPackage().name(); + } + println(level, "<"+tagPrefix+":"+tag + " typename=\""+type.typeName()+"\""+ + " qualifiedtypename=\""+type.qualifiedTypeName()+"\"" + +(type.dimension().length()==0?"":" dimension=\""+type.dimension()+"\"") + +(isIncluded?" isIncluded=\"true\"" : "") + +((null != packageName)?" package=\"" + packageName + "\"" : "") + +(atomic?"/":"")+">"); + } + + protected void outputExecutableMemberDocBody(int level, ExecutableMemberDoc memberDoc) { + + currentExecMember = memberDoc; + + outputMemberDocBody(level, memberDoc); + + Parameter[] parameters = memberDoc.parameters(); + for (int i=0, ilim=parameters.length; i 0) { + printOpenTag(2, "firstSentenceTags", false); + outputTags(3, packageDoc.firstSentenceTags(), true, CONTEXT_PACKAGE); + printCloseTag(0, "firstSentenceTags"); + printOpenTag(2, "inlineTags", false); + outputTags(3, packageDoc.inlineTags(), true, CONTEXT_PACKAGE); + printCloseTag(0, "inlineTags"); + } + + if (packageDoc.tags().length > 0) { + printOpenTag(2, "tags"); + outputTags(3, packageDoc.tags(), true, CONTEXT_PACKAGE); + printCloseTag(2, "tags"); + } + + if (packageDoc.seeTags().length > 0) { + printOpenTag(2, "seeTags"); + outputTags(3, packageDoc.seeTags(), true, CONTEXT_PACKAGE); + printCloseTag(2, "seeTags"); + } + + ClassDoc[] allClasses = (ClassDoc[]) packageDoc.allClasses().clone(); + Arrays.sort(allClasses); + + if (false) { + for (int i = 0, ilim = allClasses.length; i < ilim; ++ i) { + printAtomTag(2, "containsClass qualifiedtypename=\""+allClasses[i].qualifiedTypeName()+"\""); + } + } + + printCloseTag(1, "packagedoc"); + } + + protected void outputClassDoc(ClassDoc classDoc) throws IOException { + + currentClass = classDoc; + + println(); + printOpenTag(1, "classdoc xmlns=\"http://www.w3.org/TR/REC-html40\" xmlns:"+tagPrefix+"=\"http://www.gnu.org/software/cp-tools/gjdocxml\" name=\""+classDoc.name()+"\" qualifiedtypename=\""+classDoc.qualifiedName()+"\""); + + ClassDoc[] interfaces = classDoc.interfaces(); + for (int i=0, ilim=interfaces.length; i 0) { + printOpenTag(2, "serializableFields"); + + FieldDoc[] sfields = classDoc.serializableFields(); + for (int i=0, ilim=sfields.length; i 0) { + printOpenTag(level, "inlineTags", false); + outputTags(level+1, doc.inlineTags(), true, context); + printCloseTag(0, "inlineTags"); + } + + if (doc.firstSentenceTags().length > 0) { + printOpenTag(level, "firstSentenceTags", false); + outputTags(level+1, doc.firstSentenceTags(), true, context); + printCloseTag(0, "firstSentenceTags"); + } + + if (doc.tags().length > 0) { + printOpenTag(level, "tags"); + outputTaglets(level+1, doc.tags(), true, context); + printCloseTag(level, "tags"); + } + + if (doc.seeTags().length > 0) { + printOpenTag(level, "seeTags"); + outputTags(level+1, doc.seeTags(), true, context); + printCloseTag(level, "seeTags"); + } + + SourcePosition position = doc.position(); + if (null != position) { + printAtomTag(level, "position file=\"" + position.file().getAbsolutePath() + "\" line=\"" + position.line() + "\" column=\"" + position.column() + "\""); + } + } + + protected void outputProgramElementDocBody(int level, ProgramElementDoc programElementDoc) { + outputDocBody(level, programElementDoc); + printAtomTag(level, "containingPackage name=\""+programElementDoc.containingPackage().name()+"\""); + if (null!=programElementDoc.containingClass()) { + outputType(level, "containingClass", programElementDoc.containingClass()); + } + String access; + if (programElementDoc.isPublic()) + access="public"; + else if (programElementDoc.isProtected()) + access="protected"; + else if (programElementDoc.isPrivate()) + access="private"; + else if (programElementDoc.isPackagePrivate()) + access="package"; + else + throw new RuntimeException("Huh? "+programElementDoc+" is neither public, protected, private nor package protected."); + printAtomTag(level, "access scope=\""+access+"\""); + if (programElementDoc.isFinal()) + printAtomTag(level, "isFinal"); + if (programElementDoc.isStatic()) + printAtomTag(level, "isStatic"); + } + + protected void outputTags(int level, Tag[] tags, boolean descend, int context) { + + for (int i=0; i"); + } + //printCloseTag(0 /* don't introduce additional whitespace */, "text"); + } + else { + printWarning("Tag got null text: "+tag); + } + + if ((descend && ("@throws".equals(tag.name()) || "@param".equals(tag.name()))) || "@deprecated".equals(tag.name())) { + if (tag.firstSentenceTags().length>0) { + printOpenTag(level+1, "firstSentenceTags", false); + outputTags(level+2, tag.firstSentenceTags(), false, context); + printCloseTag(0, "firstSentenceTags"); + } + + if (tag.inlineTags().length>0) { + printOpenTag(level+1, "inlineTags", false); + outputTags(level+2, tag.firstSentenceTags(), false, context); + printCloseTag(0, "inlineTags"); + } + } + + if (fixHTML && lastTag) { + String terminateText = htmlRepairer.terminateText(); + if (null != terminateText && terminateText.length() > 0) { + print(terminateText); + } + } + + if (!"Text".equals(tag.name())) { + + Taglet inlineTaglet = (Taglet)tagletMap.get(tag.name().substring(1)); + if (null != inlineTaglet && inlineTaglet.isInlineTag()) { + printOpenTag(0, "inlineTagletText", false); + print(inlineTaglet.toString(tag)); + printCloseTag(0, "inlineTagletText"); + } + + printCloseTag(0, "tag", false); + } + } + + void outputTaglets(int level, Tag[] tags, boolean descend, int context) + { + for (Iterator it = tagletMap.keySet().iterator(); it.hasNext(); ) { + String tagName = (String)it.next(); + Object o = tagletMap.get(tagName); + Taglet taglet = (Taglet)o; + + if (!taglet.isInlineTag() + && ((context != CONTEXT_CONSTRUCTOR || taglet.inConstructor()) + || (context != CONTEXT_FIELD || taglet.inField()) + || (context != CONTEXT_METHOD || taglet.inMethod()) + || (context != CONTEXT_OVERVIEW || taglet.inOverview()) + || (context != CONTEXT_PACKAGE || taglet.inPackage()) + || (context != CONTEXT_TYPE || taglet.inType()))) { + + List tagsOfThisType = new ArrayList(); + for (int i=0, ilim=tags.length; i"); + } + printCloseTag(0, "tag", false); + } + } + } + } + } + } + + /** + * Inofficial entry point. We got an instance here. + */ + protected boolean instanceStart(RootDoc _rootDoc) { + + this.rootDoc = _rootDoc; + _rootDoc = null; + + boolean xmlOnly = true; + + // Set the default Taglet order + + registerTaglet(new VersionTaglet()); + registerTaglet(new AuthorTaglet()); + //registerTaglet(new SinceTaglet()); + registerTaglet(new StandardTaglet("deprecated")); + registerTaglet(new StandardTaglet("see")); + registerTaglet(new StandardTaglet("param")); + + // Set the built-in Taglet filter + + AuthorTaglet.setTagletEnabled(false); + VersionTaglet.setTagletEnabled(false); + SinceTaglet.setTagletEnabled(true); + DeprecatedTaglet.setTagletEnabled(true); + + try { + { + + // Process command line options passed through to this doclet + + TargetContext targetContext = null; + + TargetContext htmlTargetContext + = new TargetContext(DocTranslet.fromClasspath("/doctranslets/html/gjdoc.xsl"), + targetDirectory); + + for (int i=0, ilim=rootDoc.options().length; i= 0) { + writer.write(buf, 0, nread); + } + writer.flush(); + bottomNote = writer.toString(); + writer.close(); + reader.close(); + } + else if ("-title".equals(optionTag)) { + + title = option[1]; + } + else if ("-workpath".equals(optionTag)) { + + workingPath = option[1]; + } + else if ("-tagletpath".equals(optionTag)) { + + if (null == tagletPath) { + tagletPath = option[1]; + } + else { + tagletPath = tagletPath + File.pathSeparator + option[1]; + } + } + else if ("-taglet".equals(optionTag)) { + + boolean tagletLoaded = false; + + String useTagletPath = this.tagletPath; + if (null == useTagletPath) { + useTagletPath = System.getProperty("java.class.path"); + } + + try { + Class tagletClass; + try { + tagletClass + = new FileSystemClassLoader(useTagletPath).loadClass(option[1]); + } + catch (ClassNotFoundException e) { + // If not found on specified tagletpath, try default classloader + tagletClass + = Class.forName(option[1]); + } + Method registerTagletMethod + = tagletClass.getDeclaredMethod("register", new Class[] { java.util.Map.class }); + + if (!registerTagletMethod.getReturnType().equals(Void.TYPE)) { + printError("Taglet class '" + option[1] + "' found, but register method doesn't return void."); + } + else if (registerTagletMethod.getExceptionTypes().length > 0) { + printError("Taglet class '" + option[1] + "' found, but register method contains throws clause."); + } + else if ((registerTagletMethod.getModifiers() & (Modifier.STATIC | Modifier.PUBLIC | Modifier.ABSTRACT)) != (Modifier.STATIC | Modifier.PUBLIC)) { + printError("Taglet class '" + option[1] + "' found, but register method isn't public static, or is abstract.."); + } + else { + Map tempMap = new HashMap(); + registerTagletMethod.invoke(null, new Object[] { tempMap }); + tagletLoaded = true; + String name = (String)tempMap.keySet().iterator().next(); + Taglet taglet = (Taglet)tempMap.get(name); + tagletMap.put(name, taglet); + mentionedTags.add(taglet); + } + } + catch (NoSuchMethodException e) { + printError("Taglet class '" + option[1] + "' found, but doesn't contain the register method."); + } + catch (SecurityException e) { + printError("Taglet class '" + option[1] + "' cannot be loaded: " + e.getMessage()); + } + catch (InvocationTargetException e) { + printError("Taglet class '" + option[1] + "' found, but register method throws exception: " + e.toString()); + } + catch (IllegalAccessException e) { + printError("Taglet class '" + option[1] + "' found, but there was a problem when accessing the register method: " + e.toString()); + } + catch (IllegalArgumentException e) { + printError("Taglet class '" + option[1] + "' found, but there was a problem when accessing the register method: " + e.toString()); + } + catch (ClassNotFoundException e) { + printError("Taglet class '" + option[1] + "' cannot be found."); + } + if (!tagletLoaded) { + return false; + } + } + else if ("-author".equals(optionTag)) { + AuthorTaglet.setTagletEnabled(true); + } + else if ("-version".equals(optionTag)) { + VersionTaglet.setTagletEnabled(true); + } + else if ("-nosince".equals(optionTag)) { + SinceTaglet.setTagletEnabled(false); + } + else if ("-nodeprecated".equals(optionTag)) { + DeprecatedTaglet.setTagletEnabled(false); + } + else if ("-authormail".equals(optionTag)) { + + if ("no-replace".equalsIgnoreCase(option[1])) { + AuthorTaglet.setEmailReplacementType(AuthorTaglet.EmailReplacement.NO_REPLACEMENT); + } + else if ("mailto-name".equalsIgnoreCase(option[1])) { + AuthorTaglet.setEmailReplacementType(AuthorTaglet.EmailReplacement.MAILTO_NAME); + } + else if ("name-mailto-address".equalsIgnoreCase(option[1])) { + AuthorTaglet.setEmailReplacementType(AuthorTaglet.EmailReplacement.NAME_MAILTO_ADDRESS); + } + else if ("name-mangled-address".equalsIgnoreCase(option[1])) { + AuthorTaglet.setEmailReplacementType(AuthorTaglet.EmailReplacement.NAME_MANGLED_ADDRESS); + } + else { + printError("Invalid value for option '-authortag-email'. Allowed values are:" + + " no-replace, mailto-name, name-mailto-address, name-mangled-address."); + return false; + } + } + else if ("-mailmangledot".equals(optionTag)) { + AuthorTaglet.setDotReplacement(option[1]); + } + else if ("-mailmangleat".equals(optionTag)) { + AuthorTaglet.setAtReplacement(option[1]); + } + else if ("-docfilessubdirs".equals(optionTag)) { + docFilesSubdirsEnabled = true; + } + else if ("-excludedocfilessubdir".equals(optionTag)) { + StringTokenizer st = new StringTokenizer(option[1]); + while (st.hasMoreTokens()) { + excludeDocFilesSubDirs.add(st.nextToken()); + } + } + else if ("-nonavbar".equals(optionTag)) { + docTransletOptions.nonavbar = true; + } + else if ("-noindex".equals(optionTag)) { + docTransletOptions.noindex = true; + } + else if ("-notree".equals(optionTag)) { + docTransletOptions.notree = true; + } + else if ("-nocomment".equals(optionTag)) { + docTransletOptions.nocomment = true; + } + else if ("-nohelp".equals(optionTag)) { + docTransletOptions.nohelp = true; + } + else if ("-splitindex".equals(optionTag)) { + docTransletOptions.splitindex = true; + } + else if ("-linksource".equals(optionTag)) { + docTransletOptions.linksource = true; + } + else if ("-windowtitle".equals(optionTag)) { + docTransletOptions.windowtitle = option[1]; + } + else if ("-helpfile".equals(optionTag)) { + docTransletOptions.helpfile = new File(option[1]).toURL().toString(); + } + else if ("-stylesheetfile".equals(optionTag)) { + docTransletOptions.stylesheetfile = new File(option[1]).toURL().toString(); + } + else if ("-header".equals(optionTag)) { + docTransletOptions.header = option[1]; + } + else if ("-footer".equals(optionTag)) { + docTransletOptions.footer = option[1]; + } + else if ("-bottom".equals(optionTag)) { + docTransletOptions.bottom = option[1]; + } + else if ("-doctitle".equals(optionTag)) { + docTransletOptions.doctitle = option[1]; + } + else if ("-nodeprecatedlist".equals(optionTag)) { + docTransletOptions.nodeprecatedlist = true; + } + else if ("-uses".equals(optionTag)) { + docTransletOptions.uses = true; + } + else if ("-group".equals(optionTag)) { + if (!processGroupOption(option[1], option[2])) { + printError("Invalid package wildcard list in -group option \"" + option[1] + "\" " + option[2]); + return false; + } + } + else if ("-tag".equals(optionTag)) { + String tagSpec = option[1]; + boolean validTagSpec = false; + int ndx1 = tagSpec.indexOf(':'); + if (ndx1 < 0) { + Taglet taglet = (Taglet)tagletMap.get(tagSpec); + if (null == taglet) { + printError("There is no standard tag '" + tagSpec + "'."); + } + else { + if (mentionedTags.contains(taglet)) { + printError("Tag '" + tagSpec + "' has been added or moved before."); + } + else { + mentionedTags.add(taglet); + + // re-append taglet + tagletMap.remove(tagSpec); + tagletMap.put(tagSpec, taglet); + } + } + } + else { + int ndx2 = tagSpec.indexOf(':', ndx1 + 1); + if (ndx2 > ndx1 && ndx2 < tagSpec.length() - 1) { + String tagName = tagSpec.substring(0, ndx1); + String tagHead = null; + if (tagSpec.charAt(ndx2 + 1) == '\"') { + if (tagSpec.charAt(tagSpec.length() - 1) == '\"') { + tagHead = tagSpec.substring(ndx2 + 2, tagSpec.length() - 1); + validTagSpec = true; + } + } + else { + tagHead = tagSpec.substring(ndx2 + 1); + validTagSpec = true; + } + + boolean tagScopeOverview = false; + boolean tagScopePackages = false; + boolean tagScopeTypes = false; + boolean tagScopeConstructors = false; + boolean tagScopeMethods = false; + boolean tagScopeFields = false; + boolean tagDisabled = false; + + tag_option_loop: + for (int n=ndx1+1; n:Xaoptcmf:\"."); + } + } + } + + // Use current directory if target directory hasn't been set. + if (null == targetDirectory) { + targetDirectory = new File(System.getProperty("user.dir")); + } + if (null != targetContext) { + targetContext.setTargetDirectory(targetDirectory); + } + + // It is illegal to specify targets AND -xmlonly. + + if (xmlOnly && targets.size() > 0) { + + printError("You can only specify one of -xmlonly and a target format."); + return false; + } + + // If no target was specified and XML only was not + // requested, use HTML as default target. + + if (!xmlOnly && targets.size() == 0) { + targets.add(targetContext = htmlTargetContext); + } + + // Set the same target directory for all output. + + // FIXME: Allow separate target directories for different + // output formats. + + for (Iterator it = targets.iterator(); it.hasNext(); ) { + TargetContext t = (TargetContext)it.next(); + t.setTargetDirectory(targetDirectory); + } + + // Create temporary directory if necessary + + if (xmlOnly) { + + xmlTargetDirectory = targetDirectory; + } + else { + + File workingTopDirectory = new File(workingPath); + + workingDirectory = new File(workingTopDirectory, "gjdoc.tmp."+System.currentTimeMillis()); + + if (!workingDirectory.mkdir()) { + printError("Cannot create temporary directory at "+System.getProperty("java.io.tmpdir")); + return false; + } + + File xmlTempDirectory = new File(workingDirectory, "xmloutput"); + + if (!xmlTempDirectory.mkdir()) { + printError("Cannot create temporary directory for XML output at "+System.getProperty("java.io.tmpdir")); + return false; + } + + xmlTargetDirectory = xmlTempDirectory; + } + + // Create target directory if necessary + + if (!targetDirectory.exists()) { + printNotice("Creating destination directory: \"" + + targetDirectory + "\""); + if (!targetDirectory.mkdirs()) { + printError("Failed to create destination directory \"" + + targetDirectory + "\""); + return false; + } + } + + // Check for deprecation + + boolean hasDeprecatedClasses = false; + boolean hasDeprecatedInterfaces = false; + boolean hasDeprecatedExceptions = false; + boolean hasDeprecatedErrors = false; + boolean hasDeprecatedMethods = false; + boolean hasDeprecatedFields = false; + + { + ClassDoc[] classes = rootDoc.classes(); + for (int i = 0, ilim = classes.length; i < ilim; ++ i) { + ClassDoc c = classes[i]; + Tag[] deprecatedTags = c.tags("deprecated"); + if (null != deprecatedTags && 0 != deprecatedTags.length) { + if (c.isInterface()) { + hasDeprecatedInterfaces = true; + } + else if (c.isException()) { + hasDeprecatedExceptions = true; + } + else if (c.isError()) { + hasDeprecatedErrors = true; + } + else /*if (c.isOrdinaryClass())*/ { + hasDeprecatedClasses = true; + } + } + + MethodDoc[] methods = c.methods(); + for (int j = 0, jlim = methods.length; j < jlim; ++ j) { + MethodDoc m = methods[j]; + deprecatedTags = m.tags("deprecated"); + if (null != deprecatedTags && 0 != deprecatedTags.length) { + hasDeprecatedMethods = true; + } + } + + FieldDoc[] fields = c.fields(); + for (int j = 0, jlim = fields.length; j < jlim; ++ j) { + FieldDoc f = fields[j]; + deprecatedTags = f.tags("deprecated"); + if (null != deprecatedTags && 0 != deprecatedTags.length) { + hasDeprecatedFields = true; + } + } + } + } + + htmlRepairer = new HtmlRepairer(rootDoc, noHTMLWarn, noEmailWarn, + currentClass, currentMember, + false); + + collectUsage(); + + // Begin XML generation + + printNotice("Writing XML Index file..."); + + // Assign output stream + + setTargetFile("index.xml"); + + // Output XML document header + + println(0, ""); + println(""); + println(); + printOpenTag(0, "rootdoc xmlns=\"http://www.w3.org/TR/REC-html40\" xmlns:gjdoc=\"http://www.gnu.org/software/cp-tools/gjdocxml\""); + + println(); + println(1, ""); + + if (rootDoc.firstSentenceTags().length > 0) { + printOpenTag(2, "firstSentenceTags", false); + outputTags(3, rootDoc.firstSentenceTags(), true, CONTEXT_PACKAGE); + printCloseTag(0, "firstSentenceTags"); + } + + if (rootDoc.inlineTags().length > 0) { + printOpenTag(2, "inlineTags"); + outputTags(3, rootDoc.inlineTags(), true, CONTEXT_PACKAGE); + printCloseTag(2, "inlineTags"); + } + + if (null != bottomNote) { + printOpenTag(1, "bottomnote"); + print(bottomNote); + printCloseTag(1, "bottomnote"); + } + + if (null != title) { + printOpenTag(1, "title"); + println(2, title); + printCloseTag(1, "title"); + } + + printOpenTag(1, "created"); + println(2, DateFormat.getDateInstance(DateFormat.LONG, Locale.US).format(new java.util.Date())); + printCloseTag(1, "created"); + + if (hasDeprecatedClasses) printAtomTag(1, "hasDeprecatedClasses"); + if (hasDeprecatedInterfaces) printAtomTag(1, "hasDeprecatedInterfaces"); + if (hasDeprecatedExceptions) printAtomTag(1, "hasDeprecatedExceptions"); + if (hasDeprecatedErrors) printAtomTag(1, "hasDeprecatedErrors"); + if (hasDeprecatedMethods) printAtomTag(1, "hasDeprecatedMethods"); + if (hasDeprecatedFields) printAtomTag(1, "hasDeprecatedFields"); + + // Output summary of all classes specified on command line + + println(); + println(1, ""); + ClassDoc[] specifiedClasses = rootDoc.specifiedClasses(); + for (int i=0, ilim=specifiedClasses.length; i"); + PackageDoc[] specifiedPackages = rootDoc.specifiedPackages(); + for (int i=0, ilim=specifiedPackages.length; i"); + { + Iterator packageGroupIt = packageGroups.iterator(); + while (packageGroupIt.hasNext()) { + PackageGroup packageGroup = (PackageGroup)packageGroupIt.next(); + SortedSet groupedPackages = packageGroup.getPackages(); + if (groupedPackages.isEmpty()) { + printWarning("Package group named '" + + packageGroup.getName() + "' didn't match any packages."); + } + else { + printOpenTag(1, "packagegroup name=\"" + packageGroup.getName() + "\""); + Iterator groupedPackageIt = groupedPackages.iterator(); + while (groupedPackageIt.hasNext()) { + PackageDoc groupedPackageDoc = (PackageDoc)groupedPackageIt.next(); + printAtomTag(2, "package name=\"" + groupedPackageDoc.name() + "\""); + } + printCloseTag(1, "packagegroup"); + } + } + packageGroups = null; + } + + // Output information on all packages for which documentation + // has been made available via the Doclet API + + println(); + println(1, ""); + PackageDoc[] packages = rootDoc.specifiedPackages(); + for (int i=0, ilim=packages.length; i"); + ClassDoc[] sumclasses = rootDoc.classes(); + for (int i=0, ilim=sumclasses.length; i"); + ClassDoc[] classes = rootDoc.classes(); + String prevPackageName = null; + for (int i = 0, ilim = classes.length; i < ilim; ++ i) { + ClassDoc c = classes[i]; + + if (isVerbose()) { + printNotice("Writing XML information for "+c.qualifiedName()+"..."); + } + else { + String packageName = c.containingPackage().name(); + if (null == prevPackageName || !packageName.equals(prevPackageName)) { + printNotice("Writing XML information for "+packageName+"..."); + prevPackageName = packageName; + } + } + + setTargetFile(c.qualifiedName().replace('/','.')+".xml"); + + println(""); + println(""); + + outputClassDoc(c); + + closeTargetFile(); + } + classes = null; + } + + // Copy DTD files to temporary directory + + // FIXME: try to solve this via jar: URLs. but this will + // probably break libxmlj compatibility (?) + + String[] resources = new String[] { + "gjdoc.dtd", + "gjdoc-alphaindex.dtd", + "dbcentx.mod", + "ent/iso-amsa.ent", + "ent/iso-amsb.ent", + "ent/iso-amsc.ent", + "ent/iso-amsn.ent", + "ent/iso-amso.ent", + "ent/iso-amsr.ent", + "ent/iso-box.ent", + "ent/iso-cyr1.ent", + "ent/iso-cyr2.ent", + "ent/iso-dia.ent", + "ent/iso-grk1.ent", + "ent/iso-grk2.ent", + "ent/iso-grk3.ent", + "ent/iso-grk4.ent", + "ent/iso-lat1.ent", + "ent/iso-lat2.ent", + "ent/iso-num.ent", + "ent/iso-pub.ent", + "ent/iso-tech.ent", + }; + + File tempDtdDirectory = new File(xmlTargetDirectory, "dtd"); + File tempDtdEntDirectory = new File(tempDtdDirectory, "ent"); + + if ((tempDtdDirectory.exists() || tempDtdDirectory.mkdir()) + && (tempDtdEntDirectory.exists() || tempDtdEntDirectory.mkdir())) { + for (int i = 0; i < resources.length; ++ i) { + copyResourceToFile("/dtd/" + resources[i], + new File(tempDtdDirectory, resources[i])); + } + } + else { + printError("Cannot create temporary directories for DTD data at " + tempDtdDirectory); + return false; + } + + // Copy package data-dir directory + + { + PackageDoc[] packages = rootDoc.specifiedPackages(); + for (int i=0, ilim=packages.length; irm -Rf directory + * + * @return true on success + */ + private static boolean deleteRecursive(File directory) { + + boolean success = true; + + File[] files = directory.listFiles(); + + for (int i=0, ilim=files.length; i"); + } + + /** + * Prints an open tag at the given indentation level. + */ + protected void printOpenTag(int level, String tag) { + printOpenTag(level, replaceCharsInTag(tag), true); + } + + /** + * Prints an open tag at the given indentation level and + * conditionally appends a newline (if not in tight mode). + */ + protected void printOpenTag(int level, String tag, boolean appendNewline) { + if (appendNewline && !compress) { + println(level, "<"+tagPrefix+":"+replaceCharsInTag(tag)+">"); + } + else { + print(level, "<"+tagPrefix+":"+replaceCharsInTag(tag)+">"); + } + } + + /** + * Prints a close tag at the given indentation level. + */ + protected void printCloseTag(int level, String tag) { + printCloseTag(level, tag, true); + } + + /** + * Prints a close tag at the given indentation level and + * conditionally appends a newline (if not in tight mode). + */ + protected void printCloseTag(int level, String tag, boolean appendNewline) { + if (appendNewline && !compress) { + println(level, ""); + } + else { + print(level, ""); + } + } + + public static int optionLength(String option) { + if ("-d".equals(option)) return 2; + else if ("-fixhtml".equals(option)) return 1; + else if ("-compress".equals(option)) return 1; + else if ("-nohtmlwarn".equals(option)) return 1; + else if ("-noemailwarn".equals(option)) return 1; + else if ("-indentstep".equals(option)) return 2; + else if ("-xslsheet".equals(option)) return 2; + else if ("-xsltdriver".equals(option)) return 2; + else if ("-postprocess".equals(option)) return 2; + else if ("-genhtml".equals(option)) return 1; + else if ("-geninfo".equals(option)) return 1; + else if ("-gendocbook".equals(option)) return 1; + else if ("-xmlonly".equals(option)) return 1; + else if ("-bottomnote".equals(option)) return 2; + else if ("-workpath".equals(option)) return 2; + else if ("-title".equals(option)) return 2; + else if ("-tagletpath".equals(option)) return 2; + else if ("-taglet".equals(option)) return 2; + else if ("-authormail".equals(option)) return 2; + else if ("-mailmangledot".equals(option)) return 2; + else if ("-mailmangleat".equals(option)) return 2; + else if ("-noindex".equals(option)) return 1; + else if ("-nocomment".equals(option)) return 1; + else if ("-notree".equals(option)) return 1; + else if ("-nohelp".equals(option)) return 1; + else if ("-nonavbar".equals(option)) return 1; + else if ("-splitindex".equals(option)) return 1; + else if ("-author".equals(option)) return 1; + else if ("-version".equals(option)) return 1; + else if ("-nosince".equals(option)) return 1; + else if ("-nodeprecated".equals(option)) return 1; + else if ("-linksource".equals(option)) return 1; + else if ("-windowtitle".equals(option)) return 2; + else if ("-helpfile".equals(option)) return 2; + else if ("-stylesheetfile".equals(option)) return 2; + else if ("-tag".equals(option)) return 2; + else if ("-header".equals(option)) return 2; + else if ("-footer".equals(option)) return 2; + else if ("-bottom".equals(option)) return 2; + else if ("-doctitle".equals(option)) return 2; + else if ("-nodeprecatedlist".equals(option)) return 1; + else if ("-uses".equals(option)) return 1; + else if ("-group".equals(option)) return 3; + + else return -1; + } + + public static boolean validOptions(String[][] options) { + return true; + } + + + /** + * Workaround for non well-formed comments: fix tag contents + * by replacing < with &lt;, + * > with &gt; and + * & with &amp;. + * + * @param tagContent String to process + * + * @return given String with all special characters replaced by + * HTML entities. + */ + private static String replaceCharsInTag(String tagContent) { + return + replaceString( + replaceString( + replaceString( + tagContent, + "<", "<" + ), + ">", ">" + ), + "&", "&" + ); + } + + /** + * Replaces all occurences of string needle within string + * haystack by string replacement. + * + * @param haystack The string to search and replace in. + * @param needle The string which is searched for. + * @param replacement The string by which every occurence of needle is replaced. + */ + private static String replaceString(String haystack, String needle, String replacement) { + int ndx = haystack.indexOf(needle); + if (ndx<0) + return haystack; + else + return haystack.substring(0, ndx) + replacement + + replaceString(haystack.substring(ndx+needle.length()), needle, replacement); + } + + protected void setTargetFile(String filename) throws IOException { + + OutputStream fileOut = new FileOutputStream(new File(xmlTargetDirectory, filename)); + out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(fileOut, "UTF8")));; + } + + protected void closeTargetFile() { + + out.flush(); + out.close(); + } + + private String cdata(String str) { + + if (null==str) { + return str; + } // end of if ((null==str) + + StringBuffer rc = new StringBuffer(); + for (int i=0; i=0x20 && c<=0xd7ff) || (c>=0xe000 && c<=0xfffd) || (c>=0x10000 && c<=0x10ffff)) { + rc.append(c); + } + else { + printWarning("Invalid Unicode character 0x"+Integer.toString(c, 16)+" in javadoc markup has been stripped."); + } // end of else + + } + return rc.toString(); + } + + static void copyResourceToFile(String resourceName, File target) throws IOException { + + InputStream in = Driver.class.getResourceAsStream(resourceName); + + if (null != in) { + + FileOutputStream out = new FileOutputStream(target); + int size; + byte[] buffer = new byte[512]; + while ((size = in.read(buffer)) >= 0) { + out.write(buffer, 0, size); + } + out.close(); + } + else { + + throw new IOException("Can't find resource named "+resourceName); + } + } + + private void printError(String error) { + if (null != rootDoc) { + rootDoc.printError(error); + } + else { + System.err.println("ERROR: "+error); + } + } + + private void printWarning(String warning) { + if (null != rootDoc) { + rootDoc.printWarning(warning); + } + else { + System.err.println("WARNING: "+warning); + } + } + + private void printNotice(String notice) { + if (null != rootDoc) { + rootDoc.printNotice(notice); + } + else { + System.err.println(notice); + } + } + + /** + * Copy the contents of the input directory to the output + * directory. The output directory must exist. + */ + private void copyPackageDataDir(GjdocPackageDoc packageDoc) throws IOException { + File docFilesSourceDirectory + = new File(packageDoc.packageDirectory(), "doc-files"); + File docFilesTargetDirectory + = new File(this.targetDirectory, + packageDoc.name().replace('.', File.separatorChar)); + if (docFilesSourceDirectory.exists()) { + printNotice("Copying files from " + docFilesSourceDirectory); + copyDirectory(docFilesSourceDirectory, docFilesTargetDirectory, + docFilesSubdirsEnabled, + excludeDocFilesSubDirs); + } + } + + /** + * Recursively copy the contents of the input directory to the + * output directory. The output directory must exist. + */ + private static void copyDirectory(File sourceDir, File targetDir, + boolean recursive, + Set excludeDirs) throws IOException { + if (!targetDir.exists() && !targetDir.mkdirs()) { + throw new IOException("Cannot create directory " + targetDir); + } + + File[] sourceFiles = sourceDir.listFiles(); + for (int i=0; i= 0) { + out.write(buf, 0, nread); + } + in.close(); + out.close(); + } + + private void createIndexByName() throws IOException { + // Create index + + // Collect index + + Map indexMap = new TreeMap(new Comparator() { + public int compare(Object o1, Object o2) { + return o1.toString().toLowerCase().compareTo(o2.toString().toLowerCase()); + } + }); + + // Add packages to index + + PackageDoc[] packages = rootDoc.specifiedPackages(); + for (int i=0, ilim=packages.length; i 0) { + signature.append(", "); + } + signature.append(parameters[k].typeName()); + } + signature.append(')'); + indexMap.put(signature.toString(), method); + } + } + + // Assign output stream + + setTargetFile("alphaindex.xml"); + + // Output XML document header + + println(0, ""); + println(""); + println(); + printOpenTag(0, "alphaindex xmlns=\"http://www.w3.org/TR/REC-html40\" xmlns:gjdoc=\"http://www.gnu.org/software/cp-tools/gjdocxml\""); + + Iterator it = indexMap.keySet().iterator(); + + char previousCategoryLetter = '\0'; + boolean categoryOpen = false; + + while (it.hasNext()) { + String key = (String)it.next(); + Doc entry = (Doc)indexMap.get(key); + + char firstChar = Character.toUpperCase(key.charAt(0)); + if (firstChar != previousCategoryLetter) { + if (categoryOpen) { + printCloseTag(1, "category"); + } + printOpenTag(1, "category letter=\"" + firstChar + "\""); + categoryOpen = true; + previousCategoryLetter = firstChar; + } + + printOpenTag(2, "entry name=\"" + key + "\""); + if (entry instanceof PackageDoc) { + printAtomTag(3, "isPackage"); + } + else if (entry instanceof ClassDoc) { + printAtomTag(3, "isClass"); + ClassDoc centry = (ClassDoc)entry; + currentClass = centry; + printAtomTag(3, "containingPackage name=\"" + centry.containingPackage().name() + "\""); + if (null != centry.containingClass()) { + printAtomTag(3, "containingClass name=\"" + centry.containingClass().name() + "\""); + } + if (centry.isInterface()) { + printAtomTag(3, "isInterface"); + } + if (centry.isException()) { + printAtomTag(3, "isException"); + } + if (centry.isError()) { + printAtomTag(3, "isError"); + } + if (centry.isOrdinaryClass()) { + printAtomTag(3, "isOrdinaryClass"); + } + } + else if (entry instanceof ProgramElementDoc) { + ProgramElementDoc pentry = (ProgramElementDoc)entry; + currentClass = pentry.containingClass(); + printAtomTag(3, "containingPackage name=\"" + pentry.containingPackage().name() + "\""); + printAtomTag(3, "containingClass name=\"" + pentry.containingClass().name() + "\""); + if (pentry.isMethod()) { + printAtomTag(3, "isMethod"); + ExecutableMemberDoc mentry = (ExecutableMemberDoc)pentry; + printAtomTag(3, "signature full=\""+mentry.signature()+"\" flat=\""+mentry.flatSignature()+"\""); + printAtomTag(3, "method name=\"" + mentry.name() + "\""); + } + if (pentry.isField()) { + printAtomTag(3, "isField"); + } + } + + Tag[] tags = entry.firstSentenceTags(); + for (int i=0, ilim=tags.length; i0) { + printOpenTag(3, "firstSentenceTags", false); + outputTags(4, tag.firstSentenceTags(), false, CONTEXT_TYPE); + printCloseTag(3, "firstSentenceTags"); + } + } + + + printCloseTag(2, "entry"); + } + + if (categoryOpen) { + printCloseTag(1, "category"); + } + + printCloseTag(0, "alphaindex"); + + closeTargetFile(); + } + + private static class UsageType + { + public static final UsageType CLASS_DERIVED_FROM = new UsageType("class-derived-from"); + public static final UsageType FIELD_OF_TYPE = new UsageType("field-of-type"); + public static final UsageType METHOD_WITH_RETURN_TYPE = new UsageType("method-with-return-type"); + public static final UsageType METHOD_WITH_PARAMETER_TYPE = new UsageType("method-with-parameter-type"); + public static final UsageType METHOD_WITH_THROWN_TYPE = new UsageType("method-with-thrown-type"); + public static final UsageType CONSTRUCTOR_WITH_PARAMETER_TYPE = new UsageType("constructor-with-parameter-type"); + public static final UsageType CONSTRUCTOR_WITH_THROWN_TYPE = new UsageType("constructor-with-thrown-type"); + private String id; + + private UsageType(String id) + { + this.id = id; + } + + public String toString() { + return "UsageType{id=" + id + "}"; + } + + public String getId() { + return id; + } + } + + /** + * ClassDoc -> (PackageDoc -> (UsageType -> (Set of Doc))) + */ + private Map usedClassToPackagesMap = new HashMap(); + + private void addUsedBy(ClassDoc usedClass, UsageType usageType, Doc user, PackageDoc userPackage) + { + Map packageToUsageTypeMap = (Map)usedClassToPackagesMap.get(usedClass); + if (null == packageToUsageTypeMap) { + packageToUsageTypeMap = new HashMap(); + usedClassToPackagesMap.put(usedClass, packageToUsageTypeMap); + } + + Map usageTypeToUsersMap = (Map)packageToUsageTypeMap.get(userPackage); + if (null == usageTypeToUsersMap) { + usageTypeToUsersMap = new HashMap(); + packageToUsageTypeMap.put(userPackage, usageTypeToUsersMap); + } + + Set userSet = (Set)usageTypeToUsersMap.get(usageType); + if (null == userSet) { + userSet = new TreeSet(); // FIXME: we need the collator from Main here + usageTypeToUsersMap.put(usageType, userSet); + } + userSet.add(user); + } + + /** + * Create the cross reference database. + */ + private void collectUsage() { + + ClassDoc[] classes = rootDoc.classes(); + for (int i = 0, ilim = classes.length; i < ilim; ++ i) { + ClassDoc clazz = classes[i]; + + // classes derived from + for (ClassDoc superclass = clazz.superclass(); superclass != null; + superclass = superclass.superclass()) { + addUsedBy(superclass, UsageType.CLASS_DERIVED_FROM, clazz, clazz.containingPackage()); + } + + FieldDoc[] fields = clazz.fields(); + for (int j = 0, jlim = fields.length; j < jlim; ++ j) { + FieldDoc field = fields[j]; + + // fields of type + ClassDoc fieldType = field.type().asClassDoc(); + if (null != fieldType) { + addUsedBy(fieldType, UsageType.FIELD_OF_TYPE, + field, clazz.containingPackage()); + } + } + + MethodDoc[] methods = clazz.methods(); + for (int j = 0, jlim = methods.length; j < jlim; ++ j) { + MethodDoc method = methods[j]; + + // methods with return type + + ClassDoc returnType = method.returnType().asClassDoc(); + if (null != returnType) { + addUsedBy(returnType, UsageType.METHOD_WITH_RETURN_TYPE, + method, clazz.containingPackage()); + } + Parameter[] parameters = method.parameters(); + for (int k=0; k"); + } + */ + + protected void outputClassDoc(ClassDoc classDoc) + throws IOException + { + super.outputClassDoc(classDoc); + //outputSourcePosition(level, doc.position()); + } + + protected void outputFieldDocBody(int level, FieldDoc fieldDoc) { + super.outputFieldDocBody(level, fieldDoc); + //println(level, ""+fieldDoc.constantValueExpression()+""); + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.java new file mode 100644 index 00000000000..df9be0ae583 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/HtmlRepairer.java @@ -0,0 +1,674 @@ +/* gnu.classpath.tools.doclets.xmldoclet.HtmlRepairer.java + Copyright (C) 2003 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.xmldoclet; + +import java.io.*; +import java.util.*; +import com.sun.javadoc.DocErrorReporter; +import com.sun.javadoc.ClassDoc; +import com.sun.javadoc.MemberDoc; + +/** + * Provides methods for tidying up HTML source. + * + * @author Julian Scheid + */ +public final class HtmlRepairer { + + private static class TagInfo { + + private Set parentTags = new HashSet(); + + public TagInfo(String parentTag) { + this.parentTags.add(parentTag); + } + + public TagInfo(String[] parentTagArr) { + for (int i=0; i element"); + } + } + + private void haveStartOrEndTag(String tag) { + + boolean _isLeadingTag = isLeadingTag; + isLeadingTag = false; + + tag = tag.trim(); + + boolean isEndTag = tag.startsWith("/"); + boolean isAtomTag = tag.endsWith("/"); + + if (isEndTag && isAtomTag) { + // got something like '' which is invalid. + // suppose a close tag was intended. + tag = tag.substring(0, tag.length()-1); + } + + if (tag.length() < 1) { + printWarning("Deleting broken tag"); + return; + } + + String tagName = tag.substring(isEndTag?1:0, isAtomTag?tag.length()-1:tag.length()); + String tagAttributes = ""; + + for (int i=0; i=0) { + tagAttributes = tagName.substring(i).trim(); + tagName = tagName.substring(0, i); + break; + } + } + + if (!isEndTag && tagName.indexOf('@')>0) { + if (!noEmailWarn) { + printWarning("Tag looks like email address: <"+tagName+">"); + } + output.append("<"+tag+">"); + return; + } + + tagName = tagName.toLowerCase(); + + if (_isLeadingTag && "p".equals(tagName) && !isEndTag && throwAwayLeadingPara) { + return; + } + + if ("p".equals(tagName) || "br".equals(tagName) || "hr".equals(tagName)) { + // throw away

and
+ if (isEndTag) { + return; + } + // make sure every

is a

and every
is a
+ else if (!isAtomTag) { + tag += "/"; + isAtomTag = true; + } + } + + if (isEndTag) { + + // check whether this close tag is on the stack + // if yes, close all tags up to this tag + if (tagStack.contains(tagName)) { + String popped; + do { + popped = (String)tagStack.pop(); + if (!popped.equals(tagName)) + printWarning("Inserting '"); + output.append(""); + } + while (!popped.equals(tagName)); + } + // if not, just throw it away + else { + printWarning("Deleting <"+tag+">"); + } + } + else { + + final int STATE_INITIAL = 1; + final int STATE_EXPECT_ATTRIBUTENAME = 2; + final int STATE_UNQUOTED_ATTRIBUTEVALUE = 3; + final int STATE_SINGLEQUOTE_ATTRIBUTEVALUE = 4; + final int STATE_DOUBLEQUOTE_ATTRIBUTEVALUE = 5; + final int STATE_EXPECT_ATTRIBUTEVALUE = 6; + final int STATE_EXPECT_EQUALSIGN = 7; + + int state = STATE_INITIAL; + + String newAttributes = ""; + String attributeName = null; + StringBuffer buf = new StringBuffer(); + + char[] attrsAsChars = tagAttributes.toCharArray(); + for (int i=0, ilim=attrsAsChars.length+1; i=0){ + continue; + } + else if (-1==c) { + continue; + } + else { + state = STATE_EXPECT_ATTRIBUTENAME; + buf.append((char)c); + } + break; + + case STATE_EXPECT_ATTRIBUTENAME: + if ('='==c) { + attributeName = buf.toString(); + buf.setLength(0); + state = STATE_EXPECT_ATTRIBUTEVALUE; + } + else if (-1==c) { + attributeName = buf.toString(); + buf.setLength(0); + printWarning("In Tag '"+tag+"':\nAttribute name without a value, inserting value =\""+attributeName+"\""); + } + else if (" \t\r\n".indexOf(c)>=0) { + state = STATE_EXPECT_EQUALSIGN; + } + else { + buf.append((char)c); + } + break; + + case STATE_EXPECT_EQUALSIGN: + if (" \t\r\n".indexOf(c)>=0){ + continue; + } + else if ('='==c) { + state = STATE_EXPECT_ATTRIBUTEVALUE; + attributeName = buf.toString(); + buf.setLength(0); + } + else { + attributeName = buf.toString(); + buf.setLength(0); + printWarning("In Tag '"+tag+"':\nAttribute name without a value, inserting value =\""+attributeName+"\""); + newAttributes += " "+attributeName+"=\""+attributeName+"\""; + buf.append((char)c); + state = STATE_EXPECT_ATTRIBUTENAME; + } + break; + + case STATE_EXPECT_ATTRIBUTEVALUE: + if (" \t\r\n".indexOf(c)>=0){ + continue; + } + else if ('\"'==c) { + state = STATE_DOUBLEQUOTE_ATTRIBUTEVALUE; + } + else if ('\''==c) { + state = STATE_SINGLEQUOTE_ATTRIBUTEVALUE; + } + else { + state = STATE_UNQUOTED_ATTRIBUTEVALUE; + buf.append((char)c); + } + break; + + case STATE_UNQUOTED_ATTRIBUTEVALUE: + if (-1==c || " \t\r\n".indexOf(c)>=0){ + state = STATE_INITIAL; + newAttributes += " "+attributeName + "=\"" + buf.toString() + "\""; + buf.setLength(0); + } + else { + buf.append((char)c); + } + break; + + case STATE_SINGLEQUOTE_ATTRIBUTEVALUE: + if ('\''==c) { + state = STATE_INITIAL; + newAttributes += " "+attributeName + "=\"" + buf.toString() + "\""; + buf.setLength(0); + } + else { + buf.append((char)c); + } + break; + + case STATE_DOUBLEQUOTE_ATTRIBUTEVALUE: + if ('\"'==c) { + state = STATE_INITIAL; + newAttributes += " "+attributeName + "=\"" + buf.toString() + "\""; + buf.setLength(0); + } + else { + buf.append((char)c); + } + break; + } + } + + + if (!isAtomTag) { + + // check whether this open tag is equal to the topmost + // entry on the stack; if yes, emit a close tag first + + // corrects stuff like '......'); + if (!tagStack.isEmpty() && tagStack.peek().equals(tagName)) { + printWarning("Inserting "); + output.append(""); + tagStack.pop(); + } + else { + processKnownChildTags(tagName, tagStack, output); + } + + // otherwise, we assume there are no close tags required + // before this open tag. + tagStack.push(tagName); + + output.append("<"+tagName+newAttributes+">"); + } + else { + output.append("<"+tagName+newAttributes+"/>"); + } + } + } + + private boolean processKnownChildTags(String tagName, Stack tagStack, StringBuffer output) { + + TagInfo tagInfo = (TagInfo)tagInfoMap.get(tagName); + if (null != tagInfo) { + + String parentTag = null; + for (Enumeration en = tagStack.elements(); en.hasMoreElements(); ) { + String tag = (String)en.nextElement(); + if (tagInfo.isLegalParentTag(tag)) { + parentTag = tag; + break; + } + } + if (parentTag != null) { + while (((String)tagStack.peek()) != parentTag) { + String poppedTagName = (String)tagStack.pop(); + output.append(""); + printWarning("Inserting "); + } + return true; + } + } + return false; + } + + private void flush() { + + // close all pending tags + while (!tagStack.isEmpty()) { + String tagName = (String)tagStack.pop(); + printWarning("Inserting "); + output.append(""); + } + } + + /** + * Takes HTML fragment and returns a well-formed XHTML + * equivalent. + * + * In the returned String, all tags are properly closed and + * nested. + * + * Currently, the returned String is not guaranteed to be + * well-formed. In particular there are no checks on the tag + * names, attribute names and entity names. + */ + public String getWellformedHTML(String text) { + + final int STATE_INITIAL = 1; + final int STATE_TAG_START = 2; + final int STATE_TAG = 3; + final int STATE_TAG_DOUBLEQUOTE = 4; + final int STATE_TAG_SINGLEQUOTE = 5; + final int STATE_AMP = 6; + + int state = STATE_INITIAL; + output.setLength(0); + + + StringBuffer buf = new StringBuffer(); + char[] textAsChars = text.toCharArray(); + + outer_loop: + for (int i=0, ilim=textAsChars.length+1; i0) { + haveText(buf.toString()); + buf.setLength(0); + } + } + else if ('>'==c) { + // assume this is a greater-than sign + buf.append(">"); + } + else if ('&'==c) { + state = STATE_AMP; + } + else if (-1==c) { + if (buf.length()>0) { + haveText(buf.toString()); + buf.setLength(0); + } + continue; + } + else { + buf.append((char)c); + } + break; + + case STATE_AMP: + if ('<'==c) { + buf.append("&"); + state = STATE_TAG_START; + if (buf.length()>0) { + haveText(buf.toString()); + buf.setLength(0); + } + } + else if ('>'==c) { + // assume this is a greater-than sign + buf.append("&"); + buf.append(">"); + state = STATE_INITIAL; + } + else if ('&'==c) { + buf.append("&"); + buf.append("&"); + state = STATE_INITIAL; + } + else if (-1==c) { + buf.append("&"); + haveText(buf.toString()); + buf.setLength(0); + state = STATE_INITIAL; + continue; + } + else { + // peek forward and see whether this is a valid entity. + if ('#'==c) { + buf.append("&"); + buf.append((char)c); + state = STATE_INITIAL; + continue outer_loop; + } + else if (Character.isLetter((char)c)) { + for (int i2=i+1; i2=0) { + //continue; + + // new: assume this is a less-sign + haveText("<"+c); + state = STATE_INITIAL; + } + else if ('/'==c) { + buf.append((char)c); + state = STATE_TAG; + } + else if ('<'==c) { + // assume this is a less-sign + haveText("<<"); + state = STATE_INITIAL; + } + else if ('>'==c) { + // assume this is a less-sign + haveText("<>"); + state = STATE_INITIAL; + } + //else if ('-'==c || '+'==c || '='==c || '\''==c || "0123456789".indexOf(c)>=0) { + else if (!Character.isLetter((char)c)) { + // assume this is a less-sign + haveText("<"+(char)c); + state = STATE_INITIAL; + } + else { + buf.append((char)c); + state = STATE_TAG; + } + break; + + case STATE_TAG: + if ('\"'==c) { + buf.append((char)c); + state = STATE_TAG_DOUBLEQUOTE; + } + else if ('\''==c) { + buf.append((char)c); + state = STATE_TAG_SINGLEQUOTE; + } + else if ('>'==c) { + state = STATE_INITIAL; + haveStartOrEndTag(buf.toString()); + buf.setLength(0); + } + else if ('<'==c) { + // notify user, missing greater-than sign + haveStartOrEndTag(buf.toString()); + buf.setLength(0); + } + else if (-1==c) { + printWarning("Unclosed tag at end-of-comment: <"+buf); + haveStartOrEndTag(buf.toString()); + buf.setLength(0); + } + else { + buf.append((char)c); + } + break; + + case STATE_TAG_DOUBLEQUOTE: + if ('\"'==c) { + buf.append((char)c); + state = STATE_TAG; + } + else if (-1==c) { + printWarning("Unclosed attribute value at end-of-comment."); + haveStartOrEndTag(buf.toString()+"\""); + } + else { + buf.append((char)c); + } + break; + + case STATE_TAG_SINGLEQUOTE: + if ('\''==c) { + buf.append((char)c); + state = STATE_TAG; + } + else if (-1==c) { + printWarning("Unclosed attribute value at end-of-comment."); + haveStartOrEndTag(buf.toString()+"'"); + } + else { + buf.append((char)c); + } + break; + } + } + + return output.toString(); + } + + private String getContext() { + if (null != contextClass) { + StringBuffer rc = new StringBuffer(); + rc.append(contextClass.qualifiedTypeName()); + if (null != contextMember) { + rc.append("."+contextMember.toString()); + } + return rc.toString(); + } + else { + return null; + } + } + + private void printWarning(String msg) { + if (null != warningReporter && !noWarn) { + String context = getContext(); + if (null != context) { + warningReporter.printWarning("In "+getContext()+": "+msg); + } + else { + warningReporter.printWarning("In overview page: "+msg); + } + } + } + + public String terminateText() { + output.setLength(0); + flush(); + return output.toString(); + } +} + diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/TargetContext.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/TargetContext.java new file mode 100644 index 00000000000..72dd9f6a6bc --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/TargetContext.java @@ -0,0 +1,86 @@ +/* gnu.classpath.tools.doclets.xmldoclet.TargetContext + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.xmldoclet; + +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; + +import java.net.URL; + +import java.util.List; +import java.util.Iterator; +import java.util.Map; +import java.util.HashMap; + +import gnu.classpath.tools.doclets.xmldoclet.doctranslet.DocTranslet; + +/** + * Stores any XSL transformation and postprocessing-specific + * information given by the user on the doclet command line. + * + * @author Julian Scheid + */ +public class TargetContext { + + /** + * The DocTranslet to use for processing doclet output. + */ + private DocTranslet docTranslet; + + /** + * Directory to write final output to. + */ + private File targetDirectory; + + /** + * Directory where XSLT output will be written to. If an XSLT + * sheet was specified, but no postprocessing driver was given, + * this is the target directory specified by the user. Otherwise, + * this is a temporary directory. + */ + private File xsltTargetDirectory; + + + public TargetContext(DocTranslet docTranslet, File targetDirectory) { + this.docTranslet = docTranslet; + this.targetDirectory = targetDirectory; + } + + public File getTargetDirectory() { + return targetDirectory; + } + + public void setTargetDirectory(File targetDirectory) { + this.targetDirectory = targetDirectory; + } + + public DocTranslet getDocTranslet() { + return docTranslet; + } + + public void setDocTranslet(DocTranslet docTranslet) { + this.docTranslet = docTranslet; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.java new file mode 100644 index 00000000000..573ca368c6a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/DocTranslet.java @@ -0,0 +1,443 @@ +/* gnu.classpath.tools.doclets.xmldoclet.doctranslet.DocTranslet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.xmldoclet.doctranslet; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintStream; + +import java.net.MalformedURLException; +import java.net.URL; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.HashMap; +import java.util.Map; + +import java.util.jar.JarFile; +import java.util.jar.Manifest; +import java.util.jar.Attributes; + +import javax.xml.transform.ErrorListener; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.TransformerFactoryConfigurationError; +import javax.xml.transform.URIResolver; + +import javax.xml.transform.dom.DOMResult; + +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; + +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.ParserConfigurationException; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import org.xml.sax.SAXException; + +import gnu.classpath.tools.IOToolkit; +import gnu.classpath.tools.doclets.xmldoclet.Driver; + +import com.sun.javadoc.DocErrorReporter; + +public class DocTranslet implements ErrorListener { + + private static class DocErrorReporterOutputStream + extends OutputStream + { + private ByteArrayOutputStream out = new ByteArrayOutputStream(); + private DocErrorReporter reporter; + + public DocErrorReporterOutputStream(DocErrorReporter reporter) { + this.reporter = reporter; + } + + public void write(int ch) { + out.write(ch); + if (ch == 10) { + reporter.printNotice(out.toString()); + out.reset(); + } + } + } + + private String mainResourceFilename; + private ClassLoader classLoader; + private Map transformerMap = new java.util.HashMap(); //WeakHashMap(); + private DocTransletOptions options; + + protected DocTranslet(String mainResourceFilename, + ClassLoader classLoader) + throws DocTransletConfigurationException { + + if (mainResourceFilename.length() > 0 && mainResourceFilename.charAt(0) == '/') { + mainResourceFilename = mainResourceFilename.substring(1); + } + this.mainResourceFilename = mainResourceFilename; + this.classLoader = classLoader; + } + + private static boolean equalsFile(File file1, File file2) { + return file1.getAbsolutePath().equals(file2.getAbsolutePath()); + } + + private static File getParentFile(File file) { + String filename = file.getAbsolutePath(); + if (filename.endsWith(File.separator)) { + filename = filename.substring(0, filename.length() - 1); + } + int lastSlash = filename.lastIndexOf(File.separatorChar); + if (lastSlash > 0) { + filename = filename.substring(0, lastSlash); + } + else { + filename = File.separator; + } + + return new File(filename); + } + + private static boolean cacheXSLTSheets = true; + + public void apply(File xmlSourceDirectory, File targetDirectory, + DocErrorReporter reporter) + throws DocTransletException { + + PrintStream err = System.err; + + try{ + URL mainResourceURL = classLoader == null ? + ClassLoader.getSystemResource(mainResourceFilename): + classLoader.getResource(mainResourceFilename); + + if (null == mainResourceURL) { + throw new DocTransletException("Cannot find resource '" + mainResourceFilename + "'"); + } + + + Map parameters = new HashMap(); + parameters.put("gjdoc.xmldoclet.version", Driver.XMLDOCLET_VERSION); + + parameters.put("gjdoc.option.nonavbar", xsltBoolean(options.nonavbar)); + parameters.put("gjdoc.option.noindex", xsltBoolean(options.noindex)); + parameters.put("gjdoc.option.notree", xsltBoolean(options.notree)); + parameters.put("gjdoc.option.nocomment", xsltBoolean(options.nocomment)); + parameters.put("gjdoc.option.nohelp", xsltBoolean(options.nohelp)); + parameters.put("gjdoc.option.splitindex", xsltBoolean(options.splitindex)); + parameters.put("gjdoc.option.linksource", xsltBoolean(options.linksource)); + parameters.put("gjdoc.option.nodeprecatedlist", xsltBoolean(options.nodeprecatedlist)); + parameters.put("gjdoc.option.uses", xsltBoolean(options.uses)); + parameters.put("gjdoc.option.windowtitle", options.windowtitle); + parameters.put("gjdoc.option.helpfile", options.helpfile); + parameters.put("gjdoc.option.stylesheetfile", options.stylesheetfile); + parameters.put("gjdoc.option.header", options.header); + parameters.put("gjdoc.option.footer", options.footer); + parameters.put("gjdoc.option.bottom", options.bottom); + parameters.put("gjdoc.option.doctitle", options.doctitle); + + List outputFileList = getOutputFileList(mainResourceURL, + xmlSourceDirectory, + parameters); + + reporter.printNotice("Running DocTranslet..."); + + TransformerFactory transformerFactory + = TransformerFactory.newInstance(); + + transformerFactory.setErrorListener(this); + + boolean isLibxmlJ + = transformerFactory.getClass().getName().equals("gnu.xml.libxmlj.transform.TransformerFactoryImpl"); + + for (Iterator it = outputFileList.iterator(); it.hasNext(); ) { + + if (isLibxmlJ) { + System.gc(); + Runtime.getRuntime().runFinalization(); + } + + OutputFileInfo fileInfo = (OutputFileInfo)it.next(); + + File targetFile = new File(targetDirectory, fileInfo.getName()); + File packageTargetDir = getParentFile(targetFile); + + if (!packageTargetDir.exists() && !packageTargetDir.mkdirs()) { + throw new DocTransletException("Target directory " + packageTargetDir + " does not exist and cannot be created."); + } + + if (options.linksource) { + File sourceTargetDirectory = new File(targetDirectory, "src-html"); + File sourceTargetFile = new File(sourceTargetDirectory, fileInfo.getName()); + File sourcePackageTargetDir = getParentFile(sourceTargetFile); + + if (!sourcePackageTargetDir.exists() && !sourcePackageTargetDir.mkdirs()) { + throw new DocTransletException("Target directory " + packageTargetDir + " does not exist and cannot be created."); + } + } + + if (options.uses) { + File usesTargetDirectory = new File(targetDirectory, "class-use"); + File usesTargetFile = new File(usesTargetDirectory, fileInfo.getName()); + File usesPackageTargetDir = getParentFile(usesTargetFile); + + if (!usesPackageTargetDir.exists() && !usesPackageTargetDir.mkdirs()) { + throw new DocTransletException("Target directory " + packageTargetDir + " does not exist and cannot be created."); + } + } + + if (null != fileInfo.getSource()) { + + reporter.printNotice("Copying " + fileInfo.getComment() + "..."); + InputStream in = new URL(mainResourceURL, fileInfo.getSource()).openStream(); + FileOutputStream out = new FileOutputStream(targetFile.getAbsolutePath()); + IOToolkit.copyStream(in, out); + in.close(); + out.close(); + } + else { + + reporter.printNotice("Generating " + fileInfo.getComment() + "..."); + + String pathToRoot = ""; + for (File file = getParentFile(targetFile); !equalsFile(file, targetDirectory); file = getParentFile(file)) { + pathToRoot += "../"; + } + + StreamResult out = new StreamResult(targetFile.getAbsolutePath()); + + StreamSource in = new StreamSource(new File(xmlSourceDirectory, "index.xml").getAbsolutePath()); + URL resource = new URL(mainResourceURL, fileInfo.getSheet()); + + + StreamSource xsltSource = new StreamSource(resource.toExternalForm()); + + if (null != fileInfo.getInfo()) { + parameters.put("gjdoc.outputfile.info", fileInfo.getInfo()); + } + parameters.put("gjdoc.pathtoroot", pathToRoot); + + Transformer transformer; + transformer = (Transformer)transformerMap.get(xsltSource.getSystemId()); + if (null == transformer) { + transformer = transformerFactory.newTransformer(xsltSource); + if (cacheXSLTSheets) { + transformerMap.put(xsltSource.getSystemId(), transformer); + } + } + + transformer.clearParameters(); + for (Iterator pit = parameters.keySet().iterator(); pit.hasNext(); ) { + String key = (String)pit.next(); + String value = (String)parameters.get(key); + transformer.setParameter(key, value); + } + + transformer.setErrorListener(this); + DocErrorReporterOutputStream errorReporterOut + = new DocErrorReporterOutputStream(reporter); + System.setErr(new PrintStream(errorReporterOut)); + + transformer.transform(in, out); + errorReporterOut.flush(); + } + } + } + catch (MalformedURLException e) { + throw new DocTransletException(e); + } + catch (TransformerFactoryConfigurationError e) { + throw new DocTransletException(e); + } + catch (TransformerException e) { + throw new DocTransletException(e.getMessageAndLocation(), e); + } + catch (IOException e) { + throw new DocTransletException(e); + } + finally { + System.setErr(err); + } + } + + private List getOutputFileList(URL resource, File xmlSourceDirectory, Map parameters) + throws DocTransletException { + + try { + List result; + + OutputStream out = new ByteArrayOutputStream(); + + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + Document document = documentBuilder.newDocument(); + DOMResult domResult = new DOMResult(document); + { + StreamSource source = new StreamSource(resource.toExternalForm()); + + TransformerFactory transformerFactory = TransformerFactory.newInstance(); + Transformer transformer = (Transformer)transformerFactory.newTransformer(source); + + transformer.clearParameters(); + for (Iterator pit = parameters.keySet().iterator(); pit.hasNext(); ) { + String key = (String)pit.next(); + String value = (String)parameters.get(key); + transformer.setParameter(key, value); + } + + transformer.transform(new StreamSource(new File(xmlSourceDirectory, + "index.xml").getAbsolutePath()), + domResult); + } + + { + NodeList nodeList = document.getElementsByTagName("outputfile"); + result = new ArrayList(nodeList.getLength()); + + for (int i=0; i 0) { + if (null != elem.getElementsByTagName("info").item(0).getFirstChild()) { + info = getTextContent(elem.getElementsByTagName("info").item(0)); + } + else { + info = ""; + } + } + result.add(new OutputFileInfo(name, source, sheet, comment, info)); + } + } + return result; + } + catch (TransformerFactoryConfigurationError e) { + throw new DocTransletException(e); + } + catch (TransformerException e) { + throw new DocTransletException(e.getMessageAndLocation(), e); + } + catch (ParserConfigurationException e) { + throw new DocTransletException(e); + } + } + + private String getTextContent(Node elem) + { + StringBuffer result = new StringBuffer(); + NodeList children = elem.getChildNodes(); + for (int i=0; i= 0) { + offset += nread; + } + in.close(); + return result; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.java b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.java new file mode 100644 index 00000000000..92a1fba27be --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/OutputFileInfo.java @@ -0,0 +1,49 @@ +/* gnu.classpath.tools.doclets.xmldoclet.doctranslet.OutputFileInfo + Copyright (C) 2003 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.doclets.xmldoclet.doctranslet; + +/** + * Holds information about a file to be generated by the DocTranslet. + */ +public class OutputFileInfo { + + private String name; + private String source; + private String sheet; + private String comment; + private String info; + + public OutputFileInfo(String name, String source, String sheet, String comment, String info) { + this.name = name; + this.source = source; + this.sheet = sheet; + this.comment = comment; + this.info = info; + } + + public String getName() { return name; } + public String getSource() { return source; } + public String getSheet() { return sheet; } + public String getComment() { return comment; } + public String getInfo() { return info; } + + public String toString() { return "OutputFileInfo{name="+name+",source="+source+",sheet="+sheet+",comment="+comment+",info="+info+"}"; } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java index b142836a5dc..bb38e82acc4 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java +++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/Parser.java @@ -1,5 +1,5 @@ /* Parser.java - parse command line options - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2008 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -66,7 +66,9 @@ public class Parser private boolean longOnly; - private ArrayList options = new ArrayList(); + // All of the options. This is null initially; users must call + // requireOptions before access. + private ArrayList options; private ArrayList optionGroups = new ArrayList(); @@ -195,7 +197,7 @@ public class Parser * * @param headerText the header text */ - public void setHeader(String headerText) + public synchronized void setHeader(String headerText) { this.headerText = headerText; } @@ -205,7 +207,7 @@ public class Parser * * @param footerText the footer text */ - public void setFooter(String footerText) + public synchronized void setFooter(String footerText) { this.footerText = footerText; } @@ -218,7 +220,6 @@ public class Parser */ public synchronized void add(Option opt) { - options.add(opt); defaultGroup.add(opt); } @@ -230,7 +231,6 @@ public class Parser */ protected synchronized void addFinal(Option opt) { - options.add(opt); finalGroup.add(opt); } @@ -242,7 +242,6 @@ public class Parser */ public synchronized void add(OptionGroup group) { - options.addAll(group.options); // This ensures that the final group always appears at the end // of the options. if (optionGroups.isEmpty()) @@ -251,13 +250,29 @@ public class Parser optionGroups.add(optionGroups.size() - 1, group); } + // Make sure the 'options' field is properly initialized. + private void requireOptions() + { + if (options != null) + return; + options = new ArrayList(); + Iterator it = optionGroups.iterator(); + while (it.hasNext()) + { + OptionGroup group = (OptionGroup) it.next(); + options.addAll(group.options); + } + } + public void printHelp() { this.printHelp(System.out); } - void printHelp(PrintStream out) + synchronized void printHelp(PrintStream out) { + requireOptions(); + if (headerText != null) { formatText(out, headerText); @@ -417,6 +432,7 @@ public class Parser */ public synchronized void parse(String[] inArgs, FileArgumentCallback files) { + requireOptions(); try { args = inArgs; diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/AbstractTagImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/AbstractTagImpl.java new file mode 100644 index 00000000000..4a638e25426 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/AbstractTagImpl.java @@ -0,0 +1,90 @@ +/* gnu.classpath.tools.gjdoc.AbstractTagImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; + +public abstract class AbstractTagImpl + implements Tag, TagContainer { + + private static final Tag[] emptyTags = new Tag[0]; + + protected String text; + protected Map tagMap; + + protected AbstractTagImpl(String text) { + this.text=text; + } + + public void resolve() { + Tag[] allTags=inlineTags(); + if (null != allTags) { + for (int i=0; i=beginIndex && currentIndexbeginIndex)?endIndex-1:endIndex)]; + } + + // Increments the iterator's index by one and returns the character at the new index. + public char next() { + return (++currentIndex=beginIndex)?data[currentIndex]:DONE; + } + + // Sets the position to the specified position in the text and returns that character. + public char setIndex(int position) { + this.currentIndex=position; + return current(); + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java new file mode 100644 index 00000000000..fee68006f40 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocImpl.java @@ -0,0 +1,1244 @@ +/* gnu.classpath.tools.gjdoc.ClassDocImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; +import java.io.*; +import gnu.classpath.tools.gjdoc.expr.EvaluatorEnvironment; +import gnu.classpath.tools.gjdoc.expr.CircularExpressionException; +import gnu.classpath.tools.gjdoc.expr.IllegalExpressionException; +import gnu.classpath.tools.gjdoc.expr.UnknownIdentifierException; + +public class ClassDocImpl + extends ProgramElementDocImpl + implements ClassDoc, WritableType, EvaluatorEnvironment { + + private ClassDoc baseClassDoc; + private ClassDoc[] importedClasses; + private PackageDoc[] importedPackages; + private boolean definesSerializableFields; + private FieldDoc[] serialPersistentField; + private MethodDoc[] serializationMethods; + private String dimension = ""; + + public ClassDocImpl(ClassDoc containingClass, + PackageDoc containingPackage, + int accessLevel, + boolean isFinal, + boolean isStatic, + SourcePosition position) { + super(containingClass, containingPackage, accessLevel, isFinal, isStatic, + position); + this.baseClassDoc = this; + } + + public ClassDocImpl(ClassDoc containingClass, + PackageDoc containingPackage, + ClassDoc[] importedClasses, + PackageDoc[] importedPackages, + SourcePosition position) { + super(containingClass, containingPackage, + position); + this.importedClasses=importedClasses; + this.importedPackages=importedPackages; + this.baseClassDoc = this; + } + + // Return constructors in class. + public ConstructorDoc[] constructors() { + return constructors(true); + } + + public ConstructorDoc[] constructors(boolean filter) { + return filter ? filteredConstructors : unfilteredConstructors; + } + + // Return true if Serializable fields are explicitly defined with the special class member serialPersistentFields. + public boolean definesSerializableFields() { + return definesSerializableFields; + } + + // Return fields in class. + public FieldDoc[] fields() { + return fields(true); + } + + public FieldDoc[] fields(boolean filter) { + return filter ? filteredFields : unfilteredFields; + } + + private static Set primitiveNames; + static { + primitiveNames = new HashSet(); + primitiveNames.add("int"); + primitiveNames.add("long"); + primitiveNames.add("char"); + primitiveNames.add("short"); + primitiveNames.add("byte"); + primitiveNames.add("float"); + primitiveNames.add("double"); + primitiveNames.add("boolean"); + } + + private Map findClassCache = new HashMap(); + + public ClassDoc findClass(String className, String dimension) + { + ClassDoc cached = (ClassDoc)findClassCache.get(className + dimension); + if (null != cached) { + return cached; + } + else { + ClassDoc classDoc = findClass(className); + + if (null!=classDoc) { + try { + if (classDoc.dimension().equals(dimension)) { + return classDoc; + } + else { + ClassDoc rc = (ClassDoc) ((WritableType)classDoc).clone(); + ((WritableType)rc).setDimension(dimension); + findClassCache.put(className + dimension, rc); + return rc; + } + } + catch (CloneNotSupportedException e) { + throw new RuntimeException(e); + } + } + else { + return null; + } + } + } + + public ClassDoc findClass(String className) + { + String qualifiedName = Main.getRootDoc().resolveClassName(className, this); + ClassDoc rc=Main.getRootDoc().classNamed(qualifiedName); + + if (null == rc) { + for (ClassDoc cdi=this; cdi!=null; cdi=cdi.containingClass()) { + for (ClassDoc sdi=cdi; sdi!=null; sdi=sdi.superclass()) { + if (sdi instanceof ClassDocProxy) { + ClassDoc realClass = Main.getRootDoc().classNamed(sdi.qualifiedName()); + if (null != realClass) { + sdi = realClass; + } + } + rc=Main.getRootDoc().classNamed(sdi.qualifiedName()+"."+className); + if (rc!=null) return rc; + } + } + } + + return rc; + } + + // Get the list of classes declared as imported. + public ClassDoc[] importedClasses() { + return importedClasses; + } + + // Get the list of packages declared as imported. + public PackageDoc[] importedPackages() { + return importedPackages; + } + + // Return inner classes within this class. + public ClassDoc[] innerClasses() { + return innerClasses(true); + } + + public ClassDoc[] innerClasses(boolean filtered) { + return filtered ? filteredInnerClasses : unfilteredInnerClasses; + } + + void setFilteredInnerClasses(ClassDoc[] filteredInnerClasses) { + this.filteredInnerClasses=filteredInnerClasses; + } + + void setInnerClasses(ClassDoc[] unfilteredInnerClasses) { + this.unfilteredInnerClasses=unfilteredInnerClasses; + } + + // Return interfaces implemented by this class or interfaces extended by this interface. + public ClassDoc[] interfaces() { + return interfaces; + } + + public void setInterfaces(ClassDoc[] interfaces) { + this.interfaces=interfaces; + } + + // Return true if this class is abstract + public boolean isAbstract() { + return isAbstract || isInterface(); + } + + public boolean isInterface() { + return isInterface; + } + + public boolean isAnnotation() { + return isAnnotation; + } + + public boolean isEnum() + { + return isEnum; + } + + // Return true if this class is abstract + public void setIsAbstract(boolean b) { + this.isAbstract=b; + } + + // Return true if this class implements java.io.Externalizable. + public boolean isExternalizable() { + return implementsInterface("java.io.Externalizable"); + } + + // Return true if this class implements java.io.Serializable. + public boolean isSerializable() { + return implementsInterface("java.io.Serializable"); + } + + public boolean implementsInterface(String name) { + for (ClassDoc cdi=this; cdi!=null; cdi=(ClassDoc)cdi.superclass()) { + if (cdi instanceof ClassDocImpl) { + ClassDoc[] cdiInterfaces=(ClassDoc[])cdi.interfaces(); + if (null != cdiInterfaces) { + for (int i=0; i') + { + --varLevel; + word += c; + } + else if (c=='{' && parLevel == 0 || + c==',' && varLevel == 0 && parLevel == 0 || + Parser.WHITESPACE.indexOf(c)>=0 && parLevel == 0 && varLevel == 0) { + processWord=true; + state=STATE_NORMAL; + } + else { + word+=c; + } + + if (processWord && word.length()>0) { + if (item==0) { + if (rc.processModifier(word)) { + } + else if (word.equals("abstract")) { + rc.setIsAbstract(true); + } + else if (word.equals("class")) { + rc.setIsInterface(false); + item=1; + } + else if (word.equals("enum")) + { + rc.setIsEnum(true); + item = 1; + } + else if (word.equals("interface")) { + rc.setIsInterface(true); + item=1; + } + else if (word.equals("@interface")) { + rc.setIsInterface(true); + rc.setIsAnnotation(true); + item=1; + } + else if (word.equals("strictfp")) { + } + else { + Main.getRootDoc().printWarning("unknown modifier '"+word+"'"); + } + } + else if (word.equals("extends") && !rc.isAnnotation()) { + if (rc.isInterface()) { + item=3; + } + else { + item=2; + } + } + else if (word.equals("implements") && !rc.isAnnotation()) { + item=3; + } + else if (item==1) { + int parameterIndex = word.indexOf("<"); + if (parameterIndex == -1) + rc.setClass(word); + else + { + rc.setClass(word.substring(0, parameterIndex)); + parseTypeVariables(rc,word.substring(parameterIndex, + word.length())); + } + } + else if (item==2) { + //Debug.log(9,"setting baseclass of "+rc+" to "+word); + int parameterIndex = word.indexOf("<"); + if (parameterIndex == -1) + superclassName=word; + else + { + /* FIXME: Parse type parameters */ + superclassName=word.substring(0,parameterIndex); + } + } + else if (item==3) { + int parameterIndex = word.indexOf("<"); + if (parameterIndex == -1) + implementedInterfaces.add(word); + else + { + /* FIXME: Parse type parameters */ + implementedInterfaces.add(word.substring(0,parameterIndex)); + } + } + word=""; + } + + if (c=='{' && state==STATE_NORMAL) break; + } + prev=c; + } + + if (null != containingClass + && containingClass.isInterface()) { + rc.accessLevel = ACCESS_PUBLIC; + } + + if (rc.name()==null) { + throw new ParseException("No classdef found in expression \""+new String(source,startIndex,endIndex-startIndex)+"\""); + } + + rc.setPosition(ClassDocImpl.getPosition(rc, source, startIndex)); + + ClassDoc superclassProxy=new ClassDocProxy(superclassName, rc); + + if (!rc.qualifiedName().equals("java.lang.Object")) { + rc.setSuperclass(superclassProxy); + } + + ClassDoc[] interfaces=new ClassDoc[implementedInterfaces.size()]; + for (int i=0; i=0) { + for (int i=ndx; i=0) { + dim+=typeName.charAt(i); + } + } + typeName=typeName.substring(0,ndx).trim(); + } + + ClassDoc classDoc = findClass(typeName, dim); + if (null != classDoc) { + return classDoc; + } + + Type type = (Type)typeMap.get(typeName+dim); + if (null!=type) { + try { + if (type.dimension().equals(dim)) { + return type; + } + else { + Type rc = (Type) ((WritableType)type).clone(); + ((WritableType)rc).setDimension(dim); + return rc; + } + } + catch (CloneNotSupportedException e) { + throw new ParseException(e.toString()); + } + } + + if ("boolean".equals(typeName) + || "char".equals(typeName) + || "byte".equals(typeName) + || "short".equals(typeName) + || "int".equals(typeName) + || "long".equals(typeName) + || "void".equals(typeName) + || "float".equals(typeName) + || "double".equals(typeName)) { + Type rc=new TypeImpl(null, typeName, dim); + typeMap.put(typeName+dim, rc); + return rc; + } + + if (Main.getInstance().isDocletRunning()) { + //System.err.println(findClass("java.lang.String")); + //throw new ParseException("Doclet running, class not found: "+typeName+" ("+orgTypename+")"); + } + Type rc=new ClassDocProxy(typeName, this); + ((WritableType)rc).setDimension(dim); + return rc; + } + + public boolean isException() { + for (ClassDoc cdi=this; + cdi!=null; + cdi=cdi.superclass()) { + + if ("java.lang.Exception".equals(cdi.qualifiedName())) + return true; + } + return false; + } + + public boolean isError() { + for (ClassDoc cdi=this; cdi!=null; cdi=cdi.superclass()) { + if ("java.lang.Error".equals(cdi.qualifiedName())) + return true; + } + return false; + } + + public boolean isOrdinaryClass() { + return !isException() && !isError() && !isInterface(); + } + + public void setIsInterface(boolean b) { + this.isInterface=b; + } + + public void setIsAnnotation(boolean b) { + this.isAnnotation=b; + } + + public void setIsEnum(boolean b) + { + isEnum = b; + } + + public ExecutableMemberDoc findExecutableRec(String nameAndSignature) { + + ExecutableMemberDoc rc; + for (ClassDoc cdi=this; cdi!=null; ) { + rc=findMethod(cdi, nameAndSignature); + if (rc!=null) return rc; + rc=findConstructor(cdi, nameAndSignature); + if (rc!=null) return rc; + + ClassDoc _superclass = cdi.superclass(); + if (null == _superclass) { + break; + } + else { + cdi = _superclass; + } + } + return null; + } + + public static ConstructorDoc findConstructor(ClassDoc classDoc, String nameAndSignature) { + int ndx=nameAndSignature.indexOf('('); + if (ndx<=0) + return null; + else { + String fullSignature = resolveSignature(classDoc, nameAndSignature.substring(ndx)); + return findConstructor(classDoc, + nameAndSignature.substring(0,ndx), + fullSignature); + } + } + + public static ConstructorDoc findConstructor(ClassDoc classDoc, String name, String signature) { + ConstructorDoc[] filteredConstructors = classDoc.constructors(true); + if (null != filteredConstructors) { + for (int i=0; i 0 && type.charAt(ndx - 1) == '[' || type.charAt(ndx - 1) == ']') { + -- ndx; + } + String dim = type.substring(ndx); + type = type.substring(0, ndx); + ClassDoc typeClass = classDoc.findClass(type); + if (fullSignature.length() > 1) { + fullSignature.append(","); + } + if (null != typeClass) { + fullSignature.append(typeClass.qualifiedName()); + } + else { + fullSignature.append(type); + } + fullSignature.append(dim); + } + fullSignature.append(')'); + return fullSignature.toString(); + } + + public static MethodDoc findMethod(ClassDoc classDoc, String name, String signature) { + MethodDoc[] filteredMethods = classDoc.methods(true); + if (null != filteredMethods) { + for (int i=0; i= 0) { + String _className = identifier.substring(0, ndx); + String _fieldName = identifier.substring(ndx + 1); + + ClassDoc _classDoc = findClass(_className); + if (null != _classDoc) { + return findFieldValue(identifier, _classDoc, _fieldName, visitedFields); + } + else { + throw new UnknownIdentifierException(identifier); + } + } + else { + return findFieldValue(identifier, this, identifier, visitedFields); + } + } + + public boolean isPrimitive() + { + return false; + } + + // Compares this Object with the specified Object for order. + public int compareTo(java.lang.Object o) { + int rc; + + if (o instanceof ClassDocImpl) { + + ClassDocImpl c1 = this; + ClassDocImpl c2 = (ClassDocImpl)o; + + if (null != c1.containingClass() && null == c2.containingClass()) { + rc = c1.containingClass().compareTo(c2); + if (0 == rc) { + rc = 1; + } + return rc; + } + else if (null == c1.containingClass() && null != c2.containingClass()) { + rc = c1.compareTo(c2.containingClass()); + if (0 == rc) { + rc = -1; + } + return rc; + } + else if (null != c1.containingClass() && null != c2.containingClass()) { + rc = c1.containingClass().compareTo(c2.containingClass()); + if (0 != rc) { + return rc; + } + } + + rc = super.compareTo(o); + if (0 == rc) { + return Main.getInstance().getCollator().compare(containingPackage().name(), + ((ClassDocImpl)o).containingPackage().name()); + } + else { + return rc; + } + } + else { + return 1; + } + } + + private List importStatementList; + + public void setImportStatementList(List importStatementList) + { + this.importStatementList = new LinkedList(); + this.importStatementList.addAll(importStatementList); + } + + public List getImportSpecifierList() + { + return importStatementList; + } + + public TypeVariable[] typeParameters() + { + return typeParameters; + } + + /** + *

+ * Parses the type variables declared in the class definition. + * The syntax is: + *

+ *

+ *

+ *
TypeParameters:
+ *
< TypeParameter { , TypeParameter }
+ *
TypeParameter:
+ *
Identifier { extends Bound + * }
+ *
Bound:
+ *
Type{& Type }
+ *
+ * + * @param rc the owning class. + * @param typeVariables the string to be parsed. + * @throws ParseException if parsing fails. + */ + public static void parseTypeVariables(ClassDocImpl rc, + String typeVariables) + throws ParseException + { + List parsedBounds = null; + StringTokenizer parameters = new StringTokenizer(typeVariables, + Parser.WHITESPACE + + "<>,"); + List variables = new ArrayList(); + while (parameters.hasMoreTokens()) + { + String parameter = parameters.nextToken(); + StringTokenizer parts = new StringTokenizer(parameter, + Parser.WHITESPACE); + TypeVariableImpl variable = new TypeVariableImpl(rc.qualifiedName(), + parts.nextToken(),"", + rc); + if (parts.hasMoreTokens()) + { + if (!parts.nextToken().equals("extends")) + throw new ParseException("Invalid type parameter: " + parameter); + StringTokenizer bounds = new StringTokenizer(parts.nextToken(), + Parser.WHITESPACE + + "&"); + parsedBounds = new ArrayList(); + while (bounds.hasMoreTokens()) + { + String bound = bounds.nextToken(); + int nameSep = bound.lastIndexOf("."); + String packageName = bound.substring(0, nameSep); + String boundName = bound.substring(nameSep, bound.length()); + parsedBounds.add(new TypeImpl(packageName,boundName,"")); + } + } + if (parsedBounds != null) + variable.setBounds(parsedBounds); + variables.add(variable); + } + rc.setTypeParameters(variables); + } + + /** + * Set the type parameters to the contents of the supplied list. + * + * @param variables a list of type parameters. + */ + void setTypeParameters(List variables) + { + typeParameters = + (TypeVariable[]) variables.toArray(new TypeVariable[variables.size()]); + } + +} + diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java new file mode 100644 index 00000000000..79abf3dc6ee --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocProxy.java @@ -0,0 +1,152 @@ +/* gnu.classpath.tools.gjdoc.ClassDocProxy + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; + +import java.io.*; + +public class ClassDocProxy implements ClassDoc, WritableType { + + private String name; + private String qualifiedName; + private ClassDoc classContext; + private String dimension = ""; + + public ClassDocProxy(String qualifiedName, ClassDoc classContext) + { + this.qualifiedName + = Main.getRootDoc().resolveClassName(qualifiedName, + (ClassDocImpl)classContext); + this.classContext=classContext; + int pndx=qualifiedName.lastIndexOf('.'); + if (pndx>=0) { + this.name=qualifiedName.substring(pndx+1); + } + else { + this.name=qualifiedName; + } + } + + private final String errorText() + { + return "CLASS "+qualifiedName+" NOT LOADED."; + } + + public ConstructorDoc[] constructors() { return new ConstructorDoc[0]; } + public ConstructorDoc[] constructors(boolean filtered) { return new ConstructorDoc[0]; } + public boolean definesSerializableFields() { return false; } + public FieldDoc[] fields() { return new FieldDoc[0]; } + public FieldDoc[] fields(boolean filtered) { return new FieldDoc[0]; } + public ClassDoc findClass(java.lang.String className) { return null; } + public ClassDoc[] importedClasses() { return new ClassDoc[0]; } + public PackageDoc[] importedPackages() { return new PackageDoc[0]; } + public ClassDoc[] innerClasses() { return new ClassDoc[0]; } + public ClassDoc[] innerClasses(boolean filtered) { return new ClassDoc[0]; } + public ClassDoc[] interfaces() { return new ClassDoc[0]; } + public boolean isAbstract() { return false; } + public boolean isExternalizable() { return false; } + public boolean isSerializable() { return false; } + public MethodDoc[] methods() { return new MethodDoc[0]; } + public MethodDoc[] methods(boolean filtered) { return new MethodDoc[0]; } + public FieldDoc[] serializableFields() { return new FieldDoc[0]; } + public MethodDoc[] serializationMethods() { return new MethodDoc[0]; } + public boolean subclassOf(ClassDoc cd) { return false; } + public ClassDoc superclass() { return null; } + public ClassDoc containingClass() { return null; } + public PackageDoc containingPackage() { + /* + try { + File file=Main.getRootDoc().findScheduledClass(qualifiedName, classContext); + if (file!=null) { + //String clsName=file.getCanonicalFile().getAbsolutePath().substring(new File(Main.getRootDoc().getSourcePath()).getCanonicalFile().getAbsolutePath().length()+1); + String clsName=file.getAbsolutePath().substring(new File(Main.getRootDoc().getSourcePath()).getAbsolutePath().length()+1); + clsName=clsName.substring(0,clsName.length()-5).replace(File.separatorChar,'.'); + Debug.log(9,"ClassDocProxy '"+qualifiedName+"': found class "+clsName); + qualifiedName=clsName; + } + return new PackageDocImpl("test."); + } + catch (Exception e) { + return PackageDocImpl.DEFAULT_PACKAGE; + } + */ + return PackageDocImpl.DEFAULT_PACKAGE; + } + + public boolean isFinal() { return false; } + public boolean isPackagePrivate() { return false; } + public boolean isPrivate() { return false; } + public boolean isProtected() { return false; } + public boolean isPublic() { return false; } + public boolean isStatic() { return false; } + public String modifiers() { return ""; } + public int modifierSpecifier() { return 0; } + public String qualifiedName() { return qualifiedName; } + public String commentText() { return null; } + public Tag[] firstSentenceTags() { return new Tag[0]; } + public String getRawCommentText() { return null; } + public Tag[] inlineTags() { return new Tag[0]; } + public boolean isClass() { return false; } + public boolean isConstructor() { return false; } + public boolean isError() { return false; } + public boolean isException() { return false; } + public boolean isField() { return false; } + public boolean isIncluded() { return false; } + public boolean isInterface() { return false; } + public boolean isMethod() { return false; } + public boolean isOrdinaryClass() { return false; } + public String name() { return name; } + public SourcePosition position() { return null; } + public SeeTag[] seeTags() { return new SeeTag[0]; } + public void setRawCommentText(java.lang.String rawDocumentation) {} + public Tag[] tags() { return new Tag[0]; } + public Tag[] tags(java.lang.String tagname) { return new Tag[0]; } + public String typeName() { return name; } + public String qualifiedTypeName() { return qualifiedName; } + public String dimension() { return dimension; } + public ClassDoc asClassDoc() { return this; } + public TypeVariable asTypeVariable() { return null; } + public boolean isPrimitive() { return false; } + + public String toString() { return "ClassDocProxy{"+qualifiedName+", context="+classContext+"}"; } + + public void setDimension(String dimension) { + this.dimension = dimension; + } + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + // Compares this Object with the specified Object for order. + public int compareTo(java.lang.Object o) { + if (o instanceof Doc) { + return Main.getInstance().getCollator().compare(name(), ((Doc)o).name()); + } + else { + return 0; + } + } + + public TypeVariable[] typeParameters() { return new TypeVariable[0]; } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java new file mode 100644 index 00000000000..2920e89f235 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ClassDocReflectedImpl.java @@ -0,0 +1,202 @@ +/* gnu.classpath.tools.gjdoc.ClassDocReflectedImpl + Copyright (C) 2001 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath 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 2, or (at your option) + any later version. + + GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.Map; +import java.util.HashMap; + +public class ClassDocReflectedImpl + implements ClassDoc, WritableType +{ + private Class clazz; + private String name; + private ClassDoc superclassDoc; + private ClassDoc[] unfilteredInnerClasses; + private String dimension = ""; + + private static Map reflectionCache = new HashMap(); + + public static ClassDocReflectedImpl newInstance(Class clazz) + { + ClassDocReflectedImpl result + = (ClassDocReflectedImpl)reflectionCache.get(clazz); + if (null != result) { + return result; + } + else { + return new ClassDocReflectedImpl(clazz); + } + } + + public ClassDocReflectedImpl(Class clazz) + { + reflectionCache.put(clazz, this); + + //System.err.println("ClassDocReflectedImpl: " + clazz); + + this.clazz = clazz; + String className = clazz.getName(); + int ndx = className.lastIndexOf('.'); + if (ndx >= 0) { + this.name = className.substring(ndx + 1); + } + else { + this.name = className; + } + + Class superclass = clazz.getSuperclass(); + if (null != superclass && !clazz.getName().equals("java.lang.Object")) { + this.superclassDoc = (ClassDocReflectedImpl)reflectionCache.get(superclass); + if (null == this.superclassDoc) { + this.superclassDoc = new ClassDocReflectedImpl(superclass); + } + } + + Class[] innerclasses = clazz.getDeclaredClasses(); + this.unfilteredInnerClasses = new ClassDoc[innerclasses.length]; + for (int i=0; i 0) { + packageName = packageName.substring(0, ndx); + } + else { + packageName = ""; + } + PackageDoc result = Main.getRootDoc().findOrCreatePackageDoc(packageName); + return result; + } + + public boolean isFinal() { return false; } + public boolean isPackagePrivate() { return false; } + public boolean isPrivate() { return false; } + public boolean isProtected() { return false; } + public boolean isPublic() { return false; } + public boolean isStatic() { return false; } + public String modifiers() { return ""; } + public int modifierSpecifier() { return 0; } + public String qualifiedName() { return clazz.getName().replace('$', '.'); } + public String commentText() { return null; } + public Tag[] firstSentenceTags() { return new Tag[0]; } + public String getRawCommentText() { return null; } + public Tag[] inlineTags() { return new Tag[0]; } + public boolean isClass() { return false; } + public boolean isConstructor() { return false; } + public boolean isError() { return false; } + public boolean isException() { return false; } + public boolean isField() { return false; } + public boolean isIncluded() { return false; } + public boolean isInterface() { return false; } + public boolean isMethod() { return false; } + public boolean isOrdinaryClass() { return false; } + public String name() { return name; } + public SourcePosition position() { return null; } + public SeeTag[] seeTags() { return new SeeTag[0]; } + public void setRawCommentText(java.lang.String rawDocumentation) {} + public Tag[] tags() { return new Tag[0]; } + public Tag[] tags(java.lang.String tagname) { return new Tag[0]; } + public String typeName() { return name; } + public String qualifiedTypeName() { return qualifiedName(); } + public ClassDoc asClassDoc() { return this; } + public TypeVariable asTypeVariable() { return null; } + public boolean isPrimitive() { return false; } + + public String toString() { return "ClassDocReflectedImpl{"+qualifiedName()+"}"; } + + public int compareTo(java.lang.Object o) { + if (o instanceof Doc) { + return Main.getInstance().getCollator().compare(name(), ((Doc)o).name()); + } + else { + return 0; + } + } + + public String dimension() { return dimension; } + + public void setDimension(String dimension) { + this.dimension = dimension; + } + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + public TypeVariable[] typeParameters() { return new TypeVariable[0]; } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ConstructorDocImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ConstructorDocImpl.java new file mode 100644 index 00000000000..f114485c19b --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ConstructorDocImpl.java @@ -0,0 +1,42 @@ +/* gnu.classpath.tools.gjdoc.ConstructorDocImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import java.util.*; +import com.sun.javadoc.*; + +public class ConstructorDocImpl extends ExecutableMemberDocImpl implements ConstructorDoc { + + public ConstructorDocImpl(ClassDoc containingClass, + PackageDoc containingPackage, + SourcePosition position) { + + super(containingClass, + containingPackage, + position); + } + + // Is this Doc item a constructor. + public boolean isConstructor() { + return true; + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Debug.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Debug.java new file mode 100644 index 00000000000..06f39a4fa1b --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Debug.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.Debug + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +public final class Debug { + + //private static int logLevel = 7; + private static int logLevel = 0; + + static { + String llProp = System.getProperty("gnu.classpath.tools.gjdoc.LogLevel"); + if (null!=llProp) logLevel = Integer.parseInt(llProp); + } + + public static final void log(String msg) { + System.err.println(msg); + } + + public static final void log(int level, String msg) { + if (level<=logLevel) { + System.err.println(msg); + } + } + + public static final void dumpArray(int level, Object[] array) { + if (level<=logLevel) { + for (int i=0; i=0) + return Main.getRootDoc().readRawComment(rawDocOffset); + else + return null; + } + + // Return comment as tags. + public Tag[] inlineTags() { + + Tag[] rc=(Tag[])tagMap.get("inline"); + if (rc==null) rc=new Tag[0]; + return rc; + } + + // Is this Doc item a class. + public boolean isClass() { + return false; + } + + // Is this Doc item a constructor? False until overridden. + public boolean isConstructor() { + return false; + } + + // Is this Doc item a error class? False until overridden. + public boolean isError() { + return false; + } + + // Is this Doc item a exception class? False until overridden. + public boolean isException() { + return false; + } + + // Is this Doc item a field? False until overridden. + public boolean isField() { + return false; + } + + // return true if this Doc is include in the active set. + public boolean isIncluded() { + return false; + } + + // Is this Doc item a interface? False until overridden. + public boolean isInterface() { + return false; + } + + // Is this Doc item a simple method (i.e. + public boolean isMethod() { + return false; + } + + public boolean isPackage() { + return false; + } + + // Is this Doc item a ordinary class (i.e. + public boolean isOrdinaryClass() { + return false; + } + + // Return the see also tags in this Doc item. + public SeeTag[] seeTags() { + return (SeeTag[])getTagArr("see", seeTagEmptyArr); + } + + protected Tag[] getTagArr(String kindOfTag, Tag[] defaultRc) { + Tag[] rc=(Tag[])tagMap.get(kindOfTag); + if (rc==null) rc=defaultRc; + return rc; + } + + // Set the full unprocessed text of the comment. + public void setRawCommentText(String rawDocumentation) { + this.rawDocumentation=rawDocumentation; + } + + public void resolveComments() { + + if (rawDocumentation!=null && tagMap.isEmpty()) { + char[] charArray = rawDocumentation.toCharArray(); + int length = rawDocumentation.length(); + int startOffset = 0; + int endOffset = 0; + if (charArray[0] == '/' + && charArray[1] == '*' + && charArray[2] == '*' + && charArray[length - 2] == '*' + && charArray[length - 1] == '/') { + + startOffset = 3; + endOffset = 2; + } + + this.tagMap=parseCommentTags(charArray, + startOffset, + length - endOffset, + getContextClass(), + getContextMember(), + null, + boilerplateComment); + + if (Main.getInstance().isCacheRawComments()) { + rawDocOffset=Main.getRootDoc().writeRawComment(rawDocumentation); + rawDocumentation=null; + } + + resolveTags(); + } + else if (tagMap.isEmpty() && null != boilerplateComment) { + tagMap.put("all", new Tag[] { new TagImpl("@boilerplate", boilerplateComment,getContextClass(),null) }); + tagMap.put("@boilerplate", new Tag[] { new TagImpl("@boilerplate", boilerplateComment,getContextClass(),null) }); + } + } + + public static int skipHtmlWhitespace(char[] buffer, int startIndex) { + while (startIndex < buffer.length) { + char c=buffer[startIndex]; + if (!Parser.isWhitespace(c)) { + break; + } + else { + ++ startIndex; + } + } + return startIndex; + } + + /** + * Looks for an end-of-sentence marker in text, + * starting at startIndex and stopping at + * endIndex. + * + * @param text the text to be searched + * @param startIndex index in text at which to start + * @param endIndex index in text at which to stop + * + * @return the index of the character following the end-of-sentence + * marker, endIndex if no end-of-sentence + * marker could be found, or -1 if not implemented. + */ + private static int findEndOfSentence(char[] text, int startIndex, + int endIndex) + { + if (Main.getInstance().isUseBreakIterator()) { + Segment segment = new Segment(text, startIndex, endIndex - startIndex); + BreakIterator breakIterator = BreakIterator.getSentenceInstance(Main.getInstance().getLocale()); + breakIterator.setText(segment); + int result = breakIterator.next(); + if (BreakIterator.DONE == result) { + return endIndex; + } + else { + return result; + } + } + else { + while (startIndex < endIndex) { + if (text[startIndex] == '.' + && (startIndex+1 == endIndex + || Character.isWhitespace(text[startIndex+1]) + || isHTMLBreakTag(text, startIndex+1, endIndex) + )) { + return startIndex; + } + + startIndex++; + } + return endIndex; + } + } + + /** + * Returns true is the text from start to end begins with a 'p' or 'br' tag. + */ + private static boolean isHTMLBreakTag(char[] text, int start, int end) + { + String[] breakTags = { + "p>", "/p>", "h1>", "h2>", "h3>", "h4>", "h5>", "h6>", "hr>", + "pre>", "/pre>" + }; + + if (text[start] == '<') { + + outer: + for (int i=0; irawDocStart) { + + firstSentenceEnd = findEndOfSentence(comment, rawDocStart, comment.length); + + if (firstSentenceEnd < 0) { + BreakIterator boundary = BreakIterator.getSentenceInstance(Locale.ENGLISH); + boundary.setText(new ArrayCharacterIterator(comment, rawDocStart)); + boundary.first(); + boundary.next(); + firstSentenceEnd = boundary.current(); + } + + // Always include period at end of sentence if there is one. + if (firstSentenceEnd < comment.length + && '.' == comment[firstSentenceEnd]) { + ++ firstSentenceEnd; + } + } + + final int STATE_BEGOFLINE = 1; + final int STATE_TEXT = 2; + final int STATE_PARAM = 3; + final int STATE_PARAMVALUE = 4; + final int STATE_PARAMWRAP = 5; + final int STATE_INLINEPARAM = 6; + final int STATE_INLINEPARAMVALUE = 7; + final int STATE_WHITESPACE = 8; + final int STATE_INLINEPARAMVALUE_BOL = 9; + final int STATE_IPV_WHITESPACE = 10; + + int state=STATE_BEGOFLINE; + int prevState=STATE_TEXT; + + setBufLength(0); + whitespaceBuf.setLength(0); + + String paramName="", paramValue=""; + + Map tags=new HashMap(); + tags.put("inline", new LinkedList()); + tags.put("first", new LinkedList()); + tags.put("all", new LinkedList()); + + final char EOL=(char)-1; + + for (int i=rawDocStart; i<=endIndex; ++i) { + char c=(i0) { + addTag(tags, "text", bufToString(), i0) { + AbstractTagImpl newTag = addTag(tags, "text", bufToString(), i0) { + AbstractTagImpl newTag = addTag(tags, "text", bufToString(), i0) { + AbstractTagImpl newTag = addTag(tags, "text", bufToString(), i")) { + newTag = new TextTagImpl(txt.substring(3)); + } + else if (txt.endsWith("

")) { + newTag = new TextTagImpl(txt.substring(0, txt.length() - 4)); + } + else { + newTag = tag; + } + ((List)tags.get("first")).add(newTag); + + } + else { + ((List)tags.get("first")).add(tag); + } + } + } + else { + ((List)tags.get("all")).add(tag); + } + + List l=((List)tags.get(name)); + if (l==null) { + l=new LinkedList(); + tags.put(name,l); + } + l.add(tag); + + return isInline ? tag : contextTag; + } + else { + return null; + } + } + + // Return all tags in this Doc item. + public Tag[] tags() { + Tag[] rc=(Tag[])tagMap.get("all"); + if (rc==null) rc=new Tag[0]; + return rc; + } + + // Return tags of the specified kind in this Doc item. + public Tag[] tags(java.lang.String tagname) { + Tag[] rc=(Tag[])tagMap.get(tagname); + if (rc==null) rc=new Tag[0]; + return rc; + } + + protected String rawDocumentation; + protected long rawDocOffset=-1; + + protected Map tagMap = new HashMap(); + + public Map getTagMap() { return tagMap; } + + protected void resolveTags() { + + Tag[] tags=tags(); + for (int i=0; iDocErrorReporter
: writes + * to System.err. + */ +public class ErrorReporter implements DocErrorReporter { + + private PrintStream out; + + /** + * Keeps track of the number of errors occured + * during generation. + */ + private int errorCount=0; + + /** + * Keeps track of the number of warnings occured + * during generation. + */ + private int warningCount=0; + + /* + * When true, no notices will be emitted. + */ + private boolean quiet = false; + + /* + * When true, no warnings will be emitted. + */ + private boolean noWarn = false; + + public ErrorReporter() + { + this.out = System.err; + } + + // Print error message, increment error count. + public void printError(java.lang.String msg) { + out.println("ERROR: "+msg); + ++errorCount; + } + + // Print error message, increment error count. + public void printFatal(java.lang.String msg) { + out.println("FATAL: "+msg); + System.exit(10); + } + + // Print a message. + public void printNotice(java.lang.String msg) { + if (!quiet) { + out.println(msg); + } + } + + // Print warning message, increment warning count. + public void printWarning(java.lang.String msg) { + if (!noWarn) { + out.println("WARNING: "+msg); + ++warningCount;; + } + } + + public int getErrorCount() { + return errorCount; + } + + public int getWarningCount() { + return warningCount; + } + + /** + * Specify whether notices should be printed. + */ + public void setQuiet(boolean quiet) { + this.quiet = quiet; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java new file mode 100644 index 00000000000..7dcdd25d215 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ExecutableMemberDocImpl.java @@ -0,0 +1,411 @@ +/* gnu.classpath.tools.gjdoc.ExecutableMemberDocImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import java.util.*; +import java.io.*; +import com.sun.javadoc.*; + +public class ExecutableMemberDocImpl extends MemberDocImpl implements ExecutableMemberDoc { + + protected ExecutableMemberDocImpl(ClassDoc containingClass, + PackageDoc containingPackage, + SourcePosition position) { + + super(containingClass, + containingPackage, + position); + } + + protected boolean processModifier(String word) { + if (super.processModifier(word)) { + return true; + } + else if (word.equals("synchronized")) { + isSynchronized=true; + return true; + } + else if (word.equals("native")) { + isNative=true; + return true; + } + else if (word.equals("abstract")) { + isAbstract=true; + return true; + } + else { + return false; + } + } + + private boolean isAbstract=false; + private boolean isNative=false; + private boolean isSynchronized=false; + + public boolean isAbstract() { return isAbstract; } + + public boolean isNative() { return isNative; } + + public boolean isSynchronized() { return isSynchronized; } + + public ClassDoc[] thrownExceptions() { return thrownExceptions; } + + public Parameter[] parameters() { return parameters; } + + public ThrowsTag[] throwsTags() { + return (ThrowsTag[])getTagArr("throws", throwsTagEmptyArr); + } + + public ParamTag[] paramTags() { + return (ParamTag[])getTagArr("param", paramTagEmptyArr); + } + + public String signature() { return signature; } + public String flatSignature() { return flatSignature; } + + public ClassDoc overriddenClass() { + for (ClassDoc cdi=(ClassDoc)containingClass().superclass(); cdi!=null; cdi=(ClassDoc)cdi.superclass()) { + if (null!=ClassDocImpl.findMethod(cdi, name(), signature())) + return cdi; + } + return null; + } + + public static ExecutableMemberDocImpl createFromSource(ClassDoc containingClass, + PackageDoc containingPackage, + char[] source, int startIndex, int endIndex) throws IOException, ParseException { + + int lastchar=32; + StringBuffer methodName=new StringBuffer(); + for (int i=startIndex; i=0 && Parser.WHITESPACE.indexOf(source[i])<0) + || (lastchar == ']' && Parser.WHITESPACE.indexOf(source[i])<0 && '[' != source[i])) { + methodName.setLength(0); + methodName.append(source[i]); + } + else if (Parser.WHITESPACE.indexOf(source[i])<0) { + methodName.append(source[i]); + } + lastchar=source[i]; + } + + ExecutableMemberDocImpl rc; + + SourcePosition position = DocImpl.getPosition(containingClass, source, startIndex); + + if (methodName.toString().equals(((ClassDocImpl)containingClass).getClassName())) { + + // Constructor + + rc=new ConstructorDocImpl(containingClass, + containingPackage, + position); + } + else { + + // Normal method + + rc=new MethodDocImpl(containingClass, + containingPackage, + position); + } + + if (containingClass.isInterface()) + rc.accessLevel=ACCESS_PUBLIC; + + int ndx=rc.parseModifiers(source, startIndex, endIndex); + StringBuffer name = new StringBuffer(); + + final int STATE_NORMAL=1; + final int STATE_STARC=2; + final int STATE_SLASHC=3; + + int state=STATE_NORMAL; + + while (source[ndx]!='(' && ndx0) { + int n = param.length()-1; + int paramNameStart = 0; + while (n >= 0) { + char c = param.charAt(n); + if ('[' == c || ']' == c || Parser.WHITESPACE.indexOf(c)>=0) { + paramNameStart = n + 1; + break; + } + else { + -- n; + } + } + while (n >= 0 && ('[' == param.charAt(n) + || ']' == param.charAt(n) + || Parser.WHITESPACE.indexOf(param.charAt(n))>=0)) { + -- n; + } + int paramTypeEnd = n + 1; + int paramTypeStart = 0; + while (n >= 0) { + char c = param.charAt(n); + if ('[' == c || ']' == c || Parser.WHITESPACE.indexOf(c)>=0) { + paramTypeStart = n + 1; + break; + } + else { + -- n; + } + } + + String paramType; + String paramName; + if (0 != paramNameStart) { + paramType=param.substring(paramTypeStart, paramTypeEnd); + paramName=param.substring(paramNameStart); + } + else { + paramName = ""; + StringBuffer paramTypeBuffer = new StringBuffer(); + for (int i=0; i=0) { + word=word.trim(); + if (!haveThrowsKeyword && word.length()>0) { + if (word.equals("throws")) haveThrowsKeyword=true; + else System.err.println("ARGH! "+word); + word=""; + } + } + else if (source[endx]=='[' || source[endx]==']') { + dimSuffix += source[endx]; + } + else if (source[endx]==',' || source[endx]=='{' || source[endx]==';') { + word=word.trim(); + if (word.length()>0) { + ClassDoc exceptionType=rc.containingClass().findClass(word); + if (exceptionType==null) { + exceptionType=new ClassDocProxy(word, + rc.containingClass()); + } + thrownExceptionsList.add(exceptionType); + } + if (source[endx]=='{') { + break; + } + else { + word=""; + } + } + else { + word+=source[endx]; + } + } + + if (dimSuffix.length()>0) { + rc.setTypeName(rc.getTypeName()+dimSuffix); + } + + rc.setThrownExceptions((ClassDoc[])thrownExceptionsList.toArray(new ClassDoc[0])); + + return rc; + } + + private ClassDoc[] thrownExceptions; + private Parameter[] parameters; + private String signature; + private String flatSignature; + + void setParameters(Parameter[] parameters) { + this.parameters=parameters; + } + + void setThrownExceptions(ClassDoc[] thrownExceptions) { + this.thrownExceptions=thrownExceptions; + } + + void resolve() { + + for (int i=0; i0) { + signatureBuf.append(","); + flatSignatureBuf.append(","); + } + signatureBuf.append(parameters[i].type().qualifiedTypeName()); + flatSignatureBuf.append(parameters[i].type().typeName()); + signatureBuf.append(parameters[i].type().dimension()); + flatSignatureBuf.append(parameters[i].type().dimension()); + } + this.signature="("+signatureBuf.toString()+")"; + this.flatSignature="("+flatSignatureBuf.toString()+")"; + + super.resolve(); + + } + + public int compareTo(Object other) { + int rc; + if (other instanceof MemberDocImpl) { + MemberDocImpl otherMember = (MemberDocImpl)other; + rc = name().compareTo(otherMember.name()); + if (0 == rc) { + if (other instanceof ExecutableMemberDocImpl) { + rc = signature().compareTo(((ExecutableMemberDocImpl)other).signature()); + if (0 == rc) { + return containingClass().compareTo(otherMember.containingClass()); + } + } + else { + rc = 1; + } + } + } + else { + rc = 1; + } + return rc; + } +} + diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java new file mode 100644 index 00000000000..8d5b66f819b --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/FieldDocImpl.java @@ -0,0 +1,392 @@ +/* gnu.classpath.tools.gjdoc.FieldDocImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import java.util.*; +import com.sun.javadoc.*; +import java.lang.reflect.Modifier; + +import gnu.classpath.tools.gjdoc.expr.Evaluator; +import gnu.classpath.tools.gjdoc.expr.CircularExpressionException; +import gnu.classpath.tools.gjdoc.expr.IllegalExpressionException; + +public class FieldDocImpl + extends MemberDocImpl + implements FieldDoc, Cloneable +{ + + private boolean isTransient; + private boolean isVolatile; + private String valueLiteral; + private Object constantValue; + private boolean constantValueEvaluated; + + private FieldDocImpl(ClassDoc containingClass, + PackageDoc containingPackage, + SourcePosition position) { + + super(containingClass, + containingPackage, + position); + } + + private static FieldDocImpl createFieldDoc(FieldDocImpl prototype, + String fieldDef, + String fieldValueLiteral) + { + if (null != fieldValueLiteral && fieldValueLiteral.length() == 0) { + fieldValueLiteral = null; + } + + try { + FieldDocImpl fieldDoc=(FieldDocImpl)prototype.clone(); + String dimSuffix=""; + while (fieldDef.trim().endsWith("[") + || fieldDef.trim().endsWith("]")) { + fieldDef=fieldDef.trim(); + dimSuffix=fieldDef.charAt(fieldDef.length()-1)+dimSuffix; + fieldDef=fieldDef.substring(0,fieldDef.length()-1); + } + + fieldDoc.setTypeName(fieldDoc.getTypeName()+dimSuffix); + fieldDoc.setName(fieldDef.trim()); + fieldDoc.setValueLiteral(fieldValueLiteral); + return fieldDoc; + } + catch (CloneNotSupportedException e) { + // should not happen + e.printStackTrace(); + return null; + } + } + + public static Collection createFromSource(ClassDoc containingClass, + PackageDoc containingPackage, + char[] source, int startIndex, int endIndex) { + + List rcList=new ArrayList(); + + FieldDocImpl fd=new FieldDocImpl(containingClass, + containingPackage, + DocImpl.getPosition(containingClass, source, startIndex)); + + int ndx=fd.parseModifiers(source, startIndex, endIndex); + + if (containingClass.isInterface()) { + fd.accessLevel = ACCESS_PUBLIC; + } + + final int STATE_FIELDNAME = 1; + final int STATE_FIELDVALUE = 2; + final int STATE_QUOTE = 3; + final int STATE_QUOTEBS = 4; + final int STATE_SQUOTE = 5; + final int STATE_SQUOTEBS = 6; + final int STATE_COMMENT = 7; + final int STATE_LINECOMMENT = 8; + + int lastFieldDefStart = ndx; + int state = STATE_FIELDNAME; + int prevState = state; + + int bracketCount = 0; + + StringBuffer fieldNameBuf = new StringBuffer(); + StringBuffer fieldValueLiteralBuf = new StringBuffer(); + + for (int i=ndx; i 0) { + rcList.add(createFieldDoc(fd, fieldNameBuf.toString(), + fieldValueLiteralBuf.toString())); + } + + return rcList; + } + + public boolean isField() { + return true; + } + + public boolean isTransient() { return isTransient; } + + public boolean isVolatile() { return isVolatile; } + + public SerialFieldTag[] serialFieldTags() { return new SerialFieldTag[0]; } + + public int modifierSpecifier() { + return super.modifierSpecifier() + | (isVolatile()?Modifier.VOLATILE:0) + | (isTransient()?Modifier.TRANSIENT:0) + ; + } + + protected boolean processModifier(String word) { + if (super.processModifier(word)) { + return true; + } + else if (word.equals("transient")) { + isTransient=true; + return true; + } + else if (word.equals("volatile")) { + isVolatile=true; + return true; + } + else { + return false; + } + } + + void resolve() { + resolveTags(); + } + + public boolean hasSerialTag() { + return true; //tagMap.get("serial")!=null; + } + + public String toString() { return name(); } + + public Object constantValue() { + return constantValue(new HashSet()); + } + + public Object constantValue(Set visitedFields) { + if (!isStatic() + || !isFinal() + || (!type().isPrimitive() && !"java.lang.String".equals(type().qualifiedTypeName())) + || type.dimension().length()>0 + || null == valueLiteral) { + + return null; + + } + else { + if (!constantValueEvaluated) { + + visitedFields.add(this); + + String expression = "(" + type().typeName() + ")(" + valueLiteral + ")"; + try { + this.constantValue = Evaluator.evaluate(expression, + visitedFields, + (ClassDocImpl)containingClass()); + } + catch (CircularExpressionException e) { + // FIXME: This should use the error reporter + System.err.println("WARNING: Cannot resolve expression for field " + containingClass.qualifiedTypeName() + "." + name() + ": " + e.getMessage()); + } + catch (IllegalExpressionException ignore) { + } + constantValueEvaluated = true; + } + return this.constantValue; + } + } + + private static void appendCharString(StringBuffer result, char c, boolean inSingleCuotes) + { + switch (c) { + case '\b': result.append("\\b"); break; + case '\t': result.append("\\t"); break; + case '\n': result.append("\\n"); break; + case '\f': result.append("\\f"); break; + case '\r': result.append("\\r"); break; + case '\"': result.append("\\\""); break; + case '\'': result.append(inSingleCuotes ? "\\'" : "'"); break; + default: + if (c >= 32 && c <= 127) { + result.append(c); + } + else { + result.append("\\u"); + String hexValue = Integer.toString((int)c, 16); + int zeroCount = 4 - hexValue.length(); + for (int i=0; iinheritDoc
tag. + */ +public class InheritDocTagImpl + extends AbstractTagImpl +{ + private ClassDocImpl contextClass; + private MemberDocImpl contextMember; + private AbstractTagImpl contextTag; + + public InheritDocTagImpl(ClassDocImpl contextClass, + MemberDocImpl contextMember, + AbstractTagImpl contextTag) + { + super(""); + this.contextClass = contextClass; + this.contextMember = contextMember; + this.contextTag = contextTag; + } + + public String kind() { + return "@inheritDoc"; + } + + public String name() { + return "@inheritDoc"; + } + + private TagContainer inheritedDoc; + private boolean inheritedDocInitialized = false; + + private TagContainer getInheritedDoc() + { + if (!inheritedDocInitialized) { + inheritedDoc = DocImpl.findInheritedDoc(contextClass, contextMember, contextTag); + inheritedDocInitialized = true; + } + return inheritedDoc; + } + + public Tag[] firstSentenceTags() { + TagContainer _inheritedDoc = getInheritedDoc(); + if (_inheritedDoc != null) { + return _inheritedDoc.firstSentenceTags(); + } + else { + return null; + } + } + + public Tag[] inlineTags() { + TagContainer _inheritedDoc = getInheritedDoc(); + if (_inheritedDoc != null) { + return _inheritedDoc.inlineTags(); + } + else { + return null; + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/JavadocWrapper.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/JavadocWrapper.java new file mode 100644 index 00000000000..3728630bcae --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/JavadocWrapper.java @@ -0,0 +1,36 @@ +/* gnu.classpath.tools.gjdoc.JavadocWrapper + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import java.util.*; +import java.io.*; +import com.sun.javadoc.*; + +public class JavadocWrapper { + + public static void main(String[] args) throws Exception { + + Timer.setStartTime(); + Class sunJavadocMain=Class.forName("com.sun.tools.javadoc.Main"); + sunJavadocMain.getMethod("main", new Class[]{String[].class}).invoke(null, new Object[]{args}); + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/LinkTagImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/LinkTagImpl.java new file mode 100644 index 00000000000..167c5154c7c --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/LinkTagImpl.java @@ -0,0 +1,46 @@ +/* gnu.classpath.tools.gjdoc.LinkTagImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; +import java.text.*; + +public class LinkTagImpl extends SeeTagImpl { + + private String name; + + public LinkTagImpl(String name, String _text, ClassDocImpl contextClass) { + super(_text, contextClass); + this.name = name; + } + + public String name() { return name; } + + public Tag[] firstSentenceTags() { + return new Tag[0]; //inlineTags(); + } + + public Tag[] inlineTags() { + return new Tag[0]; //new Tag[]{new TextTagImpl(referencedClassName)}; + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java new file mode 100644 index 00000000000..6c2c77e5bfd --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/Main.java @@ -0,0 +1,1846 @@ +/* gnu.classpath.tools.gjdoc.Main + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; +import java.lang.reflect.*; +import java.text.Collator; + +import gnu.classpath.tools.FileSystemClassLoader; + +/** + * Class that will launch the gjdoc tool. + */ +public final class Main +{ + + /** + * Do we load classes that are referenced as base class? + */ + static final boolean DESCEND_SUPERCLASS = true; + + /** + * Do we load classes that are referenced as interface? + */ + static final boolean DESCEND_INTERFACES = false; + + /** + * Do we load classes that are imported in a source file? + */ + static final boolean DESCEND_IMPORTED = true; + + /** + * Document only public members. + */ + static final int COVERAGE_PUBLIC = 0; + + /** + * Document only public and protected members. + */ + static final int COVERAGE_PROTECTED = 1; + + /** + * Document public, protected and package private members. + */ + static final int COVERAGE_PACKAGE = 2; + + /** + * Document all members. + */ + static final int COVERAGE_PRIVATE = 3; + + /* + * FIXME: This should come from a ResourceBundle + */ + private static final String STRING_TRY_GJDOC_HELP = + "Try `gjdoc --help' for more information."; + + /** + * Grid for looking up whether a particular access level is included in the + * documentation. + */ + static final boolean[][] coverageTemplates = new boolean[][] + { new boolean[] + { true, false, false, false }, // public + new boolean[] + { true, true, false, false }, // protected + new boolean[] + { true, true, true, false }, // package + new boolean[] + { true, true, true, true }, // private + }; + + /** + * Holds the Singleton instance of this class. + */ + private static Main instance = new Main(); + + /** + * Avoid re-instantiation of this class. + */ + private Main() + { + } + + private static RootDocImpl rootDoc; + + private ErrorReporter reporter; + + /** + * Cache for version string from resource /version.properties + */ + private String gjdocVersion; + + /** + * false during Phase I: preparation of the documentation data. + * true during Phase II: documentation output by doclet. + */ + boolean docletRunning = false; + + //---- Command line options + + /** + * Option "-doclet": name of the Doclet class to use. + */ + private String option_doclet = "gnu.classpath.tools.doclets.htmldoclet.HtmlDoclet"; + + /** + * Option "-overview": path to the special overview file. + */ + private String option_overview; + + /** + * Option "-coverage": which members to include in generated documentation. + */ + private int option_coverage = COVERAGE_PROTECTED; + + /** + * Option "-help": display command line usage. + */ + private boolean option_help; + + /** + * Option "-docletpath": path to doclet classes. + */ + private String option_docletpath; + + /** + * Option "-classpath": path to additional classes. + */ + private String option_classpath; + + /** + * Option "-sourcepath": path to the Java source files to be documented. + * FIXME: this should be a list of paths + */ + private List option_sourcepath = new ArrayList(); + + /** + * Option "-extdirs": path to Java extension files. + */ + private String option_extdirs; + + /** + * Option "-verbose": Be verbose when generating documentation. + */ + private boolean option_verbose; + + /** + * Option "-nowarn": Do not print warnings. + */ + private boolean option_nowarn; + + /** + * Option "-locale:" Specify the locale charset of Java source files. + */ + private Locale option_locale = new Locale("en", "us"); + + /** + * Option "-encoding": Specify character encoding of Java source files. + */ + private String option_encoding; + + /** + * Option "-J": Specify flags to be passed to Java runtime. + */ + private List option_java_flags = new LinkedList(); //ArrayList(); + + /** + * Option "-source:" should be 1.4 to handle assertions, 1.1 is no + * longer supported. + */ + private String option_source = "1.2"; + + /** + * Option "-subpackages": list of subpackages to be recursively + * added. + */ + private List option_subpackages = new ArrayList(); + + /** + * Option "-exclude": list of subpackages to exclude. + */ + private List option_exclude = new ArrayList(); + + /** + * Option "-breakiterator" - whether to use BreakIterator for + * detecting the end of the first sentence. + */ + private boolean option_breakiterator; + + /** + * Option "-licensetext" - whether to copy license text. + */ + private boolean option_licensetext; + + /** + * The locale-dependent collator used for sorting. + */ + private Collator collator; + + /** + * true when --version has been specified on the command line. + */ + private boolean option_showVersion; + + /** + * true when -bootclasspath has been specified on the command line. + */ + private boolean option_bootclasspath_specified; + + /** + * true when -all has been specified on the command line. + */ + private boolean option_all; + + /** + * true when -reflection has been specified on the command line. + */ + private boolean option_reflection; + + // TODO: add the rest of the options as instance variables + + /** + * Parse all source files/packages and subsequentially start the Doclet given + * on the command line. + * + * @param allOptions List of all command line tokens + */ + private boolean startDoclet(List allOptions) + { + + try + { + + //--- Fetch the Class object for the Doclet. + + Debug.log(1, "loading doclet class..."); + + Class docletClass; + + if (null != option_docletpath) { + try { + FileSystemClassLoader docletPathClassLoader + = new FileSystemClassLoader(option_docletpath); + System.err.println("trying to load class " + option_doclet + " from path " + option_docletpath); + docletClass = docletPathClassLoader.findClass(option_doclet); + } + catch (Exception e) { + docletClass = Class.forName(option_doclet); + } + } + else { + docletClass = Class.forName(option_doclet); + } + //Object docletInstance = docletClass.newInstance(); + + Debug.log(1, "doclet class loaded..."); + + Method startTempMethod = null; + Method startMethod = null; + Method optionLenMethod = null; + Method validOptionsMethod = null; + + //--- Try to find the optionLength method in the Doclet class. + + try + { + optionLenMethod = docletClass.getMethod("optionLength", new Class[] + { String.class }); + } + catch (NoSuchMethodException e) + { + // Ignore if not found; it's OK it the Doclet class doesn't define + // this method. + } + + //--- Try to find the validOptions method in the Doclet class. + + try + { + validOptionsMethod = docletClass.getMethod("validOptions", new Class[] + { String[][].class, DocErrorReporter.class }); + } + catch (NoSuchMethodException e) + { + // Ignore if not found; it's OK it the Doclet class doesn't define + // this method. + } + + //--- Find the start method in the Doclet class; complain if not found + + try + { + startTempMethod = docletClass.getMethod("start", new Class[] + { TemporaryStore.class }); + } + catch (Exception e) + { + // ignore + } + startMethod = docletClass.getMethod("start", new Class[] + { RootDoc.class }); + + //--- Feed the custom command line tokens to the Doclet + + // stores all recognized options + List options = new LinkedList(); + + // stores packages and classes defined on the command line + List packageAndClasses = new LinkedList(); + + for (Iterator it = allOptions.iterator(); it.hasNext();) + { + String option = (String) it.next(); + + Debug.log(9, "parsing option '" + option + "'"); + + if (option.startsWith("-")) + { + + //--- Parse option + + int optlen = optionLength(option); + + //--- Try to get option length from Doclet class + + if (optlen <= 0 && optionLenMethod != null) + { + + optionLenMethod.invoke(null, new Object[] + { option }); + + Debug.log(3, "invoking optionLen method"); + + optlen = ((Integer) optionLenMethod.invoke(null, new Object[] + { option })).intValue(); + + Debug.log(3, "done"); + } + + if (optlen <= 0) { + + if (option.startsWith("-JD")) { + // Simulate VM option -D + String propertyValue = option.substring(3); + int ndx = propertyValue.indexOf('='); + if (ndx <= 0) { + reporter.printError("Illegal format in option " + option + ": use -JDproperty=value"); + return false; + } + else { + String property = propertyValue.substring(0, ndx); + String value = propertyValue.substring(ndx + 1); + System.setProperty(property, value); + } + } + else if (option.startsWith("-J")) { + //--- Warn if VM option is encountered + reporter.printWarning("Ignored option " + option + ". Pass this option to the VM if required."); + } + else { + //--- Complain if not found + + reporter.printError("Unknown option " + option); + reporter.printNotice(STRING_TRY_GJDOC_HELP); + return false; + } + } + else + { + + //--- Read option values + + String[] optionAndValues = new String[optlen]; + optionAndValues[0] = option; + for (int i = 1; i < optlen; ++i) + { + if (!it.hasNext()) + { + reporter.printError("Missing value for option " + option); + return false; + } + else + { + optionAndValues[i] = (String) it.next(); + } + } + + //--- Store option for processing later + + options.add(optionAndValues); + } + } + else if (option.length() > 0) + { + + //--- Add to list of packages/classes if not option or option + // value + + packageAndClasses.add(option); + } + } + + Debug.log(9, "options parsed..."); + + //--- For each package specified with the -subpackages option on + // the command line, recursively find all valid java files + // beneath it. + + //--- For each class or package specified on the command line, + // check that it exists and find out whether it is a class + // or a package + + for (Iterator it = option_subpackages.iterator(); it.hasNext();) + { + String subpackage = (String) it.next(); + Set foundPackages = new LinkedHashSet(); + + for (Iterator pit = option_sourcepath.iterator(); pit.hasNext(); ) { + File sourceDir = (File)pit.next(); + File packageDir = new File(sourceDir, subpackage.replace('.', File.separatorChar)); + findPackages(subpackage, packageDir, foundPackages); + } + + addFoundPackages(subpackage, foundPackages); + } + + if (option_all) { + Set foundPackages = new LinkedHashSet(); + for (Iterator pit = option_sourcepath.iterator(); pit.hasNext(); ) { + File sourceDir = (File)pit.next(); + findPackages("", sourceDir, foundPackages); + } + addFoundPackages(null, foundPackages); + for (Iterator packageIt = foundPackages.iterator(); packageIt.hasNext(); ) { + String packageName = (String)packageIt.next(); + if (null == packageName) { + packageName = ""; + } + rootDoc.addSpecifiedPackageName(packageName); + } + } + + for (Iterator it = packageAndClasses.iterator(); it.hasNext();) + { + + String classOrPackage = (String) it.next(); + + boolean foundSourceFile = false; + + if (classOrPackage.endsWith(".java")) { + for (Iterator pit = option_sourcepath.iterator(); pit.hasNext() && !foundSourceFile; ) { + File sourceDir = (File)pit.next(); + File sourceFile = new File(sourceDir, classOrPackage); + if (sourceFile.exists() && !sourceFile.isDirectory()) { + rootDoc.addSpecifiedSourceFile(sourceFile); + foundSourceFile = true; + break; + } + } + if (!foundSourceFile) { + File sourceFile = new File(classOrPackage); + if (sourceFile.exists() && !sourceFile.isDirectory()) { + rootDoc.addSpecifiedSourceFile(sourceFile); + foundSourceFile = true; + } + } + } + + if (!foundSourceFile) { + //--- Check for illegal name + + if (classOrPackage.startsWith(".") + || classOrPackage.endsWith(".") + || classOrPackage.indexOf("..") > 0 + || !checkCharSet(classOrPackage, + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_.")) + { + throw new ParseException("Illegal class or package name '" + + classOrPackage + "'"); + } + + //--- Assemble absolute path to package + + String classOrPackageRelPath = classOrPackage.replace('.', + File.separatorChar); + + //--- Create one file object each for a possible package directory + // and a possible class file, and find out if they exist. + + List packageDirs = rootDoc.findSourceFiles(classOrPackageRelPath); + List sourceFiles = rootDoc.findSourceFiles(classOrPackageRelPath + ".java"); + + boolean packageDirExists = !packageDirs.isEmpty(); + boolean sourceFileExists = !sourceFiles.isEmpty(); + + //--- Complain if neither exists: not found + + if (!packageDirExists && !sourceFileExists) + { + reporter.printError("Class or package " + classOrPackage + + " not found."); + return false; + } + + //--- Complain if both exist: ambigious + + else + if (packageDirExists && sourceFileExists) + { + reporter.printError("Ambigious class/package name " + + classOrPackage + "."); + return false; + } + + //--- Otherwise, if the package directory exists, it is a package + + else + if (packageDirExists) { + Iterator packageDirIt = packageDirs.iterator(); + boolean packageDirFound = false; + while (packageDirIt.hasNext()) { + File packageDir = (File)packageDirIt.next(); + if (packageDir.isDirectory()) { + rootDoc.addSpecifiedPackageName(classOrPackage); + packageDirFound = true; + break; + } + } + if (!packageDirFound) { + reporter.printError("No suitable file or directory found for" + classOrPackage); + return false; + } + } + + //--- Otherwise, emit error message + + else { + reporter.printError("No sources files found for package " + classOrPackage); + } + } + } + + //--- Complain if no packages or classes specified + + if (option_help) { + usage(); + return true; + } + + //--- Validate custom options passed on command line + // by asking the Doclet if they are OK. + + String[][] customOptionArr = (String[][]) options + .toArray(new String[0][0]); + if (validOptionsMethod != null + && !((Boolean) validOptionsMethod.invoke(null, new Object[] + { customOptionArr, reporter })).booleanValue()) + { + // Not ok: shutdown system. + reporter.printNotice(STRING_TRY_GJDOC_HELP); + return false; + } + + if (!rootDoc.hasSpecifiedPackagesOrClasses()) { + reporter.printError("No packages or classes specified."); + reporter.printNotice(STRING_TRY_GJDOC_HELP); + return false; + } + + rootDoc.setOptions(customOptionArr); + + rootDoc.build(); + + //--- Bail out if no classes found + + if (0 == rootDoc.classes().length + && 0 == rootDoc.specifiedPackages().length + && 0 == rootDoc.specifiedClasses().length) + { + reporter.printError("No packages or classes found(!)."); + return false; + } + + //--- Our work is done, tidy up memory + + System.gc(); + System.gc(); + + //--- Set flag indicating Phase II of documentation generation + + docletRunning = true; + + //--- Invoke the start method on the Doclet: produce output + + reporter.printNotice("Running doclet..."); + + TemporaryStore tstore = new TemporaryStore(Main.rootDoc); + + Thread.currentThread().setContextClassLoader(docletClass.getClassLoader()); + + if (null != startTempMethod) + { + startTempMethod.invoke(null, new Object[] + { tstore }); + } + else + { + startMethod.invoke(null, new Object[] + { tstore.getAndClear() }); + } + + //--- Let the user know how many warnings/errors occured + + if (reporter.getWarningCount() > 0) + { + reporter.printNotice(reporter.getWarningCount() + " warnings"); + } + + if (reporter.getErrorCount() > 0) + { + reporter.printNotice(reporter.getErrorCount() + " errors"); + } + + System.gc(); + + //--- Done. + return true; + } + catch (Exception e) + { + e.printStackTrace(); + return false; + } + } + + private void addFoundPackages(String subpackage, Set foundPackages) + { + if (foundPackages.isEmpty()) { + reporter.printWarning("No classes found under subpackage " + subpackage); + } + else { + boolean onePackageAdded = false; + for (Iterator rit = foundPackages.iterator(); rit.hasNext();) { + String foundPackage = (String)rit.next(); + boolean excludeThisPackage = false; + + for (Iterator eit = option_exclude.iterator(); eit.hasNext();) { + String excludePackage = (String)eit.next(); + if (foundPackage.equals(excludePackage) || + foundPackage.startsWith(excludePackage + ":")) { + excludeThisPackage = true; + break; + } + } + + if (!excludeThisPackage) { + rootDoc.addSpecifiedPackageName(foundPackage); + onePackageAdded = true; + } + } + if (!onePackageAdded) { + if (null != subpackage) { + reporter.printWarning("No non-excluded classes found under subpackage " + subpackage); + } + else { + reporter.printWarning("No non-excluded classes found."); + } + } + } + } + + /** + * Verify that the given file is a valid Java source file and that + * it specifies the given package. + */ + private boolean isValidJavaFile(File file, + String expectedPackage) + { + try { + InputStream in = new BufferedInputStream(new FileInputStream(file)); + + int ch, prevChar = 0; + + final int STATE_DEFAULT = 0; + final int STATE_COMMENT = 1; + final int STATE_LINE_COMMENT = 2; + + int state = STATE_DEFAULT; + + StringBuffer word = new StringBuffer(); + int wordIndex = 0; + + while ((ch = in.read()) >= 0) { + String completeWord = null; + + switch (state) { + case STATE_COMMENT: + if (prevChar == '*' && ch == '/') { + state = STATE_DEFAULT; + } + break; + + case STATE_LINE_COMMENT: + if (ch == '\n') { + state = STATE_DEFAULT; + } + break; + + case STATE_DEFAULT: + if (prevChar == '/' && ch == '*') { + word.deleteCharAt(word.length() - 1); + if (word.length() > 0) { + completeWord = word.toString(); + word.setLength(0); + } + state = STATE_COMMENT; + } + else if (prevChar == '/' && ch == '/') { + word.deleteCharAt(word.length() - 1); + if (word.length() > 0) { + completeWord = word.toString(); + word.setLength(0); + } + state = STATE_LINE_COMMENT; + } + else if (" \t\r\n".indexOf(ch) >= 0) { + if (word.length() > 0) { + completeWord = word.toString(); + word.setLength(0); + } + } + else if (1 == wordIndex && ';' == ch) { + if (word.length() > 0) { + completeWord = word.toString(); + word.setLength(0); + } + else { + // empty package name in source file: "package ;" -> invalid source file + in.close(); + return false; + } + } + else { + word.append((char)ch); + } + break; + } + + if (null != completeWord) { + if (0 == wordIndex && !"package".equals(completeWord)) { + in.close(); + return "".equals(expectedPackage); + } + else if (1 == wordIndex) { + in.close(); + return expectedPackage.equals(completeWord); + } + ++ wordIndex; + } + + prevChar = ch; + } + + // no package or class found before end-of-file -> invalid source file + + in.close(); + return false; + } + catch (IOException e) { + reporter.printWarning("Could not examine file " + file + ": " + e); + return false; + } + } + + /** + * Recursively try to locate valid Java packages under the given + * package specified by its name and its directory. Add the names + * of all valid packages to the result list. + */ + private void findPackages(String subpackage, + File packageDir, + Set result) + { + File[] files = packageDir.listFiles(); + if (null != files) { + for (int i=0; i 0) { + newSubpackage = subpackage + "." + file.getName(); + } + else { + newSubpackage = file.getName(); + } + findPackages(newSubpackage, file, result); + } + } + } + } + + /** + * + */ + private static boolean validOptions(String options[][], + DocErrorReporter reporter) + { + + boolean foundDocletOption = false; + for (int i = 0; i < options.length; i++) + { + String[] opt = options[i]; + if (opt[0].equalsIgnoreCase("-doclet")) + { + if (foundDocletOption) + { + reporter.printError("Only one -doclet option allowed."); + return false; + } + else + { + foundDocletOption = true; + } + } + } + + return true; + } + + /** + * Main entry point. This is the method called when gjdoc is invoked from the + * command line. + * + * @param args + * command line arguments + */ + public static void main(String[] args) + { + + try + { + //--- Remember current time for profiling purposes + + Timer.setStartTime(); + + //--- Handle control to the Singleton instance of this class + + int result = instance.start(args); + + if (result < 0) { + // fatal error + System.exit(5); + } + else if (result > 0) { + // errors encountered + System.exit(1); + } + else { + // success + System.exit(0); + } + } + catch (Exception e) + { + //--- unexpected error + e.printStackTrace(); + System.exit(1); + } + } + + /** + * Parses command line arguments and subsequentially handles control to the + * startDoclet() method + * + * @param args The command line parameters. + */ + public static int execute(String[] args) + { + try + { + int result = instance.start(args); + if (result < 0) { + // fatal error + return 5; + } + else if (result > 0) { + // errors encountered + return 1; + } + else { + // success + return 0; + } + } + catch (Exception e) + { + // unexpected error + return 1; + } + } + + /** + * @param programName Name of the program (for error messages). *disregarded* + * @param args The command line parameters. + * @returns The return code. + */ + public static int execute(String programName, + String[] args) + { + return execute(args); + } + + /** + * @param programName Name of the program (for error messages). + * @param defaultDocletClassName Fully qualified class name. + * @param args The command line parameters. + * @returns The return code. + *//* + public static int execute(String programName, + String defaultDocletClassName, + String[] args) + { + // not yet implemented + }*/ + + /** + * @param programName Name of the program (for error messages). + * @param defaultDocletClassName Fully qualified class name. + * @param args The command line parameters. + * @returns The return code. + *//* + public static int execute(String programName, + String defaultDocletClassName, + String[] args) + { + // not yet implemented + }*/ + + /** + * @param programName Name of the program (for error messages). + * @param errWriter PrintWriter to receive error messages. + * @param warnWriter PrintWriter to receive error messages. + * @param noticeWriter PrintWriter to receive error messages. + * @param defaultDocletClassName Fully qualified class name. + * @param args The command line parameters. + * @returns The return code. + *//* + public static int execute(String programName, + PrintWriter errWriter, + PrintWriter warnWriter, + PrintWriter noticeWriter, + String defaultDocletClassName, + String[] args) + { + // not yet implemented + }*/ + + /** + * Parses command line arguments and subsequentially handles control to the + * startDoclet() method + * + * @param args + * Command line arguments, as passed to the main() method + * @return {@code -1} in case of a fatal error (invalid arguments), + * or the number of errors encountered. + * @exception ParseException + * FIXME + * @exception IOException + * if an IO problem occur + */ + public int start(String[] args) throws ParseException, IOException + { + + //--- Collect unparsed arguments in array and resolve references + // to external argument files. + + List arguments = new ArrayList(args.length); + + for (int i = 0; i < args.length; ++i) + { + if (!args[i].startsWith("@")) + { + arguments.add(args[i]); + } + else + { + FileReader reader = new FileReader(args[i].substring(1)); + StreamTokenizer st = new StreamTokenizer(reader); + st.resetSyntax(); + st.wordChars('\u0000', '\uffff'); + st.quoteChar('\"'); + st.quoteChar('\''); + st.whitespaceChars(' ', ' '); + st.whitespaceChars('\t', '\t'); + st.whitespaceChars('\r', '\r'); + st.whitespaceChars('\n', '\n'); + while (st.nextToken() != StreamTokenizer.TT_EOF) + { + arguments.add(st.sval); + } + } + } + + //--- Initialize Map for option parsing + + initOptions(); + + //--- This will hold all options recognized by gjdoc itself + // and their associated arguments. + // Contains objects of type String[], where each entry + // specifies an option along with its aguments. + + List options = new LinkedList(); + + //--- This will hold all command line tokens not recognized + // to be part of a standard option. + // These options are intended to be processed by the doclet + // Contains objects of type String, where each entry is + // one unrecognized token. + + List customOptions = new LinkedList(); + + rootDoc = new RootDocImpl(); + reporter = rootDoc.getReporter(); + + //--- Iterate over all options given on the command line + + for (Iterator it = arguments.iterator(); it.hasNext();) + { + + String arg = (String) it.next(); + + //--- Check if gjdoc recognizes this option as a standard option + // and remember the options' argument count + + int optlen = optionLength(arg); + + //--- Argument count == 0 indicates that the option is not recognized. + // Add it to the list of custom option tokens + + //--- Otherwise the option is recognized as a standard option. + // if all required arguments are supplied. Create a new String + // array for the option and its arguments, and store it + // in the options array. + + if (optlen > 0) + { + String[] option = new String[optlen]; + option[0] = arg; + boolean optargs_ok = true; + for (int j = 1; j < optlen && optargs_ok; ++j) + { + if (it.hasNext()) + { + option[j] = (String) it.next(); + if (option[j].startsWith("-")) + { + optargs_ok = false; + } + } + else + { + optargs_ok = false; + } + } + if (optargs_ok) + options.add(option); + else + { + // If the option requires more arguments than given on the + // command line, issue a fatal error + + reporter.printFatal("Missing value for option " + arg + "."); + } + } + } + + //--- Create an array of String arrays from the dynamic array built above + + String[][] optionArr = (String[][]) options.toArray(new String[options + .size()][0]); + + //--- Validate all options and issue warnings/errors + + if (validOptions(optionArr, rootDoc)) + { + + //--- We got valid options; parse them and store the parsed values + // in 'option_*' fields. + + readOptions(optionArr); + + //--- Show version and exit if requested by user + + if (option_showVersion) { + System.out.println("gjdoc " + getGjdocVersion()); + System.exit(0); + } + + if (option_bootclasspath_specified) { + reporter.printWarning("-bootclasspath ignored: not supported by" + + " gjdoc wrapper script, or no wrapper script in use."); + } + + // If we have an empty source path list, add the current directory ('.') + + if (option_sourcepath.size() == 0) + option_sourcepath.add(new File(".")); + + //--- We have all information we need to start the doclet at this time + + if (null != option_encoding) { + rootDoc.setSourceEncoding(option_encoding); + } + else { + // be quiet about this for now: + // reporter.printNotice("No encoding specified, using platform default: " + System.getProperty("file.encoding")); + rootDoc.setSourceEncoding(System.getProperty("file.encoding")); + } + rootDoc.setSourcePath(option_sourcepath); + + //addJavaLangClasses(); + + if (!startDoclet(arguments)) { + return -1; + } + } + + return reporter.getErrorCount(); + } + + private void addJavaLangClasses() + throws IOException + { + String resourceName = "/java.lang-classes-" + option_source + ".txt"; + InputStream in = getClass().getResourceAsStream(resourceName); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String line; + while ((line = reader.readLine()) != null) { + + String className = line.trim(); + if (className.length() > 0) { + ClassDocImpl classDoc = + new ClassDocImpl(null, new PackageDocImpl("java.lang"), + ProgramElementDocImpl.ACCESS_PUBLIC, + false, false, null); + classDoc.setClass(className); + rootDoc.addClassDoc(classDoc); + } + } + } + + /** + * Helper class for parsing command line arguments. An instance of this class + * represents a particular option accepted by gjdoc (e.g. '-sourcepath') along + * with the number of expected arguments and behavior to parse the arguments. + */ + private abstract class OptionProcessor + { + + /** + * Number of arguments expected by this option. + */ + private int argCount; + + /** + * Initializes this instance. + * + * @param argCount + * number of arguments + */ + public OptionProcessor(int argCount) + { + this.argCount = argCount; + } + + /** + * Overridden by derived classes with behavior to parse the arguments + * specified with this option. + * + * @param args + * command line arguments + */ + abstract void process(String[] args); + } + + /** + * Maps option tags (e.g. '-sourcepath') to OptionProcessor objects. + * Initialized only once by method initOptions(). FIXME: Rename to + * 'optionProcessors'. + */ + private static Map options = null; + + /** + * Initialize all OptionProcessor objects needed to scan/parse command line + * options. This cannot be done in a static initializer block because + * OptionProcessors need access to the Singleton instance of the Main class. + */ + private void initOptions() + { + + options = new HashMap(); + + //--- Put one OptionProcessor object into the map + // for each option recognized. + + options.put("-overview", new OptionProcessor(2) + { + + void process(String[] args) + { + option_overview = args[0]; + } + }); + options.put("-public", new OptionProcessor(1) + { + + void process(String[] args) + { + option_coverage = COVERAGE_PUBLIC; + } + }); + options.put("-protected", new OptionProcessor(1) + { + + void process(String[] args) + { + option_coverage = COVERAGE_PROTECTED; + } + }); + options.put("-package", new OptionProcessor(1) + { + + void process(String[] args) + { + option_coverage = COVERAGE_PACKAGE; + } + }); + options.put("-private", new OptionProcessor(1) + { + + void process(String[] args) + { + option_coverage = COVERAGE_PRIVATE; + } + }); + OptionProcessor helpProcessor = new OptionProcessor(1) + { + + void process(String[] args) + { + option_help = true; + } + }; + + options.put("-help", helpProcessor); + options.put("--help", helpProcessor); + options.put("-doclet", new OptionProcessor(2) + { + + void process(String[] args) + { + option_doclet = args[0]; + } + }); + options.put("-docletpath", new OptionProcessor(2) + { + + void process(String[] args) + { + option_docletpath = args[0]; + } + }); + options.put("-nowarn", new OptionProcessor(1) + { + + void process(String[] args) + { + option_nowarn = true; + } + }); + options.put("-source", new OptionProcessor(2) + { + + void process(String[] args) + { + option_source = args[0]; + if (!"1.2".equals(option_source) + && !"1.3".equals(option_source) + && !"1.4".equals(option_source)) { + + throw new RuntimeException("Only he following values are currently" + + " supported for option -source: 1.2, 1.3, 1.4."); + } + } + }); + OptionProcessor sourcePathProcessor = new OptionProcessor(2) { + void process(String[] args) + { + Debug.log(1, "-sourcepath is '" + args[0] + "'"); + for (StringTokenizer st = new StringTokenizer(args[0], + File.pathSeparator); st.hasMoreTokens();) + { + String path = st.nextToken(); + File file = new File(path); + if (!(file.exists())) + { + throw new RuntimeException("The source path " + path + + " does not exist."); + } + option_sourcepath.add(file); + } + } + }; + options.put("-s", sourcePathProcessor); + options.put("-sourcepath", sourcePathProcessor); + options.put("-subpackages", new OptionProcessor(2) + { + void process(String[] args) + { + StringTokenizer st = new StringTokenizer(args[0], ":"); + while (st.hasMoreTokens()) { + String packageName = st.nextToken(); + + if (packageName.startsWith(".") + || packageName.endsWith(".") + || packageName.indexOf("..") > 0 + || !checkCharSet(packageName, + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_.")) { + throw new RuntimeException("Illegal package name '" + + packageName + "'"); + } + option_subpackages.add(packageName); + } + } + }); + options.put("-exclude", new OptionProcessor(2) + { + void process(String[] args) + { + StringTokenizer st = new StringTokenizer(args[0], ":"); + while (st.hasMoreTokens()) { + String packageName = st.nextToken(); + + if (packageName.startsWith(".") + || packageName.endsWith(".") + || packageName.indexOf("..") > 0 + || !checkCharSet(packageName, + "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890_.")) { + throw new RuntimeException("Illegal package name '" + + packageName + "'"); + } + option_exclude.add(packageName); + } + } + }); + // TODO include other options here + options.put("-verbose", new OptionProcessor(1) + { + + void process(String[] args) + { + option_verbose = true; + System.err.println("WARNING: Unsupported option -verbose ignored"); + } + }); + options.put("-quiet", new OptionProcessor(1) + { + + void process(String[] args) + { + reporter.setQuiet(true); + } + }); + options.put("-locale", new OptionProcessor(2) + { + + void process(String[] args) + { + String localeName = args[0]; + String language = null; + String country = null; + String variant = null; + StringTokenizer st = new StringTokenizer(localeName, "_"); + if (st.hasMoreTokens()) { + language = st.nextToken(); + } + if (st.hasMoreTokens()) { + country = st.nextToken(); + } + if (st.hasMoreTokens()) { + variant = st.nextToken(); + } + if (variant != null) { + option_locale = new Locale(language, country, variant); + } + else if (country != null) { + option_locale = new Locale(language, country); + } + else if (language != null) { + option_locale = new Locale(language); + } + else { + throw new RuntimeException("Illegal locale specification '" + + localeName + "'"); + } + } + }); + options.put("-encoding", new OptionProcessor(2) + { + + void process(String[] args) + { + option_encoding = args[0]; + } + }); + options.put("-breakiterator", new OptionProcessor(1) + { + void process(String[] args) + { + option_breakiterator = true; + } + }); + options.put("-licensetext", new OptionProcessor(1) + { + void process(String[] args) + { + option_licensetext = true; + } + }); + options.put("-overview", new OptionProcessor(2) + { + void process(String[] args) + { + try { + getRootDoc().setRawCommentText(RootDocImpl.readHtmlBody(new File(args[0]))); + } + catch (IOException e) { + throw new RuntimeException("Cannot read file specified in option -overview: " + e.getMessage()); + } + } + }); + options.put("-classpath", new OptionProcessor(2) + { + void process(String[] args) + { + reporter.printWarning("-classpath option could not be passed to the VM. Faking it with "); + reporter.printWarning(" System.setProperty(\"java.class.path\", \"" + args[0] + "\");"); + System.setProperty("java.class.path", args[0]); + } + }); + options.put("--version", new OptionProcessor(1) + { + void process(String[] args) + { + option_showVersion = true; + } + }); + options.put("-bootclasspath", new OptionProcessor(1) + { + void process(String[] args) + { + option_bootclasspath_specified = true; + } + }); + options.put("-all", new OptionProcessor(1) + { + void process(String[] args) + { + option_all = true; + } + }); + options.put("-reflection", new OptionProcessor(1) + { + void process(String[] args) + { + option_reflection = true; + } + }); + } + + /** + * Determine how many arguments the given option requires. + * + * @param option + * The name of the option without leading dash. + */ + private static int optionLength(String option) + { + + OptionProcessor op = (OptionProcessor) options.get(option.toLowerCase()); + if (op != null) + return op.argCount; + else + return 0; + } + + /** + * Process all given options. Assumes that the options have been validated + * before. + * + * @param optionArr + * Each element is a series of Strings where [0] is the name of the + * option and [1..n] are the arguments to the option. + */ + private void readOptions(String[][] optionArr) + { + + //--- For each option, find the appropriate OptionProcessor + // and call its process() method + + for (int i = 0; i < optionArr.length; ++i) + { + String[] opt = optionArr[i]; + String[] args = new String[opt.length - 1]; + System.arraycopy(opt, 1, args, 0, opt.length - 1); + OptionProcessor op = (OptionProcessor) options.get(opt[0].toLowerCase()); + op.process(args); + } + } + + /** + * Print command line usage. + */ + private static void usage() + { + System.out + .print("\n" + + "USAGE: gjdoc [options] [packagenames] " + + "[sourcefiles] [@files]\n\n" + + " --version Show version information and exit\n" + + " -all Process all source files found in the source path\n" + + " -overview Read overview documentation from HTML file\n" + + " -public Include only public classes and members\n" + + " -protected Include protected and public classes and members\n" + + " This is the default\n" + + " -package Include package/protected/public classes and members\n" + + " -private Include all classes and members\n" + + " -help, --help Show this information\n" + + " -doclet Doclet class to use for generating output\n" + + " -docletpath Specifies the search path for the doclet and\n" + + " dependencies\n" + + " -source Provide source compatibility with specified\n" + + " release (1.4 to handle assertion)\n" + + " -sourcepath Where to look for source files\n" + + " -s Alias for -sourcepath\n" + + " -subpackages List of subpackages to recursively load\n" + + " -exclude List of packages to exclude\n" + + " -verbose Output messages about what Gjdoc is doing [ignored]\n" + + " -quiet Do not print non-error and non-warning messages\n" + + " -locale Locale to be used, e.g. en_US or en_US_WIN\n" + + " -encoding Source file encoding name\n" + + " -breakiterator Compute first sentence with BreakIterator\n" + + " -classpath Set the path used for loading auxilliary classes\n" + + "\n" + + "Standard doclet options:\n" + + " -d Set target directory\n" + + " -use Includes the 'Use' page for each documented class\n" + + " and package\n" + + " -version Includes the '@version' tag\n" + + " -author Includes the '@author' tag\n" + + " -splitindex Splits the index file into multiple files\n" + + " -windowtitle Browser window title\n" + + " -doctitle Title near the top of the overview summary file\n" + + " (HTML allowed)\n" + + " -title Title for this set of API documentation\n" + + " (deprecated, -doctitle should be used instead)\n" + + " -header Text to include in the top navigation bar\n" + + " (HTML allowed)\n" + + " -footer Text to include in the bottom navigation bar\n" + + " (HTML allowed)\n" + + " -bottom Text to include at the bottom of each output file\n" + + " (HTML allowed)\n" + + " -link Link to external generated documentation at URL\n" + + " -linkoffline \n" + + " Link to external generated documentation for\n" + + " the specified package-list\n" + + " -linksource Creates an HTML version of each source file\n" + + " -group \n" + + " Separates packages on the overview page into groups\n" + + " -nodeprecated Prevents the generation of any deprecated API\n" + + " -nodeprecatedlist Prevents the generation of the file containing\n" + + " the list of deprecated APIs and the link to the\n" + + " navigation bar to that page\n" + + " -nosince Omit the '@since' tag\n" + + " -notree Do not generate the class/interface hierarchy page\n" + + " -noindex Do not generate the index file\n" + + " -nohelp Do not generate the help link\n" + + " -nonavbar Do not generate the navbar, header and footer\n" + + " -helpfile Path to an alternate help file\n" + + " -stylesheetfile Path to an alternate CSS stylesheet\n" + + " -addstylesheet Path to an additional CSS stylesheet\n" + + " -serialwarn Complain about missing '@serial' tags [ignored]\n" + + " -charset Specifies the HTML charset\n" + + " -docencoding \n" + + " Specifies the encoding of the generated HTML files\n" + + " -tag :Xaoptcmf:\"\"\n" + + " Enables gjdoc to interpret a custom tag\n" + + " -taglet Adds a Taglet class to the map of taglets\n" + + " -tagletpath Sets the CLASSPATH to load subsequent Taglets from\n" + + " -docfilessubdirs Enables deep copy of 'doc-files' directories\n" + + " -excludedocfilessubdir \n" + + " Excludes 'doc-files' subdirectories with a give name\n" + + " -noqualifier all|\n" + + " Do never fully qualify given package names\n" + + " -nocomment Suppress the entire comment body including the main\n" + + " description and all tags, only generate declarations\n" + + "\n" + + "Gjdoc extension options:\n" + + " -reflection Use reflection for resolving unqualified class names\n" + + " -licensetext Include license text from source files\n" + + " -validhtml Use valid HTML/XML names (breaks compatibility)\n" + + " -baseurl Hardwire the given base URL into generated pages\n" + /** + + " -genhtml Generate HTML code instead of XML code. This is the\n" + + " default.\n" + + " -geninfo Generate Info code instead of XML code.\n" + + " -xslsheet If specified, XML files will be written to a\n" + + " temporary directory and transformed using the\n" + + " given XSL sheet. The result of the transformation\n" + + " is written to the output directory. Not required if\n" + + " -genhtml or -geninfo has been specified.\n" + + " -xmlonly Generate XML code only, do not generate HTML code.\n" + + " -bottomnote HTML code to include at the bottom of each page.\n" + + " -nofixhtml If not specified, heurestics will be applied to\n" + + " fix broken HTML code in comments.\n" + + " -nohtmlwarn Do not emit warnings when encountering broken HTML\n" + + " code.\n" + + " -noemailwarn Do not emit warnings when encountering strings like\n" + + " .\n" + + " -indentstep How many spaces to indent each tag level in\n" + + " generated XML code.\n" + + " -xsltdriver Specifies the XSLT driver to use for transformation.\n" + + " By default, xsltproc is used.\n" + + " -postprocess XmlDoclet postprocessor class to apply after XSL\n" + + " transformation.\n" + + " -compress Generated info pages will be Zip-compressed.\n" + + " -workpath Specify a temporary directory to use.\n" + + " -authormail Specify handling of mail addresses in @author tags.\n" + + " no-replace do not replace mail addresses (default).\n" + + " mailto-name replace by Real Name.\n" + + " name-mailto-address replace by Real Name (abc@foo.com).\n" + + " name-mangled-address replace by Real Name (abc AT foo DOT com).\n" + **/ + ); + } + + /** + * The root of the gjdoc tool. + * + * @return all the options of the gjdoc application. + */ + public static RootDocImpl getRootDoc() + { + return rootDoc; + } + + /** + * Get the gjdoc singleton. + * + * @return the gjdoc instance. + */ + public static Main getInstance() + { + return instance; + } + + /** + * Is this access level covered? + * + * @param accessLevel + * the access level we want to know if it is covered. + * @return true if the access level is covered. + */ + public boolean includeAccessLevel(int accessLevel) + { + return coverageTemplates[option_coverage][accessLevel]; + } + + /** + * Is the doclet running? + * + * @return true if it's running + */ + public boolean isDocletRunning() + { + return docletRunning; + } + + /** + * Check the charset. Check that all the characters of the string 'toCheck' + * and query if they exist in the 'charSet'. The order does not matter. The + * number of times a character is in the variable does not matter. + * + * @param toCheck + * the charset to check. + * @param charSet + * the reference charset + * @return true if they match. + */ + public static boolean checkCharSet(String toCheck, String charSet) + { + for (int i = 0; i < toCheck.length(); ++i) + { + if (charSet.indexOf(toCheck.charAt(i)) < 0) + return false; + } + return true; + } + + /** + * Makes the RootDoc eligible for the GC. + */ + public static void releaseRootDoc() + { + rootDoc.flush(); + } + + /** + * Return whether the -breakiterator option has been specified. + */ + public boolean isUseBreakIterator() + { + return this.option_breakiterator + || !getLocale().getLanguage().equals(Locale.ENGLISH.getLanguage()); + } + + /** + * Return whether boilerplate license text should be copied. + */ + public boolean isCopyLicenseText() + { + return this.option_licensetext; + } + + /** + * Return the locale specified using the -locale option or the + * default locale; + */ + public Locale getLocale() + { + return this.option_locale; + } + + /** + * Return the collator to use based on the specified -locale + * option. If no collator can be found for the given locale, a + * warning is emitted and the default collator is used instead. + */ + public Collator getCollator() + { + if (null == this.collator) { + Locale locale = getLocale(); + this.collator = Collator.getInstance(locale); + Locale defaultLocale = Locale.getDefault(); + if (null == this.collator + && !defaultLocale.equals(locale)) { + this.collator = Collator.getInstance(defaultLocale); + if (null != this.collator) { + reporter.printWarning("No collator found for locale " + + locale.getDisplayName() + + "; using collator for default locale " + + defaultLocale.getDisplayName() + + "."); + } + else { + this.collator = Collator.getInstance(); + reporter.printWarning("No collator found for specified locale " + + locale.getDisplayName() + + " or default locale " + + defaultLocale.getDisplayName() + + ": using default collator."); + } + } + if (null == this.collator) { + this.collator = Collator.getInstance(); + reporter.printWarning("No collator found for locale " + + locale.getDisplayName() + + ": using default collator."); + } + } + return this.collator; + } + + public boolean isCacheRawComments() + { + return true; + } + + public String getGjdocVersion() + { + if (null == gjdocVersion) { + try { + Properties versionProperties = new Properties(); + versionProperties.load(getClass().getResourceAsStream("/version.properties")); + gjdocVersion = versionProperties.getProperty("gjdoc.version"); + } + catch (IOException ignore) { + } + if (null == gjdocVersion) { + gjdocVersion = "unknown"; + } + } + return gjdocVersion; + } + + public boolean isReflectionEnabled() + { + return this.option_reflection; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java new file mode 100644 index 00000000000..aae2462bbf3 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/MemberDocImpl.java @@ -0,0 +1,218 @@ +/* gnu.classpath.tools.gjdoc.MemberDocImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import java.util.*; +import com.sun.javadoc.*; + +public abstract class MemberDocImpl extends ProgramElementDocImpl implements MemberDoc { + + protected String typeName; + protected Type type; + + public MemberDocImpl(ClassDoc containingClass, + PackageDoc containingPackage, + SourcePosition position) { + + super(containingClass, + containingPackage, + position); + } + + public String qualifiedName() { + return containingClass().qualifiedName()+"."+name(); + } + + public boolean isSynthetic() { + return false; + } + + int parseModifiers(char[] source, int startIndex, int endIndex) { + + Debug.log(9,"parseModifiers '"+new String(source,startIndex,endIndex-startIndex)+"'"); + + final int STATE_NORMAL = 1; + final int STATE_STARC = 2; + final int STATE_SLASHC = 3; + + int state = STATE_NORMAL; + + StringBuffer word = new StringBuffer(); + StringBuffer typeNameBuf = new StringBuffer(); + int lastWordStart = startIndex; + int firstChar = 0; + int lastChar = 0; + for (; startIndex=0 + || (startIndex > 0 && source[startIndex-1] == ']' && source[startIndex] != '[')) { + if (word.length()>0 && lastChar != '.') { + if (processModifier(word.toString())) { + } + else if (typeNameBuf.length()==0 && !isConstructor()) { + typeNameBuf.setLength(0); + typeNameBuf.append(word); + } + else if ((firstChar=='[' || firstChar==']') && !isConstructor()) { + typeNameBuf.append(word); + } + else { + typeName = typeNameBuf.toString(); + return lastWordStart; + } + word.setLength(0); + lastWordStart=startIndex; + } + } + else { + if (lastWordStart<0) lastWordStart=startIndex; + lastChar = source[startIndex]; + if (0 == word.length()) { + firstChar = lastChar; + } + word.append((char)lastChar); + } + } + + typeName = typeNameBuf.toString(); + return startIndex; + } + + public Type type() { + //public Type type() throws ParseException { + Debug.log(9,"type() called on "+containingClass()+"."+this); + if (type==null) { + try { + type=((ClassDocImpl)containingClass()).typeForString(typeName); + } catch (ParseException e) { + System.err.println("FIXME: add try-catch to force compilation"); + e.printStackTrace(); + } + } + return type; + } + + + protected void setName(String name) { + this.name=name; + } + private String name; + + + public String name() { + return name; + } + + public void setTypeName(String typeName) { + this.typeName=typeName; + this.type=null; + } + + public String getTypeName() { + return typeName; + } + + // return true if this Doc is include in the active set. + public boolean isIncluded() { + return Main.getInstance().includeAccessLevel(accessLevel); + } + + public int compareTo(Object o) { + if (o instanceof MemberDocImpl) { + int rc=name().compareTo(((MemberDocImpl)o).name()); + if (rc==0) + rc=containingClass().qualifiedName().compareTo(((MemberDocImpl)o).containingClass().qualifiedName()); + return rc; + } + else { + return super.compareTo(o); + } + } + + void resolve() { + + if (type==null && typeName!=null) { + Debug.log(1, "MemberDocImpl.resolve(), looking up type named "+typeName); + try { + type=((ClassDocImpl)containingClass()).typeForString(typeName); + } catch (ParseException e) { + //System.err.println("FIXME: add try-catch to force compilation"); + //e.printStackTrace(); + Debug.log(1, "INTERNAL WARNING: Couldn't find type for name '"+typeName+"'"); + } + } + + if (type instanceof ClassDocProxy) { + String className=type.qualifiedTypeName(); + ClassDoc realClassDoc=((ClassDocImpl)containingClass()).findClass(className, type.dimension()); + if (realClassDoc!=null) { + type=realClassDoc; + } + else { + //throw new Error("Class not found: "+className); + /*** This is not an error, the class was not included + * on the command line. Perhaps emit a notice here. + * + + Main.getRootDoc().printError("Class not found '" + + className + + "' in class '" + + containingClass().qualifiedName() + + "' member '" + + name() + + "'"); + */ + } + } + } + + public void resolveComments() + { + super.resolveComments(); + + if (tagMap.isEmpty()) { + TagContainer inheritedTagMap = ClassDocImpl.findInheritedDoc(containingClass(), + this, + null); + if (null != inheritedTagMap) { + this.tagMap = inheritedTagMap.getTagMap(); + } + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/MethodDocImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/MethodDocImpl.java new file mode 100644 index 00000000000..8654a224991 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/MethodDocImpl.java @@ -0,0 +1,47 @@ +/* gnu.classpath.tools.gjdoc.MethodDocImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import java.util.*; +import com.sun.javadoc.*; + +public class MethodDocImpl extends ExecutableMemberDocImpl implements MethodDoc { + + public MethodDocImpl(ClassDoc containingClass, + PackageDoc containingPackage, + SourcePosition position) { + + super(containingClass, + containingPackage, + position); + } + + // Is this Doc item a class. + public boolean isMethod() { + return true; + } + + public Type returnType() { + return super.type(); + } + + public String toString() { return name()+((signature()==null)?"()":signature()); } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java new file mode 100644 index 00000000000..d0b28d62742 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/PackageDocImpl.java @@ -0,0 +1,206 @@ +/* gnu.classpath.tools.gjdoc.PackageDocImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; +import java.io.File; + +class PackageDocImpl extends DocImpl implements GjdocPackageDoc { + + private String packageName; + private File packageDirectory; + + private Set allClassesSet = new TreeSet(); + private List ordinaryClassesList = new ArrayList(); + private List exceptionsList = new ArrayList(); + private List interfacesList = new ArrayList(); + private List errorsList = new ArrayList(); + + private ClassDoc[] allClasses; + private ClassDoc[] ordinaryClasses; + private ClassDoc[] exceptions; + private ClassDoc[] interfaces; + private ClassDoc[] errors; + + PackageDocImpl(String packageName) { + super(null); + this.packageName=packageName; + } + + public void addClass(ClassDoc classDoc) { + if (Main.getInstance().includeAccessLevel(((ClassDocImpl)classDoc).accessLevel)) { + allClassesSet.add(classDoc); + } + } + + public void resolve() { + for (Iterator it=allClassesSet.iterator(); it.hasNext(); ) { + ClassDocImpl classDoc=(ClassDocImpl)it.next(); + try { + classDoc.resolve(); + } catch (ParseException e) { + System.err.println("FIXME: add try-catch to force compilation" + + e); + } + + if (classDoc.isInterface()) { + interfacesList.add(classDoc); + } + else if (classDoc.isException()) { + exceptionsList.add(classDoc); + } + else if (classDoc.isError()) { + errorsList.add(classDoc); + } + else { + ordinaryClassesList.add(classDoc); + } + } + } + + public void resolveComments() { + if (rawDocumentation!=null) { + this.tagMap=parseCommentTags(rawDocumentation.toCharArray(), + 0, + rawDocumentation.length(), + null, + null, + null, + null); + } + + resolveTags(); + } + + public String name() { + return packageName; + } + + public ClassDoc[] allClasses() + { + if (null == this.allClasses) { + this.allClasses = toClassDocArray(allClassesSet); + } + return this.allClasses; + } + + public ClassDoc[] ordinaryClasses() + { + if (null == this.ordinaryClasses) { + this.ordinaryClasses = toClassDocArray(ordinaryClassesList); + } + return this.ordinaryClasses; + } + + + public ClassDoc[] exceptions() + { + if (null == this.exceptions) { + this.exceptions = toClassDocArray(exceptionsList); + } + return this.exceptions; + } + + public ClassDoc[] interfaces() + { + if (null == this.interfaces) { + this.interfaces = toClassDocArray(interfacesList); + } + return this.interfaces; + } + + public ClassDoc[] errors() + { + if (null == this.errors) { + this.errors = toClassDocArray(errorsList); + } + return this.errors; + } + + private ClassDoc[] toClassDocArray(Collection classDocList) + { + ClassDoc[] result = (ClassDoc[])classDocList.toArray(new ClassDoc[classDocList.size()]); + Arrays.sort(result); + return result; + } + + public ClassDoc findClass(String name) { + return Main.getRootDoc().classNamed(packageName+"."+name); + } + + public void dump(int level) { + Debug.log(level, "All classes:"); + Debug.dumpArray(level, allClasses()); + + Debug.log(level, "Ordinary classes:"); + Debug.dumpArray(level, ordinaryClasses()); + + } + + public static final PackageDocImpl DEFAULT_PACKAGE = new PackageDocImpl(""); + + public boolean isPackage() { + return true; + } + + public boolean isIncluded() { + return isIncluded; + } + + void setIsIncluded(boolean b) { + this.isIncluded=b; + } + + private boolean isIncluded = false; + + public String toString() { + return packageName; + } + + public int compareTo(Object o) { + if (o!=null && o instanceof PackageDocImpl) + return name().compareTo(((PackageDocImpl)o).name()); + else + return 0; + } + + public boolean equals(Object o) { + if (o!=null && o instanceof PackageDocImpl) + return name().equals(((PackageDocImpl)o).name()); + else + return false; + } + + /** + * Sets the directory containing this package's source files. + */ + public void setPackageDirectory(File packageDirectory) { + this.packageDirectory = packageDirectory; + } + + /** + * Gets the directory containing this package's source files. + */ + public File packageDirectory() { + return this.packageDirectory; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ParamTagImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ParamTagImpl.java new file mode 100644 index 00000000000..2d9567e66c4 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ParamTagImpl.java @@ -0,0 +1,64 @@ +/* gnu.classpath.tools.gjdoc.ParamTagImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; +import java.text.*; + +public class ParamTagImpl extends AbstractTagImpl implements ParamTag { + + private String parameterName; + private String parameterComment; + + public ParamTagImpl(String text, + ClassDocImpl contextClass, + MemberDocImpl contextMember) { + super(text); + char[] textarr=text.toCharArray(); + int i=0; + for (; i=0) ++rc; + + return (rc!=index) ? rc : -1; + } + } + + class BracketClose extends SourceComponent { + + int match(char[] source, int index) { + if (source[index]=='}') { + return index+1; + } + else { + return -1; + } + } + + int process(Parser parser, char[] source, int startIndex, int endIndex) + throws ParseException, IOException + { + parser.classClosed(); + return endIndex; + } + } + + class CommentComponent extends SourceComponent { + + int match(char[] source, int index) throws ParseException { + if (index+1= 0) { + parser.setBoilerplateComment(boilerplateComment); + } + } + + return endIndex; + } + } + + class SlashSlashCommentComponent extends SourceComponent { + + int match(char[] source, int index) { + if (index+1=0) { + + for (index+=7; index=0) { + + for (index+=7; index=0; ++index) + ; + + if (index0) { + if (source[index] == '(') + ++ parLevel; + if (source[index] == ')') + -- parLevel; + ++ index; + if (parLevel==0) + break; + } + } + break; + case '=': // field + case ';': // field + case '(': // function + return -1; + case '{': + isClass=true; + break; + } + if (isClass) break; + } + if (!isClass || index>=source.length) + return -1; + + return index+1; + } + + int process(Parser parser, char[] source, int startIndex, int endIndex) throws ParseException, IOException { + + parser.classOpened(source, startIndex, endIndex); + if (parser.getAddComments()) + parser.ctx.classDoc.setRawCommentText(parser.getLastComment()); + parser.setLastComment(null); + if (parser.ctx.classDoc.isEnum()) + { + int depth = 0; + for (int a = endIndex; a < source.length; ++a) + { + Debug.log(9, "Enum skipping " + a); + if (source[a] == '{') + { + Debug.log(1, "Found inner { in enum"); + ++depth; + } + if (source[a] == '}') + { + if (depth > 0) + { + Debug.log(1, "Found inner } in enum"); + --depth; + } + else + { + Debug.log(1, "Found enum }"); + parser.classClosed(); + return a + 1; + } + } + } + } + int rc=parser.parse(source, endIndex, parser.getClassLevelComponents()); + return rc; + } + + } + + +public class Parser { + + + static int skipExpression(char[] source, int endIndex, int level, char delimiter) throws ParseException { + + int orgEndIndex=endIndex; + + final int STATE_NORMAL=1; + final int STATE_STARC=2; + final int STATE_SLASHC=3; + final int STATE_CHAR=4; + final int STATE_STRING=5; + + int state=STATE_NORMAL; + int prev=0; + for (; !((level==0 && state==STATE_NORMAL && (delimiter=='\0' || source[endIndex]==delimiter))) && endIndex0) + throw new ParseException("Unexpected end of source."); + else { + String rc=new String(source, orgEndIndex, endIndex-orgEndIndex); + return endIndex; + } + } + + private boolean addComments = false; + + public boolean getAddComments() + { + return this.addComments; + } + + public static final String WHITESPACE=" \t\r\n "; + + public static final boolean isWhitespace(char c) { + return (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == ' '); + //return WHITESPACE.indexOf(c)>=0; + } + + private int currentLine; + + static char[] loadFile(final File file, String encoding) + throws IOException + { + InputStream in = new FileInputStream(file); + NotifyingInputStreamReader notifyingInput + = new NotifyingInputStreamReader(in, encoding); + notifyingInput.addMalformedInputListener(new MalformedInputListener() { + public void malformedInputEncountered(MalformedInputEvent event) { + Main.getRootDoc().printWarning("Illegal character in file " + file + ", line " + event.getLineNumber() + ", column " + event.getColumnNumber()); + try { + Main.getRootDoc().printWarning(IOToolkit.getLineFromFile(file, event.getLineNumber())); + Main.getRootDoc().printWarning(IOToolkit.getColumnDisplayLine(event.getColumnNumber())); + } + catch (IOException ignore) { + } + } + }); + Reader reader + = new BufferedReader(notifyingInput); + char[] result = IOToolkit.readFully(reader); + reader.close(); + return result; + } + + private SourceComponent[] sourceLevelComponents; + private SourceComponent[] classLevelComponents; + + public SourceComponent[] getClassLevelComponents() + { + return this.classLevelComponents; + } + + public Parser() { + try { + + sourceLevelComponents=new SourceComponent[] { + new Whitespace(), + new CommentComponent(), + new SlashSlashCommentComponent(), + new PackageComponent(), + new EmptyStatementComponent(), + new ImportComponent(), + new ClassComponent(), + }; + + classLevelComponents=new SourceComponent[] { + new Whitespace(), + new BracketClose(), + new CommentComponent(), + new SlashSlashCommentComponent(), + new FunctionComponent(), + new StaticBlockComponent(), + new ImportComponent(), + new ClassComponent(), + new FieldComponent(), + }; + } + catch (Exception e) { + e.printStackTrace(); + } + } + + public int getNumberOfProcessedFiles() { + return processedFiles.size(); + } + + static Set processedFiles = new HashSet(); + + ClassDocImpl processSourceFile(File file, boolean addComments, + String encoding, String expectedPackageName) + throws IOException, ParseException + { + //System.err.println("Processing " + file + "..."); + this.currentFile = file; + this.currentPackage = null; + this.currentPackageName = null; + this.expectedPackageName = expectedPackageName; + this.outerClass = null; + this.boilerplateComment = null; + + this.addComments=addComments; + + if (processedFiles.contains(file)) { + return null; + } + + processedFiles.add(file); + + Debug.log(1,"Processing file "+file); + + contextStack.clear(); + ctx=null; + + importedClassesList.clear(); + importedStringList.clear(); + importedPackagesList.clear(); + importedStatementList.clear(); + + currentLine = 1; + + char[] source = loadFile(file, encoding); + + try { + parse(source, 0, sourceLevelComponents); + + ClassDoc[] importedClasses=(ClassDoc[])importedClassesList.toArray(new ClassDoc[0]); + PackageDoc[] importedPackages=(PackageDoc[])importedPackagesList.toArray(new PackageDoc[0]); + + if (Main.DESCEND_IMPORTED) { + for (int i=0; i0) { + Debug.log(1,"-->contextStack not empty! size is "+contextStack.size()); + } + + return outerClass; + } + catch (IgnoredFileParseException ignore) { + Debug.log(1, "File ignored: " + ignore); + return null; + } + } + + int parse(char[] source, int index, SourceComponent[] componentTypes) throws ParseException, IOException { + + while (index=0) { + //Debug.log(1,componentTypes[i].getClass().getName()+" ("+match+"/"+source.length+")"); + break; + } + } + + if (iClassDocImpl + */ + private Map classDocMap = new HashMap(); + + /** + * Stores all packages loaded in the course of preparing + * the documentation data. Maps the package name + * to its PackageDocImpl representation. + * + * @contains String->PackageDocImpl + */ + private Map packageDocMap = new HashMap(); + + /** + * All classes specified by the user, both those explicitly + * individually specified on the command line and those contained + * in packages specified on the command line (as Array for quick + * retrieval by Doclet). This is created from classesList after + * all classes have been loaded. + */ + private ClassDocImpl[] classes; + + /** + * All classes which were individually specified on the command + * line (as Array for quick retrieval by Doclet). This is created + * from specifiedClassNames after all classes have been loaded. + */ + private List specifiedClasses; + + /** + * All packages which were specified on the command line (as Array + * for quick retrieval by Doclet). This is created from + * specifiedPackageNames after all classes have been loaded. + */ + private Set specifiedPackages; + + + /** + * Temporarily stores a list of classes which are referenced + * by classes already loaded and which still have to be + * resolved. + */ + private List scheduledClasses=new LinkedList(); + + private List sourcePath; + + private String sourceEncoding; + + private Parser parser = new Parser(); + + private Set unlocatableReportedSet = new HashSet(); + + private Set inaccessibleReportedSet = new HashSet(); + + //-------------------------------------------------------------------------- + // + // Implementation of RootDoc interface + // + //-------------------------------------------------------------------------- + + /** + * Return classes and interfaces to be documented. + */ + public ClassDoc[] classes() { return classes; } + + /** + * Return a ClassDoc object for the specified class/interface + * name. + * + * @return a ClassDoc object describing the given class, or + * null if no corresponding ClassDoc object + * has been constructed. + */ + public ClassDoc classNamed(String qualifiedName) { + return (ClassDoc)classDocMap.get(qualifiedName); + } + + /** + * Return an xxx + */ + public String[][] options() { return customOptionArr; } + + // Return a PackageDoc for the specified package name + public PackageDoc packageNamed(String name) { + return (PackageDoc)packageDocMap.get(name); + } + + + // classes and interfaces specified on the command line. + public ClassDoc[] specifiedClasses() + { + return (ClassDocImpl[]) specifiedClasses.toArray(new ClassDocImpl[0]); + } + + // packages specified on the command line. + public PackageDoc[] specifiedPackages() + { + return (PackageDocImpl[])specifiedPackages.toArray(new PackageDocImpl[0]); + } + + // Print error message, increment error count. + public void printError(java.lang.String msg) { + reporter.printError(msg); + } + + // Print error message, increment error count. + public void printFatal(java.lang.String msg) { + reporter.printFatal(msg); + } + + // Print a message. + public void printNotice(java.lang.String msg) { + reporter.printNotice(msg); + } + + // Print warning message, increment warning count. + public void printWarning(java.lang.String msg) { + reporter.printWarning(msg); + } + + public String name() { + return "RootDoc"; + } + + public ErrorReporter getReporter() { + return reporter; + } + + public void build() throws ParseException, IOException { + + //--- Create a temporary random access file for caching comment text. + + //File rawCommentCacheFile=File.createTempFile("gjdoc_rawcomment",".cache"); + File rawCommentCacheFile = new File("gjdoc_rawcomment.cache"); + rawCommentCacheFile.deleteOnExit(); + rawCommentCache = new RandomAccessFile(rawCommentCacheFile, "rw"); + + //--- Parse all files in "java.lang". + + List javaLangSourceDirs = findSourceFiles("java/lang"); + if (!javaLangSourceDirs.isEmpty()) { + Iterator it = javaLangSourceDirs.iterator(); + while (it.hasNext()) { + File javaLangSourceDir = (File)it.next(); + parser.processSourceDir(javaLangSourceDir, + sourceEncoding, "java.lang"); + } + } + else { + + Debug.log(1, "Sourcepath is "+sourcePath); + + // Core docs not included in source-path: + // we need to gather the information about java.lang + // classes via reflection... + + } + + //--- Parse all files in explicitly specified package directories. + + for (Iterator it=specifiedPackageNames.iterator(); it.hasNext(); ) { + + String specifiedPackageName = (String)it.next(); + String displayPackageName = specifiedPackageName; + if (null == displayPackageName || 0 == displayPackageName.length()) { + displayPackageName = ""; + } + printNotice("Loading classes for package "+displayPackageName+"..."); + String relPath; + if (null != specifiedPackageName) { + relPath = specifiedPackageName.replace('.',File.separatorChar); + } + else { + relPath = ""; + } + List sourceDirs = findSourceFiles(relPath); + if (!sourceDirs.isEmpty()) { + Iterator sourceDirIt = sourceDirs.iterator(); + while (sourceDirIt.hasNext()) { + File sourceDir = (File)sourceDirIt.next(); + parser.processSourceDir(sourceDir, sourceEncoding, specifiedPackageName); + } + } + else { + printError("Package '"+specifiedPackageName+"' not found."); + } + } + + specifiedClasses = new LinkedList(); + + //--- Parse all explicitly specified source files. + + for (Iterator it=specifiedSourceFiles.iterator(); it.hasNext(); ) { + + File specifiedSourceFile = (File)it.next(); + printNotice("Loading source file "+specifiedSourceFile+" ..."); + ClassDocImpl classDoc = parser.processSourceFile(specifiedSourceFile, true, sourceEncoding, null); + if (null != classDoc) { + specifiedClasses.add(classDoc); + classesList.add(classDoc); + classDoc.setIsIncluded(true); + addPackageDoc(classDoc.containingPackage()); + } + } + + + //--- Let the user know that all specified classes are loaded. + + printNotice("Constructing Javadoc information..."); + + //--- Load all classes implicitly referenced by explicitly specified classes. + + loadScheduledClasses(parser); + + printNotice("Resolving references in comments..."); + + resolveComments(); + + //--- Resolve pending references in all ClassDocImpls + + printNotice("Resolving references in classes..."); + + for (Iterator it = classDocMap.values().iterator(); it.hasNext(); ) { + ClassDoc cd=(ClassDoc)it.next(); + if (cd instanceof ClassDocImpl) { + ((ClassDocImpl)cd).resolve(); + } + } + + //--- Resolve pending references in all PackageDocImpls + + printNotice("Resolving references in packages..."); + + for (Iterator it = packageDocMap.values().iterator(); it.hasNext(); ) { + PackageDocImpl pd=(PackageDocImpl)it.next(); + pd.resolve(); + } + + //--- Assemble the array with all specified packages + + specifiedPackages = new LinkedHashSet(); + for (Iterator it = specifiedPackageNames.iterator(); it.hasNext(); ) { + String specifiedPackageName = (String)it.next(); + PackageDoc specifiedPackageDoc = (PackageDoc)packageDocMap.get(specifiedPackageName); + if (null!=specifiedPackageDoc) { + ((PackageDocImpl)specifiedPackageDoc).setIsIncluded(true); + specifiedPackages.add(specifiedPackageDoc); + + ClassDoc[] packageClassDocs=specifiedPackageDoc.allClasses(); + for (int i=0; i0) { + + // Maybe the dotted notation doesn't mean a package + // name but instead an inner class, as in 'Outer.Inner'. + // so let's assume this and try to load the outer class. + + String outerClass=""; + for (StringTokenizer st=new StringTokenizer(scheduledClassName,"."); st.hasMoreTokens(); ) { + if (outerClass.length()>0) outerClass+="."; + outerClass+=st.nextToken(); + if (!st.hasMoreTokens()) break; + try { + loadClass(outerClass); + //FIXME: shouldn't this be loadScheduledClass(outerClass, scheduledClassContext); ??? + continue; + } + catch (Exception ee) { + // Ignore: try next level + } + } + } + + **********************************************************/ + + // If we arrive here, the class could not be found + + printWarning("Couldn't load class "+scheduledClassName+" referenced by "+scheduledClassContext); + + //FIXME: shouldn't this be throw new Error("cannot load: "+scheduledClassName); + } + } + } + } + + private void loadScheduledClass(Parser parser, String scheduledClassName, ClassDoc scheduledClassContext) throws ParseException, IOException { + + ClassDoc loadedClass=(ClassDoc)scheduledClassContext.findClass(scheduledClassName); + + if (loadedClass==null || loadedClass instanceof ClassDocProxy) { + + ClassDoc classDoc = findScheduledClassFile(scheduledClassName, scheduledClassContext); + if (null != classDoc) { + + if (classDoc instanceof ClassDocReflectedImpl) { + Main.getRootDoc().addClassDocRecursive(classDoc); + } + + if (Main.DESCEND_SUPERCLASS + && null != classDoc.superclass() + && (classDoc.superclass() instanceof ClassDocProxy)) { + scheduleClass(classDoc, classDoc.superclass().qualifiedName()); + } + } + else { + // It might be an inner class of one of the outer/super classes. + // But we can only check that when they are all fully loaded. + boolean retryLater = false; + + int numberOfProcessedFilesBefore = parser.getNumberOfProcessedFiles(); + + ClassDoc cc = scheduledClassContext.containingClass(); + while (cc != null && !retryLater) { + ClassDoc sc = cc.superclass(); + while (sc != null && !retryLater) { + if (sc instanceof ClassDocProxy) { + ((ClassDocImpl)cc).resolve(); + retryLater = true; + } + sc = sc.superclass(); + } + cc = cc.containingClass(); + } + + // Now that outer/super references have been resolved, try again + // to find the class. + + loadedClass = (ClassDoc)scheduledClassContext.findClass(scheduledClassName); + + int numberOfProcessedFilesAfter = parser.getNumberOfProcessedFiles(); + + boolean filesWereProcessed = numberOfProcessedFilesAfter > numberOfProcessedFilesBefore; + + // Only re-schedule class if additional files have been processed + // If there haven't, there's no point in re-scheduling. + // Will avoid infinite loops of re-scheduling + if (null == loadedClass && retryLater && filesWereProcessed) + scheduleClass(scheduledClassContext, scheduledClassName); + + /* A warning needn't be emitted - this is normal, can happen + if the scheduled class is in a package which is not + included on the command line. + + else if (null == loadedClass) + printWarning("Can't find scheduled class '" + + scheduledClassName + + "' in context '" + + scheduledClassContext.qualifiedName() + + "'"); + */ + } + } + } + + private static interface ResolvedImport + { + public String match(String name); + public boolean mismatch(String name); + public ClassDoc tryFetch(String name); + } + + private class ResolvedImportNotFound + implements ResolvedImport + { + private String importSpecifier; + private String name; + + ResolvedImportNotFound(String importSpecifier) + { + this.importSpecifier = importSpecifier; + int ndx = importSpecifier.lastIndexOf('.'); + if (ndx >= 0) { + this.name = importSpecifier.substring(ndx + 1); + } + else { + this.name = importSpecifier; + } + } + + public String toString() + { + return "ResolvedImportNotFound{" + importSpecifier + "}"; + } + + public String match(String name) + { + if ((name.equals(this.name)) || (importSpecifier.equals(name))) + return this.name; + // FIXME: note that we don't handle on-demand imports here. + return null; + } + + public boolean mismatch(String name) + { + return true; // FIXME! + } + + public ClassDoc tryFetch(String name) + { + return null; + } + } + + private class ResolvedImportPackageFile + implements ResolvedImport + { + private Set topLevelClassNames; + private File packageFile; + private String packageName; + private Map cache = new HashMap(); + + ResolvedImportPackageFile(File packageFile, String packageName) + { + this.packageFile = packageFile; + this.packageName = packageName; + topLevelClassNames = new HashSet(); + File[] files = packageFile.listFiles(); + for (int i=0; i 0) { + innerClassName = topLevelName.substring(ndx + 1); + topLevelName = topLevelName.substring(0, ndx); + } + + if (topLevelClassNames.contains(topLevelName)) { + //System.err.println(this + ".match returns " + packageName + "." + name); + return packageName + "." + name; + } + // FIXME: inner classes + else { + return null; + } + } + } + + public boolean mismatch(String name) + { + return null == match(name); + } + + public ClassDoc tryFetch(String name) + { + ClassDoc loadedClass = classNamed(packageName + "." + name); + if (null != loadedClass) { + return loadedClass; + } + else if (null != match(name)) { + + String topLevelName = name; + int ndx = topLevelName.indexOf('.'); + String innerClassName = null; + if (ndx > 0) { + innerClassName = topLevelName.substring(ndx + 1); + topLevelName = topLevelName.substring(0, ndx); + } + + ClassDoc topLevelClass = (ClassDoc)cache.get(topLevelName); + if (null == topLevelClass) { + File classFile = new File(packageFile, topLevelName + ".java"); + try { + // FIXME: inner classes + topLevelClass = parser.processSourceFile(classFile, false, sourceEncoding, null); + } + catch (Exception ignore) { + printWarning("Could not parse source file " + classFile); + } + cache.put(topLevelName, topLevelClass); + } + if (null == innerClassName) { + return topLevelClass; + } + else { + return getInnerClass(topLevelClass, innerClassName); + } + } + else { + return null; + } + } + + public String toString() + { + return "ResolvedImportPackageFile{" + packageFile + "," + packageName + "}"; + } + } + + private ClassDoc getInnerClass(ClassDoc topLevelClass, String innerClassName) + { + StringTokenizer st = new StringTokenizer(innerClassName, "."); + outer: + + while (st.hasMoreTokens()) { + String innerClassNameComponent = st.nextToken(); + ClassDoc[] innerClasses = topLevelClass.innerClasses(); + for (int i=0; i 0) { + _innerClassName = topLevelName.substring(ndx + 1); + topLevelName = topLevelName.substring(0, ndx); + } + + if (this.name.equals(topLevelName)) { + if (null == _innerClassName) { + return qualifiedName; + } + else { + return qualifiedName + "." + _innerClassName; + } + } + else { + return null; + } + } + + public boolean mismatch(String name) + { + return null == match(name); + } + + public ClassDoc tryFetch(String name) + { + if (null != match(name)) { + ClassDoc topLevelClass = null; + if (alreadyFetched) { + topLevelClass = classDoc; + } + else { + alreadyFetched = true; + try { + topLevelClass = parser.processSourceFile(classFile, false, sourceEncoding, null); + } + catch (Exception ignore) { + printWarning("Could not parse source file " + classFile); + } + } + if (null == topLevelClass) { + return null; + } + else { + return getInnerClass(topLevelClass, innerClassName); + } + } + else { + return null; + } + } + + public String getName() + { + if (innerClassName != null) { + return name + innerClassName; + } + else { + return name; + } + } + } + + private class ResolvedImportReflectionClass + implements ResolvedImport + { + private Class clazz; + private String name; + + ResolvedImportReflectionClass(Class clazz) + { + this.clazz = clazz; + String className = clazz.getName(); + int ndx = className.lastIndexOf('.'); + if (ndx >= 0) { + this.name = className.substring(ndx + 1); + } + else { + this.name = className; + } + } + + public String toString() + { + return "ResolvedImportReflectionClass{" + clazz.getName() + "}"; + } + + public String match(String name) + { + if ((this.name.equals(name)) || (clazz.getName().equals(name))) { + return clazz.getName(); + } + else { + return null; + } + } + + public boolean mismatch(String name) + { + return null == match(name); + } + + public ClassDoc tryFetch(String name) + { + if (null != match(name)) { + return new ClassDocReflectedImpl(clazz); + } + // FIXME: inner classes? + else { + return null; + } + } + + public String getName() + { + return name; + } + } + + private class ResolvedImportReflectionPackage + implements ResolvedImport + { + private String packagePrefix; + + ResolvedImportReflectionPackage(String packagePrefix) + { + this.packagePrefix = packagePrefix; + } + + public String toString() + { + return "ResolvedImportReflectionPackage{" + packagePrefix + ".*}"; + } + + public String match(String name) + { + try { + Class clazz = Class.forName(packagePrefix + "." + name); + return clazz.getName(); + } + catch (Exception e) { + return null; + } + } + + public boolean mismatch(String name) + { + return null == match(name); + } + + public ClassDoc tryFetch(String name) + { + try { + Class clazz = Class.forName(packagePrefix + name); + return ClassDocReflectedImpl.newInstance(clazz); + } + catch (Exception e) { + return null; + } + } + + public String getName() + { + return packagePrefix; + } + } + + private List unlocatablePrefixes = new LinkedList(); + + private ResolvedImport resolveImport(String importSpecifier) + { + ResolvedImport result = resolveImportFileSystem(importSpecifier); + if (null == result && Main.getInstance().isReflectionEnabled()) { + result = resolveImportReflection(importSpecifier); + } + if (null == result) { + result = new ResolvedImportNotFound(importSpecifier); + } + return result; + } + + private ResolvedImport resolveImportReflection(String importSpecifier) + { + String importedPackageOrClass = importSpecifier; + if (importedPackageOrClass.endsWith(".*")) { + importedPackageOrClass = importedPackageOrClass.substring(0, importedPackageOrClass.length() - 2); + + return new ResolvedImportReflectionPackage(importedPackageOrClass); + + //return null; + } + else { + try { + Class importedClass = Class.forName(importSpecifier); + return new ResolvedImportReflectionClass(importedClass); + } + catch (Throwable ignore) { + return null; + } + } + } + + private ResolvedImport resolveImportFileSystem(String importSpecifier) + { + for (Iterator it = unlocatablePrefixes.iterator(); it.hasNext(); ) { + String unlocatablePrefix = (String)it.next(); + if (importSpecifier.startsWith(unlocatablePrefix)) { + return null; + } + } + + String longestUnlocatablePrefix = ""; + + for (Iterator it=sourcePath.iterator(); it.hasNext(); ) { + + File _sourcePath = (File)it.next(); + + StringBuffer packageOrClassPrefix = new StringBuffer(); + StringTokenizer st = new StringTokenizer(importSpecifier, "."); + while (st.hasMoreTokens() && _sourcePath.isDirectory()) { + String token = st.nextToken(); + if ("*".equals(token)) { + return new ResolvedImportPackageFile(_sourcePath, + packageOrClassPrefix.substring(0, packageOrClassPrefix.length() - 1)); + } + else { + packageOrClassPrefix.append(token); + packageOrClassPrefix.append('.'); + File classFile = new File(_sourcePath, token + ".java"); + //System.err.println(" looking for file " + classFile); + if (classFile.exists()) { + StringBuffer innerClassName = new StringBuffer(); + while (st.hasMoreTokens()) { + token = st.nextToken(); + if (innerClassName.length() > 0) { + innerClassName.append('.'); + } + innerClassName.append(token); + } + return new ResolvedImportClassFile(classFile, innerClassName.toString(), token, importSpecifier); + } + else { + _sourcePath = new File(_sourcePath, token); + } + } + } + if (st.hasMoreTokens()) { + if (packageOrClassPrefix.length() > longestUnlocatablePrefix.length()) { + longestUnlocatablePrefix = packageOrClassPrefix.toString(); + } + } + } + + if (longestUnlocatablePrefix.length() > 0) { + unlocatablePrefixes.add(longestUnlocatablePrefix); + } + + return null; + } + + private Map resolvedImportCache = new HashMap(); + + private ResolvedImport getResolvedImport(String importSpecifier) + { + ResolvedImport result + = (ResolvedImport)resolvedImportCache.get(importSpecifier); + if (null == result) { + result = resolveImport(importSpecifier); + resolvedImportCache.put(importSpecifier, result); + } + return result; + } + + public String resolveClassName(String className, ClassDocImpl context) + { + Iterator it = context.getImportSpecifierList().iterator(); + while (it.hasNext()) { + String importSpecifier = (String)it.next(); + ResolvedImport resolvedImport = getResolvedImport(importSpecifier); + String resolvedScheduledClassName = resolvedImport.match(className); + + if (null != resolvedScheduledClassName) { + return resolvedScheduledClassName; + } + } + return className; + } + + public ClassDoc findScheduledClassFile(String scheduledClassName, + ClassDoc scheduledClassContext) + throws ParseException, IOException + { + String resolvedScheduledClassName = null; + + if (scheduledClassContext instanceof ClassDocImpl) { + + //((ClassDocImpl)scheduledClassContext).resolveReferencedName(scheduledClassName); + Iterator it = ((ClassDocImpl)scheduledClassContext).getImportSpecifierList().iterator(); + while (it.hasNext()) { + String importSpecifier = (String)it.next(); + ResolvedImport resolvedImport = getResolvedImport(importSpecifier); + //System.err.println(" looking in import '" + resolvedImport + "'"); + resolvedScheduledClassName = resolvedImport.match(scheduledClassName); + if (null != resolvedScheduledClassName) { + ClassDoc result = resolvedImport.tryFetch(scheduledClassName); + if (null != result) { + return result; + } + else { + if (!inaccessibleReportedSet.contains(scheduledClassName)) { + inaccessibleReportedSet.add(scheduledClassName); + printWarning("Error while loading class " + scheduledClassName); + } + // FIXME: output resolved class name here + return null; + } + } + } + } + else { + System.err.println("findScheduledClassFile for '" + scheduledClassName + "' in proxy for " + scheduledClassContext); + } + + // interpret as fully qualified name on file system + + ResolvedImport fqImport = resolveImportFileSystem(scheduledClassName); + if (null != fqImport && fqImport instanceof ResolvedImportClassFile) { + return fqImport.tryFetch(((ResolvedImportClassFile)fqImport).getName()); + } + + // use reflection, assume fully qualified class name + + if (!unlocatableReflectedClassNames.contains(scheduledClassName)) { + if (Main.getInstance().isReflectionEnabled()) { + try { + Class clazz = Class.forName(scheduledClassName); + printWarning("Cannot locate class " + scheduledClassName + " on file system, falling back to reflection."); + ClassDoc result = new ClassDocReflectedImpl(clazz); + return result; + } + catch (Throwable ignore) { + unlocatableReflectedClassNames.add(scheduledClassName); + } + } + else { + unlocatableReflectedClassNames.add(scheduledClassName); + } + } + + if (null == resolvedScheduledClassName) { + resolvedScheduledClassName = scheduledClassName; + } + if (!unlocatableReportedSet.contains(resolvedScheduledClassName)) { + unlocatableReportedSet.add(resolvedScheduledClassName); + printWarning("Cannot locate class " + resolvedScheduledClassName + " referenced in class " + scheduledClassContext.qualifiedName()); + } + return null; + } + + private Set unlocatableReflectedClassNames = new HashSet(); + + public static boolean recursiveClasses = false; + + public void addSpecifiedPackageName(String packageName) { + specifiedPackageNames.add(packageName); + } + + public void addSpecifiedSourceFile(File sourceFile) { + specifiedSourceFiles.add(sourceFile); + } + + public boolean hasSpecifiedPackagesOrClasses() { + return !specifiedPackageNames.isEmpty() + || !specifiedSourceFiles.isEmpty(); + } + + public void setOptions(String[][] customOptionArr) { + this.customOptionArr = customOptionArr; + } + + public void setSourcePath(List sourcePath) { + this.sourcePath = sourcePath; + } + + public void finalize() throws Throwable { + super.finalize(); + } + + public void flush() + { + try { + rawCommentCache.close(); + } + catch (IOException e) { + printError("Cannot close raw comment cache"); + } + + rawCommentCache = null; + customOptionArr = null; + specifiedPackageNames = null; + classesList = null; + classDocMap = null; + packageDocMap = null; + classes = null; + specifiedClasses = null; + specifiedPackages = null; + scheduledClasses = null; + sourcePath = null; + parser = null; + unlocatableReportedSet = null; + inaccessibleReportedSet = null; + } + + public void setSourceEncoding(String sourceEncoding) + { + this.sourceEncoding = sourceEncoding; + } + + public RootDocImpl() + { + super(null); + } + + public static String readHtmlBody(File file) + throws IOException + { + FileReader fr=new FileReader(file); + long size = file.length(); + char[] packageDocBuf=new char[(int)(size)]; + int index = 0; + int i = fr.read(packageDocBuf, index, (int)size); + while (i > 0) { + index += i; + size -= i; + i = fr.read(packageDocBuf, index, (int)size); + } + fr.close(); + + // We only need the part between the begin and end body tag. + String html = new String(packageDocBuf); + int start = html.indexOf(""); + if (end == -1) + end = html.indexOf(""); + if (start != -1 && end != -1) { + // Start is end of body tag. + start = html.indexOf('>', start) + 1; + if (start != -1 && start < end) + html = html.substring(start, end); + } + return html.trim(); + } + + public Parser getParser() + { + return parser; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/SeeTagImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/SeeTagImpl.java new file mode 100644 index 00000000000..f126c21aec3 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/SeeTagImpl.java @@ -0,0 +1,198 @@ +/* gnu.classpath.tools.gjdoc.SeeTagImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; +import java.text.*; + +public class SeeTagImpl extends AbstractTagImpl implements SeeTag { + + protected String reference; + private String referencedClassName; + private String referencedMemberName; + private ClassDoc referencedClass; + private MemberDoc referencedMember; + private PackageDoc referencedPackage; + private String label; + private ClassDocImpl contextClass; + + public SeeTagImpl(String text, ClassDocImpl contextClass) { + super(text); + this.contextClass=contextClass; + } + + public void resolve() { + + super.resolve(); + + text = text.trim(); + + if (text.startsWith("<") || text.startsWith("\"")) { + label = text; + return; + } + + int labelNdx=text.indexOf(';'); + if (labelNdx>=0) { + label=""; + return; + } + + for (int i=0; i= 0) { + labelNdx = i; + break; + } + } + + int openParenNdx = text.indexOf('('); + if (openParenNdx >= 0 && openParenNdx < labelNdx) { + labelNdx=text.indexOf(')', openParenNdx); + if (labelNdx >= 0) { + ++ labelNdx; + } + } + + if (labelNdx<0 || labelNdx>=text.length()) { + reference=text.trim(); + label=""; + } + else { + reference=text.substring(0,labelNdx).trim(); + label=text.substring(labelNdx).trim(); + } + + int mspecNdx=reference.indexOf('#'); + String referencedFqName; + if (mspecNdx<0) { + referencedFqName=reference; + } + else { + referencedFqName=reference.substring(0,mspecNdx); + referencedMemberName=reference.substring(mspecNdx+1); + } + + // the following is in contradiction to the api docs, but + // conform to sun javadoc: return fully qualified classname + // with referencedClassName(). + if (referencedFqName.trim().length()>0) { + referencedClassName=referencedFqName; + if (contextClass==null) + referencedClass=Main.getRootDoc().classNamed(referencedFqName); + else + referencedClass=contextClass.findClass(referencedFqName); + } + else { + referencedClassName=""; + referencedClass=contextClass; + } + + if (referencedClass==null) { + referencedClass = Main.getRootDoc().classNamed("java.lang." + referencedFqName); + } + + if (referencedClass!=null && !referencedClass.isIncluded()) referencedClass=null; + + if (referencedClass!=null) { + referencedPackage=referencedClass.containingPackage(); + referencedClassName=referencedClass.qualifiedName(); + + if (referencedMemberName!=null) { + + if (referencedMemberName.indexOf('(')<0) { + referencedMember=((ClassDocImpl)referencedClass).findFieldRec(referencedMemberName); + if (null == referencedMember) { + MethodDoc[] methods = ((ClassDocImpl)referencedClass).methods(); + for (int i=0; i + * + * Consider the following problem: + *
+ *   public class A {
+ *     public static void foo() {
+ *       long[] hugeArray = new long[1000000]; // takes around 8 MB
+ *       // ... fill hugeArray with some information ...
+ *       bar(hugeArray);
+ *       // ... hugeArray is no more required at this point
+ *     }
+ *     public static void bar(long[] arr) {
+ *       // ... process contents of arr ...
+ *       arr = null;
+ *       System.gc();      // NOTE: will not collect arr!
+ *       // ... do something memory-intensive where arr is not needed
+ *     }
+ *  }
+ *  
+ * + * In method bar(), the array cannot be garbage + * collected because the local variable hugeArray in + * method foo() still holds a reference to the array. + *

+ * + * When calling bar(new long[1000000]); in + * arr the array can be collected in + * bar(), but that way it can't be initialized in + * foo(). A local variable is needed for + * initialization, but the variable can't be cleared before it is + * passed to bar()!

+ * + * TemporaryStore is the solution for this + * dilemma. The modified method foo() which uses a + * TemporaryStore object would look like this: + * + *

+ *     public static void foo() {
+ *       long[] hugeArray = new long[1000000]; // takes around 7 MB
+ *       // ... fill hugeArray with some very important information ...
+ *       TemporaryStore tstore = new TemporaryStore(hugeArray);
+ *       hugeArray = null;
+ *       bar((long[])tstore.getAndClear());
+ *     }
+ *  
+ * + * When control flow is transferred to bar(), + * foo() will hold no more references to the array + * and so it can be garbage collected in bar(). + * + */ +public class TemporaryStore { + + private Object storedObject; + + /** + * Temporarily store the given object for passing it to a + * different method.

+ * + * The method constructing a new TemporaryStore object should + * clear all other references to the stored object, so that + * this TemporaryStore is the only object referencing it. + * + * @param storedObject the object to store temporarily + * + */ + public TemporaryStore(Object storedObject) { + this.storedObject = storedObject; + } + + /** + * Return the stored object after clearing the reference to it. + *

+ * + * When the user of this class followed the recommendations in + * the documentation of @link{TemporaryStore(Object)}, the + * returned reference will be the only reference to the stored + * object after this method returns. If the returned reference + * is passed in a method call, the called method will hold the + * only reference to the stored object and can release it by + * nulling the corresponding parameter. + * + * @return the object which was passed to the constructor. + * + */ + public Object getAndClear() { + Object rc = this.storedObject; + this.storedObject = null; + return rc; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/TextTagImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/TextTagImpl.java new file mode 100644 index 00000000000..6d7ee820c8a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/TextTagImpl.java @@ -0,0 +1,39 @@ +/* gnu.classpath.tools.gjdoc.TextTagImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; + +public class TextTagImpl extends AbstractTagImpl implements Tag { + + TextTagImpl(String text) { + super(text); + } + + public Tag[] firstSentenceTags() { return new Tag[]{this}; } + public Tag[] inlineTags() { return new Tag[]{this}; } + public String kind() { return "Text"; } + + public String toString() { return "TextTagImpl{text=" + text + "}"; } + + public String getText() { return text; } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ThrowsTagImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ThrowsTagImpl.java new file mode 100644 index 00000000000..df0091de08a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ThrowsTagImpl.java @@ -0,0 +1,88 @@ +/* gnu.classpath.tools.gjdoc.ThrowsTagImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; +import java.text.*; + +public class ThrowsTagImpl extends AbstractTagImpl implements ThrowsTag { + + private ClassDoc exception; + private String exceptionName; + private String exceptionComment; + + public ThrowsTagImpl(String text, + ClassDocImpl contextClass, + MemberDocImpl contextMember) { + super(text); + + char[] textarr=text.toCharArray(); + int i=0; + for (; i= 0 || typeName.indexOf(']') >= 0) { + throw new RuntimeException("Typename must not contain dimension information."); + } + } + + public ClassDoc asClassDoc() { + + if (this instanceof ClassDoc) + return ((ClassDocImpl)(ClassDoc)this).getBaseClassDoc(); + else + return null; + } + + public String typeName() { return typeName; } + + public String qualifiedTypeName() { return (packageName!=null)?(packageName+"."+typeName):(typeName); } + + public String dimension() { return dimension; } + public void setDimension(String dimension) { this.dimension = dimension; } + + public String toString() { return "Type{"+qualifiedTypeName()+dimension()+"}"; } + + public Object clone() throws CloneNotSupportedException { + return super.clone(); + } + + public boolean isPrimitive() + { + return null == packageName && primitiveNames.contains(typeName); + } + + private static final Set primitiveNames; + static { + Set _primitiveNames = new HashSet(); + _primitiveNames.add("boolean"); + _primitiveNames.add("char"); + _primitiveNames.add("byte"); + _primitiveNames.add("short"); + _primitiveNames.add("int"); + _primitiveNames.add("long"); + _primitiveNames.add("float"); + _primitiveNames.add("double"); + primitiveNames = Collections.unmodifiableSet(_primitiveNames); + } + + public TypeVariable asTypeVariable() + { + if (this instanceof TypeVariable) + return (TypeVariable) this; + else + return null; + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/TypeVariableImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/TypeVariableImpl.java new file mode 100644 index 00000000000..4524ab169bf --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/TypeVariableImpl.java @@ -0,0 +1,91 @@ +/* gnu.classpath.tools.gjdoc.TypeVariableImpl + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.ProgramElementDoc; +import com.sun.javadoc.Type; +import com.sun.javadoc.TypeVariable; + +import java.util.List; + +public class TypeVariableImpl + extends TypeImpl + implements TypeVariable, WritableType +{ + + /** + * The bounds of this particular type variable. + */ + Type[] bounds; + + /** + * The owning program element of this type variable. + */ + ProgramElementDoc owner; + + /** + * Constructs a new type variable with the supplied name and owner. + * + * @param packageName the name of the package containing the type variable. + * @param typeName the name of the type variable. + * @param dimension the dimensions of the type variable (always ""). + * @param owner the owning program element of the type variable. + */ + TypeVariableImpl(String packageName, String typeName, String dimension, + ProgramElementDoc owner) + { + super(packageName, typeName, dimension); + this.owner = owner; + } + + /** + * Set the bounds to the contents of the supplied list. + * + * @param parsedBounds a list of type bounds. + */ + void setBounds(List parsedBounds) + { + bounds = (Type[]) parsedBounds.toArray(new Type[parsedBounds.size()]); + } + + /** + * Returns the bounds of this type variable. + * + * @return the bounds of the variable. + */ + public Type[] bounds() + { + return bounds; + } + + /** + * Returns the owning program element for this type variable. + * + * @return the owning program element, whether a class, interface, + * constructor or method. + */ + public ProgramElementDoc owner() + { + return owner; + } + + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ValueTagImpl.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ValueTagImpl.java new file mode 100644 index 00000000000..8f0ba79e6ee --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/ValueTagImpl.java @@ -0,0 +1,48 @@ +/* gnu.classpath.tools.gjdoc.ValueTagImpl + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +import com.sun.javadoc.*; +import java.util.*; +import java.text.*; + +public class ValueTagImpl extends SeeTagImpl { + + public ValueTagImpl(String _text, ClassDocImpl contextClass) { + super(_text, contextClass); + } + + public String name() { return "@value"; } + + public Tag[] firstSentenceTags() { + return inlineTags(); + } + + public Tag[] inlineTags() { + if (null != reference && reference.trim().length() > 0) { + return new Tag[] { new TextTagImpl(reference) }; + } + else { + return new Tag[0]; + } + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/WritableType.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/WritableType.java new file mode 100644 index 00000000000..6293602b881 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/WritableType.java @@ -0,0 +1,27 @@ +/* gnu.classpath.tools.gjdoc.WritableType + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc; + +public interface WritableType extends Cloneable { + + public void setDimension(String dimension); + public Object clone() throws CloneNotSupportedException; +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AdditionExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AdditionExpression.java new file mode 100644 index 00000000000..bf9e3ff1c5c --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AdditionExpression.java @@ -0,0 +1,69 @@ +/* gnu.classpath.tools.gjdoc.expr.AdditionExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class AdditionExpression + extends BinaryComputationExpression +{ + public AdditionExpression(Expression left, Expression right) + { + super(left, right); + } + + protected double compute(double leftValue, double rightValue) + { + return leftValue + rightValue; + } + + protected float compute(float leftValue, float rightValue) + { + return leftValue + rightValue; + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue + rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue + rightValue; + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression leftValue = left.evaluate(context); + ConstantExpression rightValue = right.evaluate(context); + + if (Type.STRING == leftValue.getType() + || Type.STRING == rightValue.getType()) { + + return new ConstantString(leftValue.asObject().toString() + + rightValue.asObject().toString()); + } + else { + return super.evaluate(leftValue, rightValue); + } + + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AndExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AndExpression.java new file mode 100644 index 00000000000..9e9e13c99f2 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/AndExpression.java @@ -0,0 +1,40 @@ +/* gnu.classpath.tools.gjdoc.expr.AndExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class AndExpression + extends BinaryBitwiseExpression +{ + public AndExpression(Expression left, Expression right) + { + super(left, right); + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue & rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue & rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.java new file mode 100644 index 00000000000..4b0a993e5ef --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryBitwiseExpression.java @@ -0,0 +1,51 @@ +/* gnu.classpath.tools.gjdoc.expr.BinaryBitwiseExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class BinaryBitwiseExpression + extends BinaryExpression +{ + protected BinaryBitwiseExpression(Expression left, Expression right) + { + super(left, right); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression leftValue = left.evaluate(context); + ConstantExpression rightValue = right.evaluate(context); + + if (Type.LONG == leftValue.getType() + || Type.LONG == rightValue.getType()) { + + return new ConstantLong(compute(leftValue.asNumber().longValue(), + rightValue.asNumber().longValue())); + } + else { + return new ConstantInteger(compute(leftValue.asNumber().intValue(), + rightValue.asNumber().intValue())); + } + } + + protected abstract long compute(long leftValue, long rightValue); + protected abstract int compute(int leftValue, int rightValue); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.java new file mode 100644 index 00000000000..97cdf221eb2 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryComputationExpression.java @@ -0,0 +1,75 @@ +/* gnu.classpath.tools.gjdoc.expr.BinaryComputationExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class BinaryComputationExpression + extends BinaryExpression +{ + protected BinaryComputationExpression(Expression left, Expression right) + { + super(left, right); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression leftValue = left.evaluate(context); + ConstantExpression rightValue = right.evaluate(context); + + return evaluate(leftValue, rightValue); + } + + protected ConstantExpression evaluate(ConstantExpression leftValue, + ConstantExpression rightValue) + throws IllegalExpressionException + { + if (Type.DOUBLE == leftValue.getType() + || Type.DOUBLE == rightValue.getType()) { + + return new ConstantDouble(compute(leftValue.asNumber().doubleValue(), + rightValue.asNumber().doubleValue())); + } + else if (Type.FLOAT == leftValue.getType() + || Type.FLOAT == rightValue.getType()) { + + return new ConstantFloat(compute(leftValue.asNumber().floatValue(), + rightValue.asNumber().floatValue())); + } + else if (Type.LONG == leftValue.getType() + || Type.LONG == rightValue.getType()) { + + return new ConstantLong(compute(leftValue.asNumber().longValue(), + rightValue.asNumber().longValue())); + } + else if (leftValue.isNumber() && rightValue.isNumber()) { + return new ConstantInteger(compute(leftValue.asNumber().intValue(), + rightValue.asNumber().intValue())); + } + else { + throw new IllegalExpressionException("Operator ? cannot be applied to " + leftValue.getType() + "," + rightValue.getType()); + } + } + + protected abstract double compute(double leftValue, double rightValue); + protected abstract float compute(float leftValue, float rightValue); + protected abstract long compute(long leftValue, long rightValue); + protected abstract int compute(int leftValue, int rightValue); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.java new file mode 100644 index 00000000000..27fe2cf1f22 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryEqualityExpression.java @@ -0,0 +1,72 @@ +/* gnu.classpath.tools.gjdoc.expr.BinaryEqualityExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class BinaryEqualityExpression + extends BinaryExpression +{ + protected BinaryEqualityExpression(Expression left, Expression right) + { + super(left, right); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression leftValue = left.evaluate(context); + ConstantExpression rightValue = right.evaluate(context); + + if (Type.DOUBLE == leftValue.getType() + || Type.DOUBLE == rightValue.getType()) { + + return new ConstantBoolean(compute(leftValue.asNumber().doubleValue(), + rightValue.asNumber().doubleValue())); + } + else if (Type.FLOAT == leftValue.getType() + || Type.FLOAT == rightValue.getType()) { + + return new ConstantBoolean(compute(leftValue.asNumber().floatValue(), + rightValue.asNumber().floatValue())); + } + else if (Type.LONG == leftValue.getType() + || Type.LONG == rightValue.getType()) { + + return new ConstantBoolean(compute(leftValue.asNumber().longValue(), + rightValue.asNumber().longValue())); + } + else if (Type.BOOLEAN == leftValue.getType() + && Type.BOOLEAN == rightValue.getType()) { + + return new ConstantBoolean(compute(((ConstantBoolean)leftValue).booleanValue(), + ((ConstantBoolean)rightValue).booleanValue())); + } + else { + return new ConstantBoolean(compute(leftValue.asNumber().intValue(), + rightValue.asNumber().intValue())); + } + } + + protected abstract boolean compute(double leftValue, double rightValue); + protected abstract boolean compute(float leftValue, float rightValue); + protected abstract boolean compute(long leftValue, long rightValue); + protected abstract boolean compute(int leftValue, int rightValue); + protected abstract boolean compute(boolean leftValue, boolean rightValue); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryExpression.java new file mode 100644 index 00000000000..e44551d059e --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryExpression.java @@ -0,0 +1,34 @@ +/* gnu.classpath.tools.gjdoc.expr.BinaryExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class BinaryExpression + implements Expression +{ + protected Expression left; + protected Expression right; + + protected BinaryExpression(Expression left, Expression right) + { + this.left = left; + this.right = right; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.java new file mode 100644 index 00000000000..00bbfccbcad --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryLogicalExpression.java @@ -0,0 +1,47 @@ +/* gnu.classpath.tools.gjdoc.expr.BinaryLogicalExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class BinaryLogicalExpression + extends BinaryExpression +{ + protected BinaryLogicalExpression(Expression left, Expression right) + { + super(left, right); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression leftValue = left.evaluate(context); + ConstantExpression rightValue = right.evaluate(context); + + if (leftValue.getType() != Type.BOOLEAN || rightValue.getType() != Type.BOOLEAN) { + throw new IllegalExpressionException("logical expression expects boolean subexpressions"); + } + else { + return new ConstantBoolean(compute(((ConstantBoolean)leftValue).booleanValue(), + ((ConstantBoolean)rightValue).booleanValue())); + } + } + + protected abstract boolean compute(boolean leftValue, boolean rightValue); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.java new file mode 100644 index 00000000000..91c4441ca3a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryRelationExpression.java @@ -0,0 +1,65 @@ +/* gnu.classpath.tools.gjdoc.expr.BinaryRelationExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class BinaryRelationExpression + extends BinaryExpression +{ + protected BinaryRelationExpression(Expression left, Expression right) + { + super(left, right); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression leftValue = left.evaluate(context); + ConstantExpression rightValue = right.evaluate(context); + + if (Type.DOUBLE == leftValue.getType() + || Type.DOUBLE == rightValue.getType()) { + + return new ConstantBoolean(compute(leftValue.asNumber().doubleValue(), + rightValue.asNumber().doubleValue())); + } + else if (Type.FLOAT == leftValue.getType() + || Type.FLOAT == rightValue.getType()) { + + return new ConstantBoolean(compute(leftValue.asNumber().floatValue(), + rightValue.asNumber().floatValue())); + } + else if (Type.LONG == leftValue.getType() + || Type.LONG == rightValue.getType()) { + + return new ConstantBoolean(compute(leftValue.asNumber().longValue(), + rightValue.asNumber().longValue())); + } + else { + return new ConstantBoolean(compute(leftValue.asNumber().intValue(), + rightValue.asNumber().intValue())); + } + } + + protected abstract boolean compute(double leftValue, double rightValue); + protected abstract boolean compute(float leftValue, float rightValue); + protected abstract boolean compute(long leftValue, long rightValue); + protected abstract boolean compute(int leftValue, int rightValue); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.java new file mode 100644 index 00000000000..a5eac4d98e7 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BinaryShiftExpression.java @@ -0,0 +1,49 @@ +/* gnu.classpath.tools.gjdoc.expr.BinaryShiftExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class BinaryShiftExpression + extends BinaryExpression +{ + protected BinaryShiftExpression(Expression left, Expression right) + { + super(left, right); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression leftValue = left.evaluate(context); + ConstantExpression rightValue = right.evaluate(context); + + if (Type.LONG == leftValue.getType()) { + return new ConstantLong(compute(leftValue.asNumber().longValue(), + rightValue.asNumber().intValue())); + } + else { + return new ConstantInteger(compute(leftValue.asNumber().intValue(), + rightValue.asNumber().intValue())); + } + } + + protected abstract long compute(long leftValue, int rightValue); + protected abstract int compute(int leftValue, int rightValue); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.java new file mode 100644 index 00000000000..503421ed4d1 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/BitShiftRightExpression.java @@ -0,0 +1,40 @@ +/* gnu.classpath.tools.gjdoc.expr.BitShiftRightExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class BitShiftRightExpression + extends BinaryShiftExpression +{ + public BitShiftRightExpression(Expression left, Expression right) + { + super(left, right); + } + + protected long compute(long leftValue, int rightValue) + { + return leftValue >>> rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue >>> rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.java new file mode 100644 index 00000000000..b745de41a27 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/CircularExpressionException.java @@ -0,0 +1,35 @@ +/* gnu.classpath.tools.gjdoc.expr.IllegalExpressionException + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +public class CircularExpressionException + extends IllegalExpressionException +{ + public CircularExpressionException(String message) + { + super(message); + } + + public CircularExpressionException(Throwable cause) + { + super(cause); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.java new file mode 100644 index 00000000000..e4f86f65747 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConditionalExpression.java @@ -0,0 +1,57 @@ +/* gnu.classpath.tools.gjdoc.expr.ConditionalExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConditionalExpression + implements Expression +{ + private Expression condition; + private Expression ifTrue; + private Expression ifFalse; + + ConditionalExpression(Expression condition, Expression ifTrue, Expression ifFalse) + { + this.condition = condition; + this.ifTrue = ifTrue; + this.ifFalse = ifFalse; + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression conditionValue = condition.evaluate(context); + ConstantExpression ifTrueValue = ifTrue.evaluate(context); + ConstantExpression ifFalseValue = ifFalse.evaluate(context); + + if (Type.BOOLEAN != conditionValue.getType()) { + throw new IllegalExpressionException("condition must be boolean"); + } + else { + boolean cond = ((ConstantBoolean)conditionValue).booleanValue(); + if (cond) { + return ifTrueValue; + } + else { + return ifFalseValue; + } + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.java new file mode 100644 index 00000000000..4ef75c642d7 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantBoolean.java @@ -0,0 +1,67 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantBoolean + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantBoolean + extends ConstantExpression +{ + private boolean value; + + public ConstantBoolean(String stringValue) + { + this.value = "true".equals(stringValue); + } + + public ConstantBoolean(boolean booleanValue) + { + this.value = booleanValue; + } + + public boolean booleanValue() + { + return value; + } + + public Type getType() + { + return Type.BOOLEAN; + } + + public Number asNumber() + { + return null; + } + + public boolean isNumber() + { + return true; + } + + public Object asObject() + { + return new Boolean(value); + } + + public String toString() + { + return Boolean.toString(value); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantByte.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantByte.java new file mode 100644 index 00000000000..bbe30b29568 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantByte.java @@ -0,0 +1,57 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantByte + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantByte + extends ConstantExpression +{ + private byte value; + + public ConstantByte(byte byteValue) + { + this.value = byteValue; + } + + public Type getType() + { + return Type.BYTE; + } + + public Number asNumber() + { + return new Byte(value); + } + + public boolean isNumber() + { + return true; + } + + public Object asObject() + { + return asNumber(); + } + + public String toString() + { + return Byte.toString(value); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantChar.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantChar.java new file mode 100644 index 00000000000..56d32308336 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantChar.java @@ -0,0 +1,81 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantChar + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantChar + extends ConstantExpression +{ + private char value; + + public ConstantChar(String stringValue) + { + this.value = stringValue.charAt(1); // FIXME + if (value == '\\') { + switch (stringValue.charAt(2)) { + case 'n': value = '\n'; break; + case 't': value = '\t'; break; + case 'f': value = '\f'; break; + case 'r': value = '\r'; break; + case 'b': value = '\b'; break; + case 'u': + { + String stringVal = stringValue.substring(3, stringValue.length() - 1); + /* + while (stringVal.length() > 1 && stringVal.charAt(0) == '0') { + stringVal = stringVal.substring(1); + } + */ + value = (char)Integer.parseInt(stringVal, 16); break; + } + } + } + } + + public ConstantChar(char charValue) + { + this.value = charValue; + } + + public Type getType() + { + return Type.CHAR; + } + + public Number asNumber() + { + return new Integer((int)value); + } + + public Object asObject() + { + return new Character(value); + } + + public boolean isNumber() + { + return true; + } + + public String toString() + { + return Character.toString(value); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantDouble.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantDouble.java new file mode 100644 index 00000000000..ad9709277a7 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantDouble.java @@ -0,0 +1,62 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantDouble + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantDouble + extends ConstantExpression +{ + private double value; + + public ConstantDouble(String stringValue) + { + this.value = Double.parseDouble(stringValue); + } + + public ConstantDouble(double doubleValue) + { + this.value = doubleValue; + } + + public Type getType() + { + return Type.DOUBLE; + } + + public Number asNumber() + { + return new Double(value); + } + + public boolean isNumber() + { + return true; + } + + public Object asObject() + { + return asNumber(); + } + + public String toString() + { + return Double.toString(value); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantExpression.java new file mode 100644 index 00000000000..3078b4c585c --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantExpression.java @@ -0,0 +1,35 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class ConstantExpression + implements Expression +{ + public abstract Type getType(); + public abstract Number asNumber(); + public abstract Object asObject(); + public abstract boolean isNumber(); + + public ConstantExpression evaluate(Context context) + { + return this; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantFloat.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantFloat.java new file mode 100644 index 00000000000..cf378dba4f8 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantFloat.java @@ -0,0 +1,62 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantFloat + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantFloat + extends ConstantExpression +{ + private float value; + + public ConstantFloat(String stringValue) + { + this.value = Float.parseFloat(stringValue); + } + + public ConstantFloat(float floatValue) + { + this.value = floatValue; + } + + public Type getType() + { + return Type.FLOAT; + } + + public Number asNumber() + { + return new Float(value); + } + + public boolean isNumber() + { + return true; + } + + public Object asObject() + { + return asNumber(); + } + + public String toString() + { + return "ConstantFloat{" + value + "}"; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantInteger.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantInteger.java new file mode 100644 index 00000000000..56217cc02d4 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantInteger.java @@ -0,0 +1,62 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantInteger + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantInteger + extends ConstantExpression +{ + private long value; + + public ConstantInteger(String stringValue) + { + this.value = Evaluator.parseLong(stringValue); + } + + public ConstantInteger(int integerValue) + { + this.value = integerValue; + } + + public Type getType() + { + return Type.INTEGER; + } + + public Number asNumber() + { + return new Long(value); + } + + public boolean isNumber() + { + return true; + } + + public Object asObject() + { + return new Integer((int)value); + } + + public String toString() + { + return Long.toString(value); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantLong.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantLong.java new file mode 100644 index 00000000000..bfc1a0ad39e --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantLong.java @@ -0,0 +1,67 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantLong + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantLong + extends ConstantExpression +{ + private long value; + + public ConstantLong(String stringValue) + { + if ('l' == Character.toLowerCase(stringValue.charAt(stringValue.length() - 1))) { + this.value = Evaluator.parseLong(stringValue.substring(0, stringValue.length() - 1)); + } + else { + this.value = Evaluator.parseInt(stringValue.substring(0, stringValue.length() - 1)); + } + } + + public ConstantLong(long longValue) + { + this.value = longValue; + } + + public Type getType() + { + return Type.LONG; + } + + public Number asNumber() + { + return new Long(value); + } + + public boolean isNumber() + { + return true; + } + + public Object asObject() + { + return asNumber(); + } + + public String toString() + { + return Long.toString(value); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantNull.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantNull.java new file mode 100644 index 00000000000..23f9659076b --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantNull.java @@ -0,0 +1,49 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantNull + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantNull + extends ConstantExpression +{ + public ConstantNull() + { + } + + public Type getType() + { + return Type.NULL; + } + + public Number asNumber() + { + return null; + } + + public boolean isNumber() + { + return false; + } + + public Object asObject() + { + return null; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantShort.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantShort.java new file mode 100644 index 00000000000..acd020de2bb --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantShort.java @@ -0,0 +1,57 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantShort + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantShort + extends ConstantExpression +{ + private short value; + + public ConstantShort(short shortValue) + { + this.value = shortValue; + } + + public Type getType() + { + return Type.SHORT; + } + + public Number asNumber() + { + return new Short(value); + } + + public boolean isNumber() + { + return true; + } + + public Object asObject() + { + return asNumber(); + } + + public String toString() + { + return Short.toString(value); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantString.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantString.java new file mode 100644 index 00000000000..847e2951a1a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ConstantString.java @@ -0,0 +1,58 @@ +/* gnu.classpath.tools.gjdoc.expr.ConstantString + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ConstantString + extends ConstantExpression +{ + private String value; + + public ConstantString(String value) + { + this.value = value; + } + + public Type getType() + { + return Type.STRING; + } + + public Number asNumber() + { + return null; + } + + public boolean isNumber() + { + return false; + } + + public Object asObject() + { + return value; + } + + public String toString() + { + return value; + } +} + diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Context.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Context.java new file mode 100644 index 00000000000..99093f7cb0c --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Context.java @@ -0,0 +1,45 @@ +/* gnu.classpath.tools.gjdoc.expr.Context + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +import java.util.Set; + +class Context +{ + private EvaluatorEnvironment evaluatorEnvironment; + private Set visitedFields; + + Context(EvaluatorEnvironment evaluatorEnvironment, Set visitedFields) + { + this.evaluatorEnvironment = evaluatorEnvironment; + this.visitedFields = visitedFields; + } + + public EvaluatorEnvironment getEvaluatorEnvironment() + { + return evaluatorEnvironment; + } + + public Set getVisitedFields() + { + return visitedFields; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/DivisionExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/DivisionExpression.java new file mode 100644 index 00000000000..baaf65de642 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/DivisionExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.DivisionExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class DivisionExpression + extends BinaryComputationExpression +{ + public DivisionExpression(Expression left, Expression right) + { + super(left, right); + } + + protected double compute(double leftValue, double rightValue) + { + return leftValue / rightValue; + } + + protected float compute(float leftValue, float rightValue) + { + return leftValue / rightValue; + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue / rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue / rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EqualExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EqualExpression.java new file mode 100644 index 00000000000..c31ff884f73 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EqualExpression.java @@ -0,0 +1,55 @@ +/* gnu.classpath.tools.gjdoc.expr.EqualExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class EqualExpression + extends BinaryEqualityExpression +{ + public EqualExpression(Expression left, Expression right) + { + super(left, right); + } + + protected boolean compute(double leftValue, double rightValue) + { + return leftValue == rightValue; + } + + protected boolean compute(float leftValue, float rightValue) + { + return leftValue == rightValue; + } + + protected boolean compute(long leftValue, long rightValue) + { + return leftValue == rightValue; + } + + protected boolean compute(int leftValue, int rightValue) + { + return leftValue == rightValue; + } + + protected boolean compute(boolean leftValue, boolean rightValue) + { + return leftValue == rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java new file mode 100644 index 00000000000..94c54c25d30 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Evaluator.java @@ -0,0 +1,131 @@ +/* gnu.classpath.tools.gjdoc.expr.Evaluator + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +import java.io.StringReader; +import java.math.BigInteger; +import antlr.RecognitionException; +import antlr.TokenStreamException; +import java.util.Set; + +public class Evaluator +{ + /** + * Try to evaluate the given Java expression in the context of the + * given environment. + * + * @param expression the Java expression to evaluate. The + * expression string must not include a terminating semicolon. + * + * @param source the FieldDoc (part of) whose constant field value + * expression is being evaluated. Used to prevent circular + * references. + * + * @param environment callback hook used by the Evaluator to query + * the value of static fields referenced in the expression. + * + * @return a Java object representing the value of the expression, + * or null if the expression evaluates to + * null. + * + * @throws IllegalExpressionException if the expression is + * invalid, uses unsupported syntax constructs (e.g. method calls, + * array access) or references unknown static fields. + */ + public static Object evaluate(String expression, + Set visitedFields, + EvaluatorEnvironment environment) + throws IllegalExpressionException + { + try { + JavaLexer lexer = new JavaLexer(new StringReader(expression)); + JavaRecognizer recognizer = new JavaRecognizer(lexer); + Expression e = recognizer.expression(); + ConstantExpression value = e.evaluate(new Context(environment, visitedFields)); + return value.asObject(); + } + catch (RecognitionException e) { + throw new IllegalExpressionException(e); + } + catch (TokenStreamException e) { + throw new IllegalExpressionException(e); + } + } + + static int parseInt(String stringValue) + { + int base = 10; + + if (stringValue.startsWith("0x")) { + base = 16; + stringValue = stringValue.substring(2); + } + else if (stringValue.length() > 1 && stringValue.startsWith("0")) { + base = 8; + stringValue = stringValue.substring(1); + } + while (stringValue.length() > 1 && stringValue.startsWith("0")) { + stringValue = stringValue.substring(1); + } + + if (10 == base) { + return Integer.parseInt(stringValue); + } + else { + long result = Long.parseLong(stringValue, base); + + if (result > Integer.MAX_VALUE) { + result -= 0x100000000L; + } + + if (result > Integer.MAX_VALUE) { + throw new NumberFormatException(result + " > " + Integer.MAX_VALUE); + } + else if (result < Integer.MIN_VALUE) { + throw new NumberFormatException(result + " < " + Integer.MIN_VALUE); + } + else { + return (int)result; + } + } + } + + static long parseLong(String stringValue) + { + int base = 10; + + if (stringValue.startsWith("0x")) { + base = 16; + stringValue = stringValue.substring(2); + } + else if (stringValue.length() > 1 && stringValue.startsWith("0")) { + base = 8; + stringValue = stringValue.substring(1); + } + while (stringValue.length() > 1 && stringValue.startsWith("0")) { + stringValue = stringValue.substring(1); + } + + BigInteger bigInt = new BigInteger(stringValue, base); + long result = bigInt.longValue(); + return result; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java new file mode 100644 index 00000000000..a268b965e2a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/EvaluatorEnvironment.java @@ -0,0 +1,29 @@ +/* gnu.classpath.tools.gjdoc.expr.EvaluatorEnvironment + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +import java.util.Set; + +public interface EvaluatorEnvironment +{ + public Object getValue(String identifier, Set visitedFields) + throws IllegalExpressionException, UnknownIdentifierException; +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.java new file mode 100644 index 00000000000..563cb1b0dc2 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ExclusiveOrExpression.java @@ -0,0 +1,40 @@ +/* gnu.classpath.tools.gjdoc.expr.ExclusiveOrExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ExclusiveOrExpression + extends BinaryBitwiseExpression +{ + public ExclusiveOrExpression(Expression left, Expression right) + { + super(left, right); + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue ^ rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue ^ rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Expression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Expression.java new file mode 100644 index 00000000000..660806d599f --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Expression.java @@ -0,0 +1,27 @@ +/* gnu.classpath.tools.gjdoc.expr.Expression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +interface Expression +{ + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException; +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.java new file mode 100644 index 00000000000..647ac77faea --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.GreaterThanExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class GreaterThanExpression + extends BinaryRelationExpression +{ + public GreaterThanExpression(Expression left, Expression right) + { + super(left, right); + } + + protected boolean compute(double leftValue, double rightValue) + { + return leftValue > rightValue; + } + + protected boolean compute(float leftValue, float rightValue) + { + return leftValue > rightValue; + } + + protected boolean compute(long leftValue, long rightValue) + { + return leftValue > rightValue; + } + + protected boolean compute(int leftValue, int rightValue) + { + return leftValue > rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.java new file mode 100644 index 00000000000..e183482aaf1 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/GreaterThanOrEqualExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.GreaterThanOrEqualExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class GreaterThanOrEqualExpression + extends BinaryRelationExpression +{ + public GreaterThanOrEqualExpression(Expression left, Expression right) + { + super(left, right); + } + + protected boolean compute(double leftValue, double rightValue) + { + return leftValue >= rightValue; + } + + protected boolean compute(float leftValue, float rightValue) + { + return leftValue >= rightValue; + } + + protected boolean compute(long leftValue, long rightValue) + { + return leftValue >= rightValue; + } + + protected boolean compute(int leftValue, int rightValue) + { + return leftValue >= rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.java new file mode 100644 index 00000000000..d6cf3224b32 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IdentifierExpression.java @@ -0,0 +1,72 @@ +/* gnu.classpath.tools.gjdoc.expr.IdentifierExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class IdentifierExpression + implements Expression +{ + private String identifier; + + public IdentifierExpression(String identifier) + { + this.identifier = identifier; + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + Object value = context.getEvaluatorEnvironment().getValue(identifier, context.getVisitedFields()); + + if (value instanceof Byte) { + return new ConstantByte(((Byte)value).byteValue()); + } + else if (value instanceof Short) { + return new ConstantShort(((Short)value).shortValue()); + } + else if (value instanceof Integer) { + return new ConstantInteger(((Integer)value).intValue()); + } + else if (value instanceof Long) { + return new ConstantLong(((Long)value).longValue()); + } + else if (value instanceof Float) { + return new ConstantFloat(((Float)value).floatValue()); + } + else if (value instanceof Double) { + return new ConstantDouble(((Double)value).doubleValue()); + } + else if (value instanceof Boolean) { + return new ConstantBoolean(((Boolean)value).booleanValue()); + } + else if (value instanceof Character) { + return new ConstantChar(((Character)value).charValue()); + } + else if (value instanceof String) { + return new ConstantString((String)value); + } + else if (null != value) { + throw new IllegalExpressionException("Unsupported type " + value.getClass().getName() + " for identifier " + identifier); + } + else { + throw new IllegalExpressionException("Cannot resolve identifier " + identifier); + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.java new file mode 100644 index 00000000000..bb84a5547e7 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/IllegalExpressionException.java @@ -0,0 +1,35 @@ +/* gnu.classpath.tools.gjdoc.expr.IllegalExpressionException + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +public class IllegalExpressionException + extends Exception +{ + public IllegalExpressionException(String message) + { + super(message); + } + + public IllegalExpressionException(Throwable cause) + { + super(cause); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.java new file mode 100644 index 00000000000..350027ea276 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/InclusiveOrExpression.java @@ -0,0 +1,40 @@ +/* gnu.classpath.tools.gjdoc.expr.InclusiveOrExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class InclusiveOrExpression + extends BinaryBitwiseExpression +{ + public InclusiveOrExpression(Expression a, Expression b) + { + super(a, b); + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue | rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue | rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanExpression.java new file mode 100644 index 00000000000..d57b862c9b3 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.LessThanExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class LessThanExpression + extends BinaryRelationExpression +{ + public LessThanExpression(Expression left, Expression right) + { + super(left, right); + } + + protected boolean compute(double leftValue, double rightValue) + { + return leftValue < rightValue; + } + + protected boolean compute(float leftValue, float rightValue) + { + return leftValue < rightValue; + } + + protected boolean compute(long leftValue, long rightValue) + { + return leftValue < rightValue; + } + + protected boolean compute(int leftValue, int rightValue) + { + return leftValue < rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.java new file mode 100644 index 00000000000..eaf24994e61 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LessThanOrEqualExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.LessThanOrEqualExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class LessThanOrEqualExpression + extends BinaryRelationExpression +{ + public LessThanOrEqualExpression(Expression left, Expression right) + { + super(left, right); + } + + protected boolean compute(double leftValue, double rightValue) + { + return leftValue <= rightValue; + } + + protected boolean compute(float leftValue, float rightValue) + { + return leftValue <= rightValue; + } + + protected boolean compute(long leftValue, long rightValue) + { + return leftValue <= rightValue; + } + + protected boolean compute(int leftValue, int rightValue) + { + return leftValue <= rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.java new file mode 100644 index 00000000000..44e50751f09 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalAndExpression.java @@ -0,0 +1,35 @@ +/* gnu.classpath.tools.gjdoc.expr.LogicalAndExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class LogicalAndExpression + extends BinaryLogicalExpression +{ + LogicalAndExpression(Expression left, Expression right) + { + super(left, right); + } + + protected boolean compute(boolean leftValue, boolean rightValue) + { + return leftValue && rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.java new file mode 100644 index 00000000000..c315166d0df --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalNotExpression.java @@ -0,0 +1,43 @@ +/* gnu.classpath.tools.gjdoc.expr.LogicalNotExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class LogicalNotExpression + extends UnaryExpression +{ + protected LogicalNotExpression(Expression expr) + { + super(expr); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression value = expr.evaluate(context); + + if (Type.BOOLEAN == value.getType()) { + return new ConstantBoolean(!((ConstantBoolean)value).booleanValue()); + } + else { + throw new IllegalExpressionException("Operator ! cannot be applied to " + value.getType()); + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.java new file mode 100644 index 00000000000..77c33b4fe6a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/LogicalOrExpression.java @@ -0,0 +1,35 @@ +/* gnu.classpath.tools.gjdoc.expr.LogicalOrExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class LogicalOrExpression + extends BinaryLogicalExpression +{ + LogicalOrExpression(Expression a, Expression b) + { + super(a, b); + } + + protected boolean compute(boolean leftValue, boolean rightValue) + { + return leftValue || rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ModuloExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ModuloExpression.java new file mode 100644 index 00000000000..c8681177b7d --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ModuloExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.ModuloExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ModuloExpression + extends BinaryComputationExpression +{ + public ModuloExpression(Expression left, Expression right) + { + super(left, right); + } + + protected double compute(double leftValue, double rightValue) + { + return leftValue % rightValue; + } + + protected float compute(float leftValue, float rightValue) + { + return leftValue % rightValue; + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue % rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue % rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.java new file mode 100644 index 00000000000..520380c3408 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/MultiplicationExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.MultiplicationExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class MultiplicationExpression + extends BinaryComputationExpression +{ + public MultiplicationExpression(Expression left, Expression right) + { + super(left, right); + } + + protected double compute(double leftValue, double rightValue) + { + return leftValue * rightValue; + } + + protected float compute(float leftValue, float rightValue) + { + return leftValue * rightValue; + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue * rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue * rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NegateExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NegateExpression.java new file mode 100644 index 00000000000..e14a469c22e --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NegateExpression.java @@ -0,0 +1,49 @@ +/* gnu.classpath.tools.gjdoc.expr.NegateExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class NegateExpression + extends UnaryExpression +{ + protected NegateExpression(Expression expr) + { + super(expr); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression value = expr.evaluate(context); + + if (Type.LONG == value.getType()) { + return new ConstantLong(-value.asNumber().longValue()); + } + else if (Type.DOUBLE == value.getType()) { + return new ConstantDouble(-value.asNumber().doubleValue()); + } + else if (Type.FLOAT == value.getType()) { + return new ConstantDouble(-value.asNumber().floatValue()); + } + else { + return new ConstantInteger(-value.asNumber().intValue()); + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.java new file mode 100644 index 00000000000..c3d8ab234dc --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotEqualExpression.java @@ -0,0 +1,55 @@ +/* gnu.classpath.tools.gjdoc.expr.NotEqualExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class NotEqualExpression + extends BinaryEqualityExpression +{ + public NotEqualExpression(Expression left, Expression right) + { + super(left, right); + } + + protected boolean compute(double leftValue, double rightValue) + { + return leftValue != rightValue; + } + + protected boolean compute(float leftValue, float rightValue) + { + return leftValue != rightValue; + } + + protected boolean compute(long leftValue, long rightValue) + { + return leftValue != rightValue; + } + + protected boolean compute(int leftValue, int rightValue) + { + return leftValue != rightValue; + } + + protected boolean compute(boolean leftValue, boolean rightValue) + { + return leftValue != rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotExpression.java new file mode 100644 index 00000000000..3351b8ef7c4 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/NotExpression.java @@ -0,0 +1,43 @@ +/* gnu.classpath.tools.gjdoc.expr.NotExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class NotExpression + extends UnaryExpression +{ + protected NotExpression(Expression expr) + { + super(expr); + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression value = expr.evaluate(context); + + if (Type.LONG == value.getType()) { + return new ConstantLong(~value.asNumber().longValue()); + } + else { + return new ConstantInteger(~value.asNumber().intValue()); + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.java new file mode 100644 index 00000000000..af51cf3dea2 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftLeftExpression.java @@ -0,0 +1,40 @@ +/* gnu.classpath.tools.gjdoc.expr.ShiftLeftExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ShiftLeftExpression + extends BinaryShiftExpression +{ + public ShiftLeftExpression(Expression left, Expression right) + { + super(left, right); + } + + protected long compute(long leftValue, int rightValue) + { + return leftValue << rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue << rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.java new file mode 100644 index 00000000000..0aedf12f0de --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/ShiftRightExpression.java @@ -0,0 +1,40 @@ +/* gnu.classpath.tools.gjdoc.expr.ShiftRightExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class ShiftRightExpression + extends BinaryShiftExpression +{ + public ShiftRightExpression(Expression left, Expression right) + { + super(left, right); + } + + protected long compute(long leftValue, int rightValue) + { + return leftValue >> rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue >> rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.java new file mode 100644 index 00000000000..14e5edf039e --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/SubtractionExpression.java @@ -0,0 +1,50 @@ +/* gnu.classpath.tools.gjdoc.expr.SubtractionExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class SubtractionExpression + extends BinaryComputationExpression +{ + public SubtractionExpression(Expression left, Expression right) + { + super(left, right); + } + + protected double compute(double leftValue, double rightValue) + { + return leftValue - rightValue; + } + + protected float compute(float leftValue, float rightValue) + { + return leftValue - rightValue; + } + + protected long compute(long leftValue, long rightValue) + { + return leftValue - rightValue; + } + + protected int compute(int leftValue, int rightValue) + { + return leftValue - rightValue; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Type.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Type.java new file mode 100644 index 00000000000..47f9ea68d60 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/Type.java @@ -0,0 +1,43 @@ +/* gnu.classpath.tools.gjdoc.expr.Type + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class Type +{ + public static final Type LONG = new Type(Long.TYPE); + public static final Type INTEGER = new Type(Integer.TYPE); + public static final Type BOOLEAN = new Type(Boolean.TYPE); + public static final Type DOUBLE = new Type(Double.TYPE); + public static final Type FLOAT = new Type(Float.TYPE); + public static final Type CHAR = new Type(Character.TYPE); + public static final Type BYTE = new Type(Byte.TYPE); + public static final Type SHORT = new Type(Short.TYPE); + public static final Type VOID = new Type(Void.TYPE); + public static final Type STRING = new Type(String.class); + public static final Type NULL = new Type(null); + + private Class clazz; + + private Type(Class clazz) + { + this.clazz = clazz; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.java new file mode 100644 index 00000000000..8c06ee27a9d --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/TypeCastExpression.java @@ -0,0 +1,70 @@ +/* gnu.classpath.tools.gjdoc.expr.TypeCastExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +class TypeCastExpression + extends UnaryExpression +{ + private Type type; + + public TypeCastExpression(Type type, Expression expr) + { + super(expr); + this.type = type; + } + + public ConstantExpression evaluate(Context context) + throws IllegalExpressionException + { + ConstantExpression value = expr.evaluate(context); + + if (Type.BYTE == type) { + return new ConstantByte(value.asNumber().byteValue()); + } + else if (Type.SHORT == type) { + return new ConstantShort(value.asNumber().shortValue()); + } + else if (Type.INTEGER == type) { + return new ConstantInteger(value.asNumber().intValue()); + } + else if (Type.LONG == type) { + return new ConstantLong(value.asNumber().longValue()); + } + else if (Type.CHAR == type) { + return new ConstantChar((char)value.asNumber().intValue()); + } + else if (Type.FLOAT == type) { + return new ConstantFloat((float)value.asNumber().intValue()); + } + else if (Type.DOUBLE == type) { + return new ConstantDouble((float)value.asNumber().intValue()); + } + else if (Type.BOOLEAN == type && Type.BOOLEAN == value.getType()) { + return value; + } + else if (Type.STRING == type && Type.STRING == value.getType()) { + return value; + } + else { + throw new IllegalExpressionException("Cannot cast " + value.getType() + " to " + type); + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnaryExpression.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnaryExpression.java new file mode 100644 index 00000000000..e5421c061bf --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnaryExpression.java @@ -0,0 +1,32 @@ +/* gnu.classpath.tools.gjdoc.expr.UnaryExpression + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +abstract class UnaryExpression + implements Expression +{ + protected Expression expr; + + protected UnaryExpression(Expression expr) + { + this.expr = expr; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.java b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.java new file mode 100644 index 00000000000..f84970717a6 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/UnknownIdentifierException.java @@ -0,0 +1,30 @@ +/* gnu.classpath.tools.gjdoc.expr.UnknownIdentifierException + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.gjdoc.expr; + +public class UnknownIdentifierException + extends IllegalExpressionException +{ + public UnknownIdentifierException(String identifier) + { + super(identifier); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/java-expression.g b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/java-expression.g new file mode 100644 index 00000000000..4a21a86187f --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/gjdoc/expr/java-expression.g @@ -0,0 +1,471 @@ +/* + * This grammar is derived from the Java 1.3 Recognizer + * (http://www.antlr.org/grammar/java/java.g) by Mitchell, Parr, Lilley, + * Stanchfield, Mohnen, Williams, Jacobs, Messick and Pybus, Version + * 1.21. + * + * This grammar recognizes simple Java expressions. The following + * language elements are NOT supported: + * + * - type casts to non-primitive types + * - method calls + * - constructor calls + * - array access + * - comma expressions + * - increment and decrement operators (both prefix/postfix) + * - expressions involving constant classes (Abc.class) + */ + +header { + package gnu.classpath.tools.gjdoc.expr; +} + +class JavaRecognizer extends Parser; +options { + k = 2; // two token lookahead + exportVocab=Java; // Call its vocabulary "Java" + codeGenMakeSwitchThreshold = 2; // Some optimizations + codeGenBitsetTestThreshold = 3; + defaultErrorHandler = false; // Don't generate parser error handlers + buildAST = true; +} + +tokens { + BLOCK; MODIFIERS; OBJBLOCK; SLIST; CTOR_DEF; METHOD_DEF; VARIABLE_DEF; + INSTANCE_INIT; STATIC_INIT; TYPE; CLASS_DEF; INTERFACE_DEF; + PACKAGE_DEF; ARRAY_DECLARATOR; EXTENDS_CLAUSE; IMPLEMENTS_CLAUSE; + PARAMETERS; PARAMETER_DEF; LABELED_STAT; TYPECAST; INDEX_OP; + POST_INC; POST_DEC; METHOD_CALL; EXPR; ARRAY_INIT; + IMPORT; UNARY_MINUS; UNARY_PLUS; CASE_GROUP; ELIST; FOR_INIT; FOR_CONDITION; + FOR_ITERATOR; EMPTY_STAT; FINAL="final"; ABSTRACT="abstract"; + STRICTFP="strictfp"; SUPER_CTOR_CALL; CTOR_CALL; +} + +// A builtin type specification is a builtin type with possible brackets +// afterwards (which would make it an array type). +builtInTypeSpec[boolean addImagNode] returns [Type t = null] + : t=builtInType (lb:LBRACK^ {#lb.setType(ARRAY_DECLARATOR);} RBRACK!)* + { + if ( addImagNode ) { + #builtInTypeSpec = #(#[TYPE,"TYPE"], #builtInTypeSpec); + } + } + ; + +// A type name. which is either a (possibly qualified) class name or +// a primitive (builtin) type +type returns [Type t] + : t=builtInType + ; + +// The primitive types. +builtInType returns [Type t = null] + : "void" {t=Type.VOID;} + | "boolean" {t=Type.BOOLEAN;} + | "byte" {t=Type.BYTE;} + | "char" {t=Type.CHAR;} + | "short" {t=Type.SHORT;} + | "int" {t=Type.INTEGER;} + | "float"{t=Type.FLOAT;} + | "long" {t=Type.LONG;} + | "double" {t=Type.DOUBLE;} + | "String" {t=Type.STRING;} + ; + +// A (possibly-qualified) java identifier. We start with the first IDENT +// and expand its name by adding dots and following IDENTS +identifier returns [String s = null;] + : i:IDENT {s=i.getText();} ( DOT^ i2:IDENT {s+="."+i2.getText();} )* + ; + +expression returns [Expression e = null] + : e=conditionalExpression EOF! + ; + +// conditional test (level 12) +conditionalExpression returns [Expression e = null] { Expression a,b,c; } + : e=logicalOrExpression + ( QUESTION^ b=conditionalExpression COLON! c=conditionalExpression {e=new ConditionalExpression(e,b,c);} )? + ; + + +// logical or (||) (level 11) +logicalOrExpression returns [Expression e = null] { Expression a,b; } + : e=logicalAndExpression (LOR^ b=logicalAndExpression {e=new LogicalOrExpression(e,b);})* + ; + + +// logical and (&&) (level 10) +logicalAndExpression returns [Expression e = null] { Expression a,b; } + : e=inclusiveOrExpression (LAND^ b=inclusiveOrExpression {e=new LogicalAndExpression(e,b);})* + ; + + +// bitwise or non-short-circuiting or (|) (level 9) +inclusiveOrExpression returns [Expression e = null] { Expression a,b; } + : e=exclusiveOrExpression (BOR^ b=exclusiveOrExpression {e=new InclusiveOrExpression(e,b);})* + ; + + +// exclusive or (^) (level 8) +exclusiveOrExpression returns [Expression e = null] { Expression a,b; } + : e=andExpression (BXOR^ b=andExpression {e=new ExclusiveOrExpression(e,b);})* + ; + + +// bitwise or non-short-circuiting and (&) (level 7) +andExpression returns [Expression e = null] { Expression a,b; } + : e=equalityExpression (BAND^ b=equalityExpression {e=new AndExpression(e,b);})* + ; + + +// equality/inequality (==/!=) (level 6) +equalityExpression returns [Expression e = null] { Expression a,b; } + : e=relationalExpression ((NOT_EQUAL^ a=relationalExpression {e=new NotEqualExpression(e,a);} | EQUAL^ a=relationalExpression {e=new EqualExpression(e,a);}))* + ; + + +// boolean relational expressions (level 5) +relationalExpression returns [Expression e = null] { Expression a,b; } + : e=shiftExpression + ( ( ( LT^ a=shiftExpression {e=new LessThanExpression(e,a);} + | GT^ a=shiftExpression {e=new GreaterThanExpression(e,a);} + | LE^ a=shiftExpression {e=new LessThanOrEqualExpression(e,a);} + | GE^ a=shiftExpression {e=new GreaterThanOrEqualExpression(e,a);} + ) + + )* + ) + ; + + +// bit shift expressions (level 4) +shiftExpression returns [Expression e = null] { Expression a,b; } + : e=additiveExpression ((SL^ a=additiveExpression {e=new ShiftLeftExpression(e,a);} | SR^ a=additiveExpression {e=new ShiftRightExpression(e,a);} | BSR^ a=additiveExpression {e=new BitShiftRightExpression(e,a);}))* + ; + + +// binary addition/subtraction (level 3) +additiveExpression returns [Expression e = null] { Expression a,b; } + : e=multiplicativeExpression ((PLUS^ a=multiplicativeExpression {e=new AdditionExpression(e,a);} | MINUS^ a=multiplicativeExpression {e=new SubtractionExpression(e,a);}))* + ; + + +// multiplication/division/modulo (level 2) +multiplicativeExpression returns [Expression e = null] { Expression a,b; } + : e=unaryExpression ((STAR^ a=unaryExpression {e=new MultiplicationExpression(e,a);} | DIV^ a=unaryExpression {e=new DivisionExpression(e,a);} | MOD^ a=unaryExpression {e=new ModuloExpression(e,a);} ))* + ; + + +unaryExpression returns [Expression e = null] { Expression a,b; } + : MINUS^ {#MINUS.setType(UNARY_MINUS);} a=unaryExpression {e=new NegateExpression(a);} + | PLUS^ {#PLUS.setType(UNARY_PLUS);} e=unaryExpression + | e=unaryExpressionNotPlusMinus + ; + +unaryExpressionNotPlusMinus returns [Expression e = null] { Expression a; Type t; } + : BNOT^ a=unaryExpression {e=new NotExpression(a);} + | LNOT^ a=unaryExpression {e=new LogicalNotExpression(a);} + + // use predicate to skip cases like: (int.class) + | (LPAREN builtInTypeSpec[true] RPAREN) => + lpb:LPAREN^ {#lpb.setType(TYPECAST);} t=builtInTypeSpec[true] RPAREN! + a=unaryExpression {e=new TypeCastExpression(t,a);} + + | e=primaryExpression + ; + +// the basic element of an expression +primaryExpression returns [Expression e = null; String i = null;] + : e=constant + | i=identifier {e=new IdentifierExpression(i);} + | "true" { e=new ConstantBoolean(true); } + | "false" { e=new ConstantBoolean(false); } + | "null" { e=new ConstantNull(); } + | LPAREN! e=conditionalExpression RPAREN! + ; + +/** Match a, a.b.c refs + */ +identPrimary returns [Expression e = null] + : IDENT + ( + options { + // .ident could match here or in postfixExpression. + // We do want to match here. Turn off warning. + greedy=true; + } + : DOT^ IDENT + )* + ; + +constant returns [Expression e = null] + : l1:NUM_INT {e=new ConstantInteger(l1.getText());} + | l2:CHAR_LITERAL {e=new ConstantChar(l2.getText());} + | l3:STRING_LITERAL {e=new ConstantString(l3.getText().substring(1, l3.getText().length()-1)); } + | l4:NUM_FLOAT {e=new ConstantFloat(l4.getText());} + | l5:NUM_LONG {e=new ConstantLong(l5.getText());} + | l6:NUM_DOUBLE {e=new ConstantDouble(l6.getText());} + ; + + +//---------------------------------------------------------------------------- +// The Java scanner +//---------------------------------------------------------------------------- +class JavaLexer extends Lexer; + +options { + exportVocab=Java; // call the vocabulary "Java" + testLiterals=false; // don't automatically test for literals + k=4; // four characters of lookahead + charVocabulary='\u0003'..'\uFFFF'; + // without inlining some bitset tests, couldn't do unicode; + // I need to make ANTLR generate smaller bitsets; see + // bottom of JavaLexer.java + codeGenBitsetTestThreshold=20; +} + + + +// OPERATORS +QUESTION : '?' ; +LPAREN : '(' ; +RPAREN : ')' ; +LBRACK : '[' ; +RBRACK : ']' ; +LCURLY : '{' ; +RCURLY : '}' ; +COLON : ':' ; +COMMA : ',' ; +//DOT : '.' ; +ASSIGN : '=' ; +EQUAL : "==" ; +LNOT : '!' ; +BNOT : '~' ; +NOT_EQUAL : "!=" ; +DIV : '/' ; +DIV_ASSIGN : "/=" ; +PLUS : '+' ; +PLUS_ASSIGN : "+=" ; +INC : "++" ; +MINUS : '-' ; +MINUS_ASSIGN : "-=" ; +DEC : "--" ; +STAR : '*' ; +STAR_ASSIGN : "*=" ; +MOD : '%' ; +MOD_ASSIGN : "%=" ; +SR : ">>" ; +SR_ASSIGN : ">>=" ; +BSR : ">>>" ; +BSR_ASSIGN : ">>>=" ; +GE : ">=" ; +GT : ">" ; +SL : "<<" ; +SL_ASSIGN : "<<=" ; +LE : "<=" ; +LT : '<' ; +BXOR : '^' ; +BXOR_ASSIGN : "^=" ; +BOR : '|' ; +BOR_ASSIGN : "|=" ; +LOR : "||" ; +BAND : '&' ; +BAND_ASSIGN : "&=" ; +LAND : "&&" ; +SEMI : ';' ; + + +// Whitespace -- ignored +WS : ( ' ' + | '\t' + | '\f' + // handle newlines + | ( options {generateAmbigWarnings=false;} + : "\r\n" // Evil DOS + | '\r' // Macintosh + | '\n' // Unix (the right way) + ) + { newline(); } + )+ + { _ttype = Token.SKIP; } + ; + +// Single-line comments +SL_COMMIT + : "//" + (~('\n'|'\r'))* ('\n'|'\r'('\n')?) + {$setType(Token.SKIP); newline();} + ; + +// multiple-line comments +ML_COMMENT + : "/*" + ( /* '\r' '\n' can be matched in one alternative or by matching + '\r' in one iteration and '\n' in another. I am trying to + handle any flavor of newline that comes in, but the language + that allows both "\r\n" and "\r" and "\n" to all be valid + newline is ambiguous. Consequently, the resulting grammar + must be ambiguous. I'm shutting this warning off. + */ + options { + generateAmbigWarnings=false; + } + : + { LA(2)!='/' }? '*' + | '\r' '\n' {newline();} + | '\r' {newline();} + | '\n' {newline();} + | ~('*'|'\n'|'\r') + )* + "*/" + {$setType(Token.SKIP);} + ; + + +// character literals +CHAR_LITERAL + : '\'' ( ESC | ~('\''|'\n'|'\r'|'\\') ) '\'' + ; + +// string literals +STRING_LITERAL + : '"' (ESC|~('"'|'\\'|'\n'|'\r'))* '"' + ; + + +// escape sequence -- note that this is protected; it can only be called +// from another lexer rule -- it will not ever directly return a token to +// the parser +// There are various ambiguities hushed in this rule. The optional +// '0'...'9' digit matches should be matched here rather than letting +// them go back to STRING_LITERAL to be matched. ANTLR does the +// right thing by matching immediately; hence, it's ok to shut off +// the FOLLOW ambig warnings. +protected +ESC + : '\\' + ( 'n' + | 'r' + | 't' + | 'b' + | 'f' + | '"' + | '\'' + | '\\' + | ('u')+ HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT + | '0'..'3' + ( + options { + warnWhenFollowAmbig = false; + } + : '0'..'7' + ( + options { + warnWhenFollowAmbig = false; + } + : '0'..'7' + )? + )? + | '4'..'7' + ( + options { + warnWhenFollowAmbig = false; + } + : '0'..'7' + )? + ) + ; + + +// hexadecimal digit (again, note it's protected!) +protected +HEX_DIGIT + : ('0'..'9'|'A'..'F'|'a'..'f') + ; + + +// a dummy rule to force vocabulary to be all characters (except special +// ones that ANTLR uses internally (0 to 2) +protected +VOCAB + : '\3'..'\377' + ; + + +// an identifier. Note that testLiterals is set to true! This means +// that after we match the rule, we look in the literals table to see +// if it's a literal or really an identifer +IDENT + options {testLiterals=true;} + : ('a'..'z'|'A'..'Z'|'_'|'$') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')* + ; + + +// a numeric literal +NUM_INT + {boolean isDecimal=false; Token t=null;} + : '.' {_ttype = DOT;} + ( ('0'..'9')+ (EXPONENT)? (f1:FLOAT_SUFFIX {t=f1;})? + { + if (t != null && t.getText().toUpperCase().indexOf('F')>=0) { + _ttype = NUM_FLOAT; + } + else { + _ttype = NUM_DOUBLE; // assume double + } + } + )? + + | ( '0' {isDecimal = true;} // special case for just '0' + ( ('x'|'X') + ( // hex + // the 'e'|'E' and float suffix stuff look + // like hex digits, hence the (...)+ doesn't + // know when to stop: ambig. ANTLR resolves + // it correctly by matching immediately. It + // is therefor ok to hush warning. + options { + warnWhenFollowAmbig=false; + } + : HEX_DIGIT + )+ + + | //float or double with leading zero + (('0'..'9')+ ('.'|EXPONENT|FLOAT_SUFFIX)) => ('0'..'9')+ + + | ('0'..'7')+ // octal + )? + | ('1'..'9') ('0'..'9')* {isDecimal=true;} // non-zero decimal + ) + ( ('l'|'L') { _ttype = NUM_LONG; } + + // only check to see if it's a float if looks like decimal so far + | {isDecimal}? + ( '.' ('0'..'9')* (EXPONENT)? (f2:FLOAT_SUFFIX {t=f2;})? + | EXPONENT (f3:FLOAT_SUFFIX {t=f3;})? + | f4:FLOAT_SUFFIX {t=f4;} + ) + { + if (t != null && t.getText().toUpperCase() .indexOf('F') >= 0) { + _ttype = NUM_FLOAT; + } + else { + _ttype = NUM_DOUBLE; // assume double + } + } + )? + ; + + +// a couple protected methods to assist in matching floating point numbers +protected +EXPONENT + : ('e'|'E') ('+'|'-')? ('0'..'9')+ + ; + + +protected +FLOAT_SUFFIX + : 'f'|'F'|'d'|'D' + ; diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java index c1660b725e3..eef31e7e01a 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java +++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Creator.java @@ -50,6 +50,7 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; +import java.util.jar.Attributes; import java.util.jar.JarFile; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; @@ -222,9 +223,15 @@ public class Creator throws IOException { manifest = createManifest(parameters); + /* If no version is specified, provide the same manifest version default + * as Sun's jar tool */ + Attributes attr = manifest.getMainAttributes(); + if (attr.getValue(Attributes.Name.MANIFEST_VERSION) == null) + attr.putValue(Attributes.Name.MANIFEST_VERSION.toString(), "1.0"); + attr.putValue("Created-By", System.getProperty("java.version") + + " (" + System.getProperty("java.vendor") + ")"); outputStream = new JarOutputStream(os, manifest); - // FIXME: in Classpath this sets the method too late for the - // manifest file. + // FIXME: this sets the method too late for the manifest file. outputStream.setMethod(parameters.storageMode); writeCommandLineEntries(parameters); } diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Indexer.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Indexer.java index 401c6fb6a4e..06c5de9fb6d 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/jar/Indexer.java +++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Indexer.java @@ -57,7 +57,7 @@ import java.util.jar.Manifest; public class Indexer extends Updater { - private void indexJarFile(StringBuffer result, File fileName, + private void indexJarFile(StringBuilder result, File fileName, boolean verbose) throws IOException { @@ -129,7 +129,7 @@ public class Indexer super.writeCommandLineEntries(parameters, os); // Now compute our index file and write it. - StringBuffer contents = new StringBuffer(); + StringBuilder contents = new StringBuilder(); indexJarFile(contents, parameters.archiveFile, parameters.verbose); if (contents.length() != 0) { diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Updater.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Updater.java index 29586befdf3..f25d56fdc7d 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/jar/Updater.java +++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Updater.java @@ -38,6 +38,7 @@ package gnu.classpath.tools.jar; +import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileInputStream; @@ -70,7 +71,8 @@ public class Updater inputJar = new JarFile(parameters.archiveFile); // Write all the new entries to a temporary file. - File tmpFile = File.createTempFile("jarcopy", null); + File tmpFile = File.createTempFile("jarcopy", null, + parameters.archiveFile.getParentFile()); OutputStream os = new BufferedOutputStream(new FileOutputStream(tmpFile)); writeCommandLineEntries(parameters, os); @@ -86,6 +88,11 @@ public class Updater } close(); - tmpFile.renameTo(parameters.archiveFile); + if (!tmpFile.renameTo(parameters.archiveFile)) + { + throw new IOException("Couldn't rename new JAR file " + tmpFile + + "to " + parameters.archiveFile); + } } + } diff --git a/libjava/classpath/tools/gnu/classpath/tools/java2xhtml/Java2xhtml.java b/libjava/classpath/tools/gnu/classpath/tools/java2xhtml/Java2xhtml.java new file mode 100644 index 00000000000..a7da7c4aa15 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/java2xhtml/Java2xhtml.java @@ -0,0 +1,1337 @@ +/* gnu.classpath.tools.java2xhtml.Java2xhtml + Copyright (C) 2005 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +/** Java2xhtml.java Version 0.9 + * Produces an XHTML file from Java source code with syntax highlighting, + * includes additional options (line numbering, tab spacing, etc.) + *

+ * NOTE: Common java naming structure is assumed + * Capitalize the first letter that appears in a class or interface name + * Use lowercase for the first letter in a method or variable name + * Use only uppercase letters when naming constants + * + * @version 0.9, March 2003 + * @author Shayne Steele + */ +package gnu.classpath.tools.java2xhtml; + +import java.io.*; +import java.util.*; + +public class Java2xhtml +{ + //--- define CSS classes for individual output elements + + private static final String sourceCodeStyle = "source"; + private static final String lineNumberStyle = "line-number even"; + private static final String modulusLineNumberStyle = "line-number odd"; + + private static final String keywordStyle = "keyword"; + private static final String methodStyle = "method member"; + private static final String variableStyle = "variable member"; + private static final String singleLineCommentStyle = "line comment"; + private static final String traditionalCommentStyle = "c comment"; + private static final String javadocCommentStyle = "javadoc comment"; + private static final String javadocTagStyle = "javadoc tag"; + private static final String importNameStyle = "import header type"; + private static final String packageNameStyle = "package header type"; + private static final String primitiveTypeStyle = "primitive type"; + private static final String nonPrimitiveTypeStyle = "non-primitive type"; + private static final String constructorStyle = "constructor member"; + private static final String constantStyle = "constant member"; + private static final String doubleQuoteStyle = "double quote"; + private static final String singleQuoteStyle = "single quote"; + private static final String numericLiteralStyle = "numeric literal"; + private static final String primitiveLiteralStyle = "primitive literal"; + + private static final String iconStyle = "icon"; + + + + // parse the command line arguments + // give a decent responce for bad input + // call the HTMLifier on good input + public static void main(String args[]) + { + // parse the invokation arguments + if (args.length < 1 || args.length > 3) // invoked program incorrectly + { + System.out.println("Java2xhtml Version 0.9 (C) 2005 Free Software Foundation"); + System.out.println(" Produces an XHTML file of Java source" + + " code with syntax highlighting,"); + System.out.println(" includes additional options " + + "(line numbering, tab spacing, etc.)"); + System.out.println(" This tool is part of GNU Classpath."); + System.out.println(" GNU Classpath is free software; you can redistribute it and/or modify"); + System.out.println(" it under the terms of the GNU General Public License as published by"); + System.out.println(" the Free Software Foundation; either version 2, or (at your option)"); + System.out.println(" any later version."); + System.out.println(" NOTE: Common java naming structure is " + + "assumed"); + System.out.println(""); + System.out.println("USAGE:"); + System.out.println("java [java options] Java2xhtml " + + "source.java [options file] " + + "[output file]"); + System.out.println(""); + System.out.println(" - java is the name of the Java interpreter"); + System.out.println(" - [java options] are the optional options " + + "of the Java interpreter"); + System.out.println(" - Java2xhtml is the name of this " + + "application"); + System.out.println(" - source is a file or the directory to the " + + "Java source file(s)"); + System.out.println(" - [options file] is the optional " + + "path of a file with"); + System.out.println(" a structure like this:"); + System.out.println(" externalStyleSheetName=file_name" + + " (default style.css)"); + System.out.println(" tabSize=integer (default value is 4)"); + System.out.println(" extraIndentation=integer " + + "(default value is 0)"); + System.out.println(" lineModulus=integer (default value 5)"); + System.out.println(" isCodeSnippet=boolean" + + " (default false)"); + System.out.println(" isXHTML_1_1=boolean" + + " (default true)"); + System.out.println(" hasInternalStyleSheet=boolean" + + " (default true)"); + System.out.println(" hasExternalStyleSheet=boolean" + + " (default true)"); + System.out.println(" hasTitle=boolean" + + " (default false)"); + System.out.println(" hasLegend=boolean" + + " (default false)"); + System.out.println(" hasAllBoldSourceCode=boolean" + + " (default false)"); + System.out.println(" hasLineNumbers=boolean" + + " (default false)"); + System.out.println(" hasLineModulusDrawnLines=boolean" + + " (default false)"); + System.out.println(" hasLineModulusCodeBlocks=boolean" + + " (default false)"); + System.out.println(" hasFooter=boolean" + + " (default false)"); + System.out.println(" hasFooterIcons=boolean" + + " (default false)"); + System.out.println(" hasFooterDate=boolean" + + " (default true)"); + System.out.println(" NOTE: filename must end with '.prop'"); + System.out.println(" Default [options file] is " + + "options.prop"); + System.out.println(" - [output file] is name of the XHTML file " + + "that is produced"); + System.out.println(" Default [output file] is source_java.html"); + System.out.println(""); + System.out.println("Output: source.java --> [output file]"); + System.out.println(" Default Output is "); + System.out.println(" source.java --> source_java.html"); + System.out.println(""); + System.out.println("Examples of calling the program:"); + System.out.println(" process one file (say Java2xhtml.java):"); + System.out.println(" java Java2xhtml Java2xhtml.java"); + System.out.println(" process one directory (say C:\\HOME):"); + System.out.println(" java Java2xhtml C:\\HOME"); + System.out.println(" process one directory (say C:\\HOME with a " + + "given options file (options.prop)):"); + System.out.println(" java Java2xhtml C:\\HOME options.prop"); + } + else + { + // invoked program correctly, now get command line arguments + // get the source file name + String sourceName; + sourceName = args[0]; + // make sure that the source file exist and if so HTMLify it + File sourceFilePath = new File(sourceName); + if (sourceFilePath.exists()) + { + // good pathname so HTMLify it + // get the default html options file name + String propertiesFileName = "options.prop"; + // create a unique default html file name, + // bubba.java -> bubba_java.html + String htmlFileName = sourceName.replace('.', '_') + ".html"; + if (args.length == 2 || args.length == 3) + { + if (args[1].endsWith(".prop")) + { + // get the user supplied html options file name + propertiesFileName = args[1]; + } + else + { + // get the user supplied html outputfile name + htmlFileName = args[1]; + } + } + if (args.length == 3) + { + if (args[2].endsWith(".prop")) + { + // get the user supplied html options file name + propertiesFileName = args[2]; + } + else + { + // get the user supplied html outputfile name + htmlFileName = args[2]; + } + } + new Java2xhtml(propertiesFileName, sourceFilePath, + htmlFileName); + } + else // source file does not exist, print message and exit normally + { + System.out.println("The source parameter must be an existent" + + " file or directory"); + System.out.println("Run Java2xHtml without parameters for " + + "help"); + } + } + } + + // collect various sets of keywords + static Collection keywordCollection; + static Collection primitiveTypeCollection; + static Collection primitiveLiteralCollection; + static Collection javadocTagCollection; + + // all these variables are changeable by a options file + int extraIndentation = 0; + int tabSize = 4; + int lineModulus = 5; + boolean hasLegend = false; + boolean hasLineNumbers = false; + boolean hasLineModulusDrawnLines = false; + boolean hasLineModulusCodeBlocks = false; + boolean hasFooter = false; + boolean hasFooterIcons = false; + boolean hasFooterDate = true; + boolean isCodeSnippet = false; + boolean isXHTML_1_1 = true; + boolean hasTitle = false; + boolean hasAllBoldSourceCode = false; + boolean hasInternalStyleSheet = true; + boolean hasExternalStyleSheet = true; + String externalStyleSheetName = "style.css"; + + static + { + // collection type is Hashset for unique elements and fast retieval + String keywordArray[] = + { + "abstract", "default", "if", "private", + "do", "implements", "protected", "throws", + "break", "import", "public", "transient", + "else", "instanceof", "return", "try", + "case", "extends", "throw", "static", + "catch", "final", "interface", "while", + "volatile", "finally", "super", "synchronized", + "class", "native", "switch", "package", + "const", "for", "new", "goto", + "continue", "this", "assert", "strictfp" + }; + keywordCollection = new HashSet(Arrays.asList(keywordArray)); + String primitiveTypeArray[] = + { + "boolean", "char", "byte", "short", "int", + "long", "float", "double", "void" + }; + primitiveTypeCollection = + new HashSet(Arrays.asList(primitiveTypeArray)); + String primitiveLiteralArray[]= + { + "false", "null", "true" + }; + primitiveLiteralCollection = + new HashSet(Arrays.asList(primitiveLiteralArray)); + String javadocTagArray[]= + { + "see", "author", "version", "param", "return", "exception", + "deprecated", "throws", "link", "since", "serial", + "serialField","serialData", "beaninfo" + }; + javadocTagCollection = new HashSet(Arrays.asList(javadocTagArray)); + } + + public Java2xhtml() + { + } + + // create the various keyword collections + // parse the html options file + Java2xhtml(String propertiesFileName, File sourceFilePath, + String htmlFileName) + { + // get html properties (use defaults if necessary) + File propertiesFilePath = new File (propertiesFileName); + if (propertiesFilePath.exists()) + { + // html properies file exist try parsing it + try + { + InputStream propertiesFile = + new FileInputStream(propertiesFileName); + Properties htmlProperties = new Properties(); + htmlProperties.load(propertiesFile); + propertiesFile.close(); + setProperties(htmlProperties); + } + catch (IOException exception) + { + System.out.println(exception); + } + } + if (sourceFilePath.isFile()) + { + // process the file + processFile(sourceFilePath, htmlFileName); + } + else if (sourceFilePath.isDirectory()) + { + // process a directory + File [] sourceFilePathArray = sourceFilePath.listFiles(); + for (int i = 0; i < sourceFilePathArray.length; i++) + { + if (((sourceFilePathArray[i]).getName()).endsWith(".java")) + { + // process each file that ends in .java + // create a unique default html file name, + // bubba.java -> bubba_java.html + htmlFileName = ((sourceFilePathArray[i]).getName()).replace( + '.', '_') + ".html"; + processFile(sourceFilePathArray[i], htmlFileName); + } + } + } + } + + public void setProperties(Properties htmlProperties) + { + hasLegend + = Boolean.valueOf(htmlProperties.getProperty("hasLegend", + "false")).booleanValue(); + extraIndentation + = Integer.parseInt(htmlProperties.getProperty("extraIndentation", "0")); + tabSize + = Integer.parseInt(htmlProperties.getProperty("tabSize", "4")); + hasLineNumbers + = Boolean.valueOf(htmlProperties.getProperty("hasLineNumbers", + "false")).booleanValue(); + lineModulus + = Integer.parseInt(htmlProperties.getProperty("lineModulus", "5")); + hasLineModulusDrawnLines + = Boolean.valueOf(htmlProperties.getProperty("hasLineModulusDrawnLines", + "false")).booleanValue(); + hasLineModulusCodeBlocks + = Boolean.valueOf(htmlProperties.getProperty("hasLineModulusCodeBlocks", + "false")).booleanValue(); + hasFooter + = Boolean.valueOf(htmlProperties.getProperty("hasFooter", + "false")).booleanValue(); + hasFooterIcons + = Boolean.valueOf(htmlProperties.getProperty("hasFooterIcons", + "false")).booleanValue(); + hasFooterDate + = Boolean.valueOf(htmlProperties.getProperty("hasFooterDate", + "true")).booleanValue(); + isXHTML_1_1 + = Boolean.valueOf(htmlProperties.getProperty("isXHTML_1_1", + "true")).booleanValue(); + isCodeSnippet + = Boolean.valueOf(htmlProperties.getProperty("isCodeSnippet", + "false")).booleanValue(); + hasTitle + = Boolean.valueOf(htmlProperties.getProperty("hasTitle", + "false")).booleanValue(); + hasAllBoldSourceCode + = Boolean.valueOf(htmlProperties.getProperty("hasAllBoldSourceCode", + "false")).booleanValue(); + hasInternalStyleSheet + = Boolean.valueOf(htmlProperties.getProperty("hasInternalStyleSheet", + "true")).booleanValue(); + hasExternalStyleSheet + = Boolean.valueOf(htmlProperties.getProperty("hasExternalStyleSheet", + "true")).booleanValue(); + externalStyleSheetName + = htmlProperties.getProperty("externalStyleSheetName", "style.css"); + } + + + // read the file and put it into a stringbuffer + void processFile(File sourceFilePath, String htmlFileName) + { + // open the file, copy it to a Stringbuffer , process into an + // HTMLified String and convert result into an HTML file + try + { + BufferedReader sourceReader = + new BufferedReader(new FileReader(sourceFilePath)); + StringBuffer bufferIn = new StringBuffer(); + int readInInt = 0; + char presentChar = 0; + // copy file into a Stringbuffer + while (readInInt != -1) // -1 value means end of stream/file + { + // put the file into a Stringbuffer + readInInt= sourceReader.read(); + presentChar = ((readInInt >= 0) ? (char) readInInt : 0); + bufferIn.append(presentChar); + } + sourceReader.close(); + BufferedWriter tempBufferedWriter = + new BufferedWriter(new FileWriter(htmlFileName)); + tempBufferedWriter.write(makeHTML(bufferIn, + sourceFilePath.getName())); + tempBufferedWriter.close(); + System.out.println(sourceFilePath.getName() + " --> " + + htmlFileName); + } + catch (IOException exception) + { + System.out.println(exception); + } + } + + // constant 'States' java source code can be in + public final static class State + { + public final static State TEXT = new State(); + public final static State IMPORT_NAME = new State(); + public final static State PARAM_VARIABLE = new State(); + public final static State JAVADOC = new State(); + public final static State PACKAGE_NAME = new State(); + public final static State DOUBLE_QUOTE = new State(); + public final static State SINGLE_QUOTE = new State(); + public final static State TRADITIONAL_COMMENT = new State(); + public final static State LINE_COMMENT = new State(); + + // empty constructor + private State() + { + // empty body + } + } + + // Convert java source code StringBufffer into colorized (and tab spaced) + // HTML String . + // Assumes that Java naming convention is used + // Uses a very basic state machine design. + public String makeHTML(StringBuffer bufferIn, String sourceFileName) + { + int codeLineNumber = 0; + boolean isNewLine = true; + boolean isNewBlock = true; + int identifierLength = 0; + int qualifiedIdentifierLength = 0; + int presentIndex = -1; + int spaceLength = 0; + int saveIndex = 0; + char presentChar = 0; + State presentState = State.TEXT; + StringBuffer bufferOut = new StringBuffer(8192); + if (!isCodeSnippet) + { + bufferOut.append("\r\n"); + if (isXHTML_1_1) + { + bufferOut.append("\r\n"); + bufferOut.append("\r\n"); + } + else + { + bufferOut.append("\r\n"); + bufferOut.append("\r\n"); + } + bufferOut.append(" \r\n"); + bufferOut.append(" \r\n"); + bufferOut.append(" " + sourceFileName + "\r\n"); + bufferOut.append(" \r\n"); + bufferOut.append(" \r\n"); + if (hasInternalStyleSheet) + { + bufferOut.append(" \r\n"); + } + + if (hasExternalStyleSheet) + { + bufferOut.append(" \r\n"); + } + bufferOut.append(" \r\n"); + bufferOut.append(" \r\n"); + } + if (hasTitle) + { + bufferOut.append("

\r\n"); + bufferOut.append(" " + sourceFileName + "\r\n"); + bufferOut.append("
\r\n"); + bufferOut.append("
\r\n"); + } + if (hasLegend) + { + bufferOut.append("
\r\n"); + bufferOut.append(" Legend\r\n"); + bufferOut.append("
\r\n"); + bufferOut.append("
\r\n"); + bufferOut.append("
\r\n"); + bufferOut.append(" "); + bufferOut.append("keyword\r\n"); + bufferOut.append(" "); + bufferOut.append("method\r\n"); + bufferOut.append(" variable" + + "\r\n"); + bufferOut.append(" " + + "singleLineComment\r\n"); + bufferOut.append(" " + + "traditionalComment\r\n"); + bufferOut.append(" " + + "javadocComment\r\n"); + bufferOut.append(" javadocTag" + + "\r\n"); + bufferOut.append(" " + + "importName\r\n"); + bufferOut.append(" " + + "packageName\r\n"); + bufferOut.append(" " + + "primitiveType\r\n"); + bufferOut.append(" " + + "nonPrimitiveType\r\n"); + bufferOut.append(" " + + "constructor\r\n"); + bufferOut.append(" " + + "constant\r\n"); + bufferOut.append(" " + + "doubleQuote\r\n"); + bufferOut.append(" " + + "singleQuote\r\n"); + bufferOut.append(" " + + "numericLiteral\r\n"); + bufferOut.append(" " + + "primitiveLiteral\r\n"); + bufferOut.append("
\r\n"); + bufferOut.append("
\r\n"); + bufferOut.append("
\r\n"); + } + bufferOut.append("
\r\n"); + if (hasLineModulusCodeBlocks) + { + bufferOut.append("
\r\n");
+        }
+        else
+        {
+            bufferOut.append("
\r\n");
+        }
+        // process the input Java code Stringbuffer
+        // subtract 2 from the bufferIn.length() to get EOF marker
+        while (presentIndex++ < (bufferIn.length() - 2))
+        {
+            for (int i = 0; i < extraIndentation; i++)
+            {
+                bufferOut.append(" ");
+            }
+            if ((hasLineNumbers || hasLineModulusCodeBlocks) && isNewLine)
+            {
+                // add line numbers if desired
+                // line numbers are 1 - 9999 then rotate line numbers
+                codeLineNumber = (++codeLineNumber)%10000;
+                if ((lineModulus > 0) && hasLineModulusCodeBlocks && 
+                    (codeLineNumber%lineModulus == 1))
+                {
+                    if (isNewBlock)
+                    {
+                        if ((State.TRADITIONAL_COMMENT == presentState) ||
+                            (State.JAVADOC == presentState))
+                        {
+                                bufferOut.insert((bufferOut.length() - 
+                                                  ("\r\n").length()), 
+                                                 "");
+                        }
+                        bufferOut.append("
\r\n"); + bufferOut.append("
"); + bufferOut.append("\r\n
\r\n");
+                        if (State.TRADITIONAL_COMMENT == presentState)
+                        {
+                            bufferOut.append("");
+                        }
+                        if (State.JAVADOC == presentState)
+                        {
+                            bufferOut.append("");
+                        }
+                    }
+                    isNewBlock = !isNewBlock;
+                }
+                // make straight columns of line numbers
+                if (codeLineNumber < 1000)
+                {
+                    bufferOut.append(" ");
+                }
+                if (codeLineNumber < 100)
+                {
+                    bufferOut.append(" ");
+                }
+                if (codeLineNumber < 10)
+                {
+                    bufferOut.append(" ");
+                }
+                bufferOut.append("");
+
+                if (hasLineNumbers)
+                {
+                    if ((lineModulus > 0) && (codeLineNumber%lineModulus == 0))
+                    {
+                        bufferOut.append("");
+                        bufferOut.append(codeLineNumber);
+                        bufferOut.append(": ");
+                        if (hasLineModulusDrawnLines)
+                        {
+                            // compute spaceLength so a line can be drawn
+                            while ((presentIndex != (bufferIn.length() - 1)) &&
+                                   ((Character.isSpaceChar(
+                                     bufferIn.charAt(presentIndex))) ||
+                                    (bufferIn.charAt(presentIndex) == '\t')))
+                            {
+                                // for each tab, insert tabSize spaces 
+                                if (bufferIn.charAt(presentIndex) == '\t')
+                                {
+                                    for (int i = 0; i < tabSize; i++)
+                                    {
+                                        bufferIn.insert(presentIndex + 1, " ");
+                                    }
+                                    presentIndex++;
+                                    continue;
+                                }
+                                if (' ' == bufferIn.charAt(presentIndex))
+                                {
+                                    // read a space so place a space
+                                    bufferOut.append(" ");
+                                    spaceLength += (" ").length();
+                                }
+                                else
+                                {
+                                    // a white space character was read
+                                    bufferOut.append(bufferIn.charAt(
+                                        presentIndex));
+                                    ++spaceLength;
+                                }
+                                presentIndex++;
+                            }
+                            // check if line is empty 
+                            // (no printable characters on line)
+                            if ((presentIndex == (bufferIn.length() - 1)) ||
+                                (Character.isWhitespace(bufferIn.charAt(
+                                     presentIndex))))
+                            {
+                                spaceLength = 0;
+                            }
+                            // draw the line
+                            if (spaceLength > 1)
+                            {
+                                bufferOut.insert((bufferOut.length() - 
+                                                  spaceLength), "");
+                                bufferOut.insert((bufferOut.length() - 
+                                                  (" ").length()), "");
+                            }
+                            spaceLength = 0;
+                        }
+                    }
+                    else 
+                    {
+                        // line numbers are in lineNumberColor 
+                        bufferOut.append("");
+                        bufferOut.append(codeLineNumber);
+                        bufferOut.append(": ");
+                    }
+                }
+                isNewLine = false;
+
+                bufferOut.append("");
+            }
+            // a state machine
+            presentChar = bufferIn.charAt(presentIndex);
+            if ((Character.isJavaIdentifierPart(presentChar)) ||
+                ((State.IMPORT_NAME == presentState) && (presentChar == '*')))
+            {
+                // this is an identifier
+                bufferOut.append(presentChar);
+                identifierLength++;
+                continue; // keep adding characters until identifier is done
+            } 
+            if (identifierLength > 0)
+            {
+                // identifier
+                qualifiedIdentifierLength = 
+                    qualifiedIdentifierLength + identifierLength;
+                if (bufferIn.charAt(presentIndex) == '.')
+                {
+                    // qualified identifier 
+                    bufferOut.append(presentChar);
+                    qualifiedIdentifierLength++;
+                    identifierLength = 0;
+                    continue;  // keep adding characters to qualified identifier
+                }
+                String identifier = 
+                    bufferOut.substring(bufferOut.length() - 
+                                        identifierLength);
+                if ((State.PARAM_VARIABLE == presentState))
+                {
+                    // any identifier after a param in a javadoc is assumed to
+                    // be a variable 
+                    bufferOut.insert(bufferOut.length() -
+                                     qualifiedIdentifierLength,
+                                     "");
+                    bufferOut.append("");
+                    presentState = State.JAVADOC;
+                }
+                else if (State.JAVADOC == presentState)
+                {
+                    // in javadoc state 
+                    if ((javadocTagCollection.contains(identifier)) &&
+                        (bufferIn.charAt(presentIndex - 
+                                         (identifierLength + 1)) == '@'))
+                    {
+                        // identifier is a javadocTag
+                        bufferOut.insert(bufferOut.length() - identifierLength,
+                                         "");
+                        bufferOut.append("");
+                        if (("param").equals(identifier))
+                        {
+                            // any identifier after a param is assumed to
+                            // be a variable, get into a state to do this 
+                            presentState = State.PARAM_VARIABLE;
+                        }
+                    }
+                }
+                else if (State.IMPORT_NAME == presentState)
+                {
+                    // import identifier
+                    bufferOut.insert(bufferOut.length() - 
+                                     qualifiedIdentifierLength,
+                                     "");
+                    bufferOut.append("");
+                    presentState = State.TEXT;
+                }
+                else if (State.PACKAGE_NAME == presentState)
+                {
+                    // package identifier
+                    bufferOut.insert(bufferOut.length() - 
+                                     qualifiedIdentifierLength,
+                                     "");
+                    bufferOut.append("");
+                    presentState = State.TEXT;
+                }
+                else if (State.TEXT == presentState)
+                {
+                    if (keywordCollection.contains(identifier))
+                    {
+                        // identifier is a keyword 
+                        bufferOut.insert(bufferOut.length() - 
+                                         qualifiedIdentifierLength,
+                                         "");
+                        bufferOut.append("");
+                        if (("import").equals(identifier))
+                        {
+                            // anything after an import in text mode must be 
+                            // an import name, so enter state to process this
+                            presentState = State.IMPORT_NAME;
+                        }
+                        else if (("package").equals(identifier))
+                        {
+                            // anything after an package in text mode must be 
+                            // an package name, so enter state to process this
+                            presentState = State.PACKAGE_NAME;
+                        }
+                    }
+                    else if (primitiveTypeCollection.contains(identifier))
+                    {
+                        // identifier is a primitive type  
+                        bufferOut.insert(bufferOut.length() -
+                                         qualifiedIdentifierLength,
+                                         "");
+                        bufferOut.append("");
+                    }
+                    else if ((identifier.equals(identifier.toUpperCase())) &&
+                             (!(Character.isDigit(identifier.charAt(0)))))
+                    {
+                        // identifier is a constant
+                        bufferOut.insert(bufferOut.length() -
+                                         qualifiedIdentifierLength, 
+                                         "");
+                        bufferOut.append("");
+                    }
+                    else if (Character.isUpperCase(identifier.charAt(0)))
+                    {
+                        // identifier is a constructor or non-primitive type
+                        // eat white space 
+                        saveIndex = presentIndex;
+                        while (Character.isWhitespace(
+                                   bufferIn.charAt(saveIndex++)))
+                        {
+                            //empty body
+                        }
+                        if (bufferIn.charAt(--saveIndex) == '(')
+                        {   // identifier is a constructor
+                            bufferOut.insert(bufferOut.length() -
+                                             qualifiedIdentifierLength,
+                                             "");
+                            bufferOut.append("");
+                        }
+                        else
+                        {
+                            // identifier is a non-primitive type 
+                            bufferOut.insert(bufferOut.length() -
+                                             qualifiedIdentifierLength,
+                                             "");
+                            bufferOut.append("");
+                        }
+                    }
+                    else if (!(Character.isDigit(identifier.charAt(0)) ||
+                               primitiveLiteralCollection.contains(identifier)))
+                    {
+                        // identifier is a method or a variable
+                        // eat white space
+                        saveIndex = presentIndex;
+                        while (Character.isWhitespace(
+                                   bufferIn.charAt(saveIndex++)))
+                        {
+                            // empty body
+                        }
+                        --saveIndex;
+                        // identifier is a method
+                        if (bufferIn.charAt(saveIndex) == '(')
+                        {
+                            bufferOut.insert(bufferOut.length() - 
+                                             qualifiedIdentifierLength, 
+                                             "");
+                            bufferOut.append("");                 
+                        }
+                        else if (bufferIn.charAt(saveIndex) == ',')
+                        {
+                            // comma seperated variables
+                            bufferOut.insert(bufferOut.length() - 
+                                             qualifiedIdentifierLength, 
+                                             "");
+                            bufferOut.append(""); 
+                        }
+                        else
+                        {
+                            // a variable
+                            // take care of cases such as array[index].variable
+                            if (bufferIn.charAt(presentIndex - 
+                                                (qualifiedIdentifierLength 
+                                                 + 1)) == '.')
+                            {
+                                qualifiedIdentifierLength++;
+                            }
+                            bufferOut.insert(bufferOut.length() - 
+                                             qualifiedIdentifierLength, 
+                                             "");
+                            bufferOut.append("");                        
+                        }
+                    }
+                    else
+                    {
+                        if (primitiveLiteralCollection.contains(identifier))
+                        {
+                            // primitiveLiteral (boolean or null)
+                            bufferOut.insert(bufferOut.length() -
+                                             identifierLength, "");
+                            bufferOut.append("");
+                        }
+                        // a numeric literal
+                        else 
+                        {
+                            if (((presentIndex - 
+                                  (qualifiedIdentifierLength + 1)) > 0) && 
+                                (bufferIn.charAt(presentIndex - 
+                                     (qualifiedIdentifierLength + 1)) == '.'))
+                            {
+                                qualifiedIdentifierLength++;
+                            }
+                            bufferOut.insert(bufferOut.length() - 
+                                             qualifiedIdentifierLength, 
+                                             "");
+                            bufferOut.append("");
+                        }
+                    }
+                }
+                qualifiedIdentifierLength = 0;
+                identifierLength = 0;
+            }
+            // process characters NOT in identifiers 
+            switch (presentChar)
+            {
+                case '&': //ampersand
+                    bufferOut.append("&");  // HTMLify character
+                    break;
+                case '<': // less than sign
+                    bufferOut.append("<");   // HTMLify character
+                    break;
+                case '>': // greater than sign
+                    bufferOut.append(">");   // HTMLify character
+                    break;
+                case '\"': // double quote
+                    bufferOut.append("""); // HTMLify character
+                    if (State.TEXT == presentState)
+                    {
+                        presentState = State.DOUBLE_QUOTE;
+                        bufferOut.insert(bufferOut.length()-(""").length(),
+                                         "");
+                    }   
+                    else if (State.DOUBLE_QUOTE == presentState)
+                    {
+                        presentState = State.TEXT;
+                        bufferOut.append("");
+                    }
+                    break;
+                case '\'': // single quote
+                    bufferOut.append("\'");
+                    if (State.TEXT == presentState)
+                    {
+                        presentState = State.SINGLE_QUOTE;
+                        bufferOut.insert(bufferOut.length() - ("\'").length(), 
+                                         "");
+                    }
+                    else if (State.SINGLE_QUOTE == presentState)
+                    {
+                        presentState = State.TEXT;
+                        bufferOut.append("");
+                    }
+                    break;
+                case '\\': // backslash
+                    bufferOut.append("\\");
+                    if ((State.DOUBLE_QUOTE == presentState) || 
+                         (State.SINGLE_QUOTE == presentState))
+                    {
+                        // treat as a character escape sequence 
+                        bufferOut.append(bufferIn.charAt(++presentIndex));
+                    }
+                    break;
+                case '\t': // tab
+                    // replace tabs with tabsize number of spaces
+                    for (int i = 0; i < tabSize; i++) 
+                    {
+                        bufferOut.append(' ');
+                    }
+                    break;
+                case '*': // star
+                    bufferOut.append("*");
+                    if ((State.TEXT ==  presentState) && 
+                        (bufferIn.charAt(presentIndex - 1) == '/'))
+                    {
+                        if (((bufferIn.length() - 1) > presentIndex)  &&
+                            (bufferIn.charAt(presentIndex + 1) == '*'))
+                        {
+                            presentState = State.JAVADOC;
+                            bufferOut.insert(bufferOut.length() - 
+                                             ("/*").length(), "");
+                        }
+                        else
+                        {                        
+                            presentState = State.TRADITIONAL_COMMENT;
+                            bufferOut.insert(bufferOut.length() - 
+                                             ("/*").length(), "");
+                        }
+                    }
+                    break;
+                case '/': // foward slash
+                    bufferOut.append("/");
+                    if (((State.TRADITIONAL_COMMENT == presentState) || 
+                         (State.JAVADOC == presentState)) &&
+                        (bufferIn.charAt(presentIndex - 1) == '*'))
+                    {
+                        bufferOut.append("");
+                        presentState = State.TEXT;
+                    }
+                    if ((State.TEXT == presentState) && 
+                        (presentIndex > 0)  &&
+                        (bufferIn.charAt(presentIndex - 1) == '/'))
+                    {   
+                        bufferOut.insert(bufferOut.length() - ("//").length(), 
+                                         "");
+                        presentState = State.LINE_COMMENT;
+                    } 
+                    break;
+                case '\r': // carriage return
+                    // fall through  
+                case '\n': // line feed
+                    // all HTML lines end in \r\n
+                    if ((bufferIn.charAt(presentIndex) == '\r') &&
+                        ((bufferIn.length() - 1) > presentIndex)  &&
+                        (bufferIn.charAt(presentIndex + 1) == '\n'))
+                    {    
+                        ++presentIndex;
+                    }
+                    // end single line comments
+                    if (State.LINE_COMMENT == presentState)
+                    {
+                        bufferOut.append("");
+                        presentState = State.TEXT;
+                    }
+                    // end of block  
+                    if ((lineModulus > 0) && hasLineModulusCodeBlocks && 
+                        ((codeLineNumber%lineModulus == 0) && !isNewBlock))
+                    {
+                        // end multi-line spanning states
+                        if ((State.TRADITIONAL_COMMENT == presentState) ||
+                            (State.JAVADOC == presentState))
+                        {
+                             bufferOut.append("");
+                        }
+                        bufferOut.append("\r\n");
+                        bufferOut.append("
\r\n"); + bufferOut.append("
\r\n"); + bufferOut.append("
\r\n");
+                        // restart multi-line spanning states
+                        if (State.TRADITIONAL_COMMENT == presentState)
+                        {
+                            bufferOut.append("");
+                        }
+                        if (State.JAVADOC == presentState)
+                        {
+                            bufferOut.append("");
+                        }
+                    }
+                    else
+                    {
+                        // div automatically starts new line 
+                        bufferOut.append("\r\n");
+                    }
+                    isNewLine = true;
+                    break;
+                case 0: // nul character
+                    if ((State.LINE_COMMENT == presentState) && 
+                        (presentIndex == (bufferIn.length() - 1)))
+                    {
+                        bufferOut.append("");
+                    }
+                    break;
+                default:  // everything else 
+                    bufferOut.append(presentChar);
+            }
+            qualifiedIdentifierLength = 0;
+        }
+        if (presentState == State.LINE_COMMENT) {
+            bufferOut.append("\r\n");
+        }
+
+        bufferOut.append("
\r\n"); + // end block early if no more source code + if ((lineModulus > 0) && hasLineModulusCodeBlocks && !isNewBlock && + (codeLineNumber%lineModulus != 0)) + { + bufferOut.append("
\r\n"); + } + bufferOut.append(" \r\n"); // end div of sourceCodeStyle + // if code snippet then don't add ending tags of xhtml page + if (!isCodeSnippet) + { + // if footer mode then add a footer + if (hasFooter) + { + bufferOut.append("
\r\n"); + bufferOut.append("
\r\n"); + if (hasFooterIcons) + { + if (hasFooterDate) + { + bufferOut.append(" \r\n"); + } + bufferOut.append(" \r\n"); + bufferOut.append(" \"Valid\r\n"); + bufferOut.append(" \r\n"); + bufferOut.append("  \r\n"); + bufferOut.append(" \r\n"); + bufferOut.append(" \"Valid\r\n"); + bufferOut.append(" \r\n"); + } + else + { + bufferOut.append(" This is a valid\r\n"); + bufferOut.append(" XHTML 1.1\r\n"); + } + else + { + bufferOut.append("\">XHTML 1.0\r\n"); + } + bufferOut.append(" with\r\n"); + bufferOut.append(" CSS\r\n"); + bufferOut.append(" document \r\n"); + if (hasFooterDate) + { + bufferOut.append(" \r\n"); + } + } + bufferOut.append("
\r\n"); + } + bufferOut.append(" \r\n"); + bufferOut.append("\r\n"); + } + return bufferOut.toString(); + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java index 2172628a671..43f31a2fd9c 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/ClassWrapper.java @@ -217,7 +217,18 @@ public class ClassWrapper MethodNode m = (MethodNode) i.next(); String desc = MethodHelper.getBridgeTarget(m); if (desc != null) - bridgeTargets.add(m.name + desc); + { + String sum = m.name + desc; + boolean newTarget = bridgeTargets.add(sum); + if (newTarget) + { + // Bridge target that is new in this class. + String cname = this.name; + int index = cname.lastIndexOf('/'); + cname = cname.substring(index + 1); + methodNameMap.put(sum, cname + "$" + m.name); + } + } } } @@ -247,18 +258,7 @@ public class ClassWrapper String nameToUse; String sum = m.name + m.desc; if (bridgeTargets.contains(sum)) - { - if (methodNameMap.containsKey(sum)) - nameToUse = (String) methodNameMap.get(sum); - else - { - // Bridge target that is new in this class. - String cname = this.name; - int index = cname.lastIndexOf('/'); - cname = cname.substring(index + 1); - nameToUse = cname + "$" + m.name; - } - } + nameToUse = (String) methodNameMap.get(sum); else nameToUse = Keywords.getCxxName(m.name); methodNameMap.put(sum, nameToUse); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java index 7c508997e18..f2ca90e01b6 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java @@ -92,7 +92,7 @@ public class JniHelper public static String mangle(String name) { - StringBuffer result = new StringBuffer(); + StringBuilder result = new StringBuilder(); for (int i = 0; i < name.length(); ++i) { char c = name.charAt(i); diff --git a/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java b/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java index 6bf3193fc31..524796d3bbc 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java +++ b/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java @@ -148,7 +148,7 @@ public class Native2ASCII String s = rdr.readLine(); if (s == null) break; - StringBuffer sb = new StringBuffer(s.length() + 80); + StringBuilder sb = new StringBuilder(s.length() + 80); for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); diff --git a/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java index 6c6164d21f4..87ade64cc95 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java +++ b/libjava/classpath/tools/gnu/classpath/tools/orbd/PersistentMap.java @@ -165,7 +165,7 @@ public class PersistentMap */ public String getKey(String id, String kind) { - StringBuffer b = new StringBuffer(id.length() + 8); + StringBuilder b = new StringBuilder(id.length() + 8); appEscaping(b, id); b.append('.'); if (kind != null && kind.length() > 0) @@ -180,7 +180,7 @@ public class PersistentMap * @param b a buffer to append the contents to. * @param s a string to append. */ - void appEscaping(StringBuffer b, String s) + void appEscaping(StringBuilder b, String s) { char c; for (int i = 0; i < s.length(); i++) diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java index e853a5a1b56..255946711db 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java @@ -330,7 +330,7 @@ public class ClassRmicCompiler { Method m = remotemethods[i].meth; - StringBuffer desc = new StringBuffer(); + StringBuilder desc = new StringBuilder(); desc.append(getPrettyName(m.getReturnType()) + " "); desc.append(m.getName() + "("); @@ -1712,7 +1712,7 @@ public class ClassRmicCompiler private static String getPrettyName(Class cls) { - StringBuffer str = new StringBuffer(); + StringBuilder str = new StringBuilder(); for (int count = 0;; count++) { if (! cls.isArray()) diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java index 64eb2eaf66c..70793cf6cd3 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/Generator.java @@ -53,7 +53,7 @@ public class Generator + resourcePath); BufferedReader r = new BufferedReader(new InputStreamReader(in)); - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); String s; try @@ -90,7 +90,7 @@ public class Generator { BufferedReader r = new BufferedReader(new StringReader(template)); String s; - StringBuffer b = new StringBuffer(template.length()); + StringBuilder b = new StringBuilder(template.length()); try { Iterator iter; diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java index 335a0a65c30..650468d9465 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/MethodGenerator.java @@ -93,7 +93,7 @@ public class MethodGenerator implements AbstractMethodGenerator */ public String getArgumentList() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); @@ -115,7 +115,7 @@ public class MethodGenerator implements AbstractMethodGenerator */ public String getArgumentNames() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); @@ -135,7 +135,7 @@ public class MethodGenerator implements AbstractMethodGenerator */ public String getThrows() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getExceptionTypes(); @@ -239,7 +239,7 @@ public class MethodGenerator implements AbstractMethodGenerator */ public String getRda() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); for (int i = 0; i < args.length; i++) @@ -263,7 +263,7 @@ public class MethodGenerator implements AbstractMethodGenerator */ public String getStubParaWriteStatement() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); for (int i = 0; i < args.length; i++) diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java index 48abb8fade9..b526bbb9f75 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/RmiMethodGenerator.java @@ -74,7 +74,7 @@ public class RmiMethodGenerator */ public String getArgumentList() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); @@ -96,7 +96,7 @@ public class RmiMethodGenerator */ public String getArgumentNames() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); @@ -116,7 +116,7 @@ public class RmiMethodGenerator */ public String getThrows() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getExceptionTypes(); @@ -173,7 +173,7 @@ public class RmiMethodGenerator */ public String getStaticMethodDeclarations() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); for (int i = 0; i < args.length; i++) @@ -201,7 +201,7 @@ public class RmiMethodGenerator if (args.length==0) return "NO_ARGS"; - StringBuffer b = new StringBuffer("new Object[] {"); + StringBuilder b = new StringBuilder("new Object[] {"); for (int i = 0; i < args.length; i++) { @@ -246,7 +246,7 @@ public class RmiMethodGenerator */ public String getArgListAsClassArray() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Class[] args = method.getParameterTypes(); for (int i = 0; i < args.length; i++) diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java index a889492f9b8..b7ad7f440a5 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java @@ -140,7 +140,7 @@ public class SourceGiopRmicCompiler /** * Clear data, preparing for the next compilation. */ - public void reset() + public synchronized void reset() { packag = name = implName = stubName = null; implementedRemotes.clear(); @@ -329,7 +329,7 @@ public class SourceGiopRmicCompiler * the class to name * @return the name of class as it should appear in java language */ - public String name(Class nameIt) + public synchronized String name(Class nameIt) { if (nameIt.isArray()) { @@ -342,7 +342,7 @@ public class SourceGiopRmicCompiler dimension++; } - StringBuffer brackets = new StringBuffer(); + StringBuilder brackets = new StringBuilder(); for (int i = 0; i < dimension; i++) { @@ -388,7 +388,7 @@ public class SourceGiopRmicCompiler */ public String getIdList(Collection remotes) { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); // Keep the Ids sorted, ensuring, that the same order will be preserved // between compilations. @@ -420,7 +420,7 @@ public class SourceGiopRmicCompiler String template = getResource("Stub.jav"); // Generate methods. - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Iterator iter = methods.iterator(); while (iter.hasNext()) { @@ -444,7 +444,7 @@ public class SourceGiopRmicCompiler */ public String getAllInterfaces() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Iterator iter = implementedRemotes.iterator(); while (iter.hasNext()) @@ -494,7 +494,7 @@ public class SourceGiopRmicCompiler iter = sortedMethods.iterator(); - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); MethodGenerator prev = null; @@ -539,7 +539,7 @@ public class SourceGiopRmicCompiler imp.add("import " + ic + ";\n"); } - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); it = imp.iterator(); while (it.hasNext()) diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java index 3779c5d28fb..20ab8c15637 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/SourceRmicCompiler.java @@ -56,7 +56,7 @@ public class SourceRmicCompiler extends SourceGiopRmicCompiler String template = getResource("Stub_12.jav"); // Generate methods. - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Iterator iter = methods.iterator(); while (iter.hasNext()) { @@ -99,7 +99,7 @@ public class SourceRmicCompiler extends SourceGiopRmicCompiler */ public String getStubMethodDeclarations() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Iterator iter = methods.iterator(); @@ -122,7 +122,7 @@ public class SourceRmicCompiler extends SourceGiopRmicCompiler */ public String getStubMethodInitializations() { - StringBuffer b = new StringBuffer(); + StringBuilder b = new StringBuilder(); Iterator iter = methods.iterator(); diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/AuthorTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/AuthorTaglet.java new file mode 100644 index 00000000000..d3bb3719b92 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/AuthorTaglet.java @@ -0,0 +1,276 @@ +/* gnu.classpath.tools.taglets.AuthorTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import java.util.regex.Pattern; +import java.util.regex.Matcher; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Tag; + +/** + * The default Taglet which handles Author information. + * + * @author Julian Scheid (julian@sektor37.de) + */ +public class AuthorTaglet implements Taglet { + + /** + * Enum class which denotes whether and how to replace email + * addresses in author tags. + */ + public static class EmailReplacement { + private EmailReplacement() {} + + /** + * Specifies that email addresses should not be replaced. + */ + public static final EmailReplacement NO_REPLACEMENT = new EmailReplacement(); + + /** + * Specifies that author tag text matching "Real Name + * (user@domain.tld)" is converted to "<a + * href="mailto:user@domain.tld">Real Name</a>. + */ + public static final EmailReplacement MAILTO_NAME = new EmailReplacement(); + + /** + * Specifies that author tag text matching "Real Name + * (user@domain.tld)" is converted to "Real Name (<a + * href="mailto:user@domain.tld">user@domain.tld</a>). + */ + public static final EmailReplacement NAME_MAILTO_ADDRESS = new EmailReplacement(); + + /** + * Specifies that author tag text matching "Real Name + * (user@domain.tld)" is converted to "Real Name (user AT + * domain DOT tld)", where the "AT" and "DOT" replacement are + * specified by AuthorTaglet.emailAtReplacement and + * AuthorTaglet.emailDotReplacement. + */ + public static final EmailReplacement NAME_MANGLED_ADDRESS = new EmailReplacement(); + } + + private static EmailReplacement emailReplacementType = EmailReplacement.NO_REPLACEMENT; + private static String atReplacement = " at "; + private static String dotReplacement = " dot "; + + private static final String NAME = "author"; + private static final String SINGLE_HEADER = "Author:"; + private static final String MULTI_HEADER = "Authors:"; + + private static boolean enabled = true; + + /** + * Matches . (dot). + */ + private static final Pattern dotPattern = Pattern.compile("[.]"); + + /** + * Matches @ (at sign). + */ + private static final Pattern atPattern = Pattern.compile("[@]"); + + /** + * Matches Real Name (user@domain.tld). + */ + private static final Pattern authorEmailPattern + = Pattern.compile("^" + + "\\s*" // optional whitespace + + "(" // group #1 start (real name) + + "(?:[^\t\r\n ]|\\()+" // first name + + "(?:\\s+(?:[^\t\r\n ]|\\()+)*" // additional names + + ")" // group #1 end + + "\\s*" // optional whitespace + + "[(<]" // opening paren + + "\\s*" // optional whitespace + + "(" // group #2 start (email address) + + "(" // group #3 start (email user) + + "[A-z0-9_\\-\\.]+" // username + + ")" // group #3 end + + "[@]" // at sign + + "[A-z0-9_\\-]+(?:[.][A-z0-9_\\-]+)+[A-z]" // domain + + ")" // group #2 end + + "\\s*" // optional whitespace + + "(?:\\)|>)" // closing paren + + "$"); + + public String getName() { + return NAME; + } + + public boolean inField() { + return true; + } + + public boolean inConstructor() { + return true; + } + + public boolean inMethod() { + return true; + } + + public boolean inOverview() { + return true; + } + + public boolean inPackage() { + return true; + } + + public boolean inType() { + return true; + } + + public boolean isInlineTag() { + return false; + } + + public static void register(Map tagletMap) { + AuthorTaglet authorTaglet = new AuthorTaglet(); + tagletMap.put(authorTaglet.getName(), authorTaglet); + } + + public String toString(Tag tag) { + if (enabled) { + return toString(new Tag[] { tag }); + } + else { + return null; + } + } + + public String toString(Tag[] tags) { + if (!enabled || tags.length == 0) { + return null; + } + else { + boolean haveValidTag = false; + for (int i = 0; i < tags.length && !haveValidTag; ++i) { + if (tags[i].text().length() > 0) { + haveValidTag = true; + } + } + + if (haveValidTag) { + StringBuffer result = new StringBuffer(); + result.append("
"); + result.append("
"); + if (tags.length == 1) { + result.append(SINGLE_HEADER); + } + else { + result.append(MULTI_HEADER); + } + result.append("
"); + for (int i = 0; i < tags.length; i++) { + result.append("
"); + result.append(replaceEmail(tags[i].text())); + result.append("
"); + } + result.append("
"); + return result.toString(); + } + else { + return null; + } + } + } + + /** + * Reformat the tag text according to {@link #emailReplacementType}. + */ + private String replaceEmail(String text) { + + if (EmailReplacement.NO_REPLACEMENT == emailReplacementType) { + return text; + } + else { + Matcher matcher = authorEmailPattern.matcher(text); + if (matcher.matches()) { + String realName = matcher.group(1); + String emailAddress = matcher.group(2); + if (EmailReplacement.MAILTO_NAME == emailReplacementType) { + return "" + realName + ""; + } + else if (EmailReplacement.NAME_MAILTO_ADDRESS == emailReplacementType) { + return realName + " (" + emailAddress + ")"; + } + else if (EmailReplacement.NAME_MANGLED_ADDRESS == emailReplacementType) { + Matcher dotMatcher = dotPattern.matcher(emailAddress); + Matcher atMatcher = atPattern.matcher(dotMatcher.replaceAll(dotReplacement)); + String mangledAddress = atMatcher.replaceAll(atReplacement); + return realName + " (" + mangledAddress + ")"; + } + else { + // this shouldn't happen + return text; + } + } + else { + return text; + } + } + } + + /** + * Set the email replacement type. + */ + public static void setEmailReplacementType(EmailReplacement emailReplacementType) + { + if (null == emailReplacementType) { + throw new NullPointerException(); + } + AuthorTaglet.emailReplacementType = emailReplacementType; + } + + /** + * Set the HTML text by which the @ (at sign) in email + * addresses should be replaced if the email replacement type is + * NAME_MANGLED_ADDRESS. + */ + public static void setAtReplacement(String atReplacement) + { + AuthorTaglet.atReplacement = atReplacement; + } + + /** + * Set the HTML text by which the . (dot) in email + * addresses should be replaced if the email replacement type is + * NAME_MANGLED_ADDRESS. + */ + public static void setDotReplacement(String dotReplacement) + { + AuthorTaglet.dotReplacement = dotReplacement; + } + + /** + * Enables/disables this taglet. + */ + public static void setTagletEnabled(boolean enabled) + { + AuthorTaglet.enabled = enabled; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/CodeTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/CodeTaglet.java new file mode 100644 index 00000000000..16ed3d5b0ad --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/CodeTaglet.java @@ -0,0 +1,84 @@ +/* gnu.classpath.tools.taglets.CodeTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Doc; +import com.sun.javadoc.Tag; +import com.sun.javadoc.FieldDoc; +import com.sun.javadoc.MemberDoc; +import com.sun.javadoc.SeeTag; + +/** + * The default Taglet which shows its contents enclosed in a + * code tag. + * + * @author Julian Scheid (julian@sektor37.de) + */ +public class CodeTaglet + implements Taglet +{ + private static final String NAME = "code"; + + public String getName() { + return NAME; + } + + public boolean inField() { + return true; + } + + public boolean inConstructor() { + return true; + } + + public boolean inMethod() { + return true; + } + + public boolean inOverview() { + return true; + } + + public boolean inPackage() { + return true; + } + + public boolean inType() { + return true; + } + + public boolean isInlineTag() { + return true; + } + + public String toString(Tag tag) { + return "" + tag.text() + ""; + } + + public String toString(Tag[] tag) { + return null; + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/CopyrightTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/CopyrightTaglet.java new file mode 100644 index 00000000000..bb0d9a74d7c --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/CopyrightTaglet.java @@ -0,0 +1,106 @@ +/* gnu.classpath.tools.taglets.CopyrightTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Tag; + +/** + * A simple Taglet which handles Copyright information. + */ +public class CopyrightTaglet implements Taglet { + + private static final String NAME = "copyright"; + private static final String HEADER = "Copyright:"; + + public String getName() { + return NAME; + } + + public boolean inField() { + return true; + } + + public boolean inConstructor() { + return true; + } + + public boolean inMethod() { + return true; + } + + public boolean inOverview() { + return true; + } + + public boolean inPackage() { + return true; + } + + public boolean inType() { + return true; + } + + public boolean isInlineTag() { + return false; + } + + public static void register(Map tagletMap) { + CopyrightTaglet copyrightTaglet = new CopyrightTaglet(); + tagletMap.put(copyrightTaglet.getName(), copyrightTaglet); + } + + public String toString(Tag tag) { + return toString(new Tag[] { tag }); + } + + public String toString(Tag[] tags) { + if (tags.length == 0) { + return null; + } + else { + boolean haveValidTag = false; + for (int i = 0; i < tags.length && !haveValidTag; ++i) { + if (tags[i].text().length() > 0) { + haveValidTag = true; + } + } + + if (haveValidTag) { + StringBuffer result = new StringBuffer(); + result.append("
"); + for (int i = 0; i < tags.length; i++) { + if (tags[i].text().length() > 0) { + result.append("
Copyright © " + tags[i].text() + "
"); + } + } + result.append("
"); + return result.toString(); + } + else { + return null; + } + } + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/DeprecatedTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/DeprecatedTaglet.java new file mode 100644 index 00000000000..ba406a6ebad --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/DeprecatedTaglet.java @@ -0,0 +1,115 @@ +/* gnu.classpath.tools.taglets.DeprecatedTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Tag; + +/** + * The default Taglet which handles deprecated information. + * + * @author Julian Scheid (julian@sektor37.de) + */ +public class DeprecatedTaglet implements Taglet { + + private static final String NAME = "deprecated"; + private static final String HEADER = "Deprecated:"; + + private static boolean enabled = true; + + public String getName() { + return NAME; + } + + public boolean inField() { + return true; + } + + public boolean inConstructor() { + return true; + } + + public boolean inMethod() { + return true; + } + + public boolean inOverview() { + return true; + } + + public boolean inPackage() { + return true; + } + + public boolean inType() { + return true; + } + + public boolean isInlineTag() { + return false; + } + + public static void register(Map tagletMap) { + DeprecatedTaglet deprecatedTaglet = new DeprecatedTaglet(); + tagletMap.put(deprecatedTaglet.getName(), deprecatedTaglet); + } + + public String toString(Tag tag) { + if (enabled) { + return toString(new Tag[] { tag }); + } + else { + return null; + } + } + + public String toString(Tag[] tags) { + if (!enabled || tags.length == 0) { + return null; + } + else { + + StringBuffer result = new StringBuffer(); + result.append("
"); + result.append(HEADER); + result.append("
"); + result.append("
"); + for (int i = 0; i < tags.length; i++) { + result.append("
"); + result.append(tags[i].text()); + result.append("
"); + } + result.append("
"); + return result.toString(); + } + } + + /** + * Enables/disables this taglet. + */ + public static void setTagletEnabled(boolean enabled) + { + DeprecatedTaglet.enabled = enabled; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/GenericTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/GenericTaglet.java new file mode 100644 index 00000000000..7e18cdcac6d --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/GenericTaglet.java @@ -0,0 +1,140 @@ +/* gnu.classpath.tools.taglets.GenericTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Tag; + +/** + * A taglet which can be configured at runtime. + * + * @author Julian Scheid (julian@sektor37.de) + */ +public class GenericTaglet implements Taglet { + + private String name = "since"; + private String header = "Since:"; + + private boolean scopeOverview; + private boolean scopePackage; + private boolean scopeType; + private boolean scopeConstructor; + private boolean scopeMethod; + private boolean scopeField; + + private boolean enabled = true; + + public GenericTaglet(String name, + String header, + boolean scopeOverview, + boolean scopePackage, + boolean scopeType, + boolean scopeConstructor, + boolean scopeMethod, + boolean scopeField) + { + this.name = name; + this.header = header; + this.scopeOverview = scopeOverview; + this.scopePackage = scopePackage; + this.scopeType = scopeType; + this.scopeConstructor = scopeConstructor; + this.scopeMethod = scopeMethod; + this.scopeField = scopeField; + } + + public String getName() { + return name; + } + + public boolean inField() { + return scopeField; + } + + public boolean inConstructor() { + return scopeConstructor; + } + + public boolean inMethod() { + return scopeMethod; + } + + public boolean inOverview() { + return scopeOverview; + } + + public boolean inPackage() { + return scopePackage; + } + + public boolean inType() { + return scopeType; + } + + public boolean isInlineTag() { + return false; + } + + public void register(Map tagletMap) { + tagletMap.put(getName(), this); + } + + public String toString(Tag tag) { + if (enabled) { + return toString(new Tag[] { tag }); + } + else { + return null; + } + } + + public String toString(Tag[] tags) { + if (!enabled || tags.length == 0) { + return null; + } + else { + + StringBuffer result = new StringBuffer(); + result.append("
"); + result.append(header); + result.append("
"); + result.append("
"); + for (int i = 0; i < tags.length; i++) { + result.append("
"); + result.append(tags[i].text()); + result.append("
"); + } + result.append("
"); + return result.toString(); + } + } + + /** + * Enables/disables this taglet. + */ + public void setTagletEnabled(boolean enabled) + { + this.enabled = enabled; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/GnuExtendedTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/GnuExtendedTaglet.java new file mode 100644 index 00000000000..2e67d65191f --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/GnuExtendedTaglet.java @@ -0,0 +1,31 @@ +/* gnu.classpath.tools.taglets.GnuExtendedTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import com.sun.javadoc.Tag; +import com.sun.tools.doclets.Taglet; + +public interface GnuExtendedTaglet + extends Taglet +{ + public String toString(Tag tag, TagletContext context); + public String toString(Tag[] tags, TagletContext context); +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/SinceTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/SinceTaglet.java new file mode 100644 index 00000000000..dac68a8c46a --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/SinceTaglet.java @@ -0,0 +1,144 @@ +/* gnu.classpath.tools.taglets.SinceTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Tag; + +import gnu.classpath.tools.doclets.InlineTagRenderer; + +/** + * The default Taglet which handles since information. + * + * @author Julian Scheid (julian@sektor37.de) + */ +public class SinceTaglet implements GnuExtendedTaglet { + + private static final String NAME = "since"; + private static final String HEADER = "Since:"; + + private static boolean enabled = true; + + private InlineTagRenderer inlineTagRenderer; + + public SinceTaglet(InlineTagRenderer inlineTagRenderer) + { + this.inlineTagRenderer = inlineTagRenderer; + } + + public String getName() { + return NAME; + } + + public boolean inField() { + return true; + } + + public boolean inConstructor() { + return true; + } + + public boolean inMethod() { + return true; + } + + public boolean inOverview() { + return true; + } + + public boolean inPackage() { + return true; + } + + public boolean inType() { + return true; + } + + public boolean isInlineTag() { + return false; + } + + public String toString(Tag tag) { + // should raise assertion + if (enabled) { + return toString(new Tag[] { tag }); + } + else { + return null; + } + } + + public String toString(Tag[] tags) { + // should raise assertion + return toString(tags, null); + } + + public String toString(Tag tag, TagletContext context) + { + return null; + } + + public String toString(Tag[] tags, TagletContext context) + { + if (!enabled || tags.length == 0) { + return null; + } + else { + boolean haveValidTag = false; + for (int i = 0; i < tags.length && !haveValidTag; ++i) { + if (tags[i].text().length() > 0) { + haveValidTag = true; + } + } + + if (haveValidTag) { + StringBuffer result = new StringBuffer(); + result.append("
"); + result.append("
"); + result.append(HEADER); + result.append("
"); + for (int i = 0; i < tags.length; ++i) { + if (tags[i].text().length() > 0) { + result.append("
"); + result.append(inlineTagRenderer.renderInlineTags(tags[i].inlineTags(), context)); + result.append("
"); + } + } + result.append("
"); + return result.toString(); + } + else { + return null; + } + } + } + + /** + * Enables/disables this taglet. + */ + public static void setTagletEnabled(boolean enabled) + { + SinceTaglet.enabled = enabled; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/TagletContext.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/TagletContext.java new file mode 100644 index 00000000000..cf706b6a95c --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/TagletContext.java @@ -0,0 +1,23 @@ +package gnu.classpath.tools.taglets; + +import com.sun.javadoc.Doc; + +public class TagletContext +{ + protected Doc doc; + + public TagletContext(Doc doc) + { + this.doc = doc; + } + + public Doc getDoc() + { + return this.doc; + } + + public String toString() + { + return "TagletContext{doc=" + doc + "}"; + } +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/ValueTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/ValueTaglet.java new file mode 100644 index 00000000000..0f194ae102e --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/ValueTaglet.java @@ -0,0 +1,113 @@ +/* gnu.classpath.tools.taglets.ValueTaglet + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Doc; +import com.sun.javadoc.Tag; +import com.sun.javadoc.FieldDoc; +import com.sun.javadoc.MemberDoc; +import com.sun.javadoc.SeeTag; + +/** + * The default Taglet which shows final static field values. + * + * @author Julian Scheid (julian@sektor37.de) + */ +public class ValueTaglet + implements GnuExtendedTaglet +{ + private static final String NAME = "value"; + + public String getName() { + return NAME; + } + + public boolean inField() { + return true; + } + + public boolean inConstructor() { + return true; + } + + public boolean inMethod() { + return true; + } + + public boolean inOverview() { + return true; + } + + public boolean inPackage() { + return true; + } + + public boolean inType() { + return true; + } + + public boolean isInlineTag() { + return true; + } + + public static void register(Map tagletMap) { + ValueTaglet valueTaglet = new ValueTaglet(); + tagletMap.put(valueTaglet.getName(), valueTaglet); + } + + public String toString(Tag tag) { + return null; + } + + public String toString(Tag tag, TagletContext context) { + if (0 == tag.inlineTags().length) { + if (context.getDoc().isField()) { + FieldDoc fieldDoc = (FieldDoc)context.getDoc(); + if (fieldDoc.isStatic() && fieldDoc.isFinal()) { + return fieldDoc.constantValueExpression(); + } + } + } + else { + MemberDoc referencedMember = ((SeeTag)tag).referencedMember(); + if (null != referencedMember && referencedMember.isField()) { + FieldDoc fieldDoc = (FieldDoc)referencedMember; + if (fieldDoc.isStatic() && fieldDoc.isFinal()) { + return fieldDoc.constantValueExpression(); + } + } + } + return ""; + } + + public String toString(Tag[] tags) { + return null; + } + + public String toString(Tag[] tags, TagletContext context) { + return null; + } + +} diff --git a/libjava/classpath/tools/gnu/classpath/tools/taglets/VersionTaglet.java b/libjava/classpath/tools/gnu/classpath/tools/taglets/VersionTaglet.java new file mode 100644 index 00000000000..e4eddb822c6 --- /dev/null +++ b/libjava/classpath/tools/gnu/classpath/tools/taglets/VersionTaglet.java @@ -0,0 +1,136 @@ +/* gnu.classpath.tools.taglets.VersionTaglet + Copyright (C) 2001 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +package gnu.classpath.tools.taglets; + +import java.util.Map; + +import com.sun.tools.doclets.Taglet; + +import com.sun.javadoc.Tag; + +/** + * The default Taglet which handles version information. + * + * @author Julian Scheid (julian@sektor37.de) + */ +public class VersionTaglet implements Taglet { + + private static final String NAME = "version"; + private static final String HEADER = "Version:"; + + private static boolean enabled = true; + + public String getName() { + return NAME; + } + + public boolean inField() { + return true; + } + + public boolean inConstructor() { + return true; + } + + public boolean inMethod() { + return true; + } + + public boolean inOverview() { + return true; + } + + public boolean inPackage() { + return true; + } + + public boolean inType() { + return true; + } + + public boolean isInlineTag() { + return false; + } + + public static void register(Map tagletMap) { + VersionTaglet versionTaglet = new VersionTaglet(); + tagletMap.put(versionTaglet.getName(), versionTaglet); + } + + public String toString(Tag tag) { + if (enabled) { + return toString(new Tag[] { tag }); + } + else { + return null; + } + } + + public String toString(Tag[] tags) { + if (!enabled || tags.length == 0) { + return null; + } + else { + boolean haveValidTag = false; + for (int i = 0; i < tags.length && !haveValidTag; ++i) { + if (tags[i].text().length() > 0) { + haveValidTag = true; + } + } + + if (haveValidTag) { + + StringBuffer result = new StringBuffer(); + result.append("
"); + result.append("
"); + result.append("
"); + result.append(HEADER); + result.append("
"); + boolean firstEntry = true; + for (int i = 0; i < tags.length; i++) { + if (tags[i].text().length() > 0) { + if (!firstEntry) { + result.append(", "); + } + else { + firstEntry = false; + } + result.append(tags[i].text()); + } + } + result.append("
"); + result.append(""); + return result.toString(); + } + else { + return null; + } + } + } + + /** + * Enables/disables this taglet. + */ + public static void setTagletEnabled(boolean enabled) + { + VersionTaglet.enabled = enabled; + } +} diff --git a/libjava/classpath/tools/gorbd.in b/libjava/classpath/tools/gorbd.in index 40d01eee2a1..dbe33d3a01d 100644 --- a/libjava/classpath/tools/gorbd.in +++ b/libjava/classpath/tools/gorbd.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.orbd.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.orbd.Main "$@" diff --git a/libjava/classpath/tools/grmic.in b/libjava/classpath/tools/grmic.in index 9b7314429c1..299b4b50bee 100644 --- a/libjava/classpath/tools/grmic.in +++ b/libjava/classpath/tools/grmic.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.rmic.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.rmic.Main "$@" diff --git a/libjava/classpath/tools/grmid.in b/libjava/classpath/tools/grmid.in index 7eefb769d65..73e5789ee07 100644 --- a/libjava/classpath/tools/grmid.in +++ b/libjava/classpath/tools/grmid.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.rmid.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.rmid.Main "$@" diff --git a/libjava/classpath/tools/grmiregistry.in b/libjava/classpath/tools/grmiregistry.in index d08120af922..e3bbb738615 100644 --- a/libjava/classpath/tools/grmiregistry.in +++ b/libjava/classpath/tools/grmiregistry.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.rmiregistry.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.rmiregistry.Main "$@" diff --git a/libjava/classpath/tools/gserialver.in b/libjava/classpath/tools/gserialver.in index 85aeea62d51..24acdeb81b4 100644 --- a/libjava/classpath/tools/gserialver.in +++ b/libjava/classpath/tools/gserialver.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.serialver.SerialVer "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.serialver.SerialVer "$@" diff --git a/libjava/classpath/tools/gtnameserv.in b/libjava/classpath/tools/gtnameserv.in index 4fbcf371313..119062d0939 100644 --- a/libjava/classpath/tools/gtnameserv.in +++ b/libjava/classpath/tools/gtnameserv.in @@ -45,4 +45,4 @@ datarootdir=@datarootdir@ tools_dir=@datadir@/@PACKAGE@ tools_cp=${tools_dir}/tools.zip -exec @VM_BINARY@ -Xbootclasspath/p:"${tools_cp}" gnu.classpath.tools.tnameserv.Main "$@" +exec @JAVA@ -classpath "${tools_cp}" gnu.classpath.tools.tnameserv.Main "$@" diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties b/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties index 989fde74eee..17e79c453ac 100644 --- a/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties @@ -1,5 +1,5 @@ # MessagesBundle.properties -- English language messages -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2008 Free Software Foundation, Inc. # # This file is part of GNU Classpath. # @@ -37,4 +37,4 @@ ClasspathToolParser.JArgument=pass argument to the Java runtime ClasspathToolParser.JName=OPTION -ClasspathToolParser.VersionFormat={0} (GNU Classpath) {1}\n\nCopyright 2006 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +ClasspathToolParser.VersionFormat={0} (GNU Classpath) {1}\n\nCopyright 2008 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/gjdoc_common.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/gjdoc_common.xsl new file mode 100644 index 00000000000..2b5aec1053d --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/gjdoc_common.xsl @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/about.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/about.xsl new file mode 100644 index 00000000000..fa78cb30937 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/about.xsl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +

About this API documentation

+ + + + + + + + + + + +
+ + +
+ +
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allclasses.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allclasses.xsl new file mode 100644 index 00000000000..8739d197f62 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allclasses.xsl @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + <xsl:value-of select="concat(/gjdoc:rootdoc/gjdoc:title, ' - All Classes')"/> + + + + + + + + + + + +
+
+ + +
+ +
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allpackages.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allpackages.xsl new file mode 100644 index 00000000000..d4449ef5e14 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/allpackages.xsl @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + <xsl:if test="document('index.xml',/)/gjdoc:rootdoc/gjdoc:title"> + <xsl:value-of select="document('index.xml',/)/gjdoc:rootdoc/gjdoc:title"/> + <xsl:text> - </xsl:text> + </xsl:if> + <xsl:text>Packages</xsl:text> + <xsl:value-of select="@name"/> + + + + + + All Classes

+ + + + + +
+
+ + +
+
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex.xsl new file mode 100644 index 00000000000..5aa915cd83a --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex.xsl @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ Alphabetical Index +

+ +
+ + + + + + + + + + +
+ + +

+

+ +
+ + + + + + + + + + + + + +
+ + + +
+ +
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex_chunked.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex_chunked.xsl new file mode 100644 index 00000000000..e1847385beb --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/alphaindex_chunked.xsl @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +

+ Alphabetical Index + + - + + +

+ +
+ + + + + + + + + + +
+ + + +

+ +
+ +
+ + + + + + + + + + + + + +
+ + + +
+ +
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-source.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-source.xsl new file mode 100644 index 00000000000..a6405e40c1d --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-source.xsl @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-uses.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-uses.xsl new file mode 100644 index 00000000000..17f9b3f7f32 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc-uses.xsl @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + +

+ Uses in package + +

+ +
+ + +
+ + + + + + + + + + + + + + + + + +
+
+ + + +

+ + + + + Classes in derived from + + + Fields in of type + + + Methods in returning + + + Methods in accepting parameters of type + + + Methods in throwing + + + Constructors in accepting parameters of type + + + Constructors in throwing + + + Unknown ID + + +

+
+ +
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +

+ Uses of class + + +

+
+ + + + + + + + + + + + + + + + +
+ + + +
+ +
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc.xsl new file mode 100644 index 00000000000..e54e5fb1268 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/classdoc.xsl @@ -0,0 +1,1070 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +

Field Details

+ + + + + +
+ + +

Constructor Details

+ + + + + +
+ + +

Method Details

+ + + + + + +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +

+ + + Interface + + + Class + + + +

+ +
+ + + + + + + + Enclosing Class:
+ + + + +
+ + +

+ + + + All Superinterfaces: + + + All Implemented Interfaces: + + + +
+ + + + + + + + , + + + +

+ + + + + + All Known Direct Subinterfaces:
+ + + + + + + + , + + +
+
+ + + + + + Known Implementing Classes:
+ + + + + + + + , + + +
+
+ + + + + + Known Direct Subclasses:
+ + + + + + + + , + + +
+
+ +


+ +
+ + + + + static + final + + + interface + + + abstract + class + + + +
+ + + + + extends + + + + + + + + +
+
+ + + + + implements + + + + + + + + + + + + , + + + +
+ + + +

+ + +

+ + + +
+
+ + + + +
+ + + + + + +
+ +
+
+ + + +
+
+ + + +
+
+ +
+ + + + + + + + + + + + + +
Field Summary
+ + + + +
+ +
+ + + + + + + + + + + + +
Method Summary
+ + + + +
+ +
+ + + + + + + + + + + + + + +
Constructor Summary
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + +
+ + + + native + + + static + + + final + + + abstract + + + transient + + + volatile + + + synchronized + + + + + + static + + + abstract + + + transient + + + volatile + + + synchronized + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ( + + ) + + + + +
+ + + + Deprecated. + + + + + + + + + + + +
+ + + +
+ + + + + + + + + + + + + + +   + + + , + + + + + + + + + +
+ +
+ + + + + + + - + + + + +
+
+
+
+ + + +
See Also:
+ +
+ + +
+ + + +
+
+
+
+
+ + + + + + +
+ +

+ +

+ + + + + + + +

+ +

+ + + + +

+ + + +
+ + +

+ + + + + + + + +


+ + +
+ + + + + + + +
+ +

+ +

+ + + + + + + ( + + ) +

+ + + + +
+ + + +
+
+ +

+ + + + +

Parameters:
+ + + + +
Returns:
+
+
+ + + +
+
+
+ + +
Throws:
+
+ +
+ + + + + + + + + + + - + + + +
+
+
+
+ + + + +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + images/tree-final-node.png + + + images/tree-node.png + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + * + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+            
+              
+              
+              
+            
+          
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +-- + + + + + + + + + + + + + + + +
+
Methods inherited from class
+
+ + , + +
+
+
+ + + + + + + + + + + +
+
Fields inherited from class
+
+ + , + +
+
+
+ +
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/deprecated.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/deprecated.xsl new file mode 100644 index 00000000000..4fc9dfdfdfc --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/deprecated.xsl @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+ + + +
+
+ + + + + + +
+
+ +
+
+ + + +
+
+
+
+ +
diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/descriptor.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/descriptor.xsl new file mode 100644 index 00000000000..5cdb3325d09 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/descriptor.xsl @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + This file was generated by Gjdoc + on . + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/doctranslet.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/doctranslet.xsl new file mode 100644 index 00000000000..7008f73a3f3 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/doctranslet.xsl @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + GNU Gjdoc HTML DocTranslet + + 0.6.1 + + + HTML + + + + index.html + index + index.xsl + HTML Index file + + + + index_noframes.html + index_noframes + index_noframes.xsl + HTML Index file (No Frames) + + + + descriptor.xml + descriptor + descriptor.xsl + HTML Descriptor file + + + + allclasses.html + allclasses + allclasses.xsl + HTML All Classes file + + + + allpackages.html + allpackages + allpackages.xsl + HTML All Packages file + + + + fulltree.html + fulltree + fulltree.xsl + HTML Tree file + + + + + + package + + packagedoc.xsl + HTML Documentation for package + + + + + + + class + + classdoc.xsl + HTML Documentation for + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/fulltree.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/fulltree.xsl new file mode 100644 index 00000000000..3d60bbba240 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/fulltree.xsl @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + . + + (implements + + + + + + + + + + + + + + + + + + + + + + + + , + + + ) + + + + + + + + + + + + + + + + + + + + + + + + + +
  • + + + +
  • +
    +
    +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + +

    + + + Full Class Tree + + for + + + + + Class Hierarchy for Package + + +

    + + +
      +
    • + +
    • +
    +
    + + + + + + + + + + + + + + + +
    + + + +
    +
    diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/gjdoc.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/gjdoc.xsl new file mode 100644 index 00000000000..74558abf4d1 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/gjdoc.xsl @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + GNU Gjdoc HTML Documentation + + + index.html + index.xsl + HTML Index file + + + + index_noframes.html + index_noframes.xsl + HTML Index file (No Frames) + + + + descriptor.xml + descriptor.xsl + HTML Descriptor file + + + + allclasses.html + allclasses.xsl + HTML All Classes file + + + + + allpackages.html + allpackages.xsl + HTML All Packages file + + + + + + fulltree.html + fulltree.xsl + HTML Tree file + + + + + + + + + alphaindex.html + + alphaindex_chunked.xsl + HTML Alphabetical Index (Overview) + + + + + + + alphaindex_chunked.xsl + + + + + + + + alphaindex.html + alphaindex.xsl + HTML Alphabetical Index + + + + + + + + + + packagedoc.xsl + HTML Documentation for package + + + + + packageclasses.xsl + HTML Class list for package + + + + + + + fulltree.xsl + HTML Hierarchy for package + + + + + + + + + + classdoc.xsl + HTML Documentation for + + + + + src-html/ + + classdoc-source.xsl + HTML Source for + + + + + + class-use/ + + classdoc-uses.xsl + usage information for + + + + + + + + + user.css + + user-supplied CSS stylesheet + + + + + gjdochtml.css + res/gjdochtml.css + CSS base stylesheet + + + gjdochtml-clean.css + res/gjdochtml-clean.css + CSS stylesheet 'Clean' + + + gjdochtml-sclara.css + res/gjdochtml-sclara.css + CSS stylesheet 'Santa Clara' + + + gjdochtml-fixed.css + res/gjdochtml-fixed.css + CSS stylesheet 'Fixed' + + + + + + gjdoc.js + res/gjdoc.js + JavaScript helper file + + + + + help.html + help.xsl + help file + + + + + about.html + about.xsl + about file + + + + + deprecated.html + deprecated.xsl + deprecated list + + + + + serialized.html + serialized.xsl + serialization information + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/help.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/help.xsl new file mode 100644 index 00000000000..45af6a64480 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/help.xsl @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + +
    diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/html_common.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/html_common.xsl new file mode 100644 index 00000000000..4e648d27281 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/html_common.xsl @@ -0,0 +1,584 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + - + + + Package + + + Nested class in class + + + + Nested exception in class + + + + Nested error in class + + + + Nested interface in class + + + + Class in package + + + + Exception in package + + + + Error in package + + + + Interface in package + + + + Method in class + + + + Field in class + + + +
    +
    + + + +
    +
    +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + &nbsp; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + +
    + + +
    + +
    + +
    + +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ( + + ) + + + + <xsl:value-of select="$v_title"/> + + + + + + + + + + + + + + + + + + + + + + . + + + java.lang. + + + + + + + + + + + + + ( + + + + + + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + +
    + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index.xsl new file mode 100644 index 00000000000..da4ff6260fe --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index.xsl @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index_noframes.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index_noframes.xsl new file mode 100644 index 00000000000..ab45102313f --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/index_noframes.xsl @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +

    +
    + +
    + + + +
    +
    See Also:
    +
    +
    Description
    +
    +
    + + + + +

    + + + + + + + +
    +
    +
    + +

    All Packages

    + + + + +
    +
    +
    + + +
    + + + +
    +
    +
    + + + + + + + + + + + + + + + + +
    +
    diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packageclasses.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packageclasses.xsl new file mode 100644 index 00000000000..430b94447ab --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packageclasses.xsl @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + <xsl:value-of select="concat(/gjdoc:rootdoc/gjdoc:title, ' - ', 'Classes in ', $gjdoc.outputfile.info)"/> + + + + + + + + + + + +

    Exceptions

    + + + + +
    + + +

    Errors

    + + + + +
    + + + +
    + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packagedoc.xsl b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packagedoc.xsl new file mode 100644 index 00000000000..afe6fb77fef --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/packagedoc.xsl @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + +

    Package

    + +
    + +
    + + + + + + + + +
    Interface Summary
    +
    + + + + + + + + +
    Class Summary
    +
    + + + + + + + + +
    Exception Summary
    +
    + + + + + + + + +
    Error Summary
    +
    + +

    +

    Package Description

    + +
    + +
    + +
    + + + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + No description available. + + + + + +
    diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/default_help_en.html b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/default_help_en.html new file mode 100644 index 00000000000..b59a63c4f17 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/default_help_en.html @@ -0,0 +1,7 @@ + +

    Using the API Documentation

    + +

    + Write me. +

    + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdoc.js b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdoc.js new file mode 100644 index 00000000000..125f8f687b2 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdoc.js @@ -0,0 +1,108 @@ +/* gjdoc.js + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath 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 2, or (at your option) + any later version. + + GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/** + * Sets a new stylesheet for a single frame. + */ +function setStyleSheetForFrame(title, frame_name) +{ + var i, num, a, main; + f = eval("top.frames." + frame_name); + for(i=0; (a = f.document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("title")) { + a.disabled = true; + a.disabled = (a.getAttribute("title") != title); + } + } +} + +/** + * Sets a new stylesheet for a single document. + */ +function setStyleSheetForDocument(title) +{ + var i, num, a, main; + for(i=0; (a = top.document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("title")) { + a.disabled = true; + a.disabled = (a.getAttribute("title") != title); + } + } +} + +/** + * Sets a new stylesheets for all frames. + */ +function setStyleSheet(title) +{ + var i, num, a, main; + num = top.frames.length; + if (num > 0) { + for (i=0; i 0) + setStyleSheet(getActiveStylesheetTitle(top.frames.packages), "content"); + else if (top.selectedSheet) { + setStyleSheet(top.selectedSheet, "content"); + } +} + +/** + * Invoked when a page in one of the two frames on the left hand has + * been loaded. + */ +function secondaryPageLoaded(frame_name) +{ + setStyleSheet(getActiveStylesheetTitle(top.frames.packages), frame_name); +} diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-clean.css b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-clean.css new file mode 100644 index 00000000000..0913e7d3e6a --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-clean.css @@ -0,0 +1,382 @@ +/* gjdochtml-clean.css + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath 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 2, or (at your option) + any later version. + + GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +body.classdoc { + background: white; + font-size: 100%; + margin: 0.5em 1em 0.5em 1em; +} + +hr { + border-style: solid none none none; + border-width: thin; + height: 1px; + color: black; +} + +hr.footer { + margin-top: 2em; +} + +table,tr,td { + border: solid 1px #aaaaaa !important; + border-collapse: collapse !important; +} + +table.classdoc-table { + border-width: 1px; + border-collapse: collapse; +} + +table.classdoc-table tr { + border-width: 1px; + border-collapse: collapse; +} + +table.classdoc-table td { + border: solid 1px #aaaaaa; + border-collapse: collapse; +} + +.header { + + border-style: solid; + padding: 0.2em; + margin: 0.3em; +} + +ul { + padding-top: 0em; + margin-top: 0em; +} + +td { + padding: 0.3em; + vertical-align: top; +} + +td.with-border { + border-color: #aaaaaa; + border-style: solid; + border-top: 0px; +} + +td.no-border-r { + border-color: #aaaaaa; + border-style: solid; + border-right: 0px; + border-top: 0px; +} + +td.no-border-b { + border-color: #aaaaaa; + border-style: solid; + border-bottom: 0px; +} + +td.no-border-rb { + border-color: #aaaaaa; + border-style: solid; + border-right: 0px; + border-bottom: 0px; +} + +.classdoc-head { + border: 1px; + border-style: solid; + padding: 0.3em 0.7em 0.5em 0.7em; + margin: 0.0em; +} + +.classdoc-head-packagename { + font-size: 110%; + padding: 0.0em; + margin: 0.0em; +} + +.classdoc-head-classname { + font-size: 180%; + padding: 0.0em; + margin: 0.0em; +} + +h1.classdoc-header { + border-width: 1px; + border-style: solid; + font-size: 140%; + padding: 0.2em 0.5em 0.3em 0.5em; + margin-top: 0.0em; +} + +h2.classdoc-header { + border-width: 1px; + border-style: solid; + font-size: 140%; + padding: 0.2em 0.5em 0.3em 0.5em; + margin-top: 0.0em; +} + +h1.classdoc-header, +h2.classdoc-header, +.classdoc-head, +.classdoc-subheader, +.section-header, +.sub-section-header { + background: #80B9FF; + font-weight: bolder; +} + +table.navbar { + background: #BFDCFF; +} + +div[class="navbar top"] { + margin-bottom: 1em; +} + +span[class="navi-button current"] { + color: white; + background: #0055BA; +} + +span[class="navi-button unavailable"] { + color: #888888; +} + +h3.classdoc-header { + font-size: 110%; +} + +.classdoc-subheader { + border-width: 1px; + border-style: solid; + font-size: 120%; + padding: 1.0em; +} + +.classdoc-prototype { +} + +.classdoc-summary-comment { + margin-top: 1.0em; + margin-bottom: 1.0em; + font-size: 100%; +} + +.classdoc-tree-label { + font-size: 80%; + line-height: 2.0em; + padding: 0%; + vertical-align: top; + height: 2.0em; + margin: 0%; + padding-left: 1.0em; +} + +.classdoc-comment-body { + font-size: 100%; +} + +blockquote.classdoc-summary-comment { + margin: 0.4em 0.0em 0.2em 2.0em; + padding: 0em; +} + +div.classdoc-comment-body { + margin: 0.4em 0.0em 0.2em 2.0em; + padding: 0em; +} + +div.classdoc-package-comment-body { + margin: 0.4em 0.0em 1.5em 0.0em; + padding: 0em; +} + +div.classdoc-class-comment-body { + margin: 0.8em 0.0em 1.0em 0.0em; + padding: 0.0em; +} + +ul.classdoc-list { + margin-top: 0.2em; + margin-left: 1.6em; +} + +div.classdoc-tag-section-header { + margin-top: 0.5em; + font-weight: bold; +} + +ol.classdoc-list { + margin-top: 0.2em; + margin-left: 1.6em; + list-style-type: circle; +} + +dl.classdoc-list { + margin-top: 0.2em; + margin-left: 1.6em; +} + +.navi-button { + padding: 0.0em; + margin: 0.0em; + padding-left: 0.2em; + padding-right: 0.2em; +} + +.header { + width: 100%; + padding: 0.0em 0.7em 0.5em 0.0em; + margin: 0.0em 0.0em 0.9em 0.0em; + border: black 1px; + border-style: none none solid none; +} + +.navbar-first-row { + width: 100%; + padding: 0.0em 0.7em 0.0em 0.0em; + margin: 0.0em 0.0em 0.4em 0.0em; + font-size: 80%; +} + +.navbar-second-row { + width: 100%; + padding: 0.0em 0.7em 0.0em 0.0em; + margin: 0.0em 0.0em 0.0em 0.0em; + font-size: 70%; +} + +.prototype { + text-indent:-2em; + font-family:monospace; + padding: 0em 0em 0em 2em; + margin: 0em; +} + +.prototype-type { + font-family:monospace; + padding: 0em; + margin: 0em; +} + +.prototype-name { + font-family:monospace; +} + +span.parameter { + padding: 0em; + margin: 0em; + white-space: nowrap; +} + +div.footer { + margin-bottom: 6cm; + font-style: italic; + font-size: 0.8em; +} + +pre { + margin-left: 1.6em; +} + +pre.inheritance-tree { + margin-left: 0.0em; +} + +a.tree-class-link { + font-weight: bold; +} + +span.index-category-current { + padding: 0.4em; + border: 1px black solid; +} + +a.index-category-link { + padding: 0.4em; +} + +a.menu { + font-size: 90%; +} + +table.navbar { + width: 100%; + margin: 0px; + border: solid 1px #888888; + padding: 0px; +} + +tr.navbar, td.navbar { + padding: 0.3em; + margin: 0px; +} + + +h1.overview-doctitle { + font-size: 170%; + text-align: center; + padding-bottom: 0.5em; +} + +div.overview-description-top, +div.overview-description-full { + margin-top: 1.5em; +} + +table { + margin-top: 0em; + margin-bottom: 1em; + border-collapse: collapse; +} + +span.navsep { +} + +a[href] { + color: #0055BA; +} + +a:visited { + color: #003B82; +} + +a:active { + color: #80B9FF; +} + +blockquote.member-summary { + text-indent: 2em; + margin: 0em; + margin-top: 0.2em; +} + +table { + width: 100%; +} + +td[class="member-summary method modifiers"] { + text-align: right; +} + +td[class="member-summary field modifiers"] { + text-align: right; +} diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-fixed.css b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-fixed.css new file mode 100644 index 00000000000..0c96c009a89 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-fixed.css @@ -0,0 +1,286 @@ +/* gjdochtml-fixed.css + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath 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 2, or (at your option) + any later version. + + GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +table { + border: none !important; + border-top: none !important; + border-left: none !important; + border-right: none !important; + border-bottom: none !important; +} + +td { + border: none !important; + border-top: none !important; + border-left: none !important; + border-right: none !important; + border-bottom: none !important; +} + +body.classdoc { + font-size: 100%; + margin: 0em; + padding: 0em; +} + +table.navbar { + margin: 0em; + position: fixed; + z-index: 20; + left: 0em; + top: 0em; + width: 100%; + background: #0066B3; + color: white; + padding: 0.3em; + border-bottom: 3px solid black !important; + height: 5.3em; +} + +table[class="navbar bottom"] { + visibility: hidden; +} + +a.navi-button { + color: #FFB200; +} + +.navbar-first-row { + font-size: 80%; + padding-bottom: 0.3em; +} + +.navbar-second-row { + font-size: 70%; + text-align: right; + padding-right: 4.5em; +} + + +div.pagebody { + margin-top: 7em; + padding-left: 1em; + padding-right: 1em; + padding-bottom: 5em; + z-index: -100; +} + +span.navsep:before { + padding-left: 0.25em; + content: "|"; +} + +span[class="navi-button current"] { + background: #003D6B; + color: white; +} + +span[class="navi-button unavailable"] { + color: white; +} + +.navi-button { + padding-left: 0.1em; + padding-right: 0.1em; + +} + + +.classdoc-table-xxx { + border-color: #aaaaaa; + border-style: solid; + border-collapse: collapse; +} + +.classdoc-table { + border: 0px; + border-collapse: collapse; +} + +td { + vertical-align: top; + padding: 0.2em; +} + +table { + margin-top: 1em; +} + +span.index-category-current { + padding: 0.4em; + border: 1px black solid; +} + +a.index-category-link { + width: 5em; + min-width: 5em; + padding: 0.3em; + margin-right: 0.4em; + color: #FFB200; + border: 1px #FFB200 solid; + text-decoration: none; +} + +a[href] { + color: #991F00; +} + +.classdoc-subtitle { + position: fixed; + left: 0.0em; + top: 2.7em; + font-size: 80%; + font-weight: bold; + color: #FFD980; + z-index: 30; + padding-left: 1.0em; + padding-top: 0.0em; + margin-top: 0.0em; +} + +h1.classdoc-title { + position: fixed; + left: 0.0em; + top: 2.4em; + font-size: 130%; + z-index: 30; + color: #FFD980; + padding-left: 0.5em; + padding-top: 0.0em; + margin-top: 0.0em; +} + +div.index-categories { + position: fixed; + left: 28em; + top: 5.8em; + font-size: 60%; + padding-top: 0.0em; + margin-top: 0.0em; +} + +.before-details { +} + +h3.menu-title { + width: 100%; + position: fixed; + left: 0em; + top: 0em; + margin-top: 0em; + background: #0066B3; + color: #FFD980; + padding: 0.3em; + padding-left: 0.8em; + border-bottom: 3px solid black; + font-size: 100%; +} + +h3.menu-title > a { + color: #FFB200; +} + +body.menu { + padding-top: 2em; +} + +a.menu { + font-size: 85%; +} + +a.classdoc { + position: relative; + top: -6em; +} + + +div.section-header, h1.classdoc-header { + background: #FFD980; + margin-bottom: 0px; + font-size: 130%; + font-weight: bolder; + padding-left: 2px; + margin-top: 1em; + padding-top: 4px; + padding-bottom: 4px; + position: relative; + left: -200px; + padding-left: 202px; + padding-right: 20px; + border: 1px solid black; + width: 60%; +} + +div.sub-section-header { + background: #FFD980; + margin-bottom: 0px; + font-size: 110%; + font-weight: normal; + padding-left: 2px; + margin-top: 1em; + padding-top: 4px; + padding-bottom: 4px; + position: relative; + left: -200px; + padding-left: 202px; + padding-right: 20px; + border: 1px solid black; + width: 60%; +} + +table { + width: 100%; +} + +dl.classdoc-list { + margin-top: 0px; + margin-bottom: 0px; + margin-left: 2.5em; +} + +blockquote.member-summary { + margin: 0px; + font-style: oblique; + font-size: 90%; + margin-top: 0.1em; + margin-bottom: 0.2em; + margin-left: 1em; +} + +td[class="member-summary method modifiers"] { + text-align: right; +} + +div.classdoc-tag-section-header { + margin-top: 0.5em; + font-weight: bold; +} + +div.navbar-style-selector { + position: fixed; + right: 1em; + top: 2.9em; + z-index: 50; + padding-right: 0.6em; + vertical-align: top; +} + +/* triad @ 225 deg */ + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-sclara.css b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-sclara.css new file mode 100644 index 00000000000..5c7f119d9bc --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml-sclara.css @@ -0,0 +1,266 @@ +/* gjdochtml-sclara.css + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath 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 2, or (at your option) + any later version. + + GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +div.section-header, +h1.classdoc-header { + background: #ccccff; + border: black ridge 2px; + border-collapse: collapse; + vertical-align: inherit; + text-align: inherit; + margin-bottom: 0px; + font-size: 155%; + font-weight: bold; + padding-left: 2px; + margin-top: 1em; + padding-top: 2px; + padding-bottom: 2px; +} + +td.section-header { + background: #ccccff; + margin-bottom: 0px; + font-size: 155%; + font-weight: bold; + padding-left: 2px; + margin-top: 1em; + padding-top: 2px; + padding-bottom: 2px; +} + +td.sub-section-header { + background: #eeeeff; + margin-bottom: 0px; + font-size: 110%; + font-weight: normal; + padding-left: 2px; + margin-top: 1em; + padding-top: 2px; + padding-bottom: 2px; +} + +table.classdoc-table { + margin-top: 1.5em; +} + +div.navbar-first-row { + background: #eeeeff; + padding-top: 4px; + padding-bottom: 4px; + padding-left: 4px; + padding-right: 4px; + font-size: 100%; + color: black; + font-family: Arial, sans-serif; + font-weight: normal; +} + +div.navbar-second-row { + padding-top: 0px; + padding-bottom: 9px; +} + +div.navbar-second-row a[href] { + text-decoration: underline; + font-family: Arial, sans-serif; + font-weight: normal; + font-size: 60%; + text-transform: uppercase; + padding-top: 0px; + margin-top: 0px; + background: white; + margin-left: 8px; +} + +div.navbar-second-row span { + padding: 0px; + margin: 0px; +} + +span.navi-button { + padding-left: 0.4em; + padding-right: 0.4em; +} + +div.navbar-first-row span[class="navi-button current"] { + background: #00008B; + color: white; + font-weight: bold; +} + +div.navbar-first-row span[class="navi-button unavailable"] { + font-weight: normal; +} + +div.navbar-first-row a[href] { + padding-bottom: 0px; + font-weight: lighter; + text-decoration: none; + border-bottom: 1px solid blue; + position: relative; + top: -1px; +} + +div.navbar-first-row a:visited { + color: black; + font-weight: lighter; + text-decoration: none; + border-bottom: 1px solid black; +} + +div.navbar-first-row span.navi-link { + padding: 0px; + margin: 0px; + color: black; + font-weight: bold; + position: relative; + top: 1px; +} + +span.navsep { + padding-left: 0.15em; +} + +a.menu { + font-family: Arial, Sans-Serif; + font-size: 90%; +} + +table.navbar[class="navbar top"] { + padding-bottom: 4px; + border-bottom: inset 1px black; +} + +table { + width: 100%; + margin: 0px; + border: none; + padding: 0px; + border-collapse: collapse; + border-spacing: 0; +} + +tr.navbar { + margin: 0px; + padding: 0px; + border: none; +} + +td.navbar { + margin: 0px; + padding: 0px; + border: none; +} + +a.package-link, +a.class-link { + font-weight: bold; +} + +table,tr,td { +} + +table.classdoc-table { +} + +table.classdoc-table tr { +} + +table.classdoc-table td { + border: ridge 2px black; + border-collapse: separate; +} + +td { + padding: 2px; +} + +h1.classdoc-title, +h1.classdoc-sub-title { + font-size: 150%; + font-weight: bold; +} + +div.pagebody { + padding-bottom: 1em; +} + +h3.menu-title { + font-family: Arial, Sans-Serif; + font-weight: normal; + font-size: 105%; +} + +p.member-summary { + margin: 0px; + padding: 0px; + font-family: Monospace; +} + +p.modifiers { + font-size: 80%; +} + +a.name { + font-weight: bold; +} + +blockquote.member-summary { + text-indent: 3em; + margin: 0px; +} + +td.member-summary { + vertical-align: top; +} + +.classdoc-head-packagename { + font-weight: bold; + padding-top: 2em; + padding-bottom: 0em; + margin: 0em; +} + +.classdoc-head-classname { + padding-top: 0em; + margin-top: 0em; +} + +td.super { + font-family: Monospace; +} + +.classdoc-tag-section-header { + font-weight: bold; +} + +dl.classdoc-list { + margin-top: 0px; + margin-bottom: 0px; + margin-left: 2.5em; +} + +div.section-header, +div.sub-section-header { + border: none; + padding: 0px; + margin: 0px; + font-size: inherit; +} diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml.css b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml.css new file mode 100644 index 00000000000..5944c6cdba6 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/doctranslets/html/res/gjdochtml.css @@ -0,0 +1,29 @@ +/* gjdochtml.css + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath 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 2, or (at your option) + any later version. + + GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +body { + background: white; + font-size: 100%; +} + +ol.tree, +li.tree { + list-style-type: disc; +} diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/dbcentx.mod b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/dbcentx.mod new file mode 100644 index 00000000000..144d38deac4 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/dbcentx.mod @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + +%ISOamsa; +]]> + + + +%ISOamsb; +]]> + + + +%ISOamsc; +]]> + + + +%ISOamsn; +]]> + + + +%ISOamso; +]]> + + + +%ISOamsr; +]]> + + + +%ISObox; +]]> + + + +%ISOcyr1; +]]> + + + +%ISOcyr2; +]]> + + + +%ISOdia; +]]> + + + +%ISOgrk1; +]]> + + + +%ISOgrk2; +]]> + + + +%ISOgrk3; +]]> + + + +%ISOgrk4; +]]> + + + +%ISOlat1; +]]> + + + +%ISOlat2; +]]> + + + +%ISOnum; +]]> + + + +%ISOpub; +]]> + + + +%ISOtech; +]]> + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsa.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsa.ent new file mode 100644 index 00000000000..c03b1c91e9c --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsa.ent @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsb.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsb.ent new file mode 100644 index 00000000000..945d7eef431 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsb.ent @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsc.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsc.ent new file mode 100644 index 00000000000..604ac480c67 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsc.ent @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsn.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsn.ent new file mode 100644 index 00000000000..fbc1e94e145 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsn.ent @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amso.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amso.ent new file mode 100644 index 00000000000..6dc68108f0c --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amso.ent @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsr.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsr.ent new file mode 100644 index 00000000000..9c370b3ad4d --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-amsr.ent @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-box.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-box.ent new file mode 100644 index 00000000000..904916c908f --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-box.ent @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr1.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr1.ent new file mode 100644 index 00000000000..6507c79cb5f --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr1.ent @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr2.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr2.ent new file mode 100644 index 00000000000..50f534749a4 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-cyr2.ent @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-dia.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-dia.ent new file mode 100644 index 00000000000..278e5d9e08f --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-dia.ent @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk1.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk1.ent new file mode 100644 index 00000000000..848f203d079 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk1.ent @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk2.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk2.ent new file mode 100644 index 00000000000..a75f5b04abb --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk2.ent @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk3.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk3.ent new file mode 100644 index 00000000000..070ef252ca4 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk3.ent @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk4.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk4.ent new file mode 100644 index 00000000000..18c96eb49f6 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-grk4.ent @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat1.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat1.ent new file mode 100644 index 00000000000..9c2c24932f3 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat1.ent @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat2.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat2.ent new file mode 100644 index 00000000000..2f146967cc4 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-lat2.ent @@ -0,0 +1,163 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-num.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-num.ent new file mode 100644 index 00000000000..b3c434e30d1 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-num.ent @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-pub.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-pub.ent new file mode 100644 index 00000000000..979d178a49d --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-pub.ent @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-tech.ent b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-tech.ent new file mode 100644 index 00000000000..b0aaac49c28 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/ent/iso-tech.ent @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc-alphaindex.dtd b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc-alphaindex.dtd new file mode 100644 index 00000000000..5597d7bbe69 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc-alphaindex.dtd @@ -0,0 +1,35 @@ + + + + + + + +%dbcent; +]]> + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc.dtd b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc.dtd new file mode 100644 index 00000000000..6d02bd86c0b --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/dtd/gjdoc.dtd @@ -0,0 +1,35 @@ + + + + + + + +%dbcent; +]]> + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/HtmlDoclet.properties b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/HtmlDoclet.properties new file mode 100644 index 00000000000..37ffad45b5e --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/HtmlDoclet.properties @@ -0,0 +1,32 @@ +# gjdochtml-vanilla.css +# Copyright (C) 2004 Free Software Foundation, Inc. +# +# This file is part of GNU Classpath. +# +# GNU Classpath 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 2, or (at your option) +# any later version. +# +# GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +# 02111-1307 USA. + +# +# Defines localized strings for HtmlDoclet (US-english/fallback) +# + +usagetype.class-derived-from = Classes derived from {0} +usagetype.class-implementing = Classes implementing {0} +usagetype.field-of-type = Fields of type {0} +usagetype.method-with-return-type = Methods with return type {0} +usagetype.method-with-parameter-type = Methods with parameter type {0} +usagetype.method-with-thrown-type = Methods which throw type {0} +usagetype.constructor-with-parameter-type = Constructors with parameter type {0} +usagetype.constructor-with-thrown-type = Constructors which throw type {0} diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdoc.js b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdoc.js new file mode 100644 index 00000000000..91f8ba2ac39 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdoc.js @@ -0,0 +1,115 @@ +/* gjdoc.js + Copyright (C) 2004 Free Software Foundation, Inc. + + This file is part of GNU Classpath. + + GNU Classpath 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 2, or (at your option) + any later version. + + GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/** + * Sets a new stylesheet for a single frame. + */ +function setStyleSheetForFrame(title, frame_name) +{ + var i, num, a, main; + f = eval("top.frames." + frame_name); + for(i=0; (a = f.document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("title")) { + a.disabled = true; + a.disabled = (a.getAttribute("title") != title); + } + } +} + +/** + * Sets a new stylesheet for a single document. + */ +function setStyleSheetForDocument(title) +{ + var i, num, a, main; + for(i=0; (a = top.document.getElementsByTagName("link")[i]); i++) { + if(a.getAttribute("rel").indexOf("style") != -1 + && a.getAttribute("title")) { + a.disabled = true; + a.disabled = (a.getAttribute("title") != title); + } + } +} + +/** + * Sets a new stylesheets for all frames. + */ +function setStyleSheet(title) +{ + var i, num, a, main; + num = top.frames.length; + if (num > 0) { + for (i=0; i 0) { + setStyleSheet(getActiveStylesheetTitle(top.frames.packages), "content"); + } + else if (top.selectedSheet) { + setStyleSheet(top.selectedSheet, "content"); + } + **/ +} + +/** + * Invoked when a page in one of the two frames on the left hand has + * been loaded. + */ +function secondaryPageLoaded(frame_name) +{ + /** 20050204: removed since there is only one stylesheet at the time + setStyleSheet(getActiveStylesheetTitle(top.frames.packages), frame_name); + **/ +} diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-color1.css b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-color1.css new file mode 100644 index 00000000000..28452fa7bff --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-color1.css @@ -0,0 +1,80 @@ +/* gjdochtml-clean-layout.css + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +/* --- GNU Clean Style: Color Scheme #1 --- */ + +[class~="title"], +[class="table header"], +[class="table sub header"], +[class="section header"], +[class="serialized package header"], +[class="serialized class header"] +{ + background-color: #E8EAFF; +} + +[class~="navbar"][class~="item"] +{ + border-color: #000000; + color: #000000; +} + +[class~="navbar"][class~="item"][class~="disabled"] +{ + border-color: #aaaaaa; + color: #aaaaaa; +} + +[class~="navbar"][class~="item"][class~="active"] +{ + color: #000000; + background-color: #E8EAFF; +} + +[class~="navbar"][class~="item"][class~="active"] +{ + border-color: #222222; +} + +.navbar .header a +{ + color: #777777; +} + +a[href] { + color: #141EB8; +} + +a[href]:visited { + color: #0C126E; +} + + +/* ---- source highlighting ---- */ + +.comment { color: #777777; } +.tag { color: #444444; } +.keyword { color: #B36B00; } +.header.type { color: #00248F; } +.type { color: #0033CC; } +.literal { color: #809FFF; } +.variable { color: #007D48; } +.method { color: #B32400; } +.line-number { color: #AAAAAA; } diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-layout.css b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-layout.css new file mode 100644 index 00000000000..9d4590973bd --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-clean-layout.css @@ -0,0 +1,460 @@ +/* gjdochtml-clean-layout.css + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +/* --- GNU Clean Style: Layout --- */ + +body +{ + background: white; + color: black; +} + +body.content +{ + margin-left: 1.3em; + margin-right: 1.3em; + margin-top: 0.9em; + margin-bottom: 1.3em; +} + +div[class="class title outer"] +{ + margin: 0em; + margin-bottom: 1em; + border: 1px solid; + padding: 10pt; +} + +[class="class title-package"] +{ + margin: 0em; + padding: 0em; +} + +[class="class title-class"] +{ + margin: 0em; + margin-top: 0.2em; + padding: 0em; +} + +[class="table header"], +[class="table sub header"] +{ + margin: 0em; + padding: 0.25em; +} + +[class="section header"] +{ + margin: 0em; + padding: 0.25em; + border: 1px solid; +} + +.serialized.package.header +{ + margin: 0em; + padding: 0.25em; + border: 1px solid; + margin-bottom: 1em; +} + + +.serialized.class.header +{ + margin: 0em; + padding: 0.25em; + padding-left: 3.25em; + border: 1px solid; + text-indent: -3em; + font-weight: normal; + font-size: 1.2em; +} + +.serialized.section.header +{ + font-size: 1.15em; +} + +div.serialized.section +{ + padding-left: 1em; +} + +.summary td, +.summary .inherited +{ + padding: 0.25em; +} + +table[border] +{ + border-spacing: 0em; + border-collapse: collapse; +} + +table[border] td +{ + border-spacing: 0em; + border-collapse: collapse; +} + +hr +{ + border-top: 1px solid; + border-bottom: 0px; + border-left: 0px; + border-right: 0px; +} + +.class.summary .left +{ + width: 10%; +} + +.class.summary td.left +{ + text-align: right; +} + +.class.summary .left .synopsis +{ + font-size: small; +} + + +[class="package summary left"] +{ + width: 20%; +} + +ul.inheritance +{ + margin-left: 1.8em; + padding-left: 0em; + marker-offset: 0em !important; + list-style-type: none; + list-style-image: none; +} + +li.inheritance +{ + margin: 0em !important; + margin-top: 0.1em !important; + padding: 0em !important; + marker-offset: 0em !important; +} + +ul.inheritance > li.inheritance:before +{ + display: marker; + width: 12px; + margin: 0em !important; + padding: 0em !important; + marker-offset: 0em !important; + content: url(inherit.png); + vertical-align: center !important; +} + +[class="inheritance 0"] > li.inheritance:before +{ + display: none; +} + +ul [class="inheritance 0"] +{ + margin-left: 12px !important; + padding-left: 0em; + list-style-type: none !important; + list-style-image: none !important; +} + +.inheritance-tree +{ + position: relative; + left: -24px; +} + +.synopsis.outer +{ + padding: 0em; + margin-bottom: 0.3em; +} + +.synopsis.outer > * +{ + margin: 0em; + padding: 0em; + line-height: 1.0em; +} + +div.navbar.div +{ + padding: 0em; + margin: 0em; + position: relative; + left: -0.2em; +} + +.navbar.div, +.navbar.div tr, +.navbar.div td +{ + margin: 0em; + padding: 0em; + border-spacing: 0em; + border-collapse: collapse; +} + +table.navbar.div +{ + width: 100%; +} + +table.navbar.div td +{ + line-height: 1.9em; + text-align: top; +} + +.navbar.item +{ + /* float: left; */ + border: 1px solid; + /* width: 7.5em; */ + text-align: center; + margin: 0.05em; + padding-top: 0.2em; + padding-bottom: 0.3em; + padding-left: 0.5em; + padding-right: 0.5em; + font-size: 0.75em; + margin-bottom: 0.5em; +} + +.navbar.item.active +{ + /* font-weight: bold; */ + border: 1px solid; +} + +[class~="title"] +{ + border: 1px solid; + padding: 0.3em; + margin-top: 0em; +} + +.table.container, +.table.container dd +{ + padding: 0em; + margin: 0em; +} + +.overview.summary +{ + padding: 0em; + margin: 0em; +} + +.summary +{ + margin-bottom: 1.2em; +} + +table.navbar.top +{ + margin-bottom: 1em !important; +} + +.package.description +{ + margin-top: 0.0em; + margin-bottom: 1.0em; +} + +.class.description +{ + margin-top: 1em; + margin-bottom: 0.8em; +} + +[class="overview description top"] +{ + margin-top: 0.0em; + margin-bottom: 1.0em; +} + +[class="overview description full"] +{ + margin-top: 1.0em; + margin-bottom: 0.0em; +} + +.class.summary .right .list +{ + margin: 0em; + padding: 0em; +} + +.class.summary .right .list .synopsis +{ + margin: 0em; + padding: 0em; +} + +.classes .menu-subtitle +{ + padding: 0em; + margin-top: 0.5em; + margin-bottom: 0em; +} + +.menu-title +{ + padding: 0em; + margin-top: 0.8em; + margin-bottom: 0.2em; +} + +.menu-entry +{ + font-size: 0.8em; +} + +.class.summary .right +{ + vertical-align: top; +} + +.class.summary .right .list +{ + vertical-align: top; +} + +.navi +{ + padding-top: 0.5em; + font-size: x-small; +} + +.navbar .header +{ + vertical-align: top; +} + +.navbar .header span +{ + border: none; + white-space: nowrap; + padding-top: 0.2em; + padding-bottom: 0.3em; + padding-left: 0.5em; +} + +.navbar .header a +{ + font-weight: bold; + font-size: 11pt; +} + +h1 +{ + font-size: 1.5em; +} + +h2 +{ + font-size: 1.3em; +} + +h3 +{ + font-size: 1.1em; +} + +.summary .right .synopsis +{ + padding-left: 5.25em !important; + text-indent: -5em !important; +} + +.summary .right .description +{ + text-indent: 1em !important; + padding-top: 0.25em !important; + padding-bottom: 0.1em !important; + padding-left: 0.25em !important; +} + +td.usage.summary +{ + vertical-align: top; +} + +.index .entry .description +{ + padding-left: 3em; +} + +.index .entry .key +{ + padding-left: 5.25em; + text-indent: -5em; +} + +.dep-list .summary .description +{ + padding-top: 0.1em; + padding-left: 3em; +} + +.dep-toc .header +{ + padding-bottom: 0em; + margin-bottom: 0.2em; +} + +.dep-toc .list +{ + margin-top: 0em; + margin-bottom: 1.5em; + padding-top: 0em; + padding-bottom: 0em; + padding-left: 2em; +} + +ul.tree li.node +{ + list-style-type: disc; +} + +ul.tree ul +{ + margin-left: 0em; + padding-left: 1.8em; +} + +li.level +{ + list-style-type: none; +} diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-vanilla.css b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-vanilla.css new file mode 100644 index 00000000000..503207b65d4 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/gjdochtml-vanilla.css @@ -0,0 +1,21 @@ +/* gjdochtml-vanilla.css + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath 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 2, or (at your option) +any later version. + +GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. */ + +/* Empty Vanilla Stylesheeet */ diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/help.xhtml b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/help.xhtml new file mode 100644 index 00000000000..e1bb453b009 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/help.xhtml @@ -0,0 +1,25 @@ + + +

    + Sorry, no help available. +

    + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/inherit.png b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/inherit.png new file mode 100644 index 00000000000..50ca4747c31 Binary files /dev/null and b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/inherit.png differ diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/xhtml11-target10.dtd b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/xhtml11-target10.dtd new file mode 100644 index 00000000000..0dd73f78306 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/htmldoclet/xhtml11-target10.dtd @@ -0,0 +1,54 @@ + + + + + + + +%xhtml11.mod; + +%xhtml-target.mod; diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.2.txt b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.2.txt new file mode 100644 index 00000000000..0e44adf1b29 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.2.txt @@ -0,0 +1,78 @@ +Cloneable +Comparable +Runnable +Boolean +Byte +Character +Character.Subset +Character.UnicodeBlock +Class +ClassLoader +Compiler +Double +Float +InheritableThreadLocal +Integer +Long +Math +Number +Object +Package +Process +Runtime +RuntimePermission +SecurityManager +Short +String +StringBuffer +System +Thread +ThreadGroup +ThreadLocal +Throwable +Void +ArithmeticException +ArrayIndexOutOfBoundsException +ArrayStoreException +ClassCastException +ClassNotFoundException +CloneNotSupportedException +Exception +IllegalAccessException +IllegalArgumentException +IllegalMonitorStateException +IllegalStateException +IllegalThreadStateException +IndexOutOfBoundsException +InstantiationException +InterruptedException +NegativeArraySizeException +NoSuchFieldException +NoSuchMethodException +NullPointerException +NumberFormatException +RuntimeException +SecurityException +StringIndexOutOfBoundsException +UnsupportedOperationException +AbstractMethodError +ClassCircularityError +ClassFormatError +Error +ExceptionInInitializerError +IllegalAccessError +IncompatibleClassChangeError +InstantiationError +InternalError +LinkageError +NoClassDefFoundError +NoSuchFieldError +NoSuchMethodError +OutOfMemoryError +StackOverflowError +ThreadDeath +UnknownError +UnsatisfiedLinkError +UnsupportedClassVersionError +VerifyError +VirtualMachineError diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.3.txt b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.3.txt new file mode 100644 index 00000000000..119423d3862 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.3.txt @@ -0,0 +1,79 @@ +Cloneable +Comparable +Runnable +Boolean +Byte +Character +Character.Subset +Character.UnicodeBlock +Class +ClassLoader +Compiler +Double +Float +InheritableThreadLocal +Integer +Long +Math +Number +Object +Package +Process +Runtime +RuntimePermission +SecurityManager +Short +StrictMath +String +StringBuffer +System +Thread +ThreadGroup +ThreadLocal +Throwable +Void +ArithmeticException +ArrayIndexOutOfBoundsException +ArrayStoreException +ClassCastException +ClassNotFoundException +CloneNotSupportedException +Exception +IllegalAccessException +IllegalArgumentException +IllegalMonitorStateException +IllegalStateException +IllegalThreadStateException +IndexOutOfBoundsException +InstantiationException +InterruptedException +NegativeArraySizeException +NoSuchFieldException +NoSuchMethodException +NullPointerException +NumberFormatException +RuntimeException +SecurityException +StringIndexOutOfBoundsException +UnsupportedOperationException +AbstractMethodError +ClassCircularityError +ClassFormatError +Error +ExceptionInInitializerError +IllegalAccessError +IncompatibleClassChangeError +InstantiationError +InternalError +LinkageError +NoClassDefFoundError +NoSuchFieldError +NoSuchMethodError +OutOfMemoryError +StackOverflowError +ThreadDeath +UnknownError +UnsatisfiedLinkError +UnsupportedClassVersionError +VerifyError +VirtualMachineError diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.4.txt b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.4.txt new file mode 100644 index 00000000000..81a442d6ca2 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.4.txt @@ -0,0 +1,82 @@ +CharSequence +Cloneable +Comparable +Runnable +Boolean +Byte +Character +Character.Subset +Character.UnicodeBlock +Class +ClassLoader +Compiler +Double +Float +InheritableThreadLocal +Integer +Long +Math +Number +Object +Package +Process +Runtime +RuntimePermission +SecurityManager +Short +StackTraceElement +StrictMath +String +StringBuffer +System +Thread +ThreadGroup +ThreadLocal +Throwable +Void +ArithmeticException +ArrayIndexOutOfBoundsException +ArrayStoreException +ClassCastException +ClassNotFoundException +CloneNotSupportedException +Exception +IllegalAccessException +IllegalArgumentException +IllegalMonitorStateException +IllegalStateException +IllegalThreadStateException +IndexOutOfBoundsException +InstantiationException +InterruptedException +NegativeArraySizeException +NoSuchFieldException +NoSuchMethodException +NullPointerException +NumberFormatException +RuntimeException +SecurityException +StringIndexOutOfBoundsException +UnsupportedOperationException +AbstractMethodError +AssertionError +ClassCircularityError +ClassFormatError +Error +ExceptionInInitializerError +IllegalAccessError +IncompatibleClassChangeError +InstantiationError +InternalError +LinkageError +NoClassDefFoundError +NoSuchFieldError +NoSuchMethodError +OutOfMemoryError +StackOverflowError +ThreadDeath +UnknownError +UnsatisfiedLinkError +UnsupportedClassVersionError +VerifyError +VirtualMachineError diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.5.txt b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.5.txt new file mode 100644 index 00000000000..2439f2e3879 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/java.lang-classes-1.5.txt @@ -0,0 +1,90 @@ +Appendable +CharSequence +Cloneable +Comparable +Iterable +Readable +Runnable +Thread.UncaughtExceptionHandler +Boolean +Byte +Character +Character.Subset +Character.UnicodeBlock +Class +ClassLoader +Compiler +Double +Enum +Float +InheritableThreadLocal +Integer +Long +Math +Number +Object +Package +Process +ProcessBuilder +Runtime +RuntimePermission +SecurityManager +Short +StackTraceElement +StrictMath +String +StringBuffer +StringBuilder +System +Thread +ThreadGroup +ThreadLocal +Throwable +Void +ArithmeticException +ArrayIndexOutOfBoundsException +ArrayStoreException +ClassCastException +ClassNotFoundException +CloneNotSupportedException +Exception +IllegalAccessException +IllegalArgumentException +IllegalMonitorStateException +IllegalStateException +IllegalThreadStateException +IndexOutOfBoundsException +InstantiationException +InterruptedException +NegativeArraySizeException +NoSuchFieldException +NoSuchMethodException +NullPointerException +NumberFormatException +RuntimeException +SecurityException +StringIndexOutOfBoundsException +TypeNotPresentException +UnsupportedOperationException +AbstractMethodError +AssertionError +ClassCircularityError +ClassFormatError +Error +ExceptionInInitializerError +IllegalAccessError +IncompatibleClassChangeError +InstantiationError +InternalError +LinkageError +NoClassDefFoundError +NoSuchFieldError +NoSuchMethodError +OutOfMemoryError +StackOverflowError +ThreadDeath +UnknownError +UnsatisfiedLinkError +UnsupportedClassVersionError +VerifyError +VirtualMachineError diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-classdoc.rng b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-classdoc.rng new file mode 100644 index 00000000000..085710d17b7 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-classdoc.rng @@ -0,0 +1,649 @@ + + + + + + + + + + The Relax NG grammar for an classdoc XML document generated by + GNU Gjdoc. + + + + + The root element for a Gjdoc classdoc XML document. + + + + + Corresponds to a Javadoc API com.sun.javadoc.ClassDoc + object, the subtree of the full generated documentation + corresponding to a particular Java class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Corresponds to the abstract class + com.sun.javadoc.Doc, the common base class for + all documentation classes. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Corresponds to the abstract class + com.sun.javadoc.ProgramElementDoc. + + + + + + + + + + + + + + + + + + + + + + + + + + Corresponds to the abstract class + com.sun.javadoc.MemberDoc. + + + + + + + + + + Corresponds to the abstract class + com.sun.javadoc.ExecutableMemberDoc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + Corresponds to an object of class + com.sun.javadoc.ConstructorDoc. + + + + + + + + + + Corresponds to an object of class + com.sun.javadoc.MethodDoc. + + + + + + + + + + + Corresponds to an object of class + com.sun.javadoc.FieldDoc. + + + + + + + + + + + + + + + + + + + + + + + + + Specifies a constructor of the class. + + + + + + + + + + + Specifies a method of the class. + + + + + + + + + + + Specifies a field of the class. + + + + + + + + + + + + + Presence means ClassDoc.isAbstract() returns + true. + + + + + + + + + + Presence means Doc.isClass() returns + true. + + + + + + + + + + Presence means Doc.isConstructor() returns + true. + + + + + + + + + + Presence means Doc.isError() returns + true. + + + + + + + + + + Presence means Doc.isException() returns + true. + + + + + + + + + + Presence means ClassDoc.isSerializable() returns + true. + + + + + + + + + + Presence means ClassDoc.isExternalizable() + returns true. + + + + + + + + + + Presence means Doc.isField() returns + true. + + + + + + + + + + Presence means Doc.isIncluded() returns + true. + + + + + + + + + + Presence means Doc.isInterface() returns + true. + + + + + + + + + + Presence means Doc.isMethod() returns + true. + + + + + + + + + + Presence means Doc.isOrdinaryClass() returns + true. + + + + + + + + + + Presence means ProgramElementDoc.isFinal() + returns true. + + + + + + + + + + Presence means ProgramElementDoc.isStatic() + returns true. + + + + + + + + + + Presence means FieldDoc.isTransient() + returns true. + + + + + + + + + + Presence means FieldDoc.isVolatile() + returns true. + + + + + + + + + + Presence means ExecutableMemberDoc.isNative() + returns true. + + + + + + + + + + Presence means + ExecutableMemberDoc.isSynchronized() returns + true. + + + + + + + + + + Presence means + ClassDoc.definesSerializableFields() returns + true. + + + + + + + + + + Corresponds to the access modifier (public, protected, + private) specified by a ProgramElementDoc. + + + + + + This value is determined by calling + ProgramElementDoc.isPublic(), + ProgramElementDoc.isProtected(), + ProgramElementDoc.isPrivate() and + ProgramElementDoc.isPackagePrivate(). + + + public + protected + private + package + + + + + + + + Corresponds to the type returned by a call to + com.sun.javadoc.Classdoc.containingClass(). + + + + + The full name of the outer class containing the class, if + this class is an inner class. + + + + + + + + Corresponds to an entry in the array returned by a + com.sun.javadoc.ExecutableMemberDoc.parameters(). + + + + + A parameter for a method or constructor call. + + + + + + + + + + + Corresponds to an entry in the array returned by a + com.sun.javadoc.ExecutableMemberDoc.thrownExceptions(). + + + + + An exception thrown by a method or constructor. + + + + + + + + + Corresponds to the signature specified by a + com.sun.javadoc.MethodDoc. + + + + + The signature of a method or constructor. + + + + The full signature of a method or constructor, as + returned by + com.sun.javadoc.ExecutableMemberDoc.signature(). + + + + + + The "flat" signature of a method or constructor, as + returned by + com.sun.javadoc.ExecutableMemberDoc.flatSignature(). + + + + + + + + + Corresponds to the type returned by + com.sun.javadoc.MethodDoc.returnType(). + + + + + The type returned by a method. + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-common.rng b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-common.rng new file mode 100644 index 00000000000..85ffc1d91cf --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-common.rng @@ -0,0 +1,264 @@ + + + + + + + + A Relax NG grammar with definitions of elements and attributes + used by both the XML index file and the XML class files + generated by GNU Gjdoc. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Specifies mixed content comprised of gjdoc tags, + HTML tags, taglet output, and text. + + + + + + + + + + + Specifies an interface that the class implements. + + + + + + + + + + + Specifies an interface implemented by superclasses + (ancestors) of the class. Together with the interfaces + specified with tag `implements', this lists all interfaces + the class can be cast to. + + + + + + + + + + The name of the class, without package prefix. If the + class is an inner class, this includes the name of its + outer class. + + + + + + + + + + + The dimension of this typedef, represented by a zero or + more repetitions of the string "[]". + + + + + + + + + + + The name of some Java Entity (package, class, constructor, + method, field.) + + + + + + + + + + The fully qualified name of the class. + + + + + + + + + + Specifies the superclass of the class. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gjdoc:tag + + + + + + + + + + + + + + + + + + + + + + + + + The full name of the package containing the class. + + + + + + + + + + + A string generated by a Taglet.toString() method. + + + + The name of the tag this Taglet was assigned to. + + + + + + + + + + Exists when the described class is a subclass of + java.lang.Error. + + + + + + + + Exists when the described class is a subclass of + java.lang.Exception. + + + + + + + + Exists when the described class is an interface. + + + + + + diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-index.rng b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-index.rng new file mode 100644 index 00000000000..b7885569546 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/gjdoc/rng/gjdoc-index.rng @@ -0,0 +1,176 @@ + + + + + + + + + + The Relax NG grammar for the XML index file generated by GNU + Gjdoc. + + + + + The root element for a Gjdoc index XML document. + + + + + Corresponds to the Javadoc API RootDoc object, the root of + the generated documentation. + + + + + + + + + + + + + + + + + + + + + + + + Corresponds to a class contained in a package or in + another class. + + + + + + + + + + Corresponds to a class named on the Gjdoc command + line. This is a class the user explicitly wants + documentation generated for. + + + + + The name of the class as given by the user on the command + line. (CHECK) + + + + + + + + + + + Corresponds to a package named on the Gjdoc command + line. This is a package the user explicitly wants + documentation generated for. + + + + + The full name of the package. + + + + + + + + + + + Corresponds to a package for which XML documentation + has been generated. This is not necessarily a package + the user requested generation for. + + + + + + + + + + + + + + + Corresponds to a class for which XML documentation has + been generated. + + + + + + + + The following is optional because the root class + java.lang.Object does not have a superclass. For all + other classes, this element should be specified. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3