2002/css-validator/org/w3c/css/parser/analyzer CssParser.java,1.29,1.30 CssParser.jj,1.26,1.27 CssParserConstants.java,1.8,1.9 CssParserTokenManager.java,1.18,1.19

Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv29098

Modified Files:
	CssParser.java CssParser.jj CssParserConstants.java 
	CssParserTokenManager.java 
Log Message:
grammar fixed according to CSS2.1 rules (most fixes were also in CSS2 grammar, F
WIW) it should update bugs:

http://www.w3.org/Bugs/Public/show_bug.cgi?id=4870
http://www.w3.org/Bugs/Public/show_bug.cgi?id=3632
http://www.w3.org/Bugs/Public/show_bug.cgi?id=3313



Index: CssParserTokenManager.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParserTokenManager.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- CssParserTokenManager.java	11 Mar 2008 10:16:14 -0000	1.18
+++ CssParserTokenManager.java	12 Mar 2008 16:24:00 -0000	1.19
@@ -62,155 +62,194 @@
    switch (pos)
    {
       case 0:
-         if ((active0 & 0x20040L) != 0L)
-            return 89;
-         if ((active0 & 0xfe00000000000000L) != 0L || (active1 & 0x3fL) != 0L)
-            return 55;
-         if ((active0 & 0x2000000L) != 0L)
-            return 218;
+         if ((active0 & 0x80002000000L) != 0L)
+            return 127;
[...6335 lines suppressed...]
 {
    int i;
    jjround = 0x80000001;
-   for (i = 388; i-- > 0;)
+   for (i = 443; i-- > 0;)
       jjrounds[i] = 0x80000000;
 }
 public void ReInit(SimpleCharStream stream, int lexState)
@@ -3975,9 +4525,9 @@
          jjmatchedKind = 0x7fffffff;
          jjmatchedPos = 0;
          curPos = jjMoveStringLiteralDfa0_1();
-         if (jjmatchedPos == 0 && jjmatchedKind > 4)
+         if (jjmatchedPos == 0 && jjmatchedKind > 3)
          {
-            jjmatchedKind = 4;
+            jjmatchedKind = 3;
          }
          break;
      }

Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- CssParser.java	11 Mar 2008 10:21:01 -0000	1.29
+++ CssParser.java	12 Mar 2008 16:24:00 -0000	1.30
@@ -180,7 +180,7 @@
      */
     public abstract void handleAtRule(String ident, String string);
 
-        /* added by Sijtsche Smeman */
+    /* added by Sijtsche Smeman */
     public abstract void addCharSet(String charset);
     public abstract void newAtRule(AtRule atRule);
     public abstract void endOfAtRule();
@@ -222,7 +222,7 @@
     public abstract void handleRule(CssSelectors selector,
                                     Vector declarations);
[...6729 lines suppressed...]
-    jj_rescan = false;
-  }
-
-  final private void jj_save(int index, int xla) {
-    JJCalls p = jj_2_rtns[index];
-    while (p.gen > jj_gen) {
-      if (p.next == null) { p = p.next = new JJCalls(); break; }
-      p = p.next;
-    }
-    p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
-  }
-
-  static final class JJCalls {
-    int gen;
-    Token first;
-    int arg;
-    JJCalls next;
-  }
-
 }

