com.google.caja.ancillary.jsdoc
Class JsdocRewriter
java.lang.Object
com.google.caja.ancillary.jsdoc.JsdocRewriter
class JsdocRewriter
- extends java.lang.Object
A rewriter that rewrites javascript to store documentation strings with
javascript values so that we can evaluate the javascript and inspect the
resulting environment to get at the public API, a la pydoc.
- Author:
- mikesamuel@gmail.com
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
mq
private final MessageQueue mq
mc
private final MessageContext mc
consumed
private final java.util.Set<Token<?>> consumed
handlers
private final AnnotationHandlers handlers
TAG
private static final java.util.regex.Pattern TAG
JsdocRewriter
JsdocRewriter(AnnotationHandlers handlers,
MessageContext mc,
MessageQueue mq)
rewriteFile
ParseTreeNode rewriteFile(ParseTreeNode js)
rewritePackageDocs
ParseTreeNode rewritePackageDocs(InputSource is,
Comment cmt)
extractFileOverview
private Expression extractFileOverview(ParseTreeNode js)
rewrite
private ParseTreeNode rewrite(ParseTreeNode js)
isScopeBlock
private static boolean isScopeBlock(ParseTreeNode js)
documentExpression
private Expression documentExpression(Expression js)
documentExpression
private Expression documentExpression(Expression js,
Expression doc)
documentExpressionStmt
private ExpressionStmt documentExpressionStmt(ExpressionStmt js)
documentDeclaration
private ParseTreeNode documentDeclaration(Declaration js)
documentFunction
private ParseTreeNode documentFunction(ParseTreeNode fn)
documentObjectConstructor
private ParseTreeNode documentObjectConstructor(ObjectConstructor o)
documentReturnStmt
private ParseTreeNode documentReturnStmt(ReturnStmt js)
documentLoop
private Loop documentLoop(Loop js)
documentConditional
private Conditional documentConditional(Conditional js)
delayDocingOfUninitializedVariables
private Statement delayDocingOfUninitializedVariables(Statement s)
rewriteAll
private java.util.List<ParseTreeNode> rewriteAll(java.util.List<? extends ParseTreeNode> nodes)
getDocComment
private Comment getDocComment(ParseTreeNode js,
Criterion<Comment> filter)
getDocCommentJson
private Expression getDocCommentJson(ParseTreeNode js)
commentToJson
private Expression commentToJson(Comment cmt)
format
static java.lang.String format(FilePosition p,
MessageContext mc)
format
static java.lang.String format(InputSource s,
MessageContext mc)
- Simplify a URI by removing the common path elements from the front.
If all the input sources start with "file:///src/" then that prefix will
be skipped.
normalizeHtml
private java.util.List<Annotation> normalizeHtml(java.util.List<? extends Annotation> annotations)
- Normalize HTML so that unclosed tags don't interfere with the formatting
of the embedding page. This is not meant to enforce any security
properties.
normalizeHtml
private Comment normalizeHtml(Comment c)
normalizeHtml
private BlockAnnotation normalizeHtml(BlockAnnotation a)
Copyright (C) 2008 Google Inc.
Licensed under the Apache License, Version 2.0