Changeset 3902 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2011-02-14T16:13:57+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java
r3896 r3902 18 18 import org.openstreetmap.josm.gui.mappaint.Range; 19 19 import org.openstreetmap.josm.gui.mappaint.StyleSource; 20 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector; 20 21 import org.openstreetmap.josm.gui.mappaint.mapcss.parser.MapCSSParser; 21 22 import org.openstreetmap.josm.gui.mappaint.mapcss.parser.ParseException; … … 109 110 for (MapCSSRule r : rules) { 110 111 for (Selector s : r.selectors) { 111 if (s.base.equals(type)) { 112 for (Condition cnd : s.conds) { 113 if (!cnd.applies(env)) 114 continue NEXT_RULE; 115 } 116 for (Instruction i : r.declaration) { 117 i.execute(env); 112 if ((s instanceof GeneralSelector)) { 113 GeneralSelector gs = (GeneralSelector) s; 114 if (gs.base.equals(type)) 115 { 116 for (Condition cnd : gs.conds) { 117 if (!cnd.applies(env)) 118 continue NEXT_RULE; 119 } 120 for (Instruction i : r.declaration) { 121 i.execute(env); 122 } 118 123 } 119 124 } … … 133 138 for (Selector s : r.selectors) { 134 139 if (s.applies(env)) { 135 if (s. range.contains(scale)) {136 mc.range = Range.cut(mc.range, s. range);140 if (s.getRange().contains(scale)) { 141 mc.range = Range.cut(mc.range, s.getRange()); 137 142 } else { 138 mc.range = mc.range.reduceAround(scale, s. range);143 mc.range = mc.range.reduceAround(scale, s.getRange()); 139 144 continue; 140 145 } 141 146 142 String sub = s. subpart;147 String sub = s.getSubpart(); 143 148 if (sub == null) { 144 149 sub = "default"; -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java
r3880 r3902 4 4 import java.util.List; 5 5 6 import org.openstreetmap.josm.data.osm.Node; 6 7 import org.openstreetmap.josm.data.osm.OsmPrimitive; 7 8 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; … … 13 14 import org.openstreetmap.josm.tools.Utils; 14 15 15 public class Selector { 16 public String base; 17 public Range range; 18 protected List<Condition> conds; 19 public String subpart; 16 public interface Selector { 17 18 public boolean applies(Environment e); 20 19 21 public Selector(String base, Pair<Integer, Integer> zoom, List<Condition> conds, String subpart) { 22 this.base = base; 23 if (zoom != null) { 24 int a = zoom.a == null ? 0 : zoom.a; 25 int b = zoom.b == null ? Integer.MAX_VALUE : zoom.b; 26 if (a <= b) { 27 range = fromLevel(a, b); 20 public String getSubpart(); 21 public Range getRange(); 22 23 public static class DescendentSelector implements Selector { 24 Selector a, b; 25 boolean child; 26 27 public DescendentSelector(Selector a, Selector b, boolean child) { 28 this.a = a; 29 this.b = b; 30 this.child = child; 31 } 32 33 @Override 34 public boolean applies(Environment e) { 35 if (!b.applies(e)) 36 return false; 37 38 Environment e2 = new Environment(null, e.mc, e.layer, e.source); 39 if (child) { 40 for (OsmPrimitive osm : e.osm.getReferrers()) { 41 e2.osm = osm; 42 if (a.applies(e2)) 43 return true; 44 } 45 } else { 46 if (e.osm instanceof Relation) { 47 for (OsmPrimitive chld : ((Relation) e.osm).getMemberPrimitives()) { 48 e2.osm = chld; 49 if (a.applies(e2)) 50 return true; 51 } 52 } else if (e.osm instanceof Way) { 53 for (Node n : ((Way) e.osm).getNodes()) { 54 e2.osm = n; 55 if (a.applies(e2)) 56 return true; 57 } 58 } 28 59 } 60 return false; 29 61 } 30 if (range == null) { 31 range = new Range(); 62 63 @Override 64 public String getSubpart() { 65 return b.getSubpart(); 32 66 } 33 this.conds = conds; 34 this.subpart = subpart; 67 68 @Override 69 public Range getRange() { 70 return b.getRange(); 71 } 35 72 } 36 73 37 public boolean applies(Environment e) { 38 if (!baseApplies(e.osm)) 74 public static class GeneralSelector implements Selector { 75 public String base; 76 public Range range; 77 protected List<Condition> conds; 78 private String subpart; 79 80 public GeneralSelector(String base, Pair<Integer, Integer> zoom, List<Condition> conds, String subpart) { 81 this.base = base; 82 if (zoom != null) { 83 int a = zoom.a == null ? 0 : zoom.a; 84 int b = zoom.b == null ? Integer.MAX_VALUE : zoom.b; 85 if (a <= b) { 86 range = fromLevel(a, b); 87 } 88 } 89 if (range == null) { 90 range = new Range(); 91 } 92 this.conds = conds; 93 this.subpart = subpart; 94 } 95 96 @Override 97 public String getSubpart() { 98 return subpart; 99 } 100 @Override 101 public Range getRange() { 102 return range; 103 } 104 105 @Override 106 public boolean applies(Environment e) { 107 if (!baseApplies(e.osm)) 108 return false; 109 for (Condition c : conds) { 110 if (!c.applies(e)) 111 return false; 112 } 113 return true; 114 } 115 116 private boolean baseApplies(OsmPrimitive osm) { 117 if (base.equals("*")) 118 return true; 119 if (base.equals("area")) { 120 if (osm instanceof Way) 121 return true; 122 if (osm instanceof Relation && ((Relation) osm).isMultipolygon()) 123 return true; 124 } 125 if (base.equals(OsmPrimitiveType.from(osm).getAPIName())) 126 return true; 39 127 return false; 40 for (Condition c : conds) {41 if (!c.applies(e))42 return false;43 128 } 44 return true; 129 130 public static Range fromLevel(int a, int b) { 131 if (a > b) 132 throw new AssertionError(); 133 double lower = 0; 134 double upper = Double.POSITIVE_INFINITY; 135 if (b != Integer.MAX_VALUE) { 136 lower = level2scale(b + 1); 137 } 138 if (a != 0) { 139 upper = level2scale(a); 140 } 141 return new Range(lower, upper); 142 } 143 144 final static double R = 6378135; 145 146 public static double level2scale(int lvl) { 147 if (lvl < 0) 148 throw new IllegalArgumentException(); 149 // preliminary formula - map such that mapnik imagery tiles of the same 150 // or similar level are displayed at the given scale 151 return 2.0 * Math.PI * R / Math.pow(2.0, lvl) / 2.56; 152 } 153 154 @Override 155 public String toString() { 156 return base + (range == null ? "" : range) + Utils.join("", conds) + (subpart != null ? ("::" + subpart) : ""); 157 } 45 158 } 46 47 private boolean baseApplies(OsmPrimitive osm) {48 if (base.equals("*"))49 return true;50 if (base.equals("area")) {51 if (osm instanceof Way)52 return true;53 if (osm instanceof Relation && ((Relation) osm).isMultipolygon())54 return true;55 }56 if (base.equals(OsmPrimitiveType.from(osm).getAPIName()))57 return true;58 return false;59 }60 61 public static Range fromLevel(int a, int b) {62 if (a > b)63 throw new AssertionError();64 double lower = 0;65 double upper = Double.POSITIVE_INFINITY;66 if (b != Integer.MAX_VALUE) {67 lower = level2scale(b + 1);68 }69 if (a != 0) {70 upper = level2scale(a);71 }72 return new Range(lower, upper);73 }74 75 final static double R = 6378135;76 77 public static double level2scale(int lvl) {78 if (lvl < 0)79 throw new IllegalArgumentException();80 // preliminary formula - map such that mapnik imagery tiles of the same81 // or similar level are displayed at the given scale82 return 2.0 * Math.PI * R / Math.pow(2.0, lvl) / 2.56;83 }84 85 @Override86 public String toString() {87 return base + (range == null ? "" : range) + Utils.join("", conds) + (subpart != null ? ("::" + subpart) : "");88 }89 90 159 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.java
r3893 r3902 14 14 import org.openstreetmap.josm.gui.mappaint.mapcss.Expression.FunctionExpression; 15 15 import org.openstreetmap.josm.gui.mappaint.mapcss.Expression.LiteralExpression; 16 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.DescendentSelector; 17 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector; 16 18 import org.openstreetmap.josm.tools.Pair; 17 19 … … 229 231 Selector sel; 230 232 List<Instruction> decl; 231 sel = selector(); 232 selectors.add(sel); 233 w(); 233 sel = child_selector(); 234 selectors.add(sel); 234 235 label_4: 235 236 while (true) { … … 244 245 jj_consume_token(COMMA); 245 246 w(); 246 sel = selector(); 247 selectors.add(sel); 248 w(); 247 sel = child_selector(); 248 selectors.add(sel); 249 249 } 250 250 decl = declaration(); 251 251 {if (true) return new MapCSSRule(selectors, decl);} 252 throw new Error("Missing return statement in function"); 253 } 254 255 final public Selector child_selector() throws ParseException { 256 boolean child = false; 257 Selector sel1, sel2 = null; 258 sel1 = selector(); 259 w(); 260 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 261 case GREATER: 262 case LESS: 263 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 264 case GREATER: 265 jj_consume_token(GREATER); 266 child = true; 267 break; 268 case LESS: 269 jj_consume_token(LESS); 270 child = false; 271 break; 272 default: 273 jj_la1[9] = jj_gen; 274 jj_consume_token(-1); 275 throw new ParseException(); 276 } 277 w(); 278 sel2 = selector(); 279 w(); 280 break; 281 default: 282 jj_la1[10] = jj_gen; 283 ; 284 } 285 {if (true) return sel2 != null ? new DescendentSelector(sel1, sel2, child) : sel1;} 252 286 throw new Error("Missing return statement in function"); 253 287 } … … 267 301 break; 268 302 default: 269 jj_la1[ 9] = jj_gen;303 jj_la1[11] = jj_gen; 270 304 jj_consume_token(-1); 271 305 throw new ParseException(); … … 276 310 break; 277 311 default: 278 jj_la1[1 0] = jj_gen;312 jj_la1[12] = jj_gen; 279 313 ; 280 314 } … … 288 322 break; 289 323 default: 290 jj_la1[1 1] = jj_gen;324 jj_la1[13] = jj_gen; 291 325 break label_5; 292 326 } … … 300 334 break; 301 335 default: 302 jj_la1[1 2] = jj_gen;336 jj_la1[14] = jj_gen; 303 337 jj_consume_token(-1); 304 338 throw new ParseException(); … … 311 345 break; 312 346 default: 313 jj_la1[1 3] = jj_gen;347 jj_la1[15] = jj_gen; 314 348 ; 315 349 } 316 {if (true) return new Selector(base.image, r, conditions, sub);}350 {if (true) return new GeneralSelector(base.image, r, conditions, sub);} 317 351 throw new Error("Missing return statement in function"); 318 352 } … … 337 371 break; 338 372 default: 339 jj_la1[1 4] = jj_gen;373 jj_la1[16] = jj_gen; 340 374 ; 341 375 } 342 376 break; 343 377 default: 344 jj_la1[1 5] = jj_gen;378 jj_la1[17] = jj_gen; 345 379 ; 346 380 } 347 381 break; 348 382 default: 349 jj_la1[1 6] = jj_gen;383 jj_la1[18] = jj_gen; 350 384 jj_consume_token(-1); 351 385 throw new ParseException(); … … 359 393 Expression e; 360 394 jj_consume_token(LSQUARE); 361 if (jj_2_1( 3)) {395 if (jj_2_1(2147483647)) { 362 396 c = simple_key_condition(); 363 397 jj_consume_token(RSQUARE); 364 398 {if (true) return c;} 365 } else if (jj_2_2( 5)) {399 } else if (jj_2_2(2147483647)) { 366 400 c = simple_key_value_condition(); 367 401 jj_consume_token(RSQUARE); … … 383 417 break; 384 418 default: 385 jj_la1[1 7] = jj_gen;419 jj_la1[19] = jj_gen; 386 420 jj_consume_token(-1); 387 421 throw new ParseException(); 388 422 } 423 } 424 throw new Error("Missing return statement in function"); 425 } 426 427 final public String tag_key() throws ParseException { 428 String s; 429 Token t; 430 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 431 case STRING: 432 s = string(); 433 {if (true) return s;} 434 break; 435 case IDENT: 436 t = jj_consume_token(IDENT); 437 s = t.image; 438 label_6: 439 while (true) { 440 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 441 case COLON: 442 ; 443 break; 444 default: 445 jj_la1[20] = jj_gen; 446 break label_6; 447 } 448 jj_consume_token(COLON); 449 t = jj_consume_token(IDENT); 450 s += ':' + t.image; 451 } 452 {if (true) return s;} 453 break; 454 default: 455 jj_la1[21] = jj_gen; 456 jj_consume_token(-1); 457 throw new ParseException(); 389 458 } 390 459 throw new Error("Missing return statement in function"); … … 401 470 break; 402 471 default: 403 jj_la1[ 18] = jj_gen;472 jj_la1[22] = jj_gen; 404 473 ; 405 474 } 406 key = string_or_ident();475 key = tag_key(); 407 476 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 408 477 case QUESTION: … … 411 480 break; 412 481 default: 413 jj_la1[ 19] = jj_gen;482 jj_la1[23] = jj_gen; 414 483 ; 415 484 } … … 423 492 float f; 424 493 Condition.Op op; 425 key = string_or_ident();494 key = tag_key(); 426 495 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 427 496 case STAR: … … 452 521 break; 453 522 default: 454 jj_la1[2 0] = jj_gen;523 jj_la1[24] = jj_gen; 455 524 jj_consume_token(-1); 456 525 throw new ParseException(); … … 482 551 break; 483 552 default: 484 jj_la1[2 1] = jj_gen;553 jj_la1[25] = jj_gen; 485 554 jj_consume_token(-1); 486 555 throw new ParseException(); … … 510 579 break; 511 580 default: 512 jj_la1[2 2] = jj_gen;581 jj_la1[26] = jj_gen; 513 582 jj_consume_token(-1); 514 583 throw new ParseException(); … … 518 587 break; 519 588 default: 520 jj_la1[2 3] = jj_gen;589 jj_la1[27] = jj_gen; 521 590 jj_consume_token(-1); 522 591 throw new ParseException(); … … 534 603 break; 535 604 default: 536 jj_la1[2 4] = jj_gen;605 jj_la1[28] = jj_gen; 537 606 ; 538 607 } … … 554 623 break; 555 624 default: 556 jj_la1[2 5] = jj_gen;625 jj_la1[29] = jj_gen; 557 626 jj_consume_token(-1); 558 627 throw new ParseException(); … … 569 638 jj_consume_token(LBRACE); 570 639 w(); 571 label_ 6:640 label_7: 572 641 while (true) { 573 642 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { … … 576 645 break; 577 646 default: 578 jj_la1[ 26] = jj_gen;579 break label_ 6;647 jj_la1[30] = jj_gen; 648 break label_7; 580 649 } 581 650 key = jj_consume_token(IDENT); … … 597 666 break; 598 667 default: 599 jj_la1[ 27] = jj_gen;668 jj_la1[31] = jj_gen; 600 669 jj_consume_token(-1); 601 670 throw new ParseException(); … … 614 683 break; 615 684 default: 616 jj_la1[ 28] = jj_gen;685 jj_la1[32] = jj_gen; 617 686 jj_consume_token(-1); 618 687 throw new ParseException(); … … 675 744 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 676 745 case PLUS: 677 label_ 7:746 label_8: 678 747 while (true) { 679 748 jj_consume_token(PLUS); … … 688 757 break; 689 758 default: 690 jj_la1[ 29] = jj_gen;691 break label_ 7;759 jj_la1[33] = jj_gen; 760 break label_8; 692 761 } 693 762 } 694 763 break; 695 764 case STAR: 696 label_ 8:765 label_9: 697 766 while (true) { 698 767 jj_consume_token(STAR); … … 707 776 break; 708 777 default: 709 jj_la1[3 0] = jj_gen;710 break label_ 8;778 jj_la1[34] = jj_gen; 779 break label_9; 711 780 } 712 781 } 713 782 break; 714 783 case MINUS: 715 label_ 9:784 label_10: 716 785 while (true) { 717 786 jj_consume_token(MINUS); … … 726 795 break; 727 796 default: 728 jj_la1[3 1] = jj_gen;729 break label_ 9;797 jj_la1[35] = jj_gen; 798 break label_10; 730 799 } 731 800 } 732 801 break; 733 802 case SLASH: 734 label_1 0:803 label_11: 735 804 while (true) { 736 805 jj_consume_token(SLASH); … … 745 814 break; 746 815 default: 747 jj_la1[3 2] = jj_gen;748 break label_1 0;816 jj_la1[36] = jj_gen; 817 break label_11; 749 818 } 750 819 } … … 781 850 break; 782 851 default: 783 jj_la1[3 3] = jj_gen;852 jj_la1[37] = jj_gen; 784 853 ; 785 854 } … … 830 899 break; 831 900 default: 832 jj_la1[3 4] = jj_gen;901 jj_la1[38] = jj_gen; 833 902 jj_consume_token(-1); 834 903 throw new ParseException(); … … 836 905 break; 837 906 default: 838 jj_la1[3 5] = jj_gen;907 jj_la1[39] = jj_gen; 839 908 ; 840 909 } 841 910 break; 842 911 default: 843 jj_la1[ 36] = jj_gen;912 jj_la1[40] = jj_gen; 844 913 jj_consume_token(-1); 845 914 throw new ParseException(); … … 878 947 break; 879 948 default: 880 jj_la1[ 37] = jj_gen;949 jj_la1[41] = jj_gen; 881 950 jj_consume_token(-1); 882 951 throw new ParseException(); … … 908 977 arg = expression(); 909 978 args.add(arg); 910 label_1 1:979 label_12: 911 980 while (true) { 912 981 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { … … 915 984 break; 916 985 default: 917 jj_la1[ 38] = jj_gen;918 break label_1 1;986 jj_la1[42] = jj_gen; 987 break label_12; 919 988 } 920 989 jj_consume_token(COMMA); … … 925 994 break; 926 995 default: 927 jj_la1[ 39] = jj_gen;996 jj_la1[43] = jj_gen; 928 997 ; 929 998 } … … 964 1033 break; 965 1034 default: 966 jj_la1[4 0] = jj_gen;1035 jj_la1[44] = jj_gen; 967 1036 jj_consume_token(-1); 968 1037 throw new ParseException(); … … 1048 1117 } 1049 1118 1050 private boolean jj_3R_ 30() {1051 if (jj_3R_4 6()) return true;1052 return false; 1053 } 1054 1055 private boolean jj_3R_2 5() {1119 private boolean jj_3R_69() { 1120 if (jj_3R_47()) return true; 1121 return false; 1122 } 1123 1124 private boolean jj_3R_26() { 1056 1125 Token xsp; 1057 1126 xsp = jj_scanpos; 1058 1127 if (jj_scan_token(9)) { 1059 1128 jj_scanpos = xsp; 1129 if (jj_3R_44()) return true; 1130 } 1131 return false; 1132 } 1133 1134 private boolean jj_3R_16() { 1135 Token xsp; 1136 while (true) { 1137 xsp = jj_scanpos; 1138 if (jj_3R_26()) { jj_scanpos = xsp; break; } 1139 } 1140 return false; 1141 } 1142 1143 private boolean jj_3R_37() { 1144 if (jj_scan_token(STAR)) return true; 1145 if (jj_scan_token(EQUAL)) return true; 1146 if (jj_3R_49()) return true; 1147 return false; 1148 } 1149 1150 private boolean jj_3R_51() { 1151 if (jj_3R_49()) return true; 1152 return false; 1153 } 1154 1155 private boolean jj_3R_36() { 1156 if (jj_scan_token(DOLLAR)) return true; 1157 if (jj_scan_token(EQUAL)) return true; 1158 if (jj_3R_49()) return true; 1159 return false; 1160 } 1161 1162 private boolean jj_3R_35() { 1163 if (jj_scan_token(CARET)) return true; 1164 if (jj_scan_token(EQUAL)) return true; 1165 if (jj_3R_49()) return true; 1166 return false; 1167 } 1168 1169 private boolean jj_3R_23() { 1170 Token xsp; 1171 xsp = jj_scanpos; 1172 if (jj_3R_38()) { 1173 jj_scanpos = xsp; 1174 if (jj_3R_39()) { 1175 jj_scanpos = xsp; 1176 if (jj_3R_40()) { 1177 jj_scanpos = xsp; 1178 if (jj_3R_41()) return true; 1179 } 1180 } 1181 } 1182 if (jj_3R_42()) return true; 1183 return false; 1184 } 1185 1186 private boolean jj_3R_50() { 1187 if (jj_scan_token(TILDE)) return true; 1188 if (jj_3R_70()) return true; 1189 return false; 1190 } 1191 1192 private boolean jj_3R_34() { 1193 if (jj_scan_token(TILDE)) return true; 1194 if (jj_scan_token(EQUAL)) return true; 1195 if (jj_3R_49()) return true; 1196 return false; 1197 } 1198 1199 private boolean jj_3R_43() { 1200 Token xsp; 1201 xsp = jj_scanpos; 1202 if (jj_scan_token(9)) jj_scanpos = xsp; 1203 return false; 1204 } 1205 1206 private boolean jj_3R_53() { 1207 if (jj_3R_24()) return true; 1208 return false; 1209 } 1210 1211 private boolean jj_3R_33() { 1212 if (jj_scan_token(EQUAL)) return true; 1213 Token xsp; 1214 xsp = jj_scanpos; 1215 if (jj_3R_50()) { 1216 jj_scanpos = xsp; 1217 if (jj_3R_51()) return true; 1218 } 1219 return false; 1220 } 1221 1222 private boolean jj_3R_32() { 1223 if (jj_scan_token(EXCLAMATION)) return true; 1224 if (jj_scan_token(EQUAL)) return true; 1225 if (jj_3R_49()) return true; 1226 return false; 1227 } 1228 1229 private boolean jj_3R_70() { 1230 if (jj_scan_token(REGEX)) return true; 1231 return false; 1232 } 1233 1234 private boolean jj_3R_22() { 1235 Token xsp; 1236 xsp = jj_scanpos; 1237 if (jj_3R_32()) { 1238 jj_scanpos = xsp; 1239 if (jj_3R_33()) { 1240 jj_scanpos = xsp; 1241 if (jj_3R_34()) { 1242 jj_scanpos = xsp; 1243 if (jj_3R_35()) { 1244 jj_scanpos = xsp; 1245 if (jj_3R_36()) { 1246 jj_scanpos = xsp; 1247 if (jj_3R_37()) return true; 1248 } 1249 } 1250 } 1251 } 1252 } 1253 return false; 1254 } 1255 1256 private boolean jj_3R_48() { 1257 if (jj_scan_token(COLON)) return true; 1258 if (jj_scan_token(IDENT)) return true; 1259 return false; 1260 } 1261 1262 private boolean jj_3R_49() { 1263 Token xsp; 1264 xsp = jj_scanpos; 1265 if (jj_3R_68()) { 1266 jj_scanpos = xsp; 1267 if (jj_3R_69()) return true; 1268 } 1269 return false; 1270 } 1271 1272 private boolean jj_3R_68() { 1273 if (jj_scan_token(IDENT)) return true; 1274 return false; 1275 } 1276 1277 private boolean jj_3R_14() { 1278 if (jj_3R_20()) return true; 1279 Token xsp; 1280 xsp = jj_scanpos; 1281 if (jj_3R_22()) { 1282 jj_scanpos = xsp; 1283 if (jj_3R_23()) return true; 1284 } 1285 return false; 1286 } 1287 1288 private boolean jj_3R_80() { 1289 if (jj_scan_token(HEXCOLOR)) return true; 1290 return false; 1291 } 1292 1293 private boolean jj_3R_47() { 1294 if (jj_scan_token(STRING)) return true; 1295 return false; 1296 } 1297 1298 private boolean jj_3R_79() { 1299 if (jj_3R_24()) return true; 1300 return false; 1301 } 1302 1303 private boolean jj_3R_78() { 1304 if (jj_scan_token(PLUS)) return true; 1305 if (jj_3R_24()) return true; 1306 return false; 1307 } 1308 1309 private boolean jj_3R_71() { 1310 Token xsp; 1311 xsp = jj_scanpos; 1312 if (jj_3R_77()) { 1313 jj_scanpos = xsp; 1314 if (jj_3R_78()) { 1315 jj_scanpos = xsp; 1316 if (jj_3R_79()) { 1317 jj_scanpos = xsp; 1318 if (jj_3R_80()) return true; 1319 } 1320 } 1321 } 1322 return false; 1323 } 1324 1325 private boolean jj_3R_77() { 1326 if (jj_3R_49()) return true; 1327 return false; 1328 } 1329 1330 private boolean jj_3R_21() { 1331 if (jj_scan_token(QUESTION)) return true; 1332 return false; 1333 } 1334 1335 private boolean jj_3R_42() { 1336 Token xsp; 1337 xsp = jj_scanpos; 1338 if (jj_3R_52()) { 1339 jj_scanpos = xsp; 1340 if (jj_3R_53()) return true; 1341 } 1342 return false; 1343 } 1344 1345 private boolean jj_3R_52() { 1346 if (jj_scan_token(MINUS)) return true; 1347 if (jj_3R_24()) return true; 1348 return false; 1349 } 1350 1351 private boolean jj_3R_19() { 1352 if (jj_scan_token(EXCLAMATION)) return true; 1353 return false; 1354 } 1355 1356 private boolean jj_3R_13() { 1357 Token xsp; 1358 xsp = jj_scanpos; 1359 if (jj_3R_19()) jj_scanpos = xsp; 1360 if (jj_3R_20()) return true; 1361 xsp = jj_scanpos; 1362 if (jj_3R_21()) jj_scanpos = xsp; 1363 return false; 1364 } 1365 1366 private boolean jj_3R_81() { 1367 if (jj_scan_token(COMMA)) return true; 1368 if (jj_3R_16()) return true; 1369 if (jj_3R_17()) return true; 1370 return false; 1371 } 1372 1373 private boolean jj_3R_24() { 1374 Token xsp; 1375 xsp = jj_scanpos; 1376 if (jj_scan_token(3)) { 1377 jj_scanpos = xsp; 1378 if (jj_scan_token(2)) return true; 1379 } 1380 return false; 1381 } 1382 1383 private boolean jj_3R_31() { 1384 if (jj_scan_token(IDENT)) return true; 1385 Token xsp; 1386 while (true) { 1387 xsp = jj_scanpos; 1388 if (jj_3R_48()) { jj_scanpos = xsp; break; } 1389 } 1390 return false; 1391 } 1392 1393 private boolean jj_3R_30() { 1394 if (jj_3R_47()) return true; 1395 return false; 1396 } 1397 1398 private boolean jj_3R_20() { 1399 Token xsp; 1400 xsp = jj_scanpos; 1401 if (jj_3R_30()) { 1402 jj_scanpos = xsp; 1403 if (jj_3R_31()) return true; 1404 } 1405 return false; 1406 } 1407 1408 private boolean jj_3R_76() { 1409 if (jj_3R_17()) return true; 1410 Token xsp; 1411 while (true) { 1412 xsp = jj_scanpos; 1413 if (jj_3R_81()) { jj_scanpos = xsp; break; } 1414 } 1415 return false; 1416 } 1417 1418 private boolean jj_3_2() { 1419 if (jj_3R_14()) return true; 1420 if (jj_scan_token(RSQUARE)) return true; 1421 return false; 1422 } 1423 1424 private boolean jj_3_1() { 1425 if (jj_3R_13()) return true; 1426 if (jj_scan_token(RSQUARE)) return true; 1427 return false; 1428 } 1429 1430 private boolean jj_3R_18() { 1431 if (jj_scan_token(IDENT)) return true; 1432 if (jj_3R_16()) return true; 1433 if (jj_scan_token(LPAR)) return true; 1434 if (jj_3R_16()) return true; 1435 Token xsp; 1436 xsp = jj_scanpos; 1437 if (jj_3R_76()) jj_scanpos = xsp; 1438 if (jj_scan_token(RPAR)) return true; 1439 return false; 1440 } 1441 1442 private boolean jj_3R_55() { 1443 if (jj_scan_token(LPAR)) return true; 1444 if (jj_3R_16()) return true; 1445 if (jj_3R_17()) return true; 1446 if (jj_scan_token(RPAR)) return true; 1447 return false; 1448 } 1449 1450 private boolean jj_3R_54() { 1451 if (jj_3R_71()) return true; 1452 return false; 1453 } 1454 1455 private boolean jj_3_5() { 1456 if (jj_3R_18()) return true; 1457 return false; 1458 } 1459 1460 private boolean jj_3R_45() { 1461 Token xsp; 1462 xsp = jj_scanpos; 1463 if (jj_3_5()) { 1464 jj_scanpos = xsp; 1465 if (jj_3R_54()) { 1466 jj_scanpos = xsp; 1467 if (jj_3R_55()) return true; 1468 } 1469 } 1470 return false; 1471 } 1472 1473 private boolean jj_3R_67() { 1474 if (jj_scan_token(QUESTION)) return true; 1475 if (jj_3R_16()) return true; 1476 if (jj_3R_45()) return true; 1477 if (jj_3R_16()) return true; 1478 if (jj_scan_token(COLON)) return true; 1479 if (jj_3R_16()) return true; 1480 if (jj_3R_45()) return true; 1481 if (jj_3R_16()) return true; 1482 return false; 1483 } 1484 1485 private boolean jj_3R_66() { 1486 if (jj_scan_token(PIPE)) return true; 1487 if (jj_scan_token(PIPE)) return true; 1488 if (jj_3R_16()) return true; 1489 if (jj_3R_45()) return true; 1490 if (jj_3R_16()) return true; 1491 return false; 1492 } 1493 1494 private boolean jj_3R_65() { 1495 if (jj_scan_token(AMPERSAND)) return true; 1496 if (jj_scan_token(AMPERSAND)) return true; 1497 if (jj_3R_16()) return true; 1498 if (jj_3R_45()) return true; 1499 if (jj_3R_16()) return true; 1500 return false; 1501 } 1502 1503 private boolean jj_3R_64() { 1504 if (jj_scan_token(LESS)) return true; 1505 if (jj_3R_16()) return true; 1506 if (jj_3R_45()) return true; 1507 if (jj_3R_16()) return true; 1508 return false; 1509 } 1510 1511 private boolean jj_3R_63() { 1512 if (jj_scan_token(EQUAL)) return true; 1513 Token xsp; 1514 xsp = jj_scanpos; 1515 if (jj_scan_token(22)) jj_scanpos = xsp; 1516 if (jj_3R_16()) return true; 1517 if (jj_3R_45()) return true; 1518 if (jj_3R_16()) return true; 1519 return false; 1520 } 1521 1522 private boolean jj_3R_62() { 1523 if (jj_scan_token(GREATER)) return true; 1524 if (jj_3R_16()) return true; 1525 if (jj_3R_45()) return true; 1526 if (jj_3R_16()) return true; 1527 return false; 1528 } 1529 1530 private boolean jj_3R_61() { 1531 if (jj_scan_token(LESS_EQUAL)) return true; 1532 if (jj_3R_16()) return true; 1533 if (jj_3R_45()) return true; 1534 if (jj_3R_16()) return true; 1535 return false; 1536 } 1537 1538 private boolean jj_3R_60() { 1539 if (jj_scan_token(GREATER_EQUAL)) return true; 1540 if (jj_3R_16()) return true; 1541 if (jj_3R_45()) return true; 1542 if (jj_3R_16()) return true; 1543 return false; 1544 } 1545 1546 private boolean jj_3R_75() { 1547 if (jj_scan_token(SLASH)) return true; 1548 if (jj_3R_16()) return true; 1549 if (jj_3R_45()) return true; 1550 if (jj_3R_16()) return true; 1551 return false; 1552 } 1553 1554 private boolean jj_3R_59() { 1555 Token xsp; 1556 if (jj_3R_75()) return true; 1557 while (true) { 1558 xsp = jj_scanpos; 1559 if (jj_3R_75()) { jj_scanpos = xsp; break; } 1560 } 1561 return false; 1562 } 1563 1564 private boolean jj_3R_74() { 1565 if (jj_scan_token(MINUS)) return true; 1566 if (jj_3R_16()) return true; 1567 if (jj_3R_45()) return true; 1568 if (jj_3R_16()) return true; 1569 return false; 1570 } 1571 1572 private boolean jj_3R_58() { 1573 Token xsp; 1574 if (jj_3R_74()) return true; 1575 while (true) { 1576 xsp = jj_scanpos; 1577 if (jj_3R_74()) { jj_scanpos = xsp; break; } 1578 } 1579 return false; 1580 } 1581 1582 private boolean jj_3R_73() { 1583 if (jj_scan_token(STAR)) return true; 1584 if (jj_3R_16()) return true; 1585 if (jj_3R_45()) return true; 1586 if (jj_3R_16()) return true; 1587 return false; 1588 } 1589 1590 private boolean jj_3R_57() { 1591 Token xsp; 1592 if (jj_3R_73()) return true; 1593 while (true) { 1594 xsp = jj_scanpos; 1595 if (jj_3R_73()) { jj_scanpos = xsp; break; } 1596 } 1597 return false; 1598 } 1599 1600 private boolean jj_3R_72() { 1601 if (jj_scan_token(PLUS)) return true; 1602 if (jj_3R_16()) return true; 1603 if (jj_3R_45()) return true; 1604 if (jj_3R_16()) return true; 1605 return false; 1606 } 1607 1608 private boolean jj_3R_46() { 1609 Token xsp; 1610 xsp = jj_scanpos; 1611 if (jj_3R_56()) { 1612 jj_scanpos = xsp; 1613 if (jj_3R_57()) { 1614 jj_scanpos = xsp; 1615 if (jj_3R_58()) { 1616 jj_scanpos = xsp; 1617 if (jj_3R_59()) { 1618 jj_scanpos = xsp; 1619 if (jj_3R_60()) { 1620 jj_scanpos = xsp; 1621 if (jj_3R_61()) { 1622 jj_scanpos = xsp; 1623 if (jj_3R_62()) { 1624 jj_scanpos = xsp; 1625 if (jj_3R_63()) { 1626 jj_scanpos = xsp; 1627 if (jj_3R_64()) { 1628 jj_scanpos = xsp; 1629 if (jj_3R_65()) { 1630 jj_scanpos = xsp; 1631 if (jj_3R_66()) { 1632 jj_scanpos = xsp; 1633 if (jj_3R_67()) return true; 1634 } 1635 } 1636 } 1637 } 1638 } 1639 } 1640 } 1641 } 1642 } 1643 } 1644 } 1645 return false; 1646 } 1647 1648 private boolean jj_3R_56() { 1649 Token xsp; 1650 if (jj_3R_72()) return true; 1651 while (true) { 1652 xsp = jj_scanpos; 1653 if (jj_3R_72()) { jj_scanpos = xsp; break; } 1654 } 1655 return false; 1656 } 1657 1658 private boolean jj_3R_29() { 1659 if (jj_3R_45()) return true; 1660 if (jj_3R_16()) return true; 1661 Token xsp; 1662 xsp = jj_scanpos; 1663 if (jj_3R_46()) jj_scanpos = xsp; 1664 return false; 1665 } 1666 1667 private boolean jj_3R_28() { 1668 if (jj_scan_token(MINUS)) return true; 1669 if (jj_3R_16()) return true; 1670 if (jj_3R_45()) return true; 1671 if (jj_3R_16()) return true; 1672 return false; 1673 } 1674 1675 private boolean jj_3R_27() { 1676 if (jj_scan_token(EXCLAMATION)) return true; 1677 if (jj_3R_16()) return true; 1678 if (jj_3R_45()) return true; 1679 if (jj_3R_16()) return true; 1680 return false; 1681 } 1682 1683 private boolean jj_3_4() { 1684 if (jj_3R_17()) return true; 1685 Token xsp; 1686 xsp = jj_scanpos; 1687 if (jj_scan_token(27)) { 1688 jj_scanpos = xsp; 1689 if (jj_scan_token(13)) return true; 1690 } 1691 return false; 1692 } 1693 1694 private boolean jj_3R_17() { 1695 Token xsp; 1696 xsp = jj_scanpos; 1697 if (jj_3R_27()) { 1698 jj_scanpos = xsp; 1699 if (jj_3R_28()) { 1700 jj_scanpos = xsp; 1701 if (jj_3R_29()) return true; 1702 } 1703 } 1704 return false; 1705 } 1706 1707 private boolean jj_3_3() { 1708 if (jj_3R_15()) return true; 1709 if (jj_3R_16()) return true; 1710 Token xsp; 1711 xsp = jj_scanpos; 1712 if (jj_scan_token(27)) { 1713 jj_scanpos = xsp; 1714 if (jj_scan_token(13)) return true; 1715 } 1716 return false; 1717 } 1718 1719 private boolean jj_3R_25() { 1720 if (jj_scan_token(COMMA)) return true; 1060 1721 if (jj_3R_43()) return true; 1061 }1722 if (jj_3R_24()) return true; 1062 1723 return false; 1063 1724 } 1064 1725 1065 1726 private boolean jj_3R_15() { 1066 Token xsp; 1727 if (jj_3R_24()) return true; 1728 Token xsp; 1729 if (jj_3R_25()) return true; 1067 1730 while (true) { 1068 1731 xsp = jj_scanpos; … … 1072 1735 } 1073 1736 1074 private boolean jj_3R_52() { 1075 if (jj_scan_token(LPAR)) return true; 1076 if (jj_3R_15()) return true; 1077 if (jj_3R_16()) return true; 1078 if (jj_scan_token(RPAR)) return true; 1079 return false; 1080 } 1081 1082 private boolean jj_3R_51() { 1083 if (jj_3R_66()) return true; 1737 private boolean jj_3R_41() { 1738 if (jj_scan_token(LESS)) return true; 1084 1739 return false; 1085 1740 } 1086 1741 1087 1742 private boolean jj_3R_44() { 1088 Token xsp;1089 xsp = jj_scanpos;1090 if (jj_3_5()) {1091 jj_scanpos = xsp;1092 if (jj_3R_51()) {1093 jj_scanpos = xsp;1094 if (jj_3R_52()) return true;1095 }1096 }1097 return false;1098 }1099 1100 private boolean jj_3R_42() {1101 Token xsp;1102 xsp = jj_scanpos;1103 if (jj_scan_token(9)) jj_scanpos = xsp;1104 return false;1105 }1106 1107 private boolean jj_3_5() {1108 if (jj_3R_17()) return true;1109 return false;1110 }1111 1112 private boolean jj_3R_50() {1113 if (jj_3R_23()) return true;1114 return false;1115 }1116 1117 private boolean jj_3R_64() {1118 if (jj_scan_token(QUESTION)) return true;1119 if (jj_3R_15()) return true;1120 if (jj_3R_44()) return true;1121 if (jj_3R_15()) return true;1122 if (jj_scan_token(COLON)) return true;1123 if (jj_3R_15()) return true;1124 if (jj_3R_44()) return true;1125 if (jj_3R_15()) return true;1126 return false;1127 }1128 1129 private boolean jj_3R_63() {1130 if (jj_scan_token(PIPE)) return true;1131 if (jj_scan_token(PIPE)) return true;1132 if (jj_3R_15()) return true;1133 if (jj_3R_44()) return true;1134 if (jj_3R_15()) return true;1135 return false;1136 }1137 1138 private boolean jj_3R_40() {1139 if (jj_scan_token(LESS)) return true;1140 return false;1141 }1142 1143 private boolean jj_3R_62() {1144 if (jj_scan_token(AMPERSAND)) return true;1145 if (jj_scan_token(AMPERSAND)) return true;1146 if (jj_3R_15()) return true;1147 if (jj_3R_44()) return true;1148 if (jj_3R_15()) return true;1149 return false;1150 }1151 1152 private boolean jj_3R_39() {1153 if (jj_scan_token(LESS_EQUAL)) return true;1154 return false;1155 }1156 1157 private boolean jj_3R_61() {1158 if (jj_scan_token(LESS)) return true;1159 if (jj_3R_15()) return true;1160 if (jj_3R_44()) return true;1161 if (jj_3R_15()) return true;1162 return false;1163 }1164 1165 private boolean jj_3R_38() {1166 if (jj_scan_token(GREATER)) return true;1167 return false;1168 }1169 1170 private boolean jj_3R_60() {1171 if (jj_scan_token(EQUAL)) return true;1172 Token xsp;1173 xsp = jj_scanpos;1174 if (jj_scan_token(22)) jj_scanpos = xsp;1175 if (jj_3R_15()) return true;1176 if (jj_3R_44()) return true;1177 if (jj_3R_15()) return true;1178 return false;1179 }1180 1181 private boolean jj_3R_37() {1182 if (jj_scan_token(GREATER_EQUAL)) return true;1183 return false;1184 }1185 1186 private boolean jj_3R_65() {1187 if (jj_scan_token(REGEX)) return true;1188 return false;1189 }1190 1191 private boolean jj_3R_59() {1192 if (jj_scan_token(GREATER)) return true;1193 if (jj_3R_15()) return true;1194 if (jj_3R_44()) return true;1195 if (jj_3R_15()) return true;1196 return false;1197 }1198 1199 private boolean jj_3R_58() {1200 if (jj_scan_token(LESS_EQUAL)) return true;1201 if (jj_3R_15()) return true;1202 if (jj_3R_44()) return true;1203 if (jj_3R_15()) return true;1204 return false;1205 }1206 1207 private boolean jj_3R_36() {1208 if (jj_scan_token(STAR)) return true;1209 if (jj_scan_token(EQUAL)) return true;1210 if (jj_3R_19()) return true;1211 return false;1212 }1213 1214 private boolean jj_3R_70() {1215 if (jj_scan_token(SLASH)) return true;1216 if (jj_3R_15()) return true;1217 if (jj_3R_44()) return true;1218 if (jj_3R_15()) return true;1219 return false;1220 }1221 1222 private boolean jj_3R_57() {1223 if (jj_scan_token(GREATER_EQUAL)) return true;1224 if (jj_3R_15()) return true;1225 if (jj_3R_44()) return true;1226 if (jj_3R_15()) return true;1227 return false;1228 }1229 1230 private boolean jj_3R_48() {1231 if (jj_3R_19()) return true;1232 return false;1233 }1234 1235 private boolean jj_3R_35() {1236 if (jj_scan_token(DOLLAR)) return true;1237 if (jj_scan_token(EQUAL)) return true;1238 if (jj_3R_19()) return true;1239 return false;1240 }1241 1242 private boolean jj_3R_69() {1243 if (jj_scan_token(MINUS)) return true;1244 if (jj_3R_15()) return true;1245 if (jj_3R_44()) return true;1246 if (jj_3R_15()) return true;1247 return false;1248 }1249 1250 private boolean jj_3R_56() {1251 Token xsp;1252 if (jj_3R_70()) return true;1253 while (true) {1254 xsp = jj_scanpos;1255 if (jj_3R_70()) { jj_scanpos = xsp; break; }1256 }1257 return false;1258 }1259 1260 private boolean jj_3R_47() {1261 if (jj_scan_token(TILDE)) return true;1262 if (jj_3R_65()) return true;1263 return false;1264 }1265 1266 private boolean jj_3R_19() {1267 Token xsp;1268 xsp = jj_scanpos;1269 if (jj_3R_29()) {1270 jj_scanpos = xsp;1271 if (jj_3R_30()) return true;1272 }1273 return false;1274 }1275 1276 private boolean jj_3R_29() {1277 if (jj_scan_token(IDENT)) return true;1278 return false;1279 }1280 1281 private boolean jj_3R_22() {1282 Token xsp;1283 xsp = jj_scanpos;1284 if (jj_3R_37()) {1285 jj_scanpos = xsp;1286 if (jj_3R_38()) {1287 jj_scanpos = xsp;1288 if (jj_3R_39()) {1289 jj_scanpos = xsp;1290 if (jj_3R_40()) return true;1291 }1292 }1293 }1294 if (jj_3R_41()) return true;1295 return false;1296 }1297 1298 private boolean jj_3R_34() {1299 if (jj_scan_token(CARET)) return true;1300 if (jj_scan_token(EQUAL)) return true;1301 if (jj_3R_19()) return true;1302 return false;1303 }1304 1305 private boolean jj_3R_68() {1306 if (jj_scan_token(STAR)) return true;1307 if (jj_3R_15()) return true;1308 if (jj_3R_44()) return true;1309 if (jj_3R_15()) return true;1310 return false;1311 }1312 1313 private boolean jj_3R_55() {1314 Token xsp;1315 if (jj_3R_69()) return true;1316 while (true) {1317 xsp = jj_scanpos;1318 if (jj_3R_69()) { jj_scanpos = xsp; break; }1319 }1320 return false;1321 }1322 1323 private boolean jj_3R_33() {1324 if (jj_scan_token(TILDE)) return true;1325 if (jj_scan_token(EQUAL)) return true;1326 if (jj_3R_19()) return true;1327 return false;1328 }1329 1330 private boolean jj_3R_67() {1331 if (jj_scan_token(PLUS)) return true;1332 if (jj_3R_15()) return true;1333 if (jj_3R_44()) return true;1334 if (jj_3R_15()) return true;1335 return false;1336 }1337 1338 private boolean jj_3R_54() {1339 Token xsp;1340 if (jj_3R_68()) return true;1341 while (true) {1342 xsp = jj_scanpos;1343 if (jj_3R_68()) { jj_scanpos = xsp; break; }1344 }1345 return false;1346 }1347 1348 private boolean jj_3R_53() {1349 Token xsp;1350 if (jj_3R_67()) return true;1351 while (true) {1352 xsp = jj_scanpos;1353 if (jj_3R_67()) { jj_scanpos = xsp; break; }1354 }1355 return false;1356 }1357 1358 private boolean jj_3R_45() {1359 Token xsp;1360 xsp = jj_scanpos;1361 if (jj_3R_53()) {1362 jj_scanpos = xsp;1363 if (jj_3R_54()) {1364 jj_scanpos = xsp;1365 if (jj_3R_55()) {1366 jj_scanpos = xsp;1367 if (jj_3R_56()) {1368 jj_scanpos = xsp;1369 if (jj_3R_57()) {1370 jj_scanpos = xsp;1371 if (jj_3R_58()) {1372 jj_scanpos = xsp;1373 if (jj_3R_59()) {1374 jj_scanpos = xsp;1375 if (jj_3R_60()) {1376 jj_scanpos = xsp;1377 if (jj_3R_61()) {1378 jj_scanpos = xsp;1379 if (jj_3R_62()) {1380 jj_scanpos = xsp;1381 if (jj_3R_63()) {1382 jj_scanpos = xsp;1383 if (jj_3R_64()) return true;1384 }1385 }1386 }1387 }1388 }1389 }1390 }1391 }1392 }1393 }1394 }1395 return false;1396 }1397 1398 private boolean jj_3R_46() {1399 if (jj_scan_token(STRING)) return true;1400 return false;1401 }1402 1403 private boolean jj_3R_32() {1404 if (jj_scan_token(EQUAL)) return true;1405 Token xsp;1406 xsp = jj_scanpos;1407 if (jj_3R_47()) {1408 jj_scanpos = xsp;1409 if (jj_3R_48()) return true;1410 }1411 return false;1412 }1413 1414 private boolean jj_3R_31() {1415 if (jj_scan_token(EXCLAMATION)) return true;1416 if (jj_scan_token(EQUAL)) return true;1417 if (jj_3R_19()) return true;1418 return false;1419 }1420 1421 private boolean jj_3R_49() {1422 if (jj_scan_token(MINUS)) return true;1423 if (jj_3R_23()) return true;1424 return false;1425 }1426 1427 private boolean jj_3R_41() {1428 Token xsp;1429 xsp = jj_scanpos;1430 if (jj_3R_49()) {1431 jj_scanpos = xsp;1432 if (jj_3R_50()) return true;1433 }1434 return false;1435 }1436 1437 private boolean jj_3R_28() {1438 if (jj_3R_44()) return true;1439 if (jj_3R_15()) return true;1440 Token xsp;1441 xsp = jj_scanpos;1442 if (jj_3R_45()) jj_scanpos = xsp;1443 return false;1444 }1445 1446 private boolean jj_3R_21() {1447 Token xsp;1448 xsp = jj_scanpos;1449 if (jj_3R_31()) {1450 jj_scanpos = xsp;1451 if (jj_3R_32()) {1452 jj_scanpos = xsp;1453 if (jj_3R_33()) {1454 jj_scanpos = xsp;1455 if (jj_3R_34()) {1456 jj_scanpos = xsp;1457 if (jj_3R_35()) {1458 jj_scanpos = xsp;1459 if (jj_3R_36()) return true;1460 }1461 }1462 }1463 }1464 }1465 return false;1466 }1467 1468 private boolean jj_3R_27() {1469 if (jj_scan_token(MINUS)) return true;1470 if (jj_3R_15()) return true;1471 if (jj_3R_44()) return true;1472 if (jj_3R_15()) return true;1473 return false;1474 }1475 1476 private boolean jj_3R_26() {1477 if (jj_scan_token(EXCLAMATION)) return true;1478 if (jj_3R_15()) return true;1479 if (jj_3R_44()) return true;1480 if (jj_3R_15()) return true;1481 return false;1482 }1483 1484 private boolean jj_3R_23() {1485 Token xsp;1486 xsp = jj_scanpos;1487 if (jj_scan_token(3)) {1488 jj_scanpos = xsp;1489 if (jj_scan_token(2)) return true;1490 }1491 return false;1492 }1493 1494 private boolean jj_3R_16() {1495 Token xsp;1496 xsp = jj_scanpos;1497 if (jj_3R_26()) {1498 jj_scanpos = xsp;1499 if (jj_3R_27()) {1500 jj_scanpos = xsp;1501 if (jj_3R_28()) return true;1502 }1503 }1504 return false;1505 }1506 1507 private boolean jj_3_4() {1508 if (jj_3R_16()) return true;1509 Token xsp;1510 xsp = jj_scanpos;1511 if (jj_scan_token(27)) {1512 jj_scanpos = xsp;1513 if (jj_scan_token(13)) return true;1514 }1515 return false;1516 }1517 1518 private boolean jj_3R_13() {1519 if (jj_3R_19()) return true;1520 Token xsp;1521 xsp = jj_scanpos;1522 if (jj_3R_21()) {1523 jj_scanpos = xsp;1524 if (jj_3R_22()) return true;1525 }1526 return false;1527 }1528 1529 private boolean jj_3R_75() {1530 if (jj_scan_token(HEXCOLOR)) return true;1531 return false;1532 }1533 1534 private boolean jj_3R_74() {1535 if (jj_3R_23()) return true;1536 return false;1537 }1538 1539 private boolean jj_3_3() {1540 if (jj_3R_14()) return true;1541 if (jj_3R_15()) return true;1542 Token xsp;1543 xsp = jj_scanpos;1544 if (jj_scan_token(27)) {1545 jj_scanpos = xsp;1546 if (jj_scan_token(13)) return true;1547 }1548 return false;1549 }1550 1551 private boolean jj_3R_73() {1552 if (jj_scan_token(PLUS)) return true;1553 if (jj_3R_23()) return true;1554 return false;1555 }1556 1557 private boolean jj_3R_72() {1558 if (jj_3R_19()) return true;1559 return false;1560 }1561 1562 private boolean jj_3R_66() {1563 Token xsp;1564 xsp = jj_scanpos;1565 if (jj_3R_72()) {1566 jj_scanpos = xsp;1567 if (jj_3R_73()) {1568 jj_scanpos = xsp;1569 if (jj_3R_74()) {1570 jj_scanpos = xsp;1571 if (jj_3R_75()) return true;1572 }1573 }1574 }1575 return false;1576 }1577 1578 private boolean jj_3R_20() {1579 if (jj_scan_token(QUESTION)) return true;1580 return false;1581 }1582 1583 private boolean jj_3R_18() {1584 if (jj_scan_token(EXCLAMATION)) return true;1585 return false;1586 }1587 1588 private boolean jj_3R_12() {1589 Token xsp;1590 xsp = jj_scanpos;1591 if (jj_3R_18()) jj_scanpos = xsp;1592 if (jj_3R_19()) return true;1593 xsp = jj_scanpos;1594 if (jj_3R_20()) jj_scanpos = xsp;1595 return false;1596 }1597 1598 private boolean jj_3R_24() {1599 if (jj_scan_token(COMMA)) return true;1600 if (jj_3R_42()) return true;1601 if (jj_3R_23()) return true;1602 return false;1603 }1604 1605 private boolean jj_3R_76() {1606 if (jj_scan_token(COMMA)) return true;1607 if (jj_3R_15()) return true;1608 if (jj_3R_16()) return true;1609 return false;1610 }1611 1612 private boolean jj_3R_71() {1613 if (jj_3R_16()) return true;1614 Token xsp;1615 while (true) {1616 xsp = jj_scanpos;1617 if (jj_3R_76()) { jj_scanpos = xsp; break; }1618 }1619 return false;1620 }1621 1622 private boolean jj_3R_14() {1623 if (jj_3R_23()) return true;1624 Token xsp;1625 if (jj_3R_24()) return true;1626 while (true) {1627 xsp = jj_scanpos;1628 if (jj_3R_24()) { jj_scanpos = xsp; break; }1629 }1630 return false;1631 }1632 1633 private boolean jj_3_2() {1634 if (jj_3R_13()) return true;1635 if (jj_scan_token(RSQUARE)) return true;1636 return false;1637 }1638 1639 private boolean jj_3R_43() {1640 1743 if (jj_scan_token(COMMENT_START)) return true; 1641 1744 if (jj_scan_token(COMMENT_END)) return true; … … 1643 1746 } 1644 1747 1645 private boolean jj_3_1() { 1646 if (jj_3R_12()) return true; 1647 if (jj_scan_token(RSQUARE)) return true; 1648 return false; 1649 } 1650 1651 private boolean jj_3R_17() { 1652 if (jj_scan_token(IDENT)) return true; 1653 if (jj_3R_15()) return true; 1654 if (jj_scan_token(LPAR)) return true; 1655 if (jj_3R_15()) return true; 1656 Token xsp; 1657 xsp = jj_scanpos; 1658 if (jj_3R_71()) jj_scanpos = xsp; 1659 if (jj_scan_token(RPAR)) return true; 1748 private boolean jj_3R_40() { 1749 if (jj_scan_token(LESS_EQUAL)) return true; 1750 return false; 1751 } 1752 1753 private boolean jj_3R_39() { 1754 if (jj_scan_token(GREATER)) return true; 1755 return false; 1756 } 1757 1758 private boolean jj_3R_38() { 1759 if (jj_scan_token(GREATER_EQUAL)) return true; 1660 1760 return false; 1661 1761 } … … 1672 1772 private int jj_la; 1673 1773 private int jj_gen; 1674 final private int[] jj_la1 = new int[4 1];1774 final private int[] jj_la1 = new int[45]; 1675 1775 static private int[] jj_la1_0; 1676 1776 static private int[] jj_la1_1; … … 1680 1780 } 1681 1781 private static void jj_la1_init_0() { 1682 jj_la1_0 = new int[] {0xc,0xc,0x12,0x200,0x200,0x200,0x10000000,0x402,0x10000000,0x 402,0x40000000,0x2804000,0x2804000,0x4000000,0x4,0x0,0x4,0x8081011e,0x800000,0x0,0x1000012,0x1c00400,0x3c0000,0x1fc0400,0x800000,0x402,0x2,0x8002000,0x8002000,0x80000000,0x400,0x0,0x800,0x400000,0xa07c0c00,0xa07c0c00,0x8081011e,0x8001011e,0x10000000,0x8081011e,0x8000011e,};1782 jj_la1_0 = new int[] {0xc,0xc,0x12,0x200,0x200,0x200,0x10000000,0x402,0x10000000,0x300000,0x300000,0x402,0x40000000,0x2804000,0x2804000,0x4000000,0x4,0x0,0x4,0x8081011e,0x2000000,0x12,0x800000,0x0,0x1000012,0x1c00400,0x3c0000,0x1fc0400,0x800000,0x402,0x2,0x8002000,0x8002000,0x80000000,0x400,0x0,0x800,0x400000,0xa07c0c00,0xa07c0c00,0x8081011e,0x8001011e,0x10000000,0x8081011e,0x8000011e,}; 1683 1783 } 1684 1784 private static void jj_la1_init_1() { 1685 jj_la1_1 = new int[] {0x0,0x1,0x0,0x0,0x20,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x 1,0x1,0x1,0x0,0x4,0x0,0x18,0x0,0x18,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x7,0x7,0x1,0x0,0x0,0x1,0x0,};1785 jj_la1_1 = new int[] {0x0,0x1,0x0,0x0,0x20,0x20,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x1,0x1,0x0,0x0,0x0,0x4,0x0,0x18,0x0,0x18,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1,0x0,0x0,0x7,0x7,0x1,0x0,0x0,0x1,0x0,}; 1686 1786 } 1687 1787 final private JJCalls[] jj_2_rtns = new JJCalls[5]; … … 1700 1800 jj_ntk = -1; 1701 1801 jj_gen = 0; 1702 for (int i = 0; i < 4 1; i++) jj_la1[i] = -1;1802 for (int i = 0; i < 45; i++) jj_la1[i] = -1; 1703 1803 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1704 1804 } … … 1715 1815 jj_ntk = -1; 1716 1816 jj_gen = 0; 1717 for (int i = 0; i < 4 1; i++) jj_la1[i] = -1;1817 for (int i = 0; i < 45; i++) jj_la1[i] = -1; 1718 1818 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1719 1819 } … … 1726 1826 jj_ntk = -1; 1727 1827 jj_gen = 0; 1728 for (int i = 0; i < 4 1; i++) jj_la1[i] = -1;1828 for (int i = 0; i < 45; i++) jj_la1[i] = -1; 1729 1829 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1730 1830 } … … 1737 1837 jj_ntk = -1; 1738 1838 jj_gen = 0; 1739 for (int i = 0; i < 4 1; i++) jj_la1[i] = -1;1839 for (int i = 0; i < 45; i++) jj_la1[i] = -1; 1740 1840 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1741 1841 } … … 1747 1847 jj_ntk = -1; 1748 1848 jj_gen = 0; 1749 for (int i = 0; i < 4 1; i++) jj_la1[i] = -1;1849 for (int i = 0; i < 45; i++) jj_la1[i] = -1; 1750 1850 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1751 1851 } … … 1757 1857 jj_ntk = -1; 1758 1858 jj_gen = 0; 1759 for (int i = 0; i < 4 1; i++) jj_la1[i] = -1;1859 for (int i = 0; i < 45; i++) jj_la1[i] = -1; 1760 1860 for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls(); 1761 1861 } … … 1874 1974 jj_kind = -1; 1875 1975 } 1876 for (int i = 0; i < 4 1; i++) {1976 for (int i = 0; i < 45; i++) { 1877 1977 if (jj_la1[i] == jj_gen) { 1878 1978 for (int j = 0; j < 32; j++) { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.jj
r3893 r3902 19 19 import org.openstreetmap.josm.gui.mappaint.mapcss.Expression.FunctionExpression; 20 20 import org.openstreetmap.josm.gui.mappaint.mapcss.Expression.LiteralExpression; 21 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.DescendentSelector; 22 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector; 21 23 import org.openstreetmap.josm.tools.Pair; 22 24 … … 229 231 } 230 232 { 231 sel= selector() { selectors.add(sel); } w()233 sel=child_selector() { selectors.add(sel); } 232 234 ( 233 235 <COMMA> w() 234 sel= selector() { selectors.add(sel); } w()236 sel=child_selector() { selectors.add(sel); } 235 237 )* 236 238 decl=declaration() 237 239 { return new MapCSSRule(selectors, decl); } 240 } 241 242 Selector child_selector() : 243 { 244 boolean child = false; 245 Selector sel1, sel2 = null; 246 } 247 { 248 sel1=selector() w() 249 ( 250 ( <GREATER> { child = true; } | <LESS> { child = false; } ) w() 251 sel2=selector() w() 252 )? 253 { return sel2 != null ? new DescendentSelector(sel1, sel2, child) : sel1; } 238 254 } 239 255 … … 251 267 ( ( c=condition() | c=pseudoclass() ) { conditions.add(c); } )* 252 268 ( sub=subpart() )? 253 { return new Selector(base.image, r, conditions, sub); }269 { return new GeneralSelector(base.image, r, conditions, sub); } 254 270 } 255 271 … … 277 293 <LSQUARE> 278 294 ( 279 LOOKAHEAD( 3)295 LOOKAHEAD( simple_key_condition() <RSQUARE> ) 280 296 c=simple_key_condition() <RSQUARE> { return c; } 281 297 | 282 LOOKAHEAD( 5)298 LOOKAHEAD( simple_key_value_condition() <RSQUARE> ) 283 299 c=simple_key_value_condition() <RSQUARE> { return c; } 284 300 | … … 287 303 } 288 304 305 String tag_key() : 306 { 307 String s; 308 Token t; 309 } 310 { 311 s=string() { return s; } 312 | 313 t=<IDENT> { s = t.image; } ( <COLON> t=<IDENT> { s += ':' + t.image; } )* { return s; } 314 } 315 289 316 Condition simple_key_condition() : 290 317 { … … 295 322 { 296 323 ( <EXCLAMATION> { not = true; } )? 297 key= string_or_ident()324 key=tag_key() 298 325 ( <QUESTION> { yes = true; } )? 299 326 { return new Condition.KeyCondition(key, not, yes); } … … 308 335 } 309 336 { 310 key= string_or_ident()337 key=tag_key() 311 338 ( 312 339 ( -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParserTokenManager.java
r3876 r3902 12 12 import org.openstreetmap.josm.gui.mappaint.mapcss.Expression.FunctionExpression; 13 13 import org.openstreetmap.josm.gui.mappaint.mapcss.Expression.LiteralExpression; 14 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.DescendentSelector; 15 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector; 14 16 import org.openstreetmap.josm.tools.Pair; 15 17
Note:
See TracChangeset
for help on using the changeset viewer.