Refine search
public final XPathEnhancerParser.absoluteLocationPathNoroot_return absoluteLocationPathNoroot() throws RecognitionException { XPathEnhancerParser.absoluteLocationPathNoroot_return retval = new XPathEnhancerParser.absoluteLocationPathNoroot_return(); retval.start = input.LT(1); new STAttrMap().put("sharesPrefix", sharesPrefix(input.toString(retval.start,input.LT(-1))) ).put("commonPrefix", prefix ).put("index", index ).put("remainingSuffix", remainingSuffix(input.toString(retval.start,input.LT(-1))) ).put("originalPath", input.toString(retval.start,input.LT(-1)) )); ((Token)retval.start).getTokenIndex(), input.LT(-1).getTokenIndex(), retval.st);
protected void appendTrailingHiddenTokens() { Token tokenBefore = input.LT(-1); int size = input.size(); if (tokenBefore != null && tokenBefore.getTokenIndex() < size) { for (int x = tokenBefore.getTokenIndex() + 1; x < size; x++) { Token hidden = input.get(x); createLeafNode(hidden, null); lastConsumedIndex = hidden.getTokenIndex(); } } }
@Override public String getText() { String badText = null; if (start != null) { int i = start.getTokenIndex(); int j = stop.getTokenIndex(); if (stop.getType() == Token.EOF) { j = input.size(); } badText = ((TokenStream)input).toString(i, j); } else { // people should subclass if they alter the tree type so this // next one is for sure correct. badText = "<unknown>"; } return badText; }
/** * Matches a conditional expression * * @return * @throws RecognitionException */ public String conditionalExpression() throws RecognitionException { int first = input.index(); exprParser.conditionalExpression(); if ( state.failed ) return null; if ( state.backtracking == 0 && input.index() > first ) { // expression consumed something String expr = input.toString( first, input.LT( -1 ).getTokenIndex() ); return expr; } return null; }
int first = input.index(); exprParser.getHelper().setHasOperator( false ); // resetting try{ if( location == Location.LOCATION_LHS_INSIDE_CONDITION_END ) { helper.emit( Location.LOCATION_LHS_INSIDE_CONDITION_ARGUMENT ); } else if ( input.get(input.index()).getType() != DRLLexer.EOF ) { helper.emit( Location.LOCATION_LHS_INSIDE_CONDITION_START ); if ( state.backtracking == 0 && input.index() > first ) { int last = input.LT( -1 ).getTokenIndex(); String expr = toExpression(prefix, first, last); pattern.constraint( expr,
String typeArguments = ""; try { int first = input.index(); Token token = match( input, DRLLexer.LESS, DroolsEditorType.SYMBOL ); if ( state.failed ) return typeArguments; typeArguments = input.toString( first, token.getTokenIndex() );
int idx = input.index(); final String expr; try{ final Token tempToken = helper.getLastTokenOnList(helper.getEditorInterface().getLast().getContent()); if (tempToken != null){ for (int i = tempToken.getTokenIndex() + 1; i < input.size(); i++) { final Token token = input.get(i); if (token.getType() == DRLLexer.EOF){
/** * Matches a conditional || expression * * @return * @throws RecognitionException */ public String conditionalOrExpression() throws RecognitionException { int first = input.index(); exprParser.conditionalOrExpression(); if ( state.failed ) return null; if ( state.backtracking == 0 && input.index() > first ) { // expression consumed something String expr = input.toString( first, input.LT( -1 ).getTokenIndex() ); return expr; } return null; }
protected List<ILeafNode> appendSkippedTokens() { List<ILeafNode> skipped = new ArrayList<ILeafNode>(); Token currentToken = input.LT(-1); int currentTokenIndex = (currentToken == null) ? -1 : currentToken.getTokenIndex(); Token tokenBefore = (lastConsumedIndex == -1) ? null : input.get(lastConsumedIndex); int indexOfTokenBefore = tokenBefore != null ? tokenBefore.getTokenIndex() : -1; if (indexOfTokenBefore + 1 < currentTokenIndex) { for (int x = indexOfTokenBefore + 1; x < currentTokenIndex; x++) { Token hidden = input.get(x); ILeafNode leaf = createLeafNode(hidden, null); skipped.add(leaf); lastConsumedIndex = x; } } if (lastConsumedIndex < currentTokenIndex && currentToken != null) { ILeafNode leaf = createLeafNode(currentToken, null); skipped.add(leaf); lastConsumedIndex = currentToken.getTokenIndex(); } return skipped; }
int objCMethodDecl_StartIndex = input.index(); function.addModifiers(ModifierType.Static); function = mark(function, getLine(tp)); function.setCommentBefore(getCommentBefore(tp.getTokenIndex())); function.setCommentBefore(getCommentBefore(tm.getTokenIndex())); methodName=(Token)input.LT(1); function.setCommentAfter(getCommentAfterOnSameLine(methodName.getTokenIndex(), null));
private String getConsequenceCode( int first ) { while ( input.LA( 1 ) != DRLLexer.EOF && !helper.validateIdentifierKey( DroolsSoftKeywords.END ) && !helper.validateIdentifierKey( DroolsSoftKeywords.THEN ) ) { helper.emit( input.LT(1), DroolsEditorType.CODE_CHUNK ); input.consume(); } int last = input.LT(1).getTokenIndex(); if ( last <= first ) { return ""; } String chunk = input.toString( first, last ); if ( chunk.endsWith( DroolsSoftKeywords.END ) ) { chunk = chunk.substring( 0, chunk.length() - DroolsSoftKeywords.END.length() ); } else if ( chunk.endsWith( DroolsSoftKeywords.THEN ) ) { chunk = chunk.substring( 0, chunk.length() - DroolsSoftKeywords.THEN.length() ); } return chunk; }
@Override public String getText() { String badText = null; if (start != null) { int i = start.getTokenIndex(); int j = stop.getTokenIndex(); if (stop.getType() == Token.EOF) { j = input.size(); } badText = ((TokenStream)input).toString(i, j); } else { // people should subclass if they alter the tree type so this // next one is for sure correct. badText = "<unknown>"; } return badText; }
int start = input.index(); match( input, DRLLexer.ID, if ( state.failed ) return; int end = input.LT( -1 ).getTokenIndex(); input.toString( start, end ) );
Token currentToken = input.LT(-1); if(input.get(input.LT(-1).getTokenIndex()-1).getType() == MATCHWS )
retval.start = input.LT(1); int declaration_StartIndex = input.index(); retval.startTokenIndex = getTokenStream().index(); retval.preComment = getCommentBefore(retval.startTokenIndex); retval.stop = input.LT(-1); if (retval.declaration == null) try { int i = ((Token)retval.start).getTokenIndex(); if (i > 0) { String s1 = getTokenStream().get(i - 1).getText(), s2 = i > 1 ? getTokenStream().get(i - 2).getText() : null;
public final XPathEnhancerParser.absoluteLocationPathNoroot_return absoluteLocationPathNoroot() throws RecognitionException { XPathEnhancerParser.absoluteLocationPathNoroot_return retval = new XPathEnhancerParser.absoluteLocationPathNoroot_return(); retval.start = input.LT(1); new STAttrMap().put("sharesPrefix", sharesPrefix(input.toString(retval.start,input.LT(-1))) ).put("commonPrefix", prefix ).put("index", index ).put("remainingSuffix", remainingSuffix(input.toString(retval.start,input.LT(-1))) ).put("originalPath", input.toString(retval.start,input.LT(-1)) )); ((Token)retval.start).getTokenIndex(), input.LT(-1).getTokenIndex(), retval.st);
@Override public String getText() { String badText; if ( start instanceof Token ) { int i = start.getTokenIndex(); int j = stop.getTokenIndex(); if ( stop.getType() == Token.EOF ) { j = ((TokenStream)input).size(); } badText = ((TokenStream)input).toString(i, j); } else if ( start instanceof Tree ) { badText = ((TreeNodeStream)input).toString(start, stop); } else { // people should subclass if they alter the tree type so this // next one is for sure correct. badText = "<unknown>"; } return badText; }
String type = ""; try { int first = input.index(), last = first; match( input, DRLLexer.ID, if ( state.failed ) return type; last = input.LT( -1 ).getTokenIndex(); type = input.toString( first, last ); type = type.replace( " ",
Token templateToken = input.LT(1); String msg = "missing template at '"+input.LT(1).getText()+"'"; NoViableAltException e = new NoViableAltException("", 0, 0, input); group.errMgr.groupSyntaxError(ErrorType.SYNTAX_ERROR, getSourceName(), e, msg); if ( (name!=null?name.getTokenIndex():0) >= 0 ) { // if ID missing template = Misc.strip(template, n); String templateName = (name!=null?name.getText():null);
public String getText() { String badText = null; if ( start instanceof Token ) { int i = ((Token)start).getTokenIndex(); int j = ((Token)stop).getTokenIndex(); if ( ((Token)stop).getType() == Token.EOF ) { j = ((TokenStream)input).size(); } badText = ((TokenStream)input).toString(i, j); } else if ( start instanceof Tree ) { badText = ((TreeNodeStream)input).toString(start, stop); } else { // people should subclass if they alter the tree type so this // next one is for sure correct. badText = "<unknown>"; } return badText; }