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