@Override protected com.ochafik.lang.jnaerator.parser.ObjCppParser newObjCppParser(TypeConversion typeConverter, String s, boolean verbose, PrintStream errorOut) throws IOException { com.ochafik.lang.jnaerator.parser.ObjCppParser parser = super.newObjCppParser(typeConverter, s, verbose, errorOut); parser.allowKinds(ModifierKind.OpenCL); return parser; }
public final void synpred117_ObjCpp_fragment() throws RecognitionException { // com/ochafik/lang/jnaerator/parser/ObjCpp.g:1181:5: ({...}? => IDENTIFIER LPAREN 'return' binaryOp expression RPAREN ) // com/ochafik/lang/jnaerator/parser/ObjCpp.g:1181:5: {...}? => IDENTIFIER LPAREN 'return' binaryOp expression RPAREN { if ( !(( next("__success") )) ) { if (state.backtracking>0) {state.failed=true; return ;} throw new FailedPredicateException(input, "synpred117_ObjCpp", " next(\"__success\") "); } match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_synpred117_ObjCpp3786); if (state.failed) return ; match(input,LPAREN,FOLLOW_LPAREN_in_synpred117_ObjCpp3788); if (state.failed) return ; match(input,93,FOLLOW_93_in_synpred117_ObjCpp3790); if (state.failed) return ; pushFollow(FOLLOW_binaryOp_in_synpred117_ObjCpp3792); binaryOp(); state._fsp--; if (state.failed) return ; pushFollow(FOLLOW_expression_in_synpred117_ObjCpp3794); expression(); state._fsp--; if (state.failed) return ; match(input,RPAREN,FOLLOW_RPAREN_in_synpred117_ObjCpp3797); if (state.failed) return ; } } // $ANTLR end synpred117_ObjCpp
public final void synpred11_ObjCpp_fragment() throws RecognitionException { // com/ochafik/lang/jnaerator/parser/ObjCpp.g:569:9: ( functionDeclaration ) // com/ochafik/lang/jnaerator/parser/ObjCpp.g:569:9: functionDeclaration { pushFollow(FOLLOW_functionDeclaration_in_synpred11_ObjCpp481); functionDeclaration(); state._fsp--; if (state.failed) return ; } } // $ANTLR end synpred11_ObjCpp
public final void synpred56_ObjCpp_fragment() throws RecognitionException { TypeRef returnTypeRef =null; // com/ochafik/lang/jnaerator/parser/ObjCpp.g:863:22: (returnTypeRef= mutableTypeRef ) // com/ochafik/lang/jnaerator/parser/ObjCpp.g:863:22: returnTypeRef= mutableTypeRef { pushFollow(FOLLOW_mutableTypeRef_in_synpred56_ObjCpp2019); returnTypeRef=mutableTypeRef(); state._fsp--; if (state.failed) return ; } } // $ANTLR end synpred56_ObjCpp
public final void synpred302_ObjCpp_fragment() throws RecognitionException { // com/ochafik/lang/jnaerator/parser/ObjCpp.g:2136:20: ( expression ) // com/ochafik/lang/jnaerator/parser/ObjCpp.g:2136:20: expression { pushFollow(FOLLOW_expression_in_synpred302_ObjCpp8832); expression(); state._fsp--; if (state.failed) return ; } } // $ANTLR end synpred302_ObjCpp
if ( state.backtracking>0 && alreadyParsedRule(input, 4) ) { return retval; } if ( (((( next("__extension__") )&&( next("__extension__") ))&&synpred8_ObjCpp())) ) { alt4=1; if ( !(( next("__extension__") )) ) { if (state.backtracking>0) {state.failed=true; return retval;} throw new FailedPredicateException(input, "declaration", " next(\"__extension__\") "); match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_declaration418); if (state.failed) return retval; if ( (((synpred9_ObjCpp()&&synpred9_ObjCpp())&&( next("template") ))) ) { alt5=1; pushFollow(FOLLOW_templatePrefix_in_declaration431); tp=templatePrefix(); retval.startTokenIndex = getTokenStream().index(); retval.preComment = getCommentBefore(retval.startTokenIndex); if ( !(( next("__pragma") )) ) { if (state.backtracking>0) {state.failed=true; return retval;} throw new FailedPredicateException(input, "declaration", " next(\"__pragma\") "); pushFollow(FOLLOW_pragmaContent_in_declaration469); pragmaContent(); pushFollow(FOLLOW_functionDeclaration_in_declaration481); functionDeclaration3=functionDeclaration();
if ( state.backtracking>0 && alreadyParsedRule(input, 19) ) { return retval; } retval.function = mark(new Function(), -1); retval.function.setType(Function.Type.CFunction); if ( (((( next("operator") )&&( next("operator") ))&&synpred83_ObjCpp())) ) { alt50=1; next(2, "<") || isTypeIdentifier(next()) || parseModifier(next(1)) == null && !next(2, "=", ",", ";", ":", "[", "(", ")") if ( !(( next("operator") )) ) { if (state.backtracking>0) {state.failed=true; return retval;} throw new FailedPredicateException(input, "functionDeclaration", " next(\"operator\") "); match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_functionDeclaration2902); if (state.failed) return retval; mark(retval.function, getLine(((Token)retval.start))); if ( (((synpred82_ObjCpp()&&synpred82_ObjCpp())&&(( next("extern") )||( next("__pragma") )||( parseModifier(next()) != null )||( next("__asm") )||( next("__success") )||( next(ModifierKind.VCAnnotation1Arg, ModifierKind.VCAnnotation2Args) )))) ) { alt47=1; if ( (synpred82_ObjCpp()) ) { alt47=1;
public final void protocolExpr() throws RecognitionException { int protocolExpr_StartIndex = input.index(); try { if ( state.backtracking>0 && alreadyParsedRule(input, 58) ) { return ; } // com/ochafik/lang/jnaerator/parser/ObjCpp.g:1829:3: ( '@protocol' LPAREN IDENTIFIER RPAREN ) // com/ochafik/lang/jnaerator/parser/ObjCpp.g:1829:6: '@protocol' LPAREN IDENTIFIER RPAREN { match(input,74,FOLLOW_74_in_protocolExpr6849); if (state.failed) return ; match(input,LPAREN,FOLLOW_LPAREN_in_protocolExpr6855); if (state.failed) return ; match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_protocolExpr6861); if (state.failed) return ; match(input,RPAREN,FOLLOW_RPAREN_in_protocolExpr6867); if (state.failed) return ; } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving if ( state.backtracking>0 ) { memoize(input, 58, protocolExpr_StartIndex); } } return ; } // $ANTLR end "protocolExpr"
if ( state.backtracking>0 && alreadyParsedRule(input, 83) ) { return stat; } pushFollow(FOLLOW_statementsBlock_in_statement8451); b=statementsBlock(); if ( !(( next("__asm__", "asm") )) ) { if (state.backtracking>0) {state.failed=true; return stat;} throw new FailedPredicateException(input, "statement", " next(\"__asm__\", \"asm\") "); match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_statement8475); if (state.failed) return stat; if ( (LA149_0==IDENTIFIER) && (( next("__volatile__", "volatile") ))) { alt149=1; if ( !(( next("__volatile__", "volatile") )) ) { if (state.backtracking>0) {state.failed=true; return stat;} throw new FailedPredicateException(input, "statement", " next(\"__volatile__\", \"volatile\") "); match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_statement8486); if (state.failed) return stat; match(input,LPAREN,FOLLOW_LPAREN_in_statement8491); if (state.failed) return stat; match(input,STRING,FOLLOW_STRING_in_statement8499); if (state.failed) return stat; match(input,51,FOLLOW_51_in_statement8504); if (state.failed) return stat; pushFollow(FOLLOW_gccAsmInOuts_in_statement8506); gccAsmInOuts();
if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return retval; } if ( (((synpred106_ObjCpp()&&synpred106_ObjCpp())&&( next("__pragma") ))) ) { alt69=1; else if ( (((synpred108_ObjCpp()&&synpred108_ObjCpp())&&( parseModifier(next()) != null ))) ) { alt69=3; else if ( (((( next("__asm") )&&( next("__asm") ))&&synpred116_ObjCpp())) ) { alt69=5; else if ( (((( next("__success") )&&( next("__success") ))&&synpred117_ObjCpp())) ) { alt69=6; else if ( (( next(ModifierKind.VCAnnotation1Arg, ModifierKind.VCAnnotation2Args) )) ) { alt69=7; if ( (((( next("extern") )&&( next("extern") ))&&synpred107_ObjCpp())) ) { alt69=2; else if ( (((synpred108_ObjCpp()&&synpred108_ObjCpp())&&( parseModifier(next()) != null ))) ) { alt69=3; if ( !(( next("__pragma") )) ) { if (state.backtracking>0) {state.failed=true; return retval;} throw new FailedPredicateException(input, "modifier", " next(\"__pragma\") "); pushFollow(FOLLOW_pragmaContent_in_modifier3588); pragmaContent();
if ( state.backtracking>0 && alreadyParsedRule(input, 42) ) { return type; } pushFollow(FOLLOW_modifiers_in_nonMutableTypeRef5658); preMods=modifiers(); try { if (ModifierType.UUID.isContainedBy(modifiers)) allowKinds(ModifierKind.VCParameterAnnotation); } catch (Throwable th) { th.printStackTrace(); if ( !(( next("va_list", "__gnuc_va_list", "__builtin_va_list") )) ) { if (state.backtracking>0) {state.failed=true; return type;} throw new FailedPredicateException(input, "nonMutableTypeRef", " next(\"va_list\", \"__gnuc_va_list\", \"__builtin_va_list\") "); i=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_nonMutableTypeRef5682); if (state.failed) return type; match(input,97,FOLLOW_97_in_nonMutableTypeRef5694); if (state.failed) return type; pushFollow(FOLLOW_typeName_in_nonMutableTypeRef5698); pn=typeName(); next(2, "<") || isTypeIdentifier(next()) || parseModifier(next(1)) == null && !next(2, "=", ",", ";", ":", "[", "(", ")")
if ( state.backtracking>0 && alreadyParsedRule(input, 29) ) { return arg; } if ( (synpred132_ObjCpp()) ) { alt81=1; if ( (synpred132_ObjCpp()) ) { alt81=1; next(2, "<") || isTypeIdentifier(next()) || parseModifier(next(1)) == null && !next(2, "=", ",", ";", ":", "[", "(", ")") n=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_templateArgDecl4291); if (state.failed) return arg; addTypeIdent((n!=null?n.getText():null)); match(input,57,FOLLOW_57_in_templateArgDecl4309); if (state.failed) return arg; pushFollow(FOLLOW_mutableTypeRef_in_templateArgDecl4313); tr=mutableTypeRef(); pushFollow(FOLLOW_argDef_in_templateArgDecl4330); argDef23=argDef(); match(input,57,FOLLOW_57_in_templateArgDecl4348); if (state.failed) return arg;
if ( state.backtracking>0 && alreadyParsedRule(input, 76) ) { return expr; } if ( !(( next("new") )) ) { if (state.backtracking>0) {state.failed=true; return expr;} throw new FailedPredicateException(input, "postfixExpr", " next(\"new\") "); match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_postfixExpr7954); if (state.failed) return expr; pushFollow(FOLLOW_nonMutableTypeRef_in_postfixExpr7958); tr=nonMutableTypeRef(); if ( (synpred263_ObjCpp()) ) { alt142=1; if ( (synpred263_ObjCpp()) ) { alt142=1; if ( (synpred263_ObjCpp()) ) { alt142=1; if ( (synpred263_ObjCpp()) ) { alt142=1; if ( (synpred263_ObjCpp()) ) { alt142=1; if ( (synpred263_ObjCpp()) ) { alt142=1;
if ( state.backtracking>0 && alreadyParsedRule(input, 55) ) { return expr; } pushFollow(FOLLOW_simpleIdentifier_in_baseExpression6702); i=simpleIdentifier(); pushFollow(FOLLOW_constant_in_baseExpression6713); constant41=constant(); match(input,LPAREN,FOLLOW_LPAREN_in_baseExpression6723); if (state.failed) return expr; pushFollow(FOLLOW_expression_in_baseExpression6725); expression42=expression(); match(input,RPAREN,FOLLOW_RPAREN_in_baseExpression6727); if (state.failed) return expr; pushFollow(FOLLOW_objCMethodCall_in_baseExpression6737); objCMethodCall43=objCMethodCall(); pushFollow(FOLLOW_expressionsBlock_in_baseExpression6747); expressionsBlock44=expressionsBlock(); pushFollow(FOLLOW_selectorExpr_in_baseExpression6757); selectorExpr(); pushFollow(FOLLOW_protocolExpr_in_baseExpression6765); protocolExpr(); pushFollow(FOLLOW_encodingExpr_in_baseExpression6773); encodingExpr();
if ( state.backtracking>0 && alreadyParsedRule(input, 20) ) { return retval; } pushFollow(FOLLOW_argList_in_functionDeclarationSuffix3040); argList19=argList(); if ( ((((( next("__pragma") )||( next("__asm") )||( next("__success") )||( next(ModifierKind.VCAnnotation1Arg, ModifierKind.VCAnnotation2Args) ))&&(( next("__pragma") )||( next("__asm") )||( next("__success") )||( next(ModifierKind.VCAnnotation1Arg, ModifierKind.VCAnnotation2Args) )))&&synpred86_ObjCpp())) ) { alt51=1; pushFollow(FOLLOW_modifiers_in_functionDeclarationSuffix3052); postMods=modifiers(); if ( !(( next("throw") )) ) { if (state.backtracking>0) {state.failed=true; return retval;} throw new FailedPredicateException(input, "functionDeclarationSuffix", " next(\"throw\") "); match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_functionDeclarationSuffix3073); if (state.failed) return retval; match(input,LPAREN,FOLLOW_LPAREN_in_functionDeclarationSuffix3083); if (state.failed) return retval; if ( (synpred88_ObjCpp()) ) { alt53=1; pushFollow(FOLLOW_mutableTypeRef_in_functionDeclarationSuffix3107); t1=mutableTypeRef(); match(input,COMMA,FOLLOW_COMMA_in_functionDeclarationSuffix3135); if (state.failed) return retval; pushFollow(FOLLOW_mutableTypeRef_in_functionDeclarationSuffix3151); tx=mutableTypeRef();
if ( state.backtracking>0 && alreadyParsedRule(input, 54) ) { return expr; } match(input,LBRACE,FOLLOW_LBRACE_in_expressionsBlock6588); if (state.failed) return expr; pushFollow(FOLLOW_expression_in_expressionsBlock6606); e1=expression(); match(input,COMMA,FOLLOW_COMMA_in_expressionsBlock6626); if (state.failed) return expr; pushFollow(FOLLOW_expression_in_expressionsBlock6638); ex=expression(); match(input,RBRACE,FOLLOW_RBRACE_in_expressionsBlock6662); if (state.failed) return expr; reportError(re); recover(input,re); if ( state.backtracking>0 ) { memoize(input, 54, expressionsBlock_StartIndex); }
if ( state.backtracking>0 && alreadyParsedRule(input, 40) ) { return decl; } if ( (LA97_0==IDENTIFIER) && (( parseModifier(next()) == null ))) { alt97=1; if ( !(( parseModifier(next()) == null )) ) { if (state.backtracking>0) {state.failed=true; return decl;} throw new FailedPredicateException(input, "directDeclarator", " parseModifier(next()) == null "); IDENTIFIER29=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_directDeclarator5323); if (state.failed) return decl; decl = mark(new DirectDeclarator((IDENTIFIER29!=null?IDENTIFIER29.getText():null)), getLine(IDENTIFIER29)); match(input,LPAREN,FOLLOW_LPAREN_in_directDeclarator5336); if (state.failed) return decl; pushFollow(FOLLOW_declarator_in_directDeclarator5340); inner=declarator(); match(input,RPAREN,FOLLOW_RPAREN_in_directDeclarator5342); if (state.failed) return decl; match(input,78,FOLLOW_78_in_directDeclarator5365); if (state.failed) return decl; pushFollow(FOLLOW_expression_in_directDeclarator5396); expression30=expression(); match(input,79,FOLLOW_79_in_directDeclarator5459); if (state.failed) return decl; pushFollow(FOLLOW_argList_in_directDeclarator5470); argList31=argList();
if ( state.backtracking>0 && alreadyParsedRule(input, 73) ) { return expr; } if ( (synpred253_ObjCpp()) ) { alt138=1; if ( (synpred253_ObjCpp()) ) { alt138=1; if ( (synpred253_ObjCpp()) ) { alt138=1; if ( (synpred253_ObjCpp()) ) { alt138=1; if ( (synpred253_ObjCpp()) ) { alt138=1; match(input,LPAREN,FOLLOW_LPAREN_in_castExpr7730); if (state.failed) return expr; pushFollow(FOLLOW_mutableTypeRef_in_castExpr7734); tr=mutableTypeRef(); match(input,RPAREN,FOLLOW_RPAREN_in_castExpr7736); if (state.failed) return expr; if ( (synpred251_ObjCpp()) ) { alt137=1; if ( (synpred251_ObjCpp()) ) { alt137=1;
if ( state.backtracking>0 && alreadyParsedRule(input, 26) ) { return retval; } pushFollow(FOLLOW_mutableTypeRef_in_argDef3963); tr=mutableTypeRef(); retval.arg = new Arg(); retval.arg.setValueType(tr); int i = getTokenStream().index() + 1; retval.arg.setCommentBefore(getCommentBefore(i)); retval.arg.setCommentAfter(getCommentAfterOnSameLine(i, ")")); pushFollow(FOLLOW_declarator_in_argDef3985); declarator21=declarator(); if ( (synpred121_ObjCpp()) ) { alt73=1; if ( (synpred121_ObjCpp()) ) { alt73=1; if ( (synpred121_ObjCpp()) ) { alt73=1; if ( (synpred121_ObjCpp()) ) { alt73=1; if ( (synpred121_ObjCpp()) ) { alt73=1;
if ( state.backtracking>0 && alreadyParsedRule(input, 88) ) { return arg; } pushFollow(FOLLOW_javaType_in_javaArg9410); t=javaType(); n=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_javaArg9414); if (state.failed) return arg; reportError(re); recover(input,re); if ( state.backtracking>0 ) { memoize(input, 88, javaArg_StartIndex); }