IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 10189


Ignore:
Timestamp:
Nov 24, 2006, 3:54:46 PM (20 years ago)
Author:
jhoblitt
Message:

merge metadata_name & metadata_end into metdata
merge empty metdata case into main metadata production
error check vector

Location:
trunk/PS-IPP-Metadata-Config
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PS-IPP-Metadata-Config/Changes

    r10187 r10189  
    66    - remove support for "epoch format" times
    77    - additional metadata structure tests
     8    - merge metadata_name & metadata_end into metdata
     9    - merge empty metdata case into main metadata production
     10    - error check vector
    811
    9120.09 Thu Oct 26 16:16:28 HST 2006
  • trunk/PS-IPP-Metadata-Config/config_grammar.txt

    r10148 r10189  
    11# Copyright (c) 2005  Joshua Hoblitt
    22#
    3 # $Id: config_grammar.txt,v 1.10 2006-11-22 23:57:10 jhoblitt Exp $
     3# $Id: config_grammar.txt,v 1.11 2006-11-25 01:53:26 jhoblitt Exp $
    44
    55{
     
    1919        {
    2020            $thisparser->{local} = pop @scope_stack;
    21             [ grep $_->{class} !~ /comment_line/, @{$item[1]} ];
     21            [ grep $_->{class} !~ /comment_line/, @{$item{'statement(s)'}} ];
    2222        }
    2323
     
    5757
    5858vector:
    59      <skip:'[ \t\r]*'> vname vtype vvalue[ $item{vtype} ] comment(?) "\n"
     59     <skip:'[ \t\r]*'> vname <commit> vtype vvalue[ $item{vtype} ] comment(?) "\n"
    6060        {
    6161            $thisparser->{local}{name}{ $item{vname} }++
     
    7373                if $item{'comment(?)'}[0];
    7474        }
     75    | <error?:redefinition of MULTI> <reject>
    7576
    7677multi_declare:
     
    8990# metadatas
    9091metadata:
    91     metadata_name
    92     { push @scope_stack, $thisparser->{local}; $thisparser->{local} = {} }
    93     grammar
    94     metadata_end
    95         {
    96             my $text = $item[2];
    97            
    98             if ( defined( $text ) ) {
     92    <skip:'[ \t\r]*'> name /METADATA/i comment(?) "\n"
     93    <commit>
     94    { push @scope_stack, $thisparser->{local}; $thisparser->{local} = {}; 1; }
     95    grammar(?)
     96    <skip:'[ \t\r]*'> /END/i comment(?) "\n"
     97
     98        {
     99            if (defined(@{$item{'grammar(?)'}})) {
    99100                $return = {
    100101                    class   => 'metadata',
    101                     name    => $item{metadata_name},
    102                     value   => $item{grammar},
     102                    name    => $item{name},
     103                    value   => @{$item{'grammar(?)'}},
    103104                };
    104105            } else {
    105                 $return = undef;
    106             }
    107 
    108             if ( defined $thisparser->{local}{name}{ $item{metadata_name} } ) {
     106                $return = {
     107                    class   => 'metadata',
     108                    name    => $item{name},
     109                    value   => [],
     110                };
     111            }
     112
     113            $return->{comment} = $item[4][0]
     114                if defined $item[4][0];
     115
     116            if ( defined $thisparser->{local}{name}{ $item{name} } ) {
    109117                $return->{multi}++
    110                     if $thisparser->{local}{name}{ $item{metadata_name} } =~ /MULTI/;
    111             } else {
    112                 $thisparser->{local}{name}{ $item{metadata_name} }++;
    113             }
    114         }
    115     | metadata_name <commit> comment_line(s?) metadata_end
    116         {
    117             $return = {
    118                 class   => 'metadata',
    119                 name    => $item{metadata_name},
    120                 value   => [],
    121             };
    122 
    123             if ( defined $thisparser->{local}{name}{ $item{metadata_name} } ) {
    124                 $return->{multi}++
    125                     if $thisparser->{local}{name}{ $item{metadata_name} } =~ /MULTI/;
    126             } else {
    127                 $thisparser->{local}{name}{ $item{metadata_name} }++;
     118                    if $thisparser->{local}{name}{ $item{name} } =~ /MULTI/;
     119            } else {
     120                $thisparser->{local}{name}{ $item{name} }++;
    128121            }
    129122        }
     
    208201            }
    209202        }
    210 
    211 metadata_name:
    212     <skip:'[ \t\r]*'> name /METADATA/i comment(?) "\n"
    213         { $item{name} }
    214    
    215 metadata_end:
    216      <skip:'[ \t\r]*'> /END/i comment(?) "\n"
    217203
    218204comment:
Note: See TracChangeset for help on using the changeset viewer.