Index: CssParserConstants.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParserConstants.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- CssParserConstants.java	26 Apr 2006 12:44:15 -0000	1.8
+++ CssParserConstants.java	12 Mar 2008 16:24:00 -0000	1.9
@@ -4,111 +4,147 @@
 public interface CssParserConstants {
 
   int EOF = 0;
-  int S = 1;
-  int CDO = 5;
-  int CDC = 6;
-  int LBRACE = 7;
-  int RBRACE = 8;
-  int DASHMATCH = 9;
-  int INCLUDES = 10;
-  int PREFIXMATCH = 11;
-  int SUFFIXMATCH = 12;
-  int SUBSTRINGMATCH = 13;
-  int TILDE = 14;
-  int EQ = 15;
-  int PLUS = 16;
-  int MINUS = 17;
-  int COMMA = 18;
-  int SEMICOLON = 19;
-  int PRECEDES = 20;
-  int DIV = 21;
-  int LBRACKET = 22;
-  int RBRACKET = 23;
-  int ANY = 24;
-  int DOT = 25;
-  int LPARAN = 26;
-  int RPARAN = 27;
-  int COLON = 28;
-  int AND = 29;
-  int MEDIARESTRICTOR = 30;
-  int NONASCII = 31;
-  int H = 32;
-  int UNICODE = 33;
-  int ESCAPE = 34;
-  int NMSTART = 35;
-  int NMCHAR = 36;
-  int STRINGCHAR = 37;
-  int D = 38;
-  int NAME = 39;
-  int STRING = 40;
-  int IDENT = 41;
-  int NUMBER = 42;
-  int _URL = 43;
-  int URL = 44;
-  int PERCENTAGE = 45;
-  int LENGTH = 46;
-  int EMS = 47;
-  int EXS = 48;
-  int ANGLE = 49;
-  int TIME = 50;
-  int FREQ = 51;
-  int RESOLUTION = 52;
-  int DATE = 53;
-  int DIMEN = 54;
-  int HASH = 55;
-  int IMPORTANT_SYM = 56;
-  int IMPORT_SYM = 57;
-  int MEDIA_SYM = 58;
-  int PAGE_SYM = 59;
-  int FONT_FACE_SYM = 60;
-  int PREF_SYM = 61;
-  int COLOR_PROFILE = 62;
-  int CHARSET_SYM = 63;
-  int ATTOP = 64;
-  int ATRIGHT = 65;
-  int ATBOTTOM = 66;
-  int ATLEFT = 67;
-  int ATCOUNTER = 68;
-  int PHONETIC_ALPHABET_SYM = 69;
-  int ATKEYWORD = 70;
-  int RANGE0 = 71;
-  int RANGE1 = 72;
-  int RANGE2 = 73;
-  int RANGE3 = 74;
-  int RANGE4 = 75;
-  int RANGE5 = 76;
-  int RANGE6 = 77;
-  int RANGE = 78;
-  int UNI = 79;
-  int UNICODERANGE = 80;
-  int CLASS = 81;
-  int FUNCTION = 82;
+  int H = 4;
+  int NONASCII = 5;
+  int UNICODE = 6;
+  int ESCAPE = 7;
+  int NMSTART = 8;
+  int NMCHAR = 9;
+  int STRING1 = 10;
+  int STRING2 = 11;
+  int INVALID1 = 12;
+  int INVALID2 = 13;
+  int _IDENT = 14;
+  int NAME = 15;
+  int NUM = 16;
+  int _STRING = 17;
+  int _INVALID = 18;
+  int _URL = 19;
+  int _S = 20;
+  int _W = 21;
+  int NL = 22;
+  int S = 23;
+  int CDO = 24;
+  int CDC = 25;
+  int INCLUDES = 26;
+  int DASHMATCH = 27;
+  int LBRACE = 28;
+  int PLUS = 29;
+  int GREATER = 30;
+  int COMMA = 31;
+  int TILDE = 32;
+  int AND = 33;
+  int STRING = 34;
+  int INVALID = 35;
+  int IDENT = 36;
+  int HASH = 37;
+  int RBRACE = 38;
+  int PREFIXMATCH = 39;
+  int SUFFIXMATCH = 40;
+  int SUBSTRINGMATCH = 41;
+  int EQ = 42;
+  int MINUS = 43;
+  int SEMICOLON = 44;
+  int DIV = 45;
+  int LBRACKET = 46;
+  int RBRACKET = 47;
+  int ANY = 48;
+  int DOT = 49;
+  int LPARAN = 50;
+  int RPARAN = 51;
+  int COLON = 52;
+  int MEDIARESTRICTOR = 53;
+  int URL = 54;
+  int LENGTH = 55;
+  int EMS = 56;
+  int EXS = 57;
+  int ANGLE = 58;
+  int TIME = 59;
+  int FREQ = 60;
+  int RESOLUTION = 61;
+  int DATE = 62;
+  int DIMEN = 63;
+  int PERCENTAGE = 64;
+  int NUMBER = 65;
+  int IMPORTANT_SYM = 66;
+  int PSEUDOCLASS_SYM = 67;
+  int CHARSET_SYM = 68;
+  int IMPORT_SYM = 69;
+  int MEDIA_SYM = 70;
+  int PAGE_SYM = 71;
+  int FONT_FACE_SYM = 72;
+  int PREF_SYM = 73;
+  int COLOR_PROFILE = 74;
+  int ATTOP = 75;
+  int ATRIGHT = 76;
+  int ATBOTTOM = 77;
+  int ATLEFT = 78;
+  int ATCOUNTER = 79;
+  int PHONETIC_ALPHABET_SYM = 80;
+  int ATKEYWORD = 81;
+  int RANGE0 = 82;
+  int RANGE1 = 83;
+  int RANGE2 = 84;
+  int RANGE3 = 85;
+  int RANGE4 = 86;
+  int RANGE5 = 87;
+  int RANGE6 = 88;
+  int RANGE = 89;
+  int UNI = 90;
+  int UNICODERANGE = 91;
+  int CLASS = 92;
+  int FUNCTIONLANG = 93;
+  int FUNCTION = 94;
 
   int DEFAULT = 0;
   int IN_COMMENT = 1;
 
   String[] tokenImage = {
     "<EOF>",
-    "<S>",
     "\"/*\"",
     "\"*/\"",
-    "<token of kind 4>",
+    "<token of kind 3>",
+    "<H>",
+    "<NONASCII>",
+    "<UNICODE>",
+    "<ESCAPE>",
+    "<NMSTART>",
+    "<NMCHAR>",
+    "<STRING1>",
+    "<STRING2>",
+    "<INVALID1>",
+    "<INVALID2>",
+    "<_IDENT>",
+    "<NAME>",
+    "<NUM>",
+    "<_STRING>",
+    "<_INVALID>",
+    "<_URL>",
+    "<_S>",
+    "<_W>",
+    "<NL>",
+    "<S>",
     "\"<!--\"",
     "\"-->\"",
-    "\"{\"",
-    "\"}\"",
-    "\"|=\"",
     "\"~=\"",
+    "\"|=\"",
+    "<LBRACE>",
+    "<PLUS>",
+    "<GREATER>",
+    "<COMMA>",
+    "<TILDE>",
+    "\"and\"",
+    "<STRING>",
+    "<INVALID>",
+    "<IDENT>",
+    "<HASH>",
+    "\"}\"",
     "\"^=\"",
     "\"$=\"",
     "\"*=\"",
-    "\"~\"",
     "\"=\"",
-    "\"+\"",
     "\"-\"",
-    "\",\"",
     "\";\"",
-    "\">\"",
     "\"/\"",
     "\"[\"",
     "\"]\"",
@@ -117,23 +153,8 @@
     "\")\"",
     "\"(\"",
     "\":\"",
-    "<AND>",
     "<MEDIARESTRICTOR>",
-    "<NONASCII>",
-    "<H>",
-    "<UNICODE>",
-    "<ESCAPE>",
-    "<NMSTART>",
-    "<NMCHAR>",
-    "<STRINGCHAR>",
-    "<D>",
-    "<NAME>",
-    "<STRING>",
-    "<IDENT>",
-    "<NUMBER>",
-    "<_URL>",
     "<URL>",
-    "<PERCENTAGE>",
     "<LENGTH>",
     "<EMS>",
     "<EXS>",
@@ -143,15 +164,17 @@
     "<RESOLUTION>",
     "<DATE>",
     "<DIMEN>",
-    "<HASH>",
+    "<PERCENTAGE>",
+    "<NUMBER>",
     "<IMPORTANT_SYM>",
+    "\"::\"",
+    "\"@charset\"",
     "\"@import\"",
     "\"@media\"",
     "\"@page\"",
     "\"@font-face\"",
     "\"@preference\"",
     "\"@color-profile\"",
-    "\"@charset\"",
     "\"@top\"",
     "\"@right\"",
     "\"@bottom\"",
@@ -170,8 +193,8 @@
     "<UNI>",
     "<UNICODERANGE>",
     "<CLASS>",
+    "\"lang(\"",
     "<FUNCTION>",
-    "\"::\"",
   };
 
 }

Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- CssParser.jj	11 Mar 2008 10:21:01 -0000	1.26
+++ CssParser.jj	12 Mar 2008 16:24:00 -0000	1.27
@@ -10,8 +10,8 @@
 options {
     IGNORE_CASE  = true;
     STATIC = false;
-    /*DEBUG_TOKEN_MANAGER = true;
-	  DEBUG_PARSER = true; */
+    /*  DEBUG_TOKEN_MANAGER = true;
+	DEBUG_PARSER = true;  */
 	  
 }
 
@@ -198,7 +198,7 @@
[...1897 lines suppressed...]
 	getNextToken();
 	tok = getToken(1);
@@ -1904,6 +1934,8 @@
     StringBuffer s = new StringBuffer();
     Token tok;
     int nesting = 1;
+    /* FIXME
+       same as above */
     while (true) {
 	tok = getToken(1);
 	if (tok.kind == EOF) {
@@ -1943,7 +1975,7 @@
     Token t = getToken(1);
     StringBuffer s = new StringBuffer();
     s.append(getToken(0).image);
-    
+    // FIXME same as above (token consumption may throw an exception)
     while ((t.kind != RBRACE) && (t.kind != SEMICOLON) && (t.kind != EOF)) {
 	s.append(t.image);
 	getNextToken();

Received on Wednesday, 12 March 2008 16:24:11 UTC