Пример #1
0
 static {
   Precedence[] values = Precedence.values();
   for (Precedence precedence : values) {
     int ordinal = precedence.ordinal();
     precedence.higher = ordinal > 0 ? values[ordinal - 1] : null;
   }
 }
Пример #2
0
 static {
   Set<IElementType> operations = new HashSet<IElementType>();
   Precedence[] values = Precedence.values();
   for (Precedence precedence : values) {
     operations.addAll(Arrays.asList(precedence.getOperations().getTypes()));
   }
   ALL_OPERATIONS = TokenSet.create(operations.toArray(new IElementType[operations.size()]));
 }