*
* @return
* @throws org.antlr.runtime.RecognitionException
*/
public GlobalDescr globalStatement( PackageDescrBuilder pkg ) throws RecognitionException {
GlobalDescrBuilder global = null;
try {
global = helper.start( pkg,
GlobalDescrBuilder.class,
null );
// 'global'
match( input,
DRL6Lexer.ID,
DroolsSoftKeywords.GLOBAL,
null,
DroolsEditorType.KEYWORD );
if ( state.failed ) return null;
// type
String type = type();
if ( state.backtracking == 0 ) global.type( type );
if ( state.failed ) return null;
// identifier
Token id = match( input,
DRL6Lexer.ID,
null,
null,
DroolsEditorType.IDENTIFIER_TYPE );
if ( state.failed ) return null;
if ( state.backtracking == 0 ) {
global.identifier( id.getText() );
helper.setParaphrasesValue( DroolsParaphraseTypes.GLOBAL,
id.getText() );
}
} catch ( RecognitionException re ) {
reportError( re );
} finally {
helper.end( GlobalDescrBuilder.class,
global );
}
return (global != null) ? global.getDescr() : null;
}