Changeset 30112 in osm for applications/editors/josm/plugins/OpeningHoursEditor/src
- Timestamp:
- 2013-12-07T20:50:29+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser
- Files:
-
- 3 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/parser/OpeningTimeCompiler.jj
r22751 r30112 9 9 timespan ::= [ dayspanlist " " ] daytimespanlist 10 10 11 daytimespanlist ::= 11 daytimespanlist ::= daytimespan [ "," daytimespanlist ] 12 12 daytimespan ::= off | ( daytime ( openend | [ "-" daytime ]) ) 13 daytime ::= 13 daytime ::= (DIGIT DIGIT ":" DIGIT DIGIT ) 14 14 openend ::= PLUS 15 15 off ::= OFF 16 16 17 dayspanlist ::= 18 dayspan ::= 17 dayspanlist ::= dayspan [ "," dayspanlist ] 18 dayspan ::= WEEKDAY [ "-" WEEKDAY ] 19 19 */ 20 20 … … 77 77 { 78 78 if (time.size() == 0) { 79 80 81 82 83 84 85 79 ArrayList<DaySpan> daySpans = new ArrayList<DaySpan>(); 80 daySpans.add(new DaySpan(0,6)); 81 ArrayList<DaytimeSpan> timeSpans = new ArrayList<DaytimeSpan>(); 82 timeSpans.add(new DaytimeSpan(0, 24 * 60)); 83 time.add(new DateTime(daySpans, timeSpans)); 84 } 85 86 86 return time; 87 87 } … … 99 99 list.add(first); 100 100 if(second != null) 101 101 list.addAll(second); 102 102 return list; 103 103 } … … 128 128 list.add(first); 129 129 if(second != null) 130 130 list.addAll(second); 131 131 return list; 132 132 } … … 144 144 { 145 145 if (end < 0) 146 146 end = start; 147 147 else if(end < start) 148 148 throw new SyntaxException(null, usedTokens.lastElement().beginColumn - 1, usedTokens.lastElement().endColumn + 1); 149 149 150 150 return new DaytimeSpan(start, end); … … 167 167 168 168 if (hour > 24) 169 169 throw new SyntaxException(null, th1.beginColumn - 1, th0.endColumn + 1); 170 170 if (minute >= 60 || (hour == 24 && minute != 0)) 171 171 throw new SyntaxException(null, tm1.beginColumn - 1, tm0.endColumn + 1); 172 172 173 173 return hour * 60 + minute; … … 235 235 { 236 236 if(end < 0) 237 237 end = start; 238 238 else if(end < start) 239 239 throw new SyntaxException(null, usedTokens.lastElement().beginColumn - 1, usedTokens.lastElement().endColumn + 1); 240 240 241 241 return new DaySpan(start, end); … … 253 253 for (int i = 0; i < WEEKDAYS.length; ++i) 254 254 if (WEEKDAYS[i].equals(t.image)) 255 256 255 return i; 256 257 257 throw new SyntaxException(null, t.beginColumn - 1, t.endColumn + 1); 258 258 }
Note:
See TracChangeset
for help on using the changeset viewer.