diff --git a/pmd-visualforce/etc/grammar/VfParser.jjt b/pmd-visualforce/etc/grammar/VfParser.jjt index b036cad2dc..107e1b5ab0 100644 --- a/pmd-visualforce/etc/grammar/VfParser.jjt +++ b/pmd-visualforce/etc/grammar/VfParser.jjt @@ -48,32 +48,7 @@ public class VfParser { PARSER_END(VfParser) - -/** ******************************************************************** */ /** ************************* VF LEXICON **************************** */ -/** ******************************************************************** */ - - -/* This JavaCC lexicon has the following states: - * - StartTagState : this is the state entered after the "<" of a tag, until a - * non-whitespace is found. - * This is only for tags, not for xml-comments, declarations, etc. - * - AfterTagState : this is the state entered after the closing ">" of a tag, - * or xml-comment or declaration, until some non-whitespace is found - * - CommentState : the state between "" - * - DeclarationState : the state between "" - * - CDataState : the state between "" - * - InTagState : the state when inside a tag - * - AttrValueStatue : the state when starting an attribute value, before the starting single or double quote - * - DocTypeState : the state when inside a doctype declaration - * - ElExpressionState : the state when inside a ElExpression - * - DocTypeState : inside a document type declaration - * - DocTypeExternalIdState : inside an "external id" part of a dtd - * - AttrValueBetweenSingleQuotesState : inside an attribute that is surrounded by single quotes (') - * - AttrValueBetweenDoubleQuotesState : inside an attribute that is surrounded by double quotes (") - * - HtmlScriptContentState : inside an HTML script - */ - <*> TOKEN : { @@ -172,7 +147,7 @@ PARSER_END(VfParser) | " | "!>") > : AfterTagState | " > : AfterTagState | : InTagState //support for empty attributes } - TOKEN: + TOKEN: { | )* "}" > } @@ -200,7 +175,6 @@ PARSER_END(VfParser) : InTagState | -| : InTagState } TOKEN : @@ -208,7 +182,6 @@ PARSER_END(VfParser) : InTagState | -| : InTagState } TOKEN : @@ -223,9 +196,7 @@ PARSER_END(VfParser) | " | "" | ""> : AfterTagState } -/** ******************************************************************** */ /** ************************* VF GRAMMAR **************************** */ -/** ******************************************************************** */ /** * The root of the AST of a VF. @@ -443,42 +414,38 @@ void Attribute() : * EL expressions * are parsed as sub-nodes of the AttributeValue node. */ -void AttributeValue() : -{ - StringBuffer content = new StringBuffer(); - String tmp; - Token t = null ; -} -{ - ( - ( - ( ( tmp = UnparsedTextNoDoubleQuotes() - | tmp = QuoteIndependentAttributeValueContent() - ) { content.append(tmp); } )* - ( - | t = { content.append(t.image.substring(0, 1)); } - ) - ) - | - ( - ( ( tmp = UnparsedTextNoSingleQuotes() | tmp = QuoteIndependentAttributeValueContent() ) - { content.append(tmp); } )* - ( - | t = { content.append(t.image.substring(0, 1)); } - ) - ) - | - ( - ( ( tmp = UnparsedTextNoWhitespace() | tmp = QuoteIndependentAttributeValueContent() ) - { content.append(tmp); } - )* - ( ) - ) - | - ) - { jjtThis.setImage( content.toString() ); - } -} + void AttributeValue() : + { + StringBuffer content = new StringBuffer(); + String tmp; + Token t = null ; + } + { + ( + ( + ( ( tmp = UnparsedTextNoDoubleQuotes() + | tmp = QuoteIndependentAttributeValueContent() + ) { content.append(tmp); } )* + ( ) + ) + | + ( + ( ( tmp = UnparsedTextNoSingleQuotes() | tmp = QuoteIndependentAttributeValueContent() ) + { content.append(tmp); } )* + ( ) + ) + | + ( + ( ( tmp = UnparsedTextNoWhitespace() | tmp = QuoteIndependentAttributeValueContent() ) + { content.append(tmp); } + )* + ( ) + ) + | + ) + { jjtThis.setImage( content.toString() ); + } + } /** * Partial content of an attribute value that can contain all quotes.