Changeset 10147 for trunk/PS-IPP-Metadata-Config/config_grammar.txt
- Timestamp:
- Nov 22, 2006, 1:54:50 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-Metadata-Config/config_grammar.txt (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-Metadata-Config/config_grammar.txt
r9849 r10147 1 1 # Copyright (c) 2005 Joshua Hoblitt 2 2 # 3 # $Id: config_grammar.txt,v 1. 8 2006-11-04 01:25:32jhoblitt Exp $3 # $Id: config_grammar.txt,v 1.9 2006-11-22 23:54:50 jhoblitt Exp $ 4 4 5 5 { … … 7 7 8 8 use Carp qw( carp ); 9 use DateTime::Format::ISO8601; 9 10 10 11 our @scope_stack; … … 29 30 | typedef_declare 30 31 | multi_declare 31 | time32 32 | <error:unmatched statement: $text> 33 33 … … 131 131 <skip:'[ \t\r]*'> comment(?) "\n" 132 132 {{ 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 }156 133 157 134 typedef_declare: … … 261 238 | 'STRING' 262 239 | vtype 240 | 'UTC' 241 | 'UT1' 242 | 'TAI' 243 | 'TT' 263 244 264 245 vtype: … … 276 257 | 'C64' 277 258 | 'BOOL' 278 279 ttype:280 'UTC'281 | 'UT1'282 | 'TAI'283 | 'TT'284 259 285 260 S8: int … … 303 278 { [ map { @$_ } @{$item[1]} ] } 304 279 305 tvalue:306 iso8601307 | epoch308 309 280 # backtracking optimization 310 281 _vvalue: … … 369 340 UTC: 370 341 iso8601 371 | utc_epoch372 342 | NULL 373 343 374 344 UT1: 375 345 iso8601 376 | epoch377 346 | NULL 378 347 379 348 TAI: 380 349 iso8601 381 | epoch382 350 | NULL 383 351 384 352 TT: 385 353 iso8601 386 | epoch387 354 | NULL 388 355 … … 392 359 { DateTime::Format::ISO8601->parse_datetime( $item[1] ) } 393 360 394 utc_epoch:395 / (-?\d{1,19}) \s*,\s* (\d{1,9}) (?:\s*,\s* (\d))? /x396 {{397 sec => $1,398 nsec => $2,399 leapsecond => $3,400 }}401 402 epoch:403 / (-?\d{1,19}) \s*,\s* (\d{1,9}) /x404 {{405 sec => $1,406 nsec => $2,407 }}408 361 NULL: 409 362 /NULL/
Note:
See TracChangeset
for help on using the changeset viewer.
