*
* @return
* @throws org.antlr.runtime.RecognitionException
*/
public WindowDeclarationDescr windowDeclaration( DeclareDescrBuilder ddb ) throws RecognitionException {
WindowDeclarationDescrBuilder declare = null;
try {
declare = helper.start( ddb,
WindowDeclarationDescrBuilder.class,
null );
String window = "";
match( input,
DRL6Lexer.ID,
DroolsSoftKeywords.WINDOW,
null,
DroolsEditorType.KEYWORD );
if ( state.failed ) return null;
Token id = match( input,
DRL6Lexer.ID,
null,
null,
DroolsEditorType.IDENTIFIER );
if ( state.failed ) return null;
window = id.getText();
if( state.backtracking == 0 ) {
declare.name( window );
}
while ( input.LA( 1 ) == DRL6Lexer.AT ) {
// annotation*
annotation( declare );
if ( state.failed ) return null;
}
lhsPatternBind( declare, false );
match( input,
DRL6Lexer.ID,
DroolsSoftKeywords.END,
null,
DroolsEditorType.KEYWORD );
if ( state.failed ) return null;
} catch ( RecognitionException re ) {
reportError( re );
} finally {
helper.end( WindowDeclarationDescrBuilder.class,
declare );
}
return (declare != null) ? declare.getDescr() : null;
}