Ignore:
Timestamp:
2013-12-07T20:50:29+01:00 (11 years ago)
Author:
donvip
Message:

[josm_openinghours] remove generated code from SVN, use JOSM's JavaCC

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  
    99timespan ::= [ dayspanlist " " ] daytimespanlist
    1010
    11 daytimespanlist ::=     daytimespan [ "," daytimespanlist ]
     11daytimespanlist ::= daytimespan [ "," daytimespanlist ]
    1212daytimespan ::= off | ( daytime ( openend |  [ "-" daytime ]) )
    13 daytime ::=     (DIGIT DIGIT ":" DIGIT DIGIT )
     13daytime ::= (DIGIT DIGIT ":" DIGIT DIGIT )
    1414openend ::= PLUS
    1515off ::= OFF
    1616
    17 dayspanlist ::= dayspan [ "," dayspanlist ]
    18 dayspan ::=     WEEKDAY [ "-" WEEKDAY ]
     17dayspanlist ::= dayspan [ "," dayspanlist ]
     18dayspan ::= WEEKDAY [ "-" WEEKDAY ]
    1919*/
    2020
     
    7777  {
    7878    if (time.size() == 0) {
    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        
     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       
    8686    return time;
    8787  }
     
    9999    list.add(first);
    100100    if(second != null)
    101         list.addAll(second);
     101        list.addAll(second);
    102102    return list;
    103103  }
     
    128128    list.add(first);
    129129    if(second != null)
    130         list.addAll(second);
     130        list.addAll(second);
    131131    return list;
    132132  }
     
    144144  {
    145145    if (end < 0)
    146         end = start;
     146        end = start;
    147147    else if(end < start)
    148         throw new SyntaxException(null, usedTokens.lastElement().beginColumn - 1, usedTokens.lastElement().endColumn + 1);
     148        throw new SyntaxException(null, usedTokens.lastElement().beginColumn - 1, usedTokens.lastElement().endColumn + 1);
    149149   
    150150    return new DaytimeSpan(start, end);
     
    167167
    168168    if (hour > 24)
    169         throw new SyntaxException(null, th1.beginColumn - 1, th0.endColumn + 1);
     169        throw new SyntaxException(null, th1.beginColumn - 1, th0.endColumn + 1);
    170170    if (minute >= 60 || (hour == 24 && minute != 0))
    171         throw new SyntaxException(null, tm1.beginColumn - 1, tm0.endColumn + 1);
     171        throw new SyntaxException(null, tm1.beginColumn - 1, tm0.endColumn + 1);
    172172
    173173    return hour * 60 + minute;
     
    235235  {
    236236    if(end < 0)
    237         end = start;
     237        end = start;
    238238    else if(end < start)
    239         throw new SyntaxException(null, usedTokens.lastElement().beginColumn - 1, usedTokens.lastElement().endColumn + 1);
     239        throw new SyntaxException(null, usedTokens.lastElement().beginColumn - 1, usedTokens.lastElement().endColumn + 1);
    240240   
    241241    return new DaySpan(start, end);
     
    253253    for (int i = 0; i < WEEKDAYS.length; ++i)
    254254      if (WEEKDAYS[i].equals(t.image))
    255         return i;
    256        
     255        return i;
     256       
    257257    throw new SyntaxException(null, t.beginColumn - 1, t.endColumn + 1);
    258258  }
Note: See TracChangeset for help on using the changeset viewer.