static int nextTokenType(CeylonParseController cpc, CommonToken token) {
   for (int i = token.getTokenIndex() + 1; i < cpc.getTokens().size(); i++) {
     CommonToken tok = cpc.getTokens().get(i);
     if (tok.getChannel() != CommonToken.HIDDEN_CHANNEL) {
       return tok.getType();
     }
   }
   return -1;
 }
Пример #2
0
 private CommonToken getStartOfStringToken(CommonToken token) {
   if (token == null) {
     return null;
   }
   int type = token.getType();
   if (type == STRING_MID || type == STRING_END) {
     while (type != STRING_START) {
       int index = token.getTokenIndex();
       if (index == 0) {
         return null;
       }
       token = tokens.get(index - 1);
       type = token.getType();
     }
   }
   return token;
 }