2002/css-validator/org/w3c/css/parser/analyzer CssParser.java,1.83,1.84 CssParser.jj,1.82,1.83 CssParserConstants.java,1.20,1.21 CssParserTokenManager.java,1.43,1.44

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

Modified Files:
	CssParser.java CssParser.jj CssParserConstants.java 
	CssParserTokenManager.java 
Log Message:
preparation of new css3 types support, parser already modified to accept them, some alignment of coding std for old properties

Index: CssParserTokenManager.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParserTokenManager.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- CssParserTokenManager.java	25 Apr 2012 20:21:52 -0000	1.43
+++ CssParserTokenManager.java	6 Sep 2012 12:37:53 -0000	1.44
@@ -777,7 +777,7 @@
    catch(java.io.IOException e) { throw new Error("Internal Error"); }
    curPos = 0;
    int startsAt = 0;
-   jjnewStateCnt = 716;
+   jjnewStateCnt = 750;
    int i = 1;
    jjstateSet[0] = startState;
    int kind = 0x7fffffff;
@@ -797,31 +797,31 @@
                   {
                      if (kind > 63)
[...5361 lines suppressed...]
@@ -6033,8 +6168,8 @@
    0x2L, 0x0L, 
 };
 protected SimpleCharStream input_stream;
-private final int[] jjrounds = new int[716];
-private final int[] jjstateSet = new int[1432];
+private final int[] jjrounds = new int[750];
+private final int[] jjstateSet = new int[1500];
 protected char curChar;
 /** Constructor. */
 public CssParserTokenManager(SimpleCharStream stream){
@@ -6061,7 +6196,7 @@
 {
    int i;
    jjround = 0x80000001;
-   for (i = 716; i-- > 0;)
+   for (i = 750; i-- > 0;)
       jjrounds[i] = 0x80000000;
 }
 

Index: CssParser.jj
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.jj,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- CssParser.jj	4 Aug 2012 21:17:03 -0000	1.82
+++ CssParser.jj	6 Sep 2012 12:37:53 -0000	1.83
@@ -524,22 +524,28 @@
   < URL         : "url(" ( <S> )* ( <STRING> | <_URL>  ) ( <S> )* ")" >
 }
 
+
 <DEFAULT>
 TOKEN [IGNORE_CASE] :
 {
-  < LENGTH     : <NUM> "pt" 
-               | <NUM> "mm"
-	           | <NUM> "cm" 
-	           | <NUM> "pc" 
-	           | <NUM> "in"
-	           | <NUM> "gd" 
-	           | <NUM> "px" >
-  | < EMS        : <NUM> "em" >
-  | < EXS        : <NUM> "ex" >
+  < RELFONTLENGTH  : <NUM> "em"
+                   | <NUM> "ex"
+                   | <NUM> "ch"
+                   | <NUM> "rem" >
+  | <RELVIEWLENGTH : <NUM> "vw"
+                   | <NUM> "vh"
+                   | <NUM> "vmin"
+                   | <NUM> "vmax" >
+  | <ABSOLUTLENGTH : <NUM> "cm"
+                   | <NUM> "mm"
+                   | <NUM> "in"
+                   | <NUM> "pt"
+                   | <NUM> "pc"
+                   | <NUM> "px" >
   | < ANGLE      : <NUM> ( "deg" | "grad" | "rad" | "turn" ) >
   | < TIME       : <NUM> ( "ms" | "s" ) >
   | < FREQ       : <NUM> "Hz" | <NUM> "kHz" >
-  | < RESOLUTION : <NUM> "dpi" | <NUM> "dpcm" >
+  | < RESOLUTION : <NUM> "dpi" | <NUM> "dpcm" | <NUM> "ddpx" >
   | < DIMEN      : <NUM> <NMSTART> ( <NMCHAR> )* >
   | < PERCENTAGE : <NUM> "%" >
   | < NUMBER     : <NUM> >
@@ -1663,9 +1669,9 @@
     Token n;
 }
 {
-    ( n=<LENGTH>
-    | n=<EMS> 
-    | n=<EXS> 
+    ( n=<RELFONTLENGTH>
+    | n=<RELVIEWLENGTH>
+    | n=<ABSOLUTLENGTH>
     | n=<ANGLE>
     | n=<TIME> 
     | n=<FREQ> 
@@ -2154,9 +2160,9 @@
     ( n=<NUMBER> { setValue(new CssNumber(), exp, operator, n, NUMBER); }
     | n=<PERCENTAGE> { setValue(new CssPercentage(), exp, operator, n, 
 				PERCENTAGE); }
-    | n=<LENGTH> { setValue(new CssLength(), exp, operator, n, LENGTH); }
-    | n=<EMS> { setValue(new CssLength(), exp, operator, n, EMS); }
-    | n=<EXS> { setValue(new CssLength(), exp, operator, n, EXS); }
+    | n=<RELFONTLENGTH> { setValue(new CssLength(), exp, operator, n, RELFONTLENGTH); }
+    | n=<RELVIEWLENGTH> { setValue(new CssLength(), exp, operator, n, RELVIEWLENGTH); }
+    | n=<ABSOLUTLENGTH> { setValue(new CssLength(), exp, operator, n, ABSOLUTLENGTH); }
     | n=<ANGLE> { setValue(new CssAngle(), exp, operator, n, ANGLE);}
     | n=<TIME> { setValue(new CssTime(), exp, operator, n, TIME); }
     | n=<FREQ> { setValue(new CssFrequency(), exp, operator, n, FREQ); }
@@ -2217,9 +2223,9 @@
       )
     | n=<PERCENTAGE> { setValue(new CssPercentage(), exp, operator, n,
 				PERCENTAGE); }
-    | n=<LENGTH> { setValue(new CssLength(), exp, operator, n, LENGTH); }
-    | n=<EMS> { setValue(new CssLength(), exp, operator, n, EMS); }
-    | n=<EXS> { setValue(new CssLength(), exp, operator, n, EXS); }
+    | n=<RELFONTLENGTH> { setValue(new CssLength(), exp, operator, n, RELFONTLENGTH); }
+    | n=<RELVIEWLENGTH> { setValue(new CssLength(), exp, operator, n, RELVIEWLENGTH); }
+    | n=<ABSOLUTLENGTH> { setValue(new CssLength(), exp, operator, n, ABSOLUTLENGTH); }
     | n=<ANGLE> { setValue(new CssAngle(), exp, operator, n, ANGLE);}
     | n=<TIME> { setValue(new CssTime(), exp, operator, n, TIME); }
     | n=<FREQ> { setValue(new CssFrequency(), exp, operator, n, FREQ); }
@@ -2278,7 +2284,7 @@
 	if (funcname.equals("rgb(")) {
 	    color.setRGBColor(exp, ac);
 	    return color;
-	} else if (n.image.toLowerCase().equals("atsc-rgba(")) {
+	} else if (funcname.equals("atsc-rgba(")) {
 	    if (getAtRule().toString().equals("@media atsc-tv")) {
 	        color.setATSCRGBAColor(exp, ac);
 	        return color;
@@ -2289,8 +2295,7 @@
 	    }
 	} else {
 	    CssFunction f = new CssFunction();
-	    f.set(n.image.substring(0, n.image.length() - 1),
-		  exp);
+	    f.set(n.image.substring(0, n.image.length() - 1), exp);
 	    return f;
 	}
     }

Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- CssParser.java	25 Apr 2012 20:21:52 -0000	1.83
+++ CssParser.java	6 Sep 2012 12:37:52 -0000	1.84
@@ -113,8 +113,6 @@
     private boolean reinited = false;
     private boolean charsetdeclared = false;
 
-    static StringBuilder SPACE = new StringBuilder(" ");
-
     // to be able to remove a ruleset if the selector is not valid
     protected boolean validSelector = true;
 
@@ -606,9 +604,9 @@
       case LBRACKET:
       case ANY:
       case COLON:
-      case LENGTH:
-      case EMS:
-      case EXS:
+      case RELFONTLENGTH:
+      case RELVIEWLENGTH:
+      case ABSOLUTLENGTH:
       case ANGLE:
       case TIME:
       case FREQ:
@@ -955,9 +953,9 @@
         case LBRACKET:
         case ANY:
         case COLON:
-        case LENGTH:
-        case EMS:
-        case EXS:
+        case RELFONTLENGTH:
+        case RELVIEWLENGTH:
+        case ABSOLUTLENGTH:
         case ANGLE:
         case TIME:
         case FREQ:
@@ -2274,9 +2272,9 @@
         case HASH:
         case LBRACKET:
         case COLON:
-        case LENGTH:
-        case EMS:
-        case EXS:
+        case RELFONTLENGTH:
+        case RELVIEWLENGTH:
+        case ABSOLUTLENGTH:
         case ANGLE:
         case TIME:
         case FREQ:
@@ -2296,9 +2294,9 @@
         case HASH:
           hash(selector);
           break;
-        case LENGTH:
-        case EMS:
-        case EXS:
+        case RELFONTLENGTH:
+        case RELVIEWLENGTH:
+        case ABSOLUTLENGTH:
         case ANGLE:
         case TIME:
         case FREQ:
@@ -2329,9 +2327,9 @@
     case HASH:
     case LBRACKET:
     case COLON:
-    case LENGTH:
-    case EMS:
-    case EXS:
+    case RELFONTLENGTH:
+    case RELVIEWLENGTH:
+    case ABSOLUTLENGTH:
     case ANGLE:
     case TIME:
     case FREQ:
@@ -2347,9 +2345,9 @@
         case HASH:
           hash(selector);
           break;
-        case LENGTH:
-        case EMS:
-        case EXS:
+        case RELFONTLENGTH:
+        case RELVIEWLENGTH:
+        case ABSOLUTLENGTH:
         case ANGLE:
         case TIME:
         case FREQ:
@@ -2378,9 +2376,9 @@
         case HASH:
         case LBRACKET:
         case COLON:
-        case LENGTH:
-        case EMS:
-        case EXS:
+        case RELFONTLENGTH:
+        case RELVIEWLENGTH:
+        case ABSOLUTLENGTH:
         case ANGLE:
         case TIME:
         case FREQ:
@@ -2425,9 +2423,9 @@
             {if (true) throw new ParseException(e.getMessage());}
         }
       break;
-    case LENGTH:
-    case EMS:
-    case EXS:
+    case RELFONTLENGTH:
+    case RELVIEWLENGTH:
+    case ABSOLUTLENGTH:
     case ANGLE:
     case TIME:
     case FREQ:
@@ -2501,14 +2499,14 @@
   final public Token deprecated_class() throws ParseException {
     Token n;
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
-    case LENGTH:
-      n = jj_consume_token(LENGTH);
+    case RELFONTLENGTH:
+      n = jj_consume_token(RELFONTLENGTH);
       break;
-    case EMS:
-      n = jj_consume_token(EMS);
+    case RELVIEWLENGTH:
+      n = jj_consume_token(RELVIEWLENGTH);
       break;
-    case EXS:
-      n = jj_consume_token(EXS);
+    case ABSOLUTLENGTH:
+      n = jj_consume_token(ABSOLUTLENGTH);
       break;
     case ANGLE:
       n = jj_consume_token(ANGLE);
@@ -2825,9 +2823,9 @@
     case HASH:
       hash(ns);
       break;
-    case LENGTH:
-    case EMS:
-    case EXS:
+    case RELFONTLENGTH:
+    case RELVIEWLENGTH:
+    case ABSOLUTLENGTH:
     case ANGLE:
     case TIME:
     case FREQ:
@@ -3334,9 +3332,9 @@
       case MINUS:
       case DIV:
       case URL:
-      case LENGTH:
-      case EMS:
-      case EXS:
+      case RELFONTLENGTH:
+      case RELVIEWLENGTH:
+      case ABSOLUTLENGTH:
       case ANGLE:
       case TIME:
       case FREQ:
@@ -3376,9 +3374,9 @@
       case HASH:
       case MINUS:
       case URL:
-      case LENGTH:
-      case EMS:
-      case EXS:
+      case RELFONTLENGTH:
+      case RELVIEWLENGTH:
+      case ABSOLUTLENGTH:
       case ANGLE:
       case TIME:
       case FREQ:
@@ -3411,9 +3409,9 @@
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case PLUS:
     case MINUS:
-    case LENGTH:
-    case EMS:
-    case EXS:
+    case RELFONTLENGTH:
+    case RELVIEWLENGTH:
+    case ABSOLUTLENGTH:
     case ANGLE:
     case TIME:
     case FREQ:
@@ -3441,17 +3439,17 @@
                        setValue(new CssPercentage(), exp, operator, n,
                                 PERCENTAGE);
         break;
-      case LENGTH:
-        n = jj_consume_token(LENGTH);
-                   setValue(new CssLength(), exp, operator, n, LENGTH);
+      case RELFONTLENGTH:
+        n = jj_consume_token(RELFONTLENGTH);
+                          setValue(new CssLength(), exp, operator, n, RELFONTLENGTH);
         break;
-      case EMS:
-        n = jj_consume_token(EMS);
-                setValue(new CssLength(), exp, operator, n, EMS);
+      case RELVIEWLENGTH:
+        n = jj_consume_token(RELVIEWLENGTH);
+                          setValue(new CssLength(), exp, operator, n, RELVIEWLENGTH);
         break;
-      case EXS:
-        n = jj_consume_token(EXS);
-                setValue(new CssLength(), exp, operator, n, EXS);
+      case ABSOLUTLENGTH:
+        n = jj_consume_token(ABSOLUTLENGTH);
+                          setValue(new CssLength(), exp, operator, n, ABSOLUTLENGTH);
         break;
       case ANGLE:
         n = jj_consume_token(ANGLE);
@@ -3585,9 +3583,9 @@
     switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
     case PLUS:
     case MINUS:
-    case LENGTH:
-    case EMS:
-    case EXS:
+    case RELFONTLENGTH:
+    case RELVIEWLENGTH:
+    case ABSOLUTLENGTH:
     case ANGLE:
     case TIME:
     case FREQ:
@@ -3627,17 +3625,17 @@
                        setValue(new CssPercentage(), exp, operator, n,
                                 PERCENTAGE);
         break;
-      case LENGTH:
-        n = jj_consume_token(LENGTH);
-                   setValue(new CssLength(), exp, operator, n, LENGTH);
+      case RELFONTLENGTH:
+        n = jj_consume_token(RELFONTLENGTH);
+                          setValue(new CssLength(), exp, operator, n, RELFONTLENGTH);
         break;
-      case EMS:
-        n = jj_consume_token(EMS);
-                setValue(new CssLength(), exp, operator, n, EMS);
+      case RELVIEWLENGTH:
+        n = jj_consume_token(RELVIEWLENGTH);
+                          setValue(new CssLength(), exp, operator, n, RELVIEWLENGTH);
         break;
-      case EXS:
-        n = jj_consume_token(EXS);
-                setValue(new CssLength(), exp, operator, n, EXS);
+      case ABSOLUTLENGTH:
+        n = jj_consume_token(ABSOLUTLENGTH);
+                          setValue(new CssLength(), exp, operator, n, ABSOLUTLENGTH);
         break;
       case ANGLE:
         n = jj_consume_token(ANGLE);
@@ -4092,16 +4090,6 @@
     finally { jj_save(1, xla); }
   }
 
-  private boolean jj_3R_93() {
-    Token xsp;
-    xsp = jj_scanpos;
-    if (jj_scan_token(35)) {
-    jj_scanpos = xsp;
-    if (jj_scan_token(48)) return true;
-    }
-    return false;
-  }
-
   private boolean jj_3_2() {
     if (jj_scan_token(NUMBER)) return true;
     Token xsp;
@@ -4121,6 +4109,16 @@
     return false;
   }
 
+  private boolean jj_3R_93() {
+    Token xsp;
+    xsp = jj_scanpos;
+    if (jj_scan_token(35)) {
+    jj_scanpos = xsp;
+    if (jj_scan_token(48)) return true;
+    }
+    return false;
+  }
+
   /** Generated Token Manager. */
   public CssParserTokenManager token_source;
   SimpleCharStream jj_input_stream;

Index: CssParserConstants.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParserConstants.java,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- CssParserConstants.java	25 Apr 2012 20:21:52 -0000	1.20
+++ CssParserConstants.java	6 Sep 2012 12:37:53 -0000	1.21
@@ -117,11 +117,11 @@
   /** RegularExpression Id. */
   int URL = 53;
   /** RegularExpression Id. */
-  int LENGTH = 54;
+  int RELFONTLENGTH = 54;
   /** RegularExpression Id. */
-  int EMS = 55;
+  int RELVIEWLENGTH = 55;
   /** RegularExpression Id. */
-  int EXS = 56;
+  int ABSOLUTLENGTH = 56;
   /** RegularExpression Id. */
   int ANGLE = 57;
   /** RegularExpression Id. */
@@ -262,9 +262,9 @@
     "\"(\"",
     "\":\"",
     "<URL>",
-    "<LENGTH>",
-    "<EMS>",
-    "<EXS>",
+    "<RELFONTLENGTH>",
+    "<RELVIEWLENGTH>",
+    "<ABSOLUTLENGTH>",
     "<ANGLE>",
     "<TIME>",
     "<FREQ>",

Received on Thursday, 6 September 2012 12:38:34 UTC