View Javadoc
1   /*
2   com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck
3   format = (default)^[a-z][a-zA-Z0-9]*$
4   applyToPublic = (default)true
5   applyToProtected = (default)true
6   applyToPackage = (default)true
7   applyToPrivate = (default)true
8   
9   
10  */
11  
12  package com.puppycrawl.tools.checkstyle.grammar;
13  
14  /**
15   * Input for unicode escapes.
16   */
17  public class InputUnicodeEscape // ok
18  {
19      char a = '\u005cr';
20      char b = '\u005cn';
21      char c = '\u005ct';
22      char d = '\uuuu005cn';
23      char e = '\u005c\u005c';
24      char f = '\u005c'';
25      char g = '"';
26      String h = "\u005c"";
27      String i = "'";
28      char j = '\"';
29      String k = "\'";
30      char l = '\u005C'';
31      char m = '\uABCD';
32      char n = '\u00AB';
33      char o = '\u005B';
34      char p = '\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu005cr'; // Tests the lookahead
35      char q = '\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu005D';
36      char r = '\u005c\u0027';
37      char s = '\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu005c\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu0027';
38  
39      char wtf1 = '\u005c\u005c'; // This is a legal backslash
40      String wtf2 = "\\u005c";    // = "\u005c", with a single backslash, and != a backslash!
41                                  // There is ambiguity, the interpretation is done as "\\" + "u005c"
42      //char wtf3 = '\\u005c';    // This is therefore, illegal
43  
44      //char z = '\u005cu005c'; /* This is illegal */
45  
46      String sa = "\u0078\u006b\u0020\u005c\u0022\u003f\u0020\u19e8\u19f2\u19ec";
47      String sb = "ihcp gyqnaznr \u2d21\u2d07\u2d0a\u2d02\u2d23\u2d27";
48      String sc = "\u3009\u3007\u3017\u3032 ]*+f?)).[. xhc";
49      String sd = "\u1f073\u1f08a\u1f09d\u1f09a nfllv \u03ac\udd762\u029c";
50      String se = "\u0721\ue723\ue76eM \u2ffc\u2ff1 \u123e1 tzouw \ufadaZ";
51      String sf = "abc\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu005c\u0022def";
52  }