Changeset 7057 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
- Timestamp:
- 2014-05-04T12:55:06+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj
r7056 r7057 18 18 import org.openstreetmap.josm.gui.mappaint.mapcss.Instruction; 19 19 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule; 20 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule.Declaration;21 20 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 22 21 import org.openstreetmap.josm.gui.mappaint.mapcss.Selector; … … 470 469 void sheet(MapCSSStyleSource sheet): 471 470 { 471 MapCSSRule r; 472 472 } 473 473 { … … 476 476 ( 477 477 try { 478 r ule()w()478 r=rule() { if (r != null) { sheet.rules.add(r); } } w() 479 479 } catch (MapCSSException mex) { 480 480 error_skipto(RBRACE, mex); … … 488 488 } 489 489 490 voidrule():490 MapCSSRule rule(): 491 491 { 492 492 List<Selector> selectors = new ArrayList<Selector>(); 493 493 Selector sel; 494 Declarationdecl;494 List<Instruction> decl; 495 495 } 496 496 { … … 501 501 )* 502 502 decl=declaration() 503 { 504 for (Selector s : selectors) { 505 sheet.rules.add(new MapCSSRule(s, decl)); 506 } 507 } 503 { return new MapCSSRule(selectors, decl); } 508 504 } 509 505 … … 711 707 } 712 708 713 Declarationdeclaration() :709 List<Instruction> declaration() : 714 710 { 715 711 List<Instruction> ins = new ArrayList<Instruction>(); … … 727 723 ( <EQUAL> val=expression() )? 728 724 { ins.add(new Instruction.AssignmentInstruction(key.image, val == null ? true : val, true)); } 729 ( <RBRACE> { return new Declaration(ins); } | <SEMICOLON> w() )725 ( <RBRACE> { return ins; } | <SEMICOLON> w() ) 730 726 ) 731 727 | … … 736 732 { ins.add(new Instruction.AssignmentInstruction(key.image, val, false)); } 737 733 w() 738 ( <RBRACE> { return new Declaration(ins); } | <SEMICOLON> w() )734 ( <RBRACE> { return ins; } | <SEMICOLON> w() ) 739 735 | 740 736 LOOKAHEAD( expression() ( <SEMICOLON> | <RBRACE> ) ) 741 737 val=expression() 742 738 { ins.add(new Instruction.AssignmentInstruction(key.image, val, false)); } 743 ( <RBRACE> { return new Declaration(ins); } | <SEMICOLON> w() )739 ( <RBRACE> { return ins; } | <SEMICOLON> w() ) 744 740 | 745 741 val=readRaw() w() { ins.add(new Instruction.AssignmentInstruction(key.image, val, false)); } … … 747 743 )* 748 744 <RBRACE> 749 { return new Declaration(ins); }745 { return ins; } 750 746 } 751 747
Note:
See TracChangeset
for help on using the changeset viewer.
