ttlogo.jpg Free TextTransformer Projects
Home
Text2HTML
Wikipedia
Yacc2TT
Delphi parser
Java parser
C preprocessor
C parser
HTML4
Utilities
MIME parser
Spamfilter
Additional Examples
Free components
  Minimal Website   Impressum

JAVA

The project Java16.ttp represents the Java specification, which can be seen here:

http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html

Java16.ttp was not derived directly from this specification but from the revised ANTLR version (see below). While ANTLR parsers automatically look ahead in the code as far as necessary to decide between different grammatical alternatives, in TextTransformer projects you explicitly have to tell the parsers when and how there has to be a look-ahead. This means some overtime at the wording of the grammar. However, the developer is supported by TextTransformer with grammar checks and by the listings of the first sets. The method also has the advantage that one keeps control over the parser. Wasteful use of the time consuming look-ahead possibilities is avoided by making the parser as LL(1) conforming as possible. In addition, a look-ahead is fundamentally easier to debug in the TextTransformer as it is possible with the incomprehensible mechanism of ANTLR, which often is controlled by throwing exceptions. In a TextTransformer parser a look-ahead just works like an ordinary production. It can even be tested step-by-step in the TextTransformer IDE.

There is an older Java parser, derived from a Coco/R project, in the installation package of TextTransformer. In the help file is described, how to produced a parse-tree with the parser and how to generate a copy program, which can be used for the instrumentation of Java code easily.


Test

As a test the 400 Java files of which antlrworks 1.2.3 (see below) consists were selected and processed in the transformation manager of TextTransformer. All files could be parsed successfully.

License

Java16.ttp is an adaption of the ANTLR Java parser with the following license:

[The "BSD licence"]
Copyright (c) 2007-2008 Terence Parr
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

last update: 07/12/2009

 to the top