throws RecognitionException to handle in parser's catch block
321989
public Token recoverInline(Parser recognizer) throws RecognitionException {
        throw new RecognitionException(recognizer, recognizer.getInputStream(), recognizer.getContext());
    }
1115670
@Override
    public void handleText(
            final char[] buffer, final int offset, final int len,
            final int line, final int col)
            throws ParseException {

        this.someSelectorsMatch = false;
        for (int i = 0; i < this.selectorsLen; i++) {

            this.selectorMatches[i] =
                    this.selectorFilters[i].matchText(false, this.markupLevel, this.markupBlocks[this.markupLevel]);
            if (this.selectorMatches[i]) {
                this.someSelectorsMatch = true;
            }

        }

        if (this.someSelectorsMatch) {
            markCurrentSelection();
            this.selectedHandler.handleText(buffer, offset, len, line, col);
            unmarkCurrentSelection();
            return;
        }

        unmarkCurrentSelection();
        this.nonSelectedHandler.handleText(buffer, offset, len, line, col);

    }
1352206
public final void typeParameters() throws RecognitionException {
		int typeParameters_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 8) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:306:5: ( '<' typeParameter ( ',' typeParameter )* '>' )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:306:7: '<' typeParameter ( ',' typeParameter )* '>'
			{
			match(input,53,FOLLOW_53_in_typeParameters335); if (state.failed) return;
			pushFollow(FOLLOW_typeParameter_in_typeParameters337);
			typeParameter();
			state._fsp--;
			if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:306:25: ( ',' typeParameter )*
			loop15:
			while (true) {
				int alt15=2;
				int LA15_0 = input.LA(1);
				if ( (LA15_0==43) ) {
					alt15=1;
				}

				switch (alt15) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:306:26: ',' typeParameter
					{
					match(input,43,FOLLOW_43_in_typeParameters340); if (state.failed) return;
					pushFollow(FOLLOW_typeParameter_in_typeParameters342);
					typeParameter();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop15;
				}
			}

			match(input,56,FOLLOW_56_in_typeParameters346); if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 8, typeParameters_StartIndex); }

		}
	}
928134
public final void mID() throws RecognitionException {
        try {
            int _type = ID;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:114:3: ( ( 'I' | 'i' ) ( 'D' | 'd' ) )
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:114:5: ( 'I' | 'i' ) ( 'D' | 'd' )
            {
            if ( input.LA(1)=='I'||input.LA(1)=='i' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            if ( input.LA(1)=='D'||input.LA(1)=='d' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
48504
@Override
	public void unparseableExpression(Exception parseException, String exprName) {
		reporter.error(prefix(exprName), "Could not parse regular expression: ", parseException.getMessage());
	}
352632
public final void mNOT() throws RecognitionException {
        try {
            int _type = NOT;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:112:4: ( ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' ) )
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:112:6: ( 'N' | 'n' ) ( 'O' | 'o' ) ( 'T' | 't' )
            {
            if ( input.LA(1)=='N'||input.LA(1)=='n' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            if ( input.LA(1)=='O'||input.LA(1)=='o' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
948541
@Override
    protected void parseDataDefinition(StreamTokenizer streamTokenizer) throws FSMParseException, IOException {
        if (acceptIndex == -1 && acceptValue == -1) {

            // check we will read an identifier.
            if (streamTokenizer.nextToken() != StreamTokenizer.TT_WORD) {
                throw new FSMParseException(EXPECT_IDENTIFIER, streamTokenizer);
            }

            final String dataVariableName = streamTokenizer.sval;

            if (dataVariableName.equals(acceptingDataVariableName)) {
                acceptIndex = getPartLineNumber();

                // skip a (
                if (streamTokenizer.nextToken() != '(') {
                    throw new FSMParseException(String.format(EXPECT_CHAR, '('), streamTokenizer);
                }

                // skip a number
                if (streamTokenizer.nextToken() != StreamTokenizer.TT_WORD) {
                    throw new FSMParseException(EXPECT_NUMBER, streamTokenizer);
                }

                // skip a )
                if (streamTokenizer.nextToken() != ')') {
                    throw new FSMParseException(String.format(EXPECT_CHAR, ')'), streamTokenizer);
                }

                // skip an identifier
                if (streamTokenizer.nextToken() != StreamTokenizer.TT_WORD) {
                    throw new FSMParseException(EXPECT_IDENTIFIER, streamTokenizer);
                }

                int dataValueIndex = 0;

                // find the string containing the acceptance information
                while (streamTokenizer.nextToken() == '"' && acceptValue == -1) {
                    final String dataValue = streamTokenizer.sval;
                    if (dataValue.equals(acceptingDataValue)) {
                        acceptValue = dataValueIndex;
                    } else {
                        dataValueIndex++;
                    }
                }
                // push back the EOL, or EOF we accidentally read
                streamTokenizer.pushBack();

                // throw an Exception when the string containing acceptance information is not found in the current line
                if (acceptValue == -1) {
                    throw new FSMParseException(String.format(ACCEPT_VALUE_NOT_FOUND, acceptingDataValue),
                                                streamTokenizer);
                }
            }
        }
    }
199466
private void parseCp() throws Exception {
        if (tryRead('(')) {
            dataBufferAppend('(');
            parseElements(readBuffer);
        } else {
            dataBufferAppend(readNmtoken(true));
            char c = readCh();
            switch (c) {
                case '?':
                case '*':
                case '+':
                    dataBufferAppend(c);
                    break;
                default:
                    unread(c);
                    break;
            }
        }
    }
1157156
public final void mTEXT() throws RecognitionException {
        try {
            int _type = TEXT;
            int _channel = DEFAULT_TOKEN_CHANNEL;
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:116:5: ( ( 'T' | 't' ) ( 'E' | 'e' ) ( 'X' | 'x' ) ( 'T' | 't' ) )
            // C:\\Project\\Obdalib\\obdalib-parent\\obdalib-core\\src\\main\\java\\it\\unibz\\inf\\obda\\gui\\swing\\utils\\MappingFilter.g:116:7: ( 'T' | 't' ) ( 'E' | 'e' ) ( 'X' | 'x' ) ( 'T' | 't' )
            {
            if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            if ( input.LA(1)=='E'||input.LA(1)=='e' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            if ( input.LA(1)=='X'||input.LA(1)=='x' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            if ( input.LA(1)=='T'||input.LA(1)=='t' ) {
                input.consume();
            }
            else {
                MismatchedSetException mse = new MismatchedSetException(null,input);
                recover(mse);
                throw mse;
            }


            }

            state.type = _type;
            state.channel = _channel;
        }
        finally {
        	// do for sure before leaving
        }
    }
60575
@Override
    public void parse(InputSource is, HandlerBase hb)
        throws SAXException, IOException
    {
        if (hb != null) {
            /* Ok: let's ONLY set if there are no explicit sets... not
             * extremely clear, but JDK tries to set them always so
             * let's at least do damage control.
             */
            if (mContentHandler == null) {
                setDocumentHandler(hb);
            }
            if (mEntityResolver == null) {
                setEntityResolver(hb);
            }
            if (mErrorHandler == null) {
                setErrorHandler(hb);
            }
            if (mDTDHandler == null) {
                setDTDHandler(hb);
            }
        }
        parse(is);
    }
290988
public final void mUnderscores() throws RecognitionException {
		try {
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1335:12: ( ( '_' )+ )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1335:14: ( '_' )+
			{
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1335:14: ( '_' )+
			int cnt19=0;
			loop19:
			while (true) {
				int alt19=2;
				int LA19_0 = input.LA(1);
				if ( (LA19_0=='_') ) {
					alt19=1;
				}

				switch (alt19) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1335:14: '_'
					{
					match('_'); 
					}
					break;

				default :
					if ( cnt19 >= 1 ) break loop19;
					EarlyExitException eee = new EarlyExitException(19, input);
					throw eee;
				}
				cnt19++;
			}

			}

		}
		finally {
			// do for sure before leaving
		}
	}
963173
public final void updateStatement() throws RecognitionException {
		int updateStatement_StartIndex = input.index();

		Token s=null;
		Token c=null;
		ParserRuleReturnScope expression8 =null;

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 90) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:939:5: (s= 'update' '(' expression c= ')' )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:939:7: s= 'update' '(' expression c= ')'
			{
			s=(Token)match(input,117,FOLLOW_117_in_updateStatement4046); if (state.failed) return;
			match(input,36,FOLLOW_36_in_updateStatement4048); if (state.failed) return;
			pushFollow(FOLLOW_expression_in_updateStatement4054);
			expression8=expression();
			state._fsp--;
			if (state.failed) return;
			c=(Token)match(input,37,FOLLOW_37_in_updateStatement4064); if (state.failed) return;
			if ( state.backtracking==0 ) {
			        JavaStatementBlockDescr d = new JavaStatementBlockDescr( (expression8!=null?input.toString(expression8.start,expression8.stop):null), JavaBlockDescr.BlockType.UPDATE );
			        d.setStart( ((CommonToken)s).getStartIndex() );
			        this.addBlockDescr( d );
			        d.setEnd( ((CommonToken)c).getStopIndex() ); 
			        }
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 90, updateStatement_StartIndex); }

		}
	}
662607
@Override
    public void handleText(
            final char[] buffer, final int offset, final int len,
            final int line, final int col)
            throws ParseException {

        if (!this.insideAllSelectorMatchingBlock) {

            this.someSelectorsMatch = false;
            for (int i = 0; i < this.selectorsLen; i++) {

                if (this.matchingMarkupLevelsPerSelector[i] > this.markupLevel) {
                    this.selectorMatches[i] =
                            this.selectorFilters[i].matchText(true, this.markupLevel, this.markupBlocks[this.markupLevel]);
                    if (this.selectorMatches[i]) {
                        this.someSelectorsMatch = true;
                    }
                } else {
                    this.selectorMatches[i] = true;
                    this.someSelectorsMatch = true;
                }

            }

            if (this.someSelectorsMatch) {
                markCurrentSelection();
                this.selectedHandler.handleText(buffer, offset, len, line, col);
                unmarkCurrentSelection();
                return;
            }

            unmarkCurrentSelection();
            this.nonSelectedHandler.handleText(buffer, offset, len, line, col);
            return;

        }

        markCurrentSelection();
        this.selectedHandler.handleText(buffer, offset, len, line, col);
        unmarkCurrentSelection();

    }
229101
public final void selector() throws RecognitionException {
		int selector_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 138) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:5: ( '.' methodName ( arguments )? | '.' 'this' | '.' 'super' superSuffix | '.' 'new' ( nonWildcardTypeArguments )? innerCreator | '[' expression ']' )
			int alt189=5;
			int LA189_0 = input.LA(1);
			if ( (LA189_0==47) ) {
				switch ( input.LA(2) ) {
				case 111:
					{
					alt189=2;
					}
					break;
				case 108:
					{
					alt189=3;
					}
					break;
				case 97:
					{
					alt189=4;
					}
					break;
				case Identifier:
				case 75:
				case 90:
				case 95:
				case 103:
				case 117:
					{
					alt189=1;
					}
					break;
				default:
					if (state.backtracking>0) {state.failed=true; return;}
					int nvaeMark = input.mark();
					try {
						input.consume();
						NoViableAltException nvae =
							new NoViableAltException("", 189, 1, input);
						throw nvae;
					} finally {
						input.rewind(nvaeMark);
					}
				}
			}
			else if ( (LA189_0==59) ) {
				alt189=5;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 189, 0, input);
				throw nvae;
			}

			switch (alt189) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:7: '.' methodName ( arguments )?
					{
					match(input,47,FOLLOW_47_in_selector6270); if (state.failed) return;
					pushFollow(FOLLOW_methodName_in_selector6272);
					methodName();
					state._fsp--;
					if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:22: ( arguments )?
					int alt187=2;
					int LA187_0 = input.LA(1);
					if ( (LA187_0==36) ) {
						alt187=1;
					}
					switch (alt187) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1284:23: arguments
							{
							pushFollow(FOLLOW_arguments_in_selector6275);
							arguments();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1285:9: '.' 'this'
					{
					match(input,47,FOLLOW_47_in_selector6287); if (state.failed) return;
					match(input,111,FOLLOW_111_in_selector6289); if (state.failed) return;
					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1286:9: '.' 'super' superSuffix
					{
					match(input,47,FOLLOW_47_in_selector6299); if (state.failed) return;
					match(input,108,FOLLOW_108_in_selector6301); if (state.failed) return;
					pushFollow(FOLLOW_superSuffix_in_selector6303);
					superSuffix();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1287:9: '.' 'new' ( nonWildcardTypeArguments )? innerCreator
					{
					match(input,47,FOLLOW_47_in_selector6313); if (state.failed) return;
					match(input,97,FOLLOW_97_in_selector6315); if (state.failed) return;
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1287:19: ( nonWildcardTypeArguments )?
					int alt188=2;
					int LA188_0 = input.LA(1);
					if ( (LA188_0==53) ) {
						alt188=1;
					}
					switch (alt188) {
						case 1 :
							// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1287:20: nonWildcardTypeArguments
							{
							pushFollow(FOLLOW_nonWildcardTypeArguments_in_selector6318);
							nonWildcardTypeArguments();
							state._fsp--;
							if (state.failed) return;
							}
							break;

					}

					pushFollow(FOLLOW_innerCreator_in_selector6322);
					innerCreator();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 5 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1288:9: '[' expression ']'
					{
					match(input,59,FOLLOW_59_in_selector6332); if (state.failed) return;
					pushFollow(FOLLOW_expression_in_selector6334);
					expression();
					state._fsp--;
					if (state.failed) return;
					match(input,60,FOLLOW_60_in_selector6336); if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 138, selector_StartIndex); }

		}
	}
86579
@SuppressWarnings("unchecked")
  <T> T parse(Class<T> clazz) throws JsonParserException {
    advanceToken();
    Object parsed = currentValue();
    if (advanceToken() != Token.EOF)
      throw createParseException(null, "Expected end of input, got " + token, true);
    if (clazz != Object.class && (parsed == null || clazz != parsed.getClass()))
      throw createParseException(null, "JSON did not contain the correct type, expected " + clazz.getName()
          + ".", true);
    return (T)(parsed);
  }
490315
public void parse(CharSequence in, Appendable out) throws IOException, HttpErrorPage {
        ParserContextImpl ctx = new ParserContextImpl(out, httpRequest, httpResponse);
        Matcher matcher = pattern.matcher(in);
        int currentPosition = 0;
        while (matcher.find()) {
            String tag = matcher.group();
            ctx.characters(in, currentPosition, matcher.start());
            currentPosition = matcher.end();
            if (ctx.isCurrentTagEnd(tag)) {
                // check if this is the end tag for current element
                LOG.info("Processing end tag {}", tag);
                ctx.endElement(tag);
            } else {
                // if not, it is an opening tag for a new element
                LOG.info("Processing start tag {}", tag);
                ElementType type = null;
                for (ElementType t : elementTypes) {
                    if (t.isStartTag(tag)) {
                        type = t;
                        break;
                    }
                }
                Element element = type.newInstance();
                ctx.startElement(type, element, tag);
                if (type.isSelfClosing(tag)) {
                    ctx.endElement(tag);
                }

            }
        }
        // we reached the end of input
        ctx.characters(in, currentPosition, in.length());
    }
201857
private void parse( FormattableContainer currentRule ) {
        try {
            for( ;; ) {
                int ch = reader.nextBlockMarker();
                switch( ch ) {
                    case -1:
                        return; // end of input reached
                    case ';':
                        parseSemicolon( currentRule );
                        break;
                    case '{':
                        parseBlock( currentRule );
                        break;
                    default:
                        throw createException( "Unrecognized input: '" + reader.getLookAhead() + "'" );
                }
            }
        } catch( LessException ex ) {
            ex.addPosition( reader.getFileName(), reader.getLine(), reader.getColumn() );
            throw ex;
        } catch( RuntimeException ex ) {
            LessException lessEx = new LessException( ex );
            lessEx.addPosition( reader.getFileName(), reader.getLine(), reader.getColumn() );
            throw lessEx;
        }
    }