IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 22, 2006, 1:54:50 PM (20 years ago)
Author:
jhoblitt
Message:

merge the 'time' production into the 'scalar' production for a ~20% speed
boost
remove support for "epoch format" times

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Metadata-Config/config_grammar.txt

    r9849 r10147  
    11# Copyright (c) 2005  Joshua Hoblitt
    22#
    3 # $Id: config_grammar.txt,v 1.8 2006-11-04 01:25:32 jhoblitt Exp $
     3# $Id: config_grammar.txt,v 1.9 2006-11-22 23:54:50 jhoblitt Exp $
    44
    55{
     
    77
    88    use Carp qw( carp );
     9    use DateTime::Format::ISO8601;
    910
    1011    our @scope_stack;
     
    2930    | typedef_declare
    3031    | multi_declare
    31     | time
    3232    | <error:unmatched statement: $text>
    3333
     
    131131    <skip:'[ \t\r]*'> comment(?) "\n"
    132132        {{ class   => 'comment_line' }}
    133 
    134 time:
    135     <skip:'[ \t\r]*'> name ttype <matchrule:$item{ttype}> comment(?) "\n"
    136         {
    137             use DateTime::Format::ISO8601;
    138 
    139             $return = {
    140                 class   => 'time',
    141                 name    => $item{name},
    142                 type    => $item{ttype},
    143                 value   => $item[4],
    144             };
    145 
    146             $return->{comment} = $item{'comment(?)'}[0]
    147                 if $item{'comment(?)'}[0];
    148 
    149             if ( defined $thisparser->{local}{name}{ $item{name} } ) {
    150                 $return->{multi}++
    151                     if $thisparser->{local}{name}{ $item{name} } =~ /MULTI/;
    152             } else {
    153                 $thisparser->{local}{name}{ $item{name} }++;
    154             }
    155         }
    156133
    157134typedef_declare:
     
    261238    | 'STRING'
    262239    | vtype
     240    | 'UTC'
     241    | 'UT1'
     242    | 'TAI'
     243    | 'TT'
    263244
    264245vtype:
     
    276257    | 'C64'
    277258    | 'BOOL'
    278 
    279 ttype:
    280     'UTC'
    281     | 'UT1'
    282     | 'TAI'
    283     | 'TT'
    284259
    285260S8: int
     
    303278        { [ map { @$_ } @{$item[1]} ] }
    304279
    305 tvalue:
    306     iso8601
    307     | epoch
    308 
    309280# backtracking optimization
    310281_vvalue:
     
    369340UTC:
    370341    iso8601
    371     | utc_epoch
    372342    | NULL
    373343
    374344UT1:
    375345    iso8601
    376     | epoch
    377346    | NULL
    378347
    379348TAI:
    380349    iso8601
    381     | epoch
    382350    | NULL
    383351
    384352TT:
    385353    iso8601
    386     | epoch
    387354    | NULL
    388355
     
    392359        { DateTime::Format::ISO8601->parse_datetime( $item[1] ) }
    393360
    394 utc_epoch:
    395     / (-?\d{1,19}) \s*,\s* (\d{1,9}) (?:\s*,\s* (\d))? /x
    396         {{
    397             sec         => $1,
    398             nsec        => $2,
    399             leapsecond  => $3,
    400         }}
    401 
    402 epoch:
    403     / (-?\d{1,19}) \s*,\s* (\d{1,9}) /x
    404         {{
    405             sec     => $1,
    406             nsec    => $2,
    407         }}
    408361NULL:
    409362    /NULL/
Note: See TracChangeset for help on using the changeset viewer.