net.sourceforge.pmd.jsp.ast

Class JspParser

public class JspParser extends Object implements JspParserTreeConstants, JspParserConstants

JSP Parser for PMD.

Author: Pieter � Application Engineers NV/SA � http://www.ae.be

Field Summary
protected JJTJspParserStatejjtree
Tokenjj_nt
Next token.
Tokentoken
Current token.
JspParserTokenManagertoken_source
Generated Token Manager.
Constructor Summary
JspParser(CharStream stream)
Constructor with user supplied CharStream.
JspParser(JspParserTokenManager tm)
Constructor with generated Token Manager.
Method Summary
voidAttribute()
voidAttributeValue()
The value of an attribute of an element.
voidCData()
voidCommentTag()
ASTCompilationUnitCompilationUnit()
The root of the AST of a JSP.
voidContent()
Everything between a start-tag and the corresponding end-tag of an element.
voidContentElementPossiblyWithText()
A single (non-text) element that can occur between a start- and end-tag of an element.
voiddisable_tracing()
Disable tracing.
voidDeclaration()
voidDoctypeDeclaration()
voidDoctypeExternalId()
voidenable_tracing()
Enable tracing.
voidElement()
A XML element, either with a single empty tag, or with a starting and closing tag with optional contained content.
StringElExpression()
An EL expression, not within an attribute value.
StringElExpressionInAttribute()
ParseExceptiongenerateParseException()
Generate ParseException.
TokengetNextToken()
Get the next Token.
TokengetToken(int index)
Get the specific Token.
voidJspComment()
voidJspDeclaration()
voidJspDirective()
voidJspDirectiveAttribute()
voidJspExpression()
StringJspExpressionInAttribute()
voidJspScriptlet()
voidProlog()
The optional prolog of a JSP, including (xml) declarations and DTD.
StringQuoteIndependentAttributeValueContent()
Partial content of an attribute value that can contain all quotes.
voidReInit(CharStream stream)
Reinitialise.
voidReInit(JspParserTokenManager tm)
Reinitialise.
voidText()
This production groups all characters between two tags, where tag is an xml-tag "<...>" or a jsp-page-tag "<%...%>" or CDATA "
StringUnparsedText()
StringUnparsedTextNoDoubleQuotes()
Text that contains no double quotes, and that does not contain the start of a EL expression or value binding.
StringUnparsedTextNoSingleQuotes()
Text that contains no single quotes, and that does not contain the start of a EL expression or value binding.
StringValueBindingInAttribute()

Field Detail

jjtree

protected JJTJspParserState jjtree

jj_nt

public Token jj_nt
Next token.

token

public Token token
Current token.

token_source

public JspParserTokenManager token_source
Generated Token Manager.

Constructor Detail

JspParser

public JspParser(CharStream stream)
Constructor with user supplied CharStream.

JspParser

public JspParser(JspParserTokenManager tm)
Constructor with generated Token Manager.

Method Detail

Attribute

public final void Attribute()

AttributeValue

public final void AttributeValue()
The value of an attribute of an element. EL expressions, JSF value bindings, and JSP expressions are parsed as sub-nodes of the AttributeValue node.

CData

public final void CData()

CommentTag

public final void CommentTag()

CompilationUnit

public final ASTCompilationUnit CompilationUnit()
The root of the AST of a JSP.

Content

public final void Content()
Everything between a start-tag and the corresponding end-tag of an element.

ContentElementPossiblyWithText

public final void ContentElementPossiblyWithText()
A single (non-text) element that can occur between a start- and end-tag of an element. Possibly followed by text.

disable_tracing

public final void disable_tracing()
Disable tracing.

Declaration

public final void Declaration()

DoctypeDeclaration

public final void DoctypeDeclaration()

DoctypeExternalId

public final void DoctypeExternalId()

enable_tracing

public final void enable_tracing()
Enable tracing.

Element

public final void Element()
A XML element, either with a single empty tag, or with a starting and closing tag with optional contained content.

ElExpression

public final String ElExpression()
An EL expression, not within an attribute value.

ElExpressionInAttribute

public final String ElExpressionInAttribute()

generateParseException

public ParseException generateParseException()
Generate ParseException.

getNextToken

public final Token getNextToken()
Get the next Token.

getToken

public final Token getToken(int index)
Get the specific Token.

JspComment

public final void JspComment()

JspDeclaration

public final void JspDeclaration()

JspDirective

public final void JspDirective()

JspDirectiveAttribute

public final void JspDirectiveAttribute()

JspExpression

public final void JspExpression()

JspExpressionInAttribute

public final String JspExpressionInAttribute()

JspScriptlet

public final void JspScriptlet()

Prolog

public final void Prolog()
The optional prolog of a JSP, including (xml) declarations and DTD.

QuoteIndependentAttributeValueContent

public final String QuoteIndependentAttributeValueContent()
Partial content of an attribute value that can contain all quotes. This groups EL expressions, value bindings, and JSP expressions.

ReInit

public void ReInit(CharStream stream)
Reinitialise.

ReInit

public void ReInit(JspParserTokenManager tm)
Reinitialise.

Text

public final void Text()
This production groups all characters between two tags, where tag is an xml-tag "<...>" or a jsp-page-tag "<%...%>" or CDATA "". Text consists of unparsed text and/or Expression Language expressions.

UnparsedText

public final String UnparsedText()

UnparsedTextNoDoubleQuotes

public final String UnparsedTextNoDoubleQuotes()
Text that contains no double quotes, and that does not contain the start of a EL expression or value binding.

UnparsedTextNoSingleQuotes

public final String UnparsedTextNoSingleQuotes()
Text that contains no single quotes, and that does not contain the start of a EL expression or value binding.

ValueBindingInAttribute

public final String ValueBindingInAttribute()