public void verifyBracketContentWhitespace(ParserRuleContext ctx,String construct){
  Token openingParenthesis=ParseTreeUtil.getStopTokenForNode(ctx.getChild(0));
  Token closingParenthesis=ParseTreeUtil.getStopTokenForNode(ctx.getChild(ctx.getChildCount() - 1));
  Location openingParenthesisLoc=ListenerUtil.getTokenLocation(openingParenthesis);
  if (ctx.getChildCount() == 2) {
    if (checkLeftSpaces(openingParenthesis,closingParenthesis,0)) {
      printer.error(rule,Messages.EMPTY + construct.toLowerCase() + Messages.ILLEGAL_WHITESPACE,new Location(openingParenthesisLoc.line,openingParenthesisLoc.column + 1));
    }
    return;
  }
  Token contentStart=ParseTreeUtil.getStartTokenForNode(ctx.getChild(1));
  Token contentEnd=ParseTreeUtil.getStopTokenForNode(ctx.getChild(ctx.getChildCount() - 2));
  if (checkLeftSpaces(openingParenthesis,contentStart,0)) {
    printer.error(rule,construct + Messages.CONTENT + Messages.LEADING_WHITESPACE,new Location(openingParenthesisLoc.line,openingParenthesisLoc.column + 1));
  }
  if (checkRightSpaces(closingParenthesis,contentEnd,0)) {
    Location contentStopLocation=ListenerUtil.getTokenEndLocation(contentEnd);
    printer.error(rule,construct + Messages.CONTENT + Messages.NOT_END_SPACE,contentStopLocation);
  }
}

public void verifyBracketContentWhitespace ( ParserRuleContext ctx , String construct ) { Token openingParenthesis = ParseTreeUtil . getStopTokenForNode ( ctx . getChild ( 0 ) ) ; Token closingParenthesis = ParseTreeUtil . getStopTokenForNode ( ctx . getChild ( ctx . getChildCount ( ) - 1 ) ) ; Location openingParenthesisLoc = ListenerUtil . getTokenLocation ( openingParenthesis ) ; if ( ctx . getChildCount ( ) == 2 ) { if ( checkLeftSpaces ( openingParenthesis , closingParenthesis , 0 ) ) { printer . error ( rule , Messages . EMPTY + construct . toLowerCase ( ) + Messages . ILLEGAL_WHITESPACE , new Location ( openingParenthesisLoc . line , openingParenthesisLoc . column + 1 ) ) ; } return ; } Token contentStart = ParseTreeUtil . getStartTokenForNode ( ctx . getChild ( 1 ) ) ; Token contentEnd = ParseTreeUtil . getStopTokenForNode ( ctx . getChild ( ctx . getChildCount ( ) - 2 ) ) ; if ( checkLeftSpaces ( openingParenthesis , contentStart , 0 ) ) { printer . error ( rule , construct + Messages . CONTENT + Messages . LEADING_WHITESPACE , new Location ( openingParenthesisLoc . line , openingParenthesisLoc . column + 1 ) ) ; } if ( checkRightSpaces ( closingParenthesis , contentEnd , 0 ) ) { Location contentStopLocation = ListenerUtil . getTokenEndLocation ( contentEnd ) ; printer . error ( rule , construct + Messages . CONTENT + Messages . NOT_END_SPACE , contentStopLocation ) ; } }
verifies if a bracket construct does not contain whitespace immediately after the opening bracket and immediately before the closing bracket .
