// $ANTLR start "classDeclaration"
// /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:328:1: classDeclaration[String projectName] returns [ToolClass toolClass] : ^( CLASS_DECLARATION IDENTIFIER ( isMappedClass )? superT= qualifiedType ( cEnum )* ( component_definition )* ( ^( IMPLEMENTS qualifiedType ) )* ( classProperties )+ ( STRINGLITERAL )? ) ;
public final ToolClass classDeclaration(String projectName) throws RecognitionException {
ToolClass toolClass = null;
CommonTree IDENTIFIER28=null;
ForteAST.qualifiedType_return superT =null;
ForteAST.isMappedClass_return isMappedClass29 =null;
try {
// /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:329:5: ( ^( CLASS_DECLARATION IDENTIFIER ( isMappedClass )? superT= qualifiedType ( cEnum )* ( component_definition )* ( ^( IMPLEMENTS qualifiedType ) )* ( classProperties )+ ( STRINGLITERAL )? ) )
// /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:329:7: ^( CLASS_DECLARATION IDENTIFIER ( isMappedClass )? superT= qualifiedType ( cEnum )* ( component_definition )* ( ^( IMPLEMENTS qualifiedType ) )* ( classProperties )+ ( STRINGLITERAL )? )
{
match(input,CLASS_DECLARATION,FOLLOW_CLASS_DECLARATION_in_classDeclaration1086); if (state.failed) return toolClass;
match(input, Token.DOWN, null); if (state.failed) return toolClass;
IDENTIFIER28=(CommonTree)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_classDeclaration1088); if (state.failed) return toolClass;
if ( state.backtracking==0 ) { toolClass = new ToolClass((IDENTIFIER28!=null?IDENTIFIER28.getText():null));}
// /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:331:5: ( isMappedClass )?
int alt26=2;
int LA26_0 = input.LA(1);
if ( (LA26_0==MAPPED) ) {
alt26=1;
}
switch (alt26) {
case 1 :
// /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:331:6: isMappedClass
{
pushFollow(FOLLOW_isMappedClass_in_classDeclaration1102);
isMappedClass29=isMappedClass();
state._fsp--;
if (state.failed) return toolClass;
if ( state.backtracking==0 ) { toolClass.setMapped(Boolean.parseBoolean((isMappedClass29!=null?(input.getTokenStream().toString(input.getTreeAdaptor().getTokenStartIndex(isMappedClass29.start),input.getTreeAdaptor().getTokenStopIndex(isMappedClass29.start))):null)));}
}
break;
}
pushFollow(FOLLOW_qualifiedType_in_classDeclaration1119);
superT=qualifiedType();
state._fsp--;
if (state.failed) return toolClass;
if ( state.backtracking==0 ) { toolClass.setSuperClass((superT!=null?(input.getTokenStream().toString(input.getTreeAdaptor().getTokenStartIndex(superT.start),input.getTreeAdaptor().getTokenStopIndex(superT.start))):null));}
// /Users/peter/Documents/workspace/Tool/src/tool/model/grammar/ForteAST.g:335:5: ( cEnum )*
loop27:
do {
int alt27=2;