JavaDoq 1.0 API

com.javadoq.jjtree.ast
Class HTMLConversionVisitor

java.lang.Object
  extended by com.javadoq.jjtree.ast.TokenVisitor
      extended by com.javadoq.jjtree.ast.TokenTransformVisitor
          extended by com.javadoq.jjtree.ast.HTMLColorizeVisitor
              extended by com.javadoq.jjtree.ast.HTMLConversionVisitor
All Implemented Interfaces:
JJTreeParserConstants, JJTreeParserVisitor

public class HTMLConversionVisitor
extends HTMLColorizeVisitor

Transforms JJTree nodes to HTML at token level.

Author:
J.J.Liu (Jianjun Liu) at http://www.javadoq.com

Field Summary
 DoqHTMLSourceFile doq
          The transformer.
 
Fields inherited from interface com.javadoq.jjtree.JJTreeParserConstants
_DEFAULT, _EOF, _IGNORE_CASE, _JAVACODE, _LOOKAHEAD, _MORE, _PARSER_BEGIN, _PARSER_END, _SKIP, _SPECIAL_TOKEN, _TOKEN, _TOKEN_MGR_DECLS, ABSTRACT, ANDASSIGN, ASSIGN, AT, BANG, BIT_AND, BIT_OR, BOOLEAN, BREAK, BYTE, CASE, CATCH, CHAR, CHARACTER_LITERAL, CLASS, COLON, COMMA, CONST, CONTINUE, DECIMAL_EXPONENT, DECIMAL_FLOATING_POINT_LITERAL, DECIMAL_LITERAL, DECR, DEFAULT, DO, DOT, DOUBLE, ELLIPSIS, ELSE, EOF, EQ, EXTENDS, FALSE, FINAL, FINALLY, FLOAT, FLOATING_POINT_LITERAL, FOR, FORMAL_COMMENT, GE, GOTO, GT, HEX_LITERAL, HEXADECIMAL_EXPONENT, HEXADECIMAL_FLOATING_POINT_LITERAL, HOOK, IDENTIFIER, IF, IMPLEMENTS, IMPORT, IN_FORMAL_COMMENT, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, INCR, INSTANCEOF, INT, INTEGER_LITERAL, INTERFACE, LBRACE, LBRACKET, LE, LETTER, LONG, LPAREN, LT, MINUS, MINUSASSIGN, MULTI_LINE_COMMENT, NATIVE, NE, NEW, NULL, OCTAL_LITERAL, ORASSIGN, PACKAGE, PART_LETTER, PLUS, PLUSASSIGN, PRIVATE, PROTECTED, PUBLIC, RBRACE, RBRACKET, REM, REMASSIGN, RETURN, RPAREN, RSIGNEDSHIFT, RUNSIGNEDSHIFT, SC_AND, SC_OR, SEMICOLON, SHORT, SINGLE_LINE_COMMENT, SLASH, SLASHASSIGN, STAR, STARASSIGN, STATIC, STRICTFP, STRING_LITERAL, SUPER, SWITCH, SYNCHRONIZED, THIS, THROW, THROWS, TILDE, tokenImage, TRANSIENT, TRUE, TRY, VOID, VOLATILE, WHILE, XOR, XORASSIGN
 
Constructor Summary
HTMLConversionVisitor(DoqHTMLSourceFile doq)
          Constructs a HTMLConversionVisitor.
 
Method Summary
 java.lang.Object visit(ASTCompilationUnit node, java.lang.Object data)
          Visits a JJTree node with the specific type.
 java.lang.Object visit(ASTGrammar node, java.lang.Object data)
          Visits a JJTree node with the specific type.
 java.lang.Object visit(ASTName node, java.lang.Object data)
          Visits a JJTree node with the specific type.
 java.lang.Object visit(ASTNewType node, java.lang.Object data)
          Visits a JJTree node with the specific type.
protected  java.lang.Object visit(ASTNode node, java.lang.Object data)
          Visits a JJTree node with the specific type.
protected  void write(java.lang.String s)
          Transforms a stringDoq.write(String).
protected  void write(Token t)
          Transforms a token.
 
Methods inherited from class com.javadoq.jjtree.ast.HTMLColorizeVisitor
close, start
 
Methods inherited from class com.javadoq.jjtree.ast.TokenTransformVisitor
visit, visitSpecial, visitToken
 
Methods inherited from class com.javadoq.jjtree.ast.TokenVisitor
visit, visit, visit, visit, visit, visitChildren
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doq

public final DoqHTMLSourceFile doq

The transformer.

Since:
1.0
Constructor Detail

HTMLConversionVisitor

public HTMLConversionVisitor(DoqHTMLSourceFile doq)

Constructs a HTMLConversionVisitor.

Parameters:
doq - The transformer for this visitor.
Since:
1.0
Method Detail

visit

public java.lang.Object visit(ASTGrammar node,
                              java.lang.Object data)

Visits a JJTree node with the specific type.

This method visits all the children nodes and tokens.

Specified by:
visit in interface JJTreeParserVisitor
Overrides:
visit in class TokenVisitor
Parameters:
node - The JJTree node to visit.
data - Visitor data.
Returns:
A visitor data.
Since:
1.0

visit

public java.lang.Object visit(ASTCompilationUnit node,
                              java.lang.Object data)

Visits a JJTree node with the specific type.

This method visits all the children nodes and tokens.

Specified by:
visit in interface JJTreeParserVisitor
Overrides:
visit in class TokenVisitor
Parameters:
node - The JJTree node to visit.
data - Visitor data.
Returns:
A visitor data.
Since:
1.0

visit

public java.lang.Object visit(ASTNewType node,
                              java.lang.Object data)

Visits a JJTree node with the specific type.

This method pushes the found new type into the stack before visiting children nodes and pop it after visiting the children nodes and tokens.

Specified by:
visit in interface JJTreeParserVisitor
Overrides:
visit in class TokenVisitor
Parameters:
node - The JJTree node to visit.
data - Visitor data.
Returns:
A visitor data.
Since:
1.0

visit

protected java.lang.Object visit(ASTNode node,
                                 java.lang.Object data)

Visits a JJTree node with the specific type.

This method visits all the children nodes and tokens.

Overrides:
visit in class TokenVisitor
Parameters:
node - The JJTree node to visit.
data - Visitor data.
Returns:
A visitor data.
Since:
1.0

visit

public java.lang.Object visit(ASTName node,
                              java.lang.Object data)

Visits a JJTree node with the specific type.

This method create hyper links for the found name.

Specified by:
visit in interface JJTreeParserVisitor
Overrides:
visit in class TokenVisitor
Parameters:
node - The JJTree node to visit.
data - Visitor data.
Returns:
A visitor data.
Since:
1.0

write

protected void write(java.lang.String s)

Transforms a stringDoq.write(String).

This method invokes Doq.write(String) to write the string to the target HTML file.

Specified by:
write in class TokenTransformVisitor
Parameters:
s - The string to output.
Since:
1.0

write

protected void write(Token t)

Transforms a token.

This method invokes DoqHTMLSourceFile.writeHTML(Token) to write the token to the target HTML file.

Specified by:
write in class TokenTransformVisitor
Parameters:
t - The JJTree token to output.
Since:
1.0

JavaDoq 1.0 API

Copyright © 2008-2011 J.J.Liu (www.javadoq.com). All Rights Reserved.