Package net.sourceforge.pmd.lang.jsp.ast
Class JspParserImpl
- java.lang.Object
-
- net.sourceforge.pmd.lang.jsp.ast.JspParserImpl
-
public class JspParserImpl extends Object
JSP Parser for PMD.- Author:
- Pieter, Application Engineers NV/SA, http://www.ae.be
-
-
Field Summary
Fields Modifier and Type Field Description JavaccTokenjj_ntNext token.static intJJTATTRIBUTEstatic intJJTATTRIBUTEVALUEstatic intJJTCDATAstatic intJJTCOMMENTTAGstatic intJJTCOMPILATIONUNITstatic intJJTCONTENTstatic intJJTDECLARATIONstatic intJJTDOCTYPEDECLARATIONstatic intJJTDOCTYPEEXTERNALIDstatic intJJTELEMENTstatic intJJTELEXPRESSIONstatic intJJTHTMLSCRIPTstatic intJJTJSPCOMMENTstatic intJJTJSPDECLARATIONstatic intJJTJSPDIRECTIVEstatic intJJTJSPDIRECTIVEATTRIBUTEstatic intJJTJSPEXPRESSIONstatic intJJTJSPEXPRESSIONINATTRIBUTEstatic intJJTJSPSCRIPTLETstatic String[]jjtNodeNameprotected JjtreeBuilder<net.sourceforge.pmd.lang.jsp.ast.AbstractJspNode>jjtreestatic intJJTTEXTstatic intJJTUNPARSEDTEXTstatic intJJTVALUEBINDINGstatic intJJTVOIDJavaccTokentokenCurrent token.net.sourceforge.pmd.lang.jsp.ast.JspParserImplTokenManagertoken_sourceGenerated net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken Manager.
-
Constructor Summary
Constructors Constructor Description JspParserImpl(CharStream stream)Constructor with user supplied net.sourceforge.pmd.lang.ast.impl.javacc.CharStream.JspParserImpl(net.sourceforge.pmd.lang.jsp.ast.JspParserImplTokenManager tm)Constructor with generated net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 (if an end tag exists).voidContentElement()A single (non-text) element that can occur between a start-tag and end-tag of an element.voidDeclaration()voiddisable_tracing()Disable tracing.voidDoctypeDeclaration()voidDoctypeExternalId()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()voidenable_tracing()Enable tracing.ParseExceptiongenerateParseException()Generate net.sourceforge.pmd.lang.ast.ParseException.JavaccTokengetNextToken()Get the next net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken.JavaccTokengetToken(int index)Get the specific net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken.voidHtmlScript()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(net.sourceforge.pmd.lang.jsp.ast.JspParserImplTokenManager tm)Reinitialise.voidText()This production groups all characters between two tags, where tag is an xml-tag "<...>" or a jsp-page-tag "<%...%>" or CDATA "<![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.StringUnparsedTextNoWhitespace()StringValueBindingInAttribute()
-
-
-
Field Detail
-
jjtree
protected JjtreeBuilder<net.sourceforge.pmd.lang.jsp.ast.AbstractJspNode> jjtree
-
token_source
public net.sourceforge.pmd.lang.jsp.ast.JspParserImplTokenManager token_source
Generated net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken Manager.
-
token
public JavaccToken token
Current token.
-
jj_nt
public JavaccToken jj_nt
Next token.
-
JJTCOMPILATIONUNIT
public static final int JJTCOMPILATIONUNIT
- See Also:
- Constant Field Values
-
JJTVOID
public static final int JJTVOID
- See Also:
- Constant Field Values
-
JJTCONTENT
public static final int JJTCONTENT
- See Also:
- Constant Field Values
-
JJTJSPDIRECTIVE
public static final int JJTJSPDIRECTIVE
- See Also:
- Constant Field Values
-
JJTJSPDIRECTIVEATTRIBUTE
public static final int JJTJSPDIRECTIVEATTRIBUTE
- See Also:
- Constant Field Values
-
JJTJSPSCRIPTLET
public static final int JJTJSPSCRIPTLET
- See Also:
- Constant Field Values
-
JJTJSPEXPRESSION
public static final int JJTJSPEXPRESSION
- See Also:
- Constant Field Values
-
JJTJSPDECLARATION
public static final int JJTJSPDECLARATION
- See Also:
- Constant Field Values
-
JJTJSPCOMMENT
public static final int JJTJSPCOMMENT
- See Also:
- Constant Field Values
-
JJTTEXT
public static final int JJTTEXT
- See Also:
- Constant Field Values
-
JJTUNPARSEDTEXT
public static final int JJTUNPARSEDTEXT
- See Also:
- Constant Field Values
-
JJTELEXPRESSION
public static final int JJTELEXPRESSION
- See Also:
- Constant Field Values
-
JJTVALUEBINDING
public static final int JJTVALUEBINDING
- See Also:
- Constant Field Values
-
JJTCDATA
public static final int JJTCDATA
- See Also:
- Constant Field Values
-
JJTELEMENT
public static final int JJTELEMENT
- See Also:
- Constant Field Values
-
JJTATTRIBUTE
public static final int JJTATTRIBUTE
- See Also:
- Constant Field Values
-
JJTATTRIBUTEVALUE
public static final int JJTATTRIBUTEVALUE
- See Also:
- Constant Field Values
-
JJTJSPEXPRESSIONINATTRIBUTE
public static final int JJTJSPEXPRESSIONINATTRIBUTE
- See Also:
- Constant Field Values
-
JJTCOMMENTTAG
public static final int JJTCOMMENTTAG
- See Also:
- Constant Field Values
-
JJTDECLARATION
public static final int JJTDECLARATION
- See Also:
- Constant Field Values
-
JJTDOCTYPEDECLARATION
public static final int JJTDOCTYPEDECLARATION
- See Also:
- Constant Field Values
-
JJTDOCTYPEEXTERNALID
public static final int JJTDOCTYPEEXTERNALID
- See Also:
- Constant Field Values
-
JJTHTMLSCRIPT
public static final int JJTHTMLSCRIPT
- See Also:
- Constant Field Values
-
jjtNodeName
public static final String[] jjtNodeName
-
-
Constructor Detail
-
JspParserImpl
public JspParserImpl(CharStream stream)
Constructor with user supplied net.sourceforge.pmd.lang.ast.impl.javacc.CharStream.
-
JspParserImpl
public JspParserImpl(net.sourceforge.pmd.lang.jsp.ast.JspParserImplTokenManager tm)
Constructor with generated net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken Manager.
-
-
Method Detail
-
CompilationUnit
public final ASTCompilationUnit CompilationUnit() throws ParseException
The root of the AST of a JSP.- Throws:
ParseException
-
Prolog
public final void Prolog() throws ParseExceptionThe optional prolog of a JSP, including (xml) declarations and DTD.- Throws:
ParseException
-
Content
public final void Content() throws ParseExceptionEverything between a start-tag and the corresponding end-tag of an element (if an end tag exists).- Throws:
ParseException
-
ContentElement
public final void ContentElement() throws ParseExceptionA single (non-text) element that can occur between a start-tag and end-tag of an element.- Throws:
ParseException
-
JspDirective
public final void JspDirective() throws ParseException- Throws:
ParseException
-
JspDirectiveAttribute
public final void JspDirectiveAttribute() throws ParseException- Throws:
ParseException
-
JspScriptlet
public final void JspScriptlet() throws ParseException- Throws:
ParseException
-
JspExpression
public final void JspExpression() throws ParseException- Throws:
ParseException
-
JspDeclaration
public final void JspDeclaration() throws ParseException- Throws:
ParseException
-
JspComment
public final void JspComment() throws ParseException- Throws:
ParseException
-
Text
public final void Text() throws ParseExceptionThis production groups all characters between two tags, where tag is an xml-tag "<...>" or a jsp-page-tag "<%...%>" or CDATA "<![CDATA[...]]>". Text consists of unparsed text and/or Expression Language expressions.- Throws:
ParseException
-
UnparsedText
public final String UnparsedText() throws ParseException
- Throws:
ParseException
-
UnparsedTextNoWhitespace
public final String UnparsedTextNoWhitespace() throws ParseException
- Throws:
ParseException
-
UnparsedTextNoSingleQuotes
public final String UnparsedTextNoSingleQuotes() throws ParseException
Text that contains no single quotes, and that does not contain the start of a EL expression or value binding.- Throws:
ParseException
-
UnparsedTextNoDoubleQuotes
public final String UnparsedTextNoDoubleQuotes() throws ParseException
Text that contains no double quotes, and that does not contain the start of a EL expression or value binding.- Throws:
ParseException
-
ElExpression
public final String ElExpression() throws ParseException
An EL expression, not within an attribute value.- Throws:
ParseException
-
ValueBindingInAttribute
public final String ValueBindingInAttribute() throws ParseException
- Throws:
ParseException
-
ElExpressionInAttribute
public final String ElExpressionInAttribute() throws ParseException
- Throws:
ParseException
-
CData
public final void CData() throws ParseException- Throws:
ParseException
-
Element
public final void Element() throws ParseExceptionA XML element, either with a single empty tag, or with a starting and closing tag with optional contained content.- Throws:
ParseException
-
Attribute
public final void Attribute() throws ParseException- Throws:
ParseException
-
AttributeValue
public final void AttributeValue() throws ParseExceptionThe value of an attribute of an element. EL expressions, JSF value bindings, and JSP expressions are parsed as sub-nodes of the AttributeValue node.- Throws:
ParseException
-
QuoteIndependentAttributeValueContent
public final String QuoteIndependentAttributeValueContent() throws ParseException
Partial content of an attribute value that can contain all quotes. This groups EL expressions, value bindings, and JSP expressions.- Throws:
ParseException
-
JspExpressionInAttribute
public final String JspExpressionInAttribute() throws ParseException
- Throws:
ParseException
-
CommentTag
public final void CommentTag() throws ParseException- Throws:
ParseException
-
Declaration
public final void Declaration() throws ParseException- Throws:
ParseException
-
DoctypeDeclaration
public final void DoctypeDeclaration() throws ParseException- Throws:
ParseException
-
DoctypeExternalId
public final void DoctypeExternalId() throws ParseException- Throws:
ParseException
-
HtmlScript
public final void HtmlScript() throws ParseException- Throws:
ParseException
-
ReInit
public void ReInit(CharStream stream)
Reinitialise.
-
ReInit
public void ReInit(net.sourceforge.pmd.lang.jsp.ast.JspParserImplTokenManager tm)
Reinitialise.
-
getNextToken
public final JavaccToken getNextToken()
Get the next net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken.
-
getToken
public final JavaccToken getToken(int index)
Get the specific net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken.
-
generateParseException
public ParseException generateParseException()
Generate net.sourceforge.pmd.lang.ast.ParseException.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-