Changeset 261


Ignore:
Timestamp:
Sep 14, 2009, 5:12:29 PM (10 years ago)
Author:
Tatsukawa, Akimichi
Message:

renamed scanner.rb to adl_scanner.rb

Location:
ruby/trunk/lib/adl_parser
Files:
10 edited
1 moved

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/adl_parser/Rakefile

    r164 r261  
    11require 'rubygems'
    2 #Gem::manage_gems
    32require 'rake'
    43require 'rake/testtask'
     
    2625  end
    2726end
    28 
    29 
    3027
    3128desc "Generate TAGS by rtags."
     
    8582  candidates = Dir.glob("{bin,docs,lib,test,ext}/**/*")
    8683  s.files = candidates.delete_if do |item|
    87     item.include?(".svn") || item.include?("rdoc")
     84    item.include?(".svn") || item.include?("rdoc") || item.include?("log")
    8885  end
    8986  s.files = FileList['README', 'COPYING', 'Rakefile']
     
    9289  s.extra_rdoc_files = ["README"]
    9390  s.add_dependency("yaparc", ">= 0.2.3")
    94   s.add_dependency("openehr_models", ">= 0.0.1")
     91  s.add_dependency("openehr_models", ">= 0.0.3")
    9592end
    9693
     
    105102
    106103
    107 
    108 
    109104### Local Variables:
    110105### mode:ruby
  • ruby/trunk/lib/adl_parser/lib/adl_parser.rb

    r49 r261  
    88$:.unshift File.join(File.dirname(__FILE__))
    99require 'logger'
     10require 'adl_scanner.rb'
    1011
    1112module OpenEHR
     
    1819    LOG.level = Logger::WARN
    1920  end
    20  
    21  
    2221
    2322
     
    2524    autoload :Parser, "parser.rb"
    2625    autoload :Validator, "validator.rb"
    27    
     26
    2827    module Scanner
    2928      module DADL
    30         autoload :RootScanner, "scanner.rb"
     29        autoload :RootScanner, "adl_scanner.rb"
     30      end
     31      module CADL
     32        autoload :RootScanner, "adl_scanner.rb"
    3133      end
    3234    end
  • ruby/trunk/lib/adl_parser/lib/adl_scanner.rb

    r258 r261  
    88    module Scanner
    99      module Common
     10        class START_TERM_CODE_CONSTRAINT
     11          include Yaparc::Parsable
     12          def initialize
     13            @parser = lambda do |input|
     14              Yaparc::Apply.new(Yaparc::Regex.new(/[ \t\n]*\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/)) do |match|
     15                OpenEHR::LOG.info("START_TERM_CODE_CONSTRAINT: #{match}")
     16                [:START_TERM_CODE_CONSTRAINT, match]
     17              end
     18            end
     19          end
     20        end
     21
     22        # /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/  #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
    1023        class V_QUALIFIED_TERM_CODE_REF
    1124          include Yaparc::Parsable
     
    1326            @parser = lambda do |input|
    1427              Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/)) do |match|
    15                 OpenEHR::LOG.debug("V_QUALIFIED_TERM_CODE_REF: #{match}")
     28                OpenEHR::LOG.info("V_QUALIFIED_TERM_CODE_REF: #{match}")
    1629                [:V_QUALIFIED_TERM_CODE_REF, match]
    1730              end
     
    2538            @parser = lambda do |input|
    2639              Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/)) do |match|
    27                 OpenEHR::LOG.debug("V_TERM_CODE_REF: #{match}")
     40                OpenEHR::LOG.info("V_TERM_CODE_REF: #{match}")
    2841                [:V_LOCAL_TERM_CODE_REF, match]
    2942              end
     
    3750            @parser = lambda do |input|
    3851              Yaparc::Apply.new(Yaparc::Regex.new(/\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/)) do |match|
    39                 OpenEHR::LOG.debug("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
     52                OpenEHR::LOG.info("ERR_V_QUALIFIED_TERM_CODE_REF: #{match}")
    4053                [:ERR_V_QUALIFIED_TERM_CODE_REF, match]
    4154              end
     
    4962            @parser = lambda do |input|
    5063              Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*/)) do |match|
    51                 OpenEHR::LOG.debug("V_TYPE_IDENTIFIER: #{match}")
     64                OpenEHR::LOG.info("V_TYPE_IDENTIFIER: #{match}")
    5265                [:V_TYPE_IDENTIFIER, match]
    5366              end
     
    6174            @parser = lambda do |input|
    6275              Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/)) do |match|
    63                 OpenEHR::LOG.debug("V_GENERIC_TYPE_IDENTIFIER: #{match}")
     76                OpenEHR::LOG.info("V_GENERIC_TYPE_IDENTIFIER: #{match}")
    6477                [:V_GENERIC_TYPE_IDENTIFIER, match]
    6578              end
     
    7487            @parser = lambda do |input|
    7588              Yaparc::Apply.new(Yaparc::Regex.new(/\Aa[ct][0-9.]+/)) do |match|
    76                 OpenEHR::LOG.debug("V_LOCAL_CODE: #{match}")
     89                OpenEHR::LOG.info("V_LOCAL_CODE: #{match}")
    7790                [:V_LOCAL_CODE, match]
    7891              end
     
    8699            @parser = lambda do |input|
    87100              Yaparc::Apply.new(Yaparc::Regex.new(/\A"([^"]*)"/m)) do |match|
    88                 OpenEHR::LOG.debug("V_STRING: #{match}")
     101                OpenEHR::LOG.info("V_STRING: #{match}")
    89102                [:V_STRING, match]
    90103              end
     
    98111            @parser = lambda do |input|
    99112              Yaparc::Apply.new(Yaparc::Regex.new(/\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+/)) do |match|
    100                 OpenEHR::LOG.debug("V_REAL: #{match}")
     113                OpenEHR::LOG.info("V_REAL: #{match}")
    101114                [:V_REAL, match]
    102115              end
     
    113126                                Yaparc::Alt.new(Yaparc::Regex.new(/\AP([0-9]+|[yY])?([0-9]+|[mM])?([0-9]+|[wW])?([0-9]+|[dD])?T([0-9]+|[hH])?([0-9]+|[mM])?([0-9]+|[sS])?/),
    114127                                                Yaparc::Regex.new(/\AP([0-9]+|[yY])?([0-9]+|[mM])?([0-9]+|[wW])?([0-9]+|[dD])?/))) do |match|
    115                 OpenEHR::LOG.debug("V_ISO8601_DURATION: #{match}")
     128                OpenEHR::LOG.info("V_ISO8601_DURATION: #{match}")
    116129                [:V_ISO8601_DURATION, match]
    117130              end
     
    129142          'infinity' => :SYM_INFINITY # [Ii][Nn][Ff][Ii][Nn][Ii][Tt][Yy] -- -> SYM_INFINITY
    130143        }
    131 
     144        #
     145        # DADL::RootScanner
     146        #
    132147        class RootScanner
    133148          include Yaparc::Parsable
     
    143158                              OpenEHR::ADL::Scanner::Common::V_LOCAL_CODE.new,
    144159                              OpenEHR::ADL::Scanner::Common::V_REAL.new,
    145                               OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new
     160                              OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
     161                              #OpenEHR::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
    146162                              )
    147163            end
    148164          end
    149165        end
    150 =begin <DADL::Reserved class>
    151 =end
     166
     167        #  <DADL::Reserved class>
    152168        class Reserved
    153169          include Yaparc::Parsable
     
    161177              end
    162178              Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
    163                                 OpenEHR::LOG.debug("Reserved: #{match}")
     179                                OpenEHR::LOG.info("Reserved: #{match}")
    164180                                [OpenEHR::ADL::Scanner::DADL::RESERVED[match], OpenEHR::ADL::Scanner::DADL::RESERVED[match]]
    165181                              end,
    166182                              Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
    167                                 OpenEHR::LOG.debug("V_ATTRIBUTE_IDENTIFIER: #{match}")
     183                                OpenEHR::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
    168184                                [:V_ATTRIBUTE_IDENTIFIER, match]
    169185                              end)
     
    171187          end
    172188        end
    173 
    174 
    175 
    176189      end # of DADL
    177190
     
    213226            @parser = lambda do |input|
    214227              Yaparc::Apply.new(Yaparc::Regex.new(/\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X][T\t][hH?X][hH?X]:[mM?X][mM?X]:[sS?X][sS?X]/)) do |match|
    215                 OpenEHR::LOG.debug("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
     228                OpenEHR::LOG.info("V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN: #{match}")
    216229                [:V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, match]
    217230              end
     
    226239            @parser = lambda do |input|
    227240              Yaparc::Apply.new(Yaparc::Regex.new(/\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/)) do |match|
    228                 OpenEHR::LOG.debug("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
     241                OpenEHR::LOG.info("V_ISO8601_DATE_CONSTRAINT_PATTERN: #{match}")
    229242                [:V_ISO8601_DATE_CONSTRAINT_PATTERN, match]
    230243              end
     
    239252            @parser = lambda do |input|
    240253              Yaparc::Apply.new(Yaparc::Regex.new(/\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/)) do |match|
    241                 OpenEHR::LOG.debug("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
     254                OpenEHR::LOG.info("V_ISO8601_TIME_CONSTRAINT_PATTERN: #{match}")
    242255                [:V_ISO8601_TIME_CONSTRAINT_PATTERN, match]
    243256              end
     
    253266              Yaparc::Apply.new(Yaparc::Alt.new(Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?T[hH]?[mM]?[sS]?/),
    254267                                                Yaparc::Regex.new(/\AP[yY]?[mM]?[wW]?[dD]?/))) do |match|
    255                 OpenEHR::LOG.debug("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
     268                OpenEHR::LOG.info("V_ISO8601_DURATION_CONSTRAINT_PATTERN: #{match}")
    256269                [:V_ISO8601_DURATION_CONSTRAINT_PATTERN, match]
    257270              end
     
    266279            @parser = lambda do |input|
    267280              Yaparc::Apply.new(Yaparc::Regex.new(/\A[A-Z][a-zA-Z0-9_]*[ \n]*\</)) do |match|
    268                 OpenEHR::LOG.debug("V_C_DOMAIN_TYPE: #{match}")
     281                OpenEHR::LOG.info("V_C_DOMAIN_TYPE: #{match}")
    269282                [:START_V_C_DOMAIN_TYPE_BLOCK, match]
    270283              end
     
    273286        end
    274287
     288        #
     289        # CADL::RootScanner
     290        #
    275291        class RootScanner
    276292          include Yaparc::Parsable
     
    292308                              OpenEHR::ADL::Scanner::Common::V_LOCAL_CODE.new,
    293309                              OpenEHR::ADL::Scanner::Common::V_REAL.new,
    294                               OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new
     310                              OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new#,
     311                              #OpenEHR::ADL::Scanner::Common::START_TERM_CODE_CONSTRAINT.new
    295312                              )
    296313            end
     
    310327              end
    311328              Yaparc::Alt.new(Yaparc::Apply.new(Yaparc::Alt.new(*reserved_parsers)) do |match|
    312                                 OpenEHR::LOG.debug("Reserved: #{match}")
     329                                OpenEHR::LOG.info("Reserved: #{match}")
    313330                                [OpenEHR::ADL::Scanner::CADL::RESERVED[match], OpenEHR::ADL::Scanner::CADL::RESERVED[match]]
    314331                              end,
    315332                              Yaparc::Apply.new(Yaparc::Regex.new(/\A[a-z][a-zA-Z0-9_]*/)) do |match|
    316                                 OpenEHR::LOG.debug("V_ATTRIBUTE_IDENTIFIER: #{match}")
     333                                OpenEHR::LOG.info("V_ATTRIBUTE_IDENTIFIER: #{match}")
    317334                                [:V_ATTRIBUTE_IDENTIFIER, match]
    318335                              end)
  • ruby/trunk/lib/adl_parser/lib/parser.rb

    r258 r261  
    2424    class Parser < Racc::Parser
    2525
    26 module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1188)
     26module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1206)
    2727
    2828def assert_at(file,line, message = "")
     
    3333
    3434if $DEBUG
    35   @@log = Logger.new('log/parser.log','daily')
    36   @@log.level = Logger::INFO
     35  @@logger = Logger.new('log/parser.log','daily')
     36  @@logger.level = Logger::INFO
    3737else
    38   @@log = Logger.new(STDOUT)
    39   @@log.level = Logger::WARN
     38  @@logger = Logger.new(STDOUT)
     39  @@logger.level = Logger::WARN
    4040end
    4141
     
    102102
    103103def scan
     104  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan at #{@filename}:#{@lineno}:")
    104105  until @data.nil?  do
    105106    case @adl_type.last
     
    120121        yield sym, val
    121122      end
     123    when :term_constraint
     124      @@logger.debug("#{__FILE__}:#{__LINE__}: scan: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     125      @data = scan_term_constraint(@data) do |sym, val|
     126        yield sym, val
     127      end
    122128    else
    123129      raise
     
    130136
    131137def scan_adl(data)
     138  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_adl at #{@filename}:#{@lineno}: data = #{data.inspect}")
    132139  until data.nil?  do
    133140    case @adl_type.last
    134141    when :adl
    135 #      puts "Entering scan_adl"
    136142      case data
    137143      when /\A\n/ # carriage return
     
    142148      when /\A--.*\n/ # single line comment
    143149        @lineno += 1
    144         @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     150        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    145151        ;
    146152      when /\Adescription/   # description
     
    148154      when /\Adefinition/   # definition
    149155        yield :SYM_DEFINITION, :SYM_DEFINITION
    150 #        @adl_type.push(:cadl)
    151156        ###----------/* symbols */ -------------------------------------------------
    152157      when /\A[A-Z][a-zA-Z0-9_]*/
    153158        yield :V_TYPE_IDENTIFIER, $&
    154159#      when /\A[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z0-9]+/   #V_ARCHETYPE_ID
    155       when /\A(\w+)-(\w+)-(\w+)\.(\w+)(-\w+)?\.(v[0-9]+)/   #V_ARCHETYPE_ID
     160      when /\A(\w+)-(\w+)-(\w+)\.(\w+)(-\w+)?\.(v\w+)/   #V_ARCHETYPE_ID
    156161        object_id, rm_originator, rm_name, rm_entity, concept_name, specialisation, version_id = $&, $1, $2, $3, $4, $5, $6
    157162        archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)
     
    162167        word = $&
    163168        if @@adl_reserved[word]
    164           @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: @@adl_reserved = #{@@adl_reserved[word]} at #{@filename}:#{@lineno}")
     169          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: @@adl_reserved = #{@@adl_reserved[word]} at #{@filename}:#{@lineno}")
    165170          yield @@adl_reserved[word], @@adl_reserved[word]
    166171        elsif #/\A[A-Z][a-zA-Z0-9_]*/
    167           @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: V_ATTRIBUTE_IDENTIFIER = #{$&} at #{@filename}:#{@lineno}")
     172          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: V_ATTRIBUTE_IDENTIFIER = #{$&} at #{@filename}:#{@lineno}")
    168173          yield :V_ATTRIBUTE_IDENTIFIER, $&
    169174        end
     
    188193        else
    189194          adl_type = @adl_type.pop
    190 #          puts "Escaping #{adl_type}"
    191195          assert_at(__FILE__,__LINE__){adl_type == :dadl}
    192196          yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
     
    194198      when /\A\{/   # {
    195199        @adl_type.push(:cadl)
    196         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
     200        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
    197201        yield :SYM_START_CBLOCK, :SYM_START_CBLOCK
    198202      when /\A\}/   # }
     
    200204#        puts "Escaping #{adl_type}"
    201205        assert_at(__FILE__,__LINE__){adl_type == :cadl}
    202         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
     206        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
    203207        yield :SYM_END_CBLOCK, $&
    204208      when /\A\-/   # -
     
    285289      data = $' # variable $' receives the string after the match
    286290    when :dadl
    287 #      puts "Entering scan_dadl"
    288291      data = scan_dadl(data) do |sym, val|
    289292        yield sym, val
    290293      end
    291294    when :cadl
    292 #      puts "Entering scan_cadl"
    293295      data = scan_cadl(data) do |sym, val|
    294296        yield sym, val
    295297      end
    296298    when :regexp
    297 #      puts "Entering scan_regexp"
    298299      data = scan_regexp(data) do |sym, val|
    299300        yield sym, val
    300301      end
    301302    when :term_constraint
    302 #      puts "Entering scan_term_constraint"
     303      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     304
    303305      data = scan_term_constraint(data) do |sym, val|
    304306        yield sym, val
     
    312314
    313315def scan_cadl(data)
     316  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_cadl at #{@filename}:#{@lineno}: data = #{data.inspect}")
    314317  until data.nil?  do
    315318    case @adl_type.last
    316319    when :cadl
    317 #      puts "Entering scan_cadl"
    318320      case scanned = @@cadl_scanner.parse(data)
    319321      when Yaparc::Result::OK
     
    336338      when /\A--.*\n/ # single line comment
    337339        @lineno += 1
    338         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     340        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    339341        ;
    340342        ###----------/* symbols */ -------------------------------------------------
     
    404406      when /\A\{/   # {
    405407        @adl_type.push(:cadl)
    406         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
     408        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
    407409        yield :SYM_START_CBLOCK, :SYM_START_CBLOCK
    408410      when /\A\}/   # }
     
    410412#        puts "Escaping #{adl_type}"
    411413        assert_at(__FILE__,__LINE__){adl_type == :cadl}
    412         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
     414        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
    413415        yield :SYM_END_CBLOCK, :SYM_END_CBLOCK
    414416      when /\A\$/   # $
     
    419421        yield :Question_mark_code, :Question_mark_code
    420422      when /\A\|/   # |
    421         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
     423        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
    422424        if @in_interval
    423425          @in_interval = false
     
    426428          @in_interval = true
    427429        end
    428         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
     430        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
    429431        yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM
    430432
    431       when /\A\[[a-zA-Z0-9._\-]+::[a-zA-Z0-9._\-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
     433      when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/  #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
     434#      when /\A\[[a-zA-Z0-9._\-]+::[a-zA-Z0-9._\-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
    432435        yield :V_QUALIFIED_TERM_CODE_REF, $&
    433436      when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/   #ERR_V_QUALIFIED_TERM_CODE_REF
    434437        yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&
    435       when /\A\[([a-zA-Z0-9()._\-]+::[a-zA-Z0-9._\_-]+)\]/
    436         yield :V_TERM_CODE_CONSTRAINT, :V_TERM_CODE_CONSTRAINT
    437       when /\A\[[a-zA-Z0-9\(\)\._\-]+::[ \t\n]*/
     438      when /\A\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/
    438439        @adl_type.push(:term_constraint)
    439         yield :START_TERM_CODE_CONSTRAINT, $&
     440        yield :START_TERM_CODE_CONSTRAINT, $1
    440441      when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/   #V_LOCAL_TERM_CODE_REF
    441442        yield :V_LOCAL_TERM_CODE_REF, $&
     
    457458          yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]
    458459        else
    459           @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}:#{@lineno}")
     460          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}:#{@lineno}")
    460461          yield :V_ATTRIBUTE_IDENTIFIER, word #V_ATTRIBUTE_IDENTIFIER /\A[a-z][a-zA-Z0-9_]*/
    461462        end
     
    493494      data = $' # variable $' receives the string after the match
    494495    when :adl
    495 #      puts "Entering scan_adl"
    496496      data = scan_adl(data) do |sym, val|
    497497        yield sym, val
    498498      end
    499499    when :dadl
    500 #      puts "Entering scan_dadl"
    501500      data = scan_dadl(data) do |sym, val|
    502501        yield sym, val
    503502      end
    504503    when :regexp
    505 #      puts "Entering scan_regexp"
    506504      data = scan_regexp(data) do |sym, val|
    507505        yield sym, val
    508506      end
    509507    when :term_constraint
    510 #      puts "Entering scan_term_constraint"
     508      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     509     
    511510      data = scan_term_constraint(data) do |sym, val|
    512511        yield sym, val
     
    519518
    520519def scan_dadl(data)
     520  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_dadl at #{@filename}:#{@lineno}: data = #{data.inspect}")
    521521  until data.nil?  do
    522522    case @adl_type.last
    523523    when :dadl
    524 #      puts "Entering scan_dadl"
    525524      case scanned = @@dadl_scanner.parse(data)
    526525      when Yaparc::Result::OK
     
    538537      when /\A--.*\n/ # single line comment
    539538        @lineno += 1
    540         @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     539        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    541540        ;
    542541        ###----------/* symbols */ -------------------------------------------------
     
    569568        elsif @in_c_domain_type == false
    570569          adl_type = @adl_type.pop
    571 #          puts "Escaping #{adl_type}"
    572570          assert_at(__FILE__,__LINE__){adl_type == :dadl}
    573571          yield :SYM_END_DBLOCK, $&
     
    610608        yield :Question_mark_code, :Question_mark_code
    611609      when /\A\|/   # |
    612         @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
     610        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
    613611        if @in_interval
    614612          @in_interval = false
     
    617615          @in_interval = true
    618616        end
    619         @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
     617        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
    620618        yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM
    621619###       when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
     
    666664      data = $' # variable $' receives the string after the match
    667665    when :adl
    668 #      puts "Entering scan_adl"
    669666      data = scan_adl(data) do |sym, val|
    670667        yield sym, val
    671668      end
    672669    when :cadl
    673 #      puts "Entering scan_cadl"
    674670      data = scan_cadl(data) do |sym, val|
    675671        yield sym, val
     
    681677      end
    682678    when :term_constraint
    683 #      puts "Entering scan_term_constraint"
     679      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     680
    684681      data = scan_term_constraint(data) do |sym, val|
    685682        yield sym, val
     
    692689
    693690def scan_regexp(data)
     691  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_regexp at #{@filename}:#{@lineno}: data = #{data.inspect}")
    694692  until data.nil?  do
    695693    case @adl_type.last
    696694    when :regexp
    697 #      puts "Entering scan_regexp"
    698695      case data
    699696      when /\A\/\}/ #V_REGEXP
     
    719716      data = $' # variable $' receives the string after the match
    720717    when :adl
    721 #      puts "Entering scan_adl"
    722718      data = scan_adl(data) do |sym, val|
    723719        yield sym, val
    724720      end
    725721    when :dadl
    726 #      puts "Entering scan_dadl"
    727722      data = scan_dadl(data) do |sym, val|
    728723        yield sym, val
    729724      end
    730725    when :cadl
    731 #      puts "Entering scan_cadl"
    732726      data = scan_cadl(data) do |sym, val|
    733727        yield sym, val
    734728      end
    735729    when :term_constraint
    736 #      puts "Entering scan_term_constraint"
     730      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_regexp: Entering scan_term_constraint at #{@filename}:#{@lineno}")
    737731      data = scan_term_constraint(data) do |sym, val|
    738732        yield sym, val
     
    745739
    746740def scan_term_constraint(data)
     741  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_term_constraint")
    747742  until data.nil?  do
    748743    case @adl_type.last
    749744    when :term_constraint
    750 #      puts "Entering scan_term_constraint"
    751745      case data
    752746      when /\A\n/ # carriage return
     
    757751      when /\A--.*$/ # single line comment
    758752        @lineno += 1
    759         @@log.info("#{__FILE__}:#{__LINE__}: scan_term_constraint: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     753        #@@logger.debug("#{__FILE__}:#{__LINE__}: scan_term_constraint: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    760754        ;
    761       when /\A[a-zA-Z0-9\._\-]+[ \t]*,/ # match any line, with ',' termination
    762         yield :TERM_CODE, $&
    763       when /\A[a-zA-Z0-9\._\-]+[ \t]*;/ #match second last line with ';' termination (assumed value)
    764         yield :TERM_CODE, $&
    765 #      when /\A[a-zA-Z0-9\._\-]+[ \t]*\]/ # match final line, terminating in ']'
    766       when /\A[a-zA-Z0-9\._\-]*[ \t]*\]/ # match final line, terminating in ']'
     755      when /\A([a-zA-Z0-9\._\-])+[ \t]*,/ # match any line, with ',' termination
     756        yield :TERM_CODE, $1
     757      when /\A([a-zA-Z0-9\._\-])+[ \t]*;/ # match second last line with ';' termination (assumed value)
     758        yield :TERM_CODE, $1
     759      when /\A([a-zA-Z0-9\._\-])*[ \t]*\]/ # match final line, terminating in ']'
    767760        adl_type = @adl_type.pop
    768761        assert_at(__FILE__,__LINE__){adl_type == :term_constraint}
    769         yield :END_TERM_CODE_CONSTRAINT, $&
     762        yield :END_TERM_CODE_CONSTRAINT, $1
    770763      else
    771764        raise "data = #{data}"
     
    773766      data = $' # variable $' receives the string after the match
    774767    when :adl
    775 #      puts "Entering scan_adl"
    776768      data = scan_adl(data) do |sym, val|
    777769        yield sym, val
    778770      end
    779771    when :dadl
    780 #      puts "Entering scan_dadl"
    781772      data = scan_dadl(data) do |sym, val|
    782773        yield sym, val
    783774      end
    784775    when :cadl
    785 #      puts "Entering scan_cadl"
    786776      data = scan_cadl(data) do |sym, val|
    787777        yield sym, val
     
    11321122  -376,  -376,  -376,  -195,  -376,  -208,  -376,  -221,  -376,  -234,
    11331123  -376,  -376,  -376,   -43,  -305,  -376,   -53,   -44,  -376,  -376,
    1134    -31,   -72,  -310,   -70,   -35,   -37,  -372,   -38,   -39,  -360,
    1135    -40,  -376,  -363,   -41,  -367,  -366,   -42,  -369,  -376,   -36,
     1124   -31,   -72,  -310,   -70,   -36,   -37,  -372,   -38,   -39,  -360,
     1125   -40,  -376,  -363,   -41,  -367,  -366,   -42,  -369,  -376,   -35,
    11361126  -376,  -376,  -376,  -376,  -376,  -309,  -160,  -175,  -159,  -376,
    11371127  -174,  -376,  -196,  -376,  -209,  -376,  -222,  -376,  -235,  -376,
     
    13411331  1, 121, :_reduce_none,
    13421332  1, 121, :_reduce_none,
    1343   3, 122, :_reduce_45,
    1344   4, 123, :_reduce_46,
    1345   3, 123, :_reduce_none,
    1346   6, 124, :_reduce_48,
     1333  3, 128, :_reduce_45,
     1334  4, 122, :_reduce_46,
     1335  3, 122, :_reduce_none,
     1336  6, 123, :_reduce_48,
    13471337  2, 130, :_reduce_49,
    13481338  2, 133, :_reduce_50,
    13491339  3, 133, :_reduce_none,
    13501340  2, 133, :_reduce_none,
    1351   1, 128, :_reduce_53,
     1341  1, 127, :_reduce_53,
    13521342  1, 134, :_reduce_54,
    13531343  1, 134, :_reduce_55,
     
    16561646  3, 142, :_reduce_358,
    16571647  3, 142, :_reduce_359,
    1658   1, 127, :_reduce_none,
    1659   3, 127, :_reduce_none,
    1660   3, 127, :_reduce_none,
     1648  1, 126, :_reduce_none,
     1649  3, 126, :_reduce_none,
     1650  3, 126, :_reduce_none,
    16611651  1, 221, :_reduce_none,
    16621652  3, 221, :_reduce_none,
    16631653  3, 222, :_reduce_365,
    1664   1, 126, :_reduce_366,
    1665   1, 126, :_reduce_367,
    1666   3, 223, :_reduce_none,
     1654  1, 125, :_reduce_366,
     1655  1, 125, :_reduce_367,
     1656  3, 223, :_reduce_368,
    16671657  0, 224, :_reduce_none,
    16681658  1, 224, :_reduce_none,
    16691659  2, 224, :_reduce_none,
    1670   1, 125, :_reduce_372,
     1660  1, 124, :_reduce_372,
    16711661  1, 150, :_reduce_373,
    16721662  1, 150, :_reduce_374,
     
    19171907  "c_attributes",
    19181908  "c_object",
    1919   "v_c_domain_type",
    19201909  "archetype_internal_ref",
    19211910  "archetype_slot",
     
    19241913  "c_ordinal",
    19251914  "c_primitive_object",
     1915  "v_c_domain_type",
    19261916  "absolute_path",
    19271917  "c_archetype_slot_head",
     
    20592049      archetype.original_language = language
    20602050    end
    2061     @@log.info("#{__FILE__}:#{__LINE__}: archetype = #{archetype} at #{@filename}:#{@lineno}")
     2051    @@logger.debug("#{__FILE__}:#{__LINE__}: archetype = #{archetype} at #{@filename}:#{@lineno}")
    20622052    result = archetype
    20632053 
     
    22032193  def _reduce_26(val, _values, result)
    22042194        assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)}
    2205     @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
     2195    @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
    22062196    result = val[0]
    22072197 
     
    22762266.,.,
    22772267
    2278 module_eval(<<'.,.,', 'parser.y', 210)
     2268module_eval(<<'.,.,', 'parser.y', 220)
    22792269  def _reduce_35(val, _values, result)
    2280         result = val[0]
    2281  
    2282     result
    2283   end
    2284 .,.,
    2285 
    2286 module_eval(<<'.,.,', 'parser.y', 214)
     2270        @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}")
     2271    result = val[0]
     2272 
     2273    result
     2274  end
     2275.,.,
     2276
     2277module_eval(<<'.,.,', 'parser.y', 225)
    22872278  def _reduce_36(val, _values, result)
    2288         @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}")
    2289     result = val[0]
    2290  
    2291     result
    2292   end
    2293 .,.,
    2294 
    2295 module_eval(<<'.,.,', 'parser.y', 219)
    2296   def _reduce_37(val, _values, result)
    22972279        result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref|
    22982280      archetype_internal_ref.target_path = val[0][:absolute_path]
     
    23052287.,.,
    23062288
    2307 module_eval(<<'.,.,', 'parser.y', 227)
     2289module_eval(<<'.,.,', 'parser.y', 233)
     2290  def _reduce_37(val, _values, result)
     2291        result = val[0]
     2292 
     2293    result
     2294  end
     2295.,.,
     2296
     2297module_eval(<<'.,.,', 'parser.y', 237)
    23082298  def _reduce_38(val, _values, result)
    2309         result = val[0]
    2310  
    2311     result
    2312   end
    2313 .,.,
    2314 
    2315 module_eval(<<'.,.,', 'parser.y', 231)
    2316   def _reduce_39(val, _values, result)
    23172299        result = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.create do |constraint_ref|
    23182300      constraint_ref.reference = val[0]
     
    23232305.,.,
    23242306
    2325 module_eval(<<'.,.,', 'parser.y', 237)
     2307module_eval(<<'.,.,', 'parser.y', 243)
     2308  def _reduce_39(val, _values, result)
     2309        result = val[0]
     2310 
     2311    result
     2312  end
     2313.,.,
     2314
     2315module_eval(<<'.,.,', 'parser.y', 247)
    23262316  def _reduce_40(val, _values, result)
    23272317        result = val[0]
     
    23312321.,.,
    23322322
    2333 module_eval(<<'.,.,', 'parser.y', 241)
     2323module_eval(<<'.,.,', 'parser.y', 251)
    23342324  def _reduce_41(val, _values, result)
    23352325        result = val[0]
     
    23392329.,.,
    23402330
    2341 module_eval(<<'.,.,', 'parser.y', 245)
     2331module_eval(<<'.,.,', 'parser.y', 255)
    23422332  def _reduce_42(val, _values, result)
    23432333        result = val[0]
     
    23512341# reduce 44 omitted
    23522342
    2353 module_eval(<<'.,.,', 'parser.y', 260)
     2343module_eval(<<'.,.,', 'parser.y', 271)
    23542344  def _reduce_45(val, _values, result)
    23552345        result = val[1]
     
    23592349.,.,
    23602350
    2361 module_eval(<<'.,.,', 'parser.y', 266)
     2351module_eval(<<'.,.,', 'parser.y', 277)
    23622352  def _reduce_46(val, _values, result)
    23632353        result = {:type_identifier => val[1], :c_occurrences => val[2], :absolute_path => val[3] }
     
    23692359# reduce 47 omitted
    23702360
    2371 module_eval(<<'.,.,', 'parser.y', 273)
     2361module_eval(<<'.,.,', 'parser.y', 284)
    23722362  def _reduce_48(val, _values, result)
    23732363        result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.create do |archetype_slot|
     
    23822372.,.,
    23832373
    2384 module_eval(<<'.,.,', 'parser.y', 282)
     2374module_eval(<<'.,.,', 'parser.y', 293)
    23852375  def _reduce_49(val, _values, result)
    23862376        result = {:c_archetype_slot_id => val[0],:c_occurrences => val[1]}
     
    23902380.,.,
    23912381
    2392 module_eval(<<'.,.,', 'parser.y', 287)
     2382module_eval(<<'.,.,', 'parser.y', 298)
    23932383  def _reduce_50(val, _values, result)
    23942384        result = val[1]
     
    24022392# reduce 52 omitted
    24032393
    2404 module_eval(<<'.,.,', 'parser.y', 295)
     2394module_eval(<<'.,.,', 'parser.y', 306)
    24052395  def _reduce_53(val, _values, result)
    24062396        assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE)}
     
    24132403.,.,
    24142404
    2415 module_eval(<<'.,.,', 'parser.y', 303)
     2405module_eval(<<'.,.,', 'parser.y', 314)
    24162406  def _reduce_54(val, _values, result)
    2417         @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
     2407        @@logger.debug("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
    24182408    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.create do |c_integer|
    24192409      c_integer.list
     
    24262416.,.,
    24272417
    2428 module_eval(<<'.,.,', 'parser.y', 312)
     2418module_eval(<<'.,.,', 'parser.y', 323)
    24292419  def _reduce_55(val, _values, result)
    2430         @@log.info("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
     2420        @@logger.debug("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
    24312421    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
    24322422 
     
    24352425.,.,
    24362426
    2437 module_eval(<<'.,.,', 'parser.y', 317)
     2427module_eval(<<'.,.,', 'parser.y', 328)
    24382428  def _reduce_56(val, _values, result)
    2439         @@log.info("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
     2429        @@logger.debug("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
    24402430    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
    24412431 
     
    24442434.,.,
    24452435
    2446 module_eval(<<'.,.,', 'parser.y', 322)
     2436module_eval(<<'.,.,', 'parser.y', 333)
    24472437  def _reduce_57(val, _values, result)
    2448         @@log.info("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
     2438        @@logger.debug("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
    24492439    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
    24502440 
     
    24532443.,.,
    24542444
    2455 module_eval(<<'.,.,', 'parser.y', 327)
     2445module_eval(<<'.,.,', 'parser.y', 338)
    24562446  def _reduce_58(val, _values, result)
    2457         @@log.info("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
     2447        @@logger.debug("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
    24582448    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
    24592449 
     
    24622452.,.,
    24632453
    2464 module_eval(<<'.,.,', 'parser.y', 332)
     2454module_eval(<<'.,.,', 'parser.y', 343)
    24652455  def _reduce_59(val, _values, result)
    2466         @@log.info("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
     2456        @@logger.debug("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
    24672457    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
    24682458 
     
    24712461.,.,
    24722462
    2473 module_eval(<<'.,.,', 'parser.y', 337)
     2463module_eval(<<'.,.,', 'parser.y', 348)
    24742464  def _reduce_60(val, _values, result)
    2475         @@log.info("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
     2465        @@logger.debug("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
    24762466    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
    24772467 
     
    24802470.,.,
    24812471
    2482 module_eval(<<'.,.,', 'parser.y', 342)
     2472module_eval(<<'.,.,', 'parser.y', 353)
    24832473  def _reduce_61(val, _values, result)
    24842474        assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN)}
    2485     @@log.info("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}")
     2475    @@logger.debug("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}")
    24862476    result = val[0]
    24872477 
     
    24922482# reduce 62 omitted
    24932483
    2494 module_eval(<<'.,.,', 'parser.y', 354)
     2484module_eval(<<'.,.,', 'parser.y', 365)
    24952485  def _reduce_63(val, _values, result)
    24962486        result = [val[0]]
     
    25002490.,.,
    25012491
    2502 module_eval(<<'.,.,', 'parser.y', 358)
     2492module_eval(<<'.,.,', 'parser.y', 369)
    25032493  def _reduce_64(val, _values, result)
    25042494        result = (val[0] << val[1])
     
    25082498.,.,
    25092499
    2510 module_eval(<<'.,.,', 'parser.y', 364)
     2500module_eval(<<'.,.,', 'parser.y', 375)
    25112501  def _reduce_65(val, _values, result)
    25122502        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
     
    25192509.,.,
    25202510
    2521 module_eval(<<'.,.,', 'parser.y', 371)
     2511module_eval(<<'.,.,', 'parser.y', 382)
    25222512  def _reduce_66(val, _values, result)
    25232513        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
     
    25282518.,.,
    25292519
    2530 module_eval(<<'.,.,', 'parser.y', 376)
     2520module_eval(<<'.,.,', 'parser.y', 387)
    25312521  def _reduce_67(val, _values, result)
    25322522        assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
     
    25372527.,.,
    25382528
    2539 module_eval(<<'.,.,', 'parser.y', 383)
     2529module_eval(<<'.,.,', 'parser.y', 394)
    25402530  def _reduce_68(val, _values, result)
    2541         @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
     2531        @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
    25422532    result = OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new(
    25432533                                                                              :rm_attribute_name => val[0],
     
    25502540.,.,
    25512541
    2552 module_eval(<<'.,.,', 'parser.y', 392)
     2542module_eval(<<'.,.,', 'parser.y', 403)
    25532543  def _reduce_69(val, _values, result)
    25542544        assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY) }
    2555     @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}")
     2545    @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}")
    25562546    result = OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(
    25572547                                                                                :rm_attribute_name => val[0],
     
    25642554.,.,
    25652555
    2566 module_eval(<<'.,.,', 'parser.y', 403)
     2556module_eval(<<'.,.,', 'parser.y', 414)
    25672557  def _reduce_70(val, _values, result)
    25682558        result = Array[val[0]]
     
    25722562.,.,
    25732563
    2574 module_eval(<<'.,.,', 'parser.y', 407)
     2564module_eval(<<'.,.,', 'parser.y', 418)
    25752565  def _reduce_71(val, _values, result)
    25762566        result = (val[0] << val[1])
     
    25802570.,.,
    25812571
    2582 module_eval(<<'.,.,', 'parser.y', 411)
     2572module_eval(<<'.,.,', 'parser.y', 422)
    25832573  def _reduce_72(val, _values, result)
    25842574        result = Array[val[0]]
     
    25902580# reduce 73 omitted
    25912581
    2592 module_eval(<<'.,.,', 'parser.y', 419)
     2582module_eval(<<'.,.,', 'parser.y', 430)
    25932583  def _reduce_74(val, _values, result)
    25942584        result = val[1]
     
    26002590# reduce 75 omitted
    26012591
    2602 module_eval(<<'.,.,', 'parser.y', 427)
     2592module_eval(<<'.,.,', 'parser.y', 438)
    26032593  def _reduce_76(val, _values, result)
    26042594        result = val[1]
     
    26242614# reduce 84 omitted
    26252615
    2626 module_eval(<<'.,.,', 'parser.y', 447)
     2616module_eval(<<'.,.,', 'parser.y', 458)
    26272617  def _reduce_85(val, _values, result)
    26282618        dadl_section = val[1]
     
    26412631# reduce 89 omitted
    26422632
    2643 module_eval(<<'.,.,', 'parser.y', 462)
     2633module_eval(<<'.,.,', 'parser.y', 473)
    26442634  def _reduce_90(val, _values, result)
    26452635        result = Array[val[0]]
     
    26492639.,.,
    26502640
    2651 module_eval(<<'.,.,', 'parser.y', 466)
     2641module_eval(<<'.,.,', 'parser.y', 477)
    26522642  def _reduce_91(val, _values, result)
    26532643        result = (val[0] << val[1])
     
    26572647.,.,
    26582648
    2659 module_eval(<<'.,.,', 'parser.y', 470)
     2649module_eval(<<'.,.,', 'parser.y', 481)
    26602650  def _reduce_92(val, _values, result)
    26612651        result = (val[0] << val[2])
     
    26652655.,.,
    26662656
    2667 module_eval(<<'.,.,', 'parser.y', 475)
     2657module_eval(<<'.,.,', 'parser.y', 486)
    26682658  def _reduce_93(val, _values, result)
    2669         @@log.info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
     2659        @@logger.debug("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]} at #{@filename}:#{@lineno}")
    26702660    result = {:attr_id => val[0], :object_block => val[2]}
    26712661 
     
    26742664.,.,
    26752665
    2676 module_eval(<<'.,.,', 'parser.y', 481)
     2666module_eval(<<'.,.,', 'parser.y', 492)
    26772667  def _reduce_94(val, _values, result)
    2678         @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}")
     2668        @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}")
    26792669    result = val[0]
    26802670 
     
    26852675# reduce 95 omitted
    26862676
    2687 module_eval(<<'.,.,', 'parser.y', 488)
     2677module_eval(<<'.,.,', 'parser.y', 499)
    26882678  def _reduce_96(val, _values, result)
    26892679        result = val[0]
     
    26932683.,.,
    26942684
    2695 module_eval(<<'.,.,', 'parser.y', 492)
     2685module_eval(<<'.,.,', 'parser.y', 503)
    26962686  def _reduce_97(val, _values, result)
    26972687        result = val[0]
     
    27012691.,.,
    27022692
    2703 module_eval(<<'.,.,', 'parser.y', 497)
     2693module_eval(<<'.,.,', 'parser.y', 508)
    27042694  def _reduce_98(val, _values, result)
    27052695        result = val[0]
     
    27092699.,.,
    27102700
    2711 module_eval(<<'.,.,', 'parser.y', 501)
     2701module_eval(<<'.,.,', 'parser.y', 512)
    27122702  def _reduce_99(val, _values, result)
    27132703        result = val[0]
     
    27172707.,.,
    27182708
    2719 module_eval(<<'.,.,', 'parser.y', 506)
     2709module_eval(<<'.,.,', 'parser.y', 517)
    27202710  def _reduce_100(val, _values, result)
    27212711        result = {:untyped_multiple_attr_object_block => val[0]}
     
    27252715.,.,
    27262716
    2727 module_eval(<<'.,.,', 'parser.y', 510)
     2717module_eval(<<'.,.,', 'parser.y', 521)
    27282718  def _reduce_101(val, _values, result)
    27292719        result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]}
     
    27332723.,.,
    27342724
    2735 module_eval(<<'.,.,', 'parser.y', 515)
     2725module_eval(<<'.,.,', 'parser.y', 526)
    27362726  def _reduce_102(val, _values, result)
    27372727        result = {:multiple_attr_object_block_head => val[0], :keyed_objects => val[1]}
     
    27412731.,.,
    27422732
    2743 module_eval(<<'.,.,', 'parser.y', 520)
     2733module_eval(<<'.,.,', 'parser.y', 531)
    27442734  def _reduce_103(val, _values, result)
    2745         @@log.info("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}")
     2735        @@logger.debug("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}")
    27462736    result = val[0]
    27472737 
     
    27502740.,.,
    27512741
    2752 module_eval(<<'.,.,', 'parser.y', 526)
     2742module_eval(<<'.,.,', 'parser.y', 537)
    27532743  def _reduce_104(val, _values, result)
    27542744        result = Array[val[0]]
     
    27582748.,.,
    27592749
    2760 module_eval(<<'.,.,', 'parser.y', 530)
     2750module_eval(<<'.,.,', 'parser.y', 541)
    27612751  def _reduce_105(val, _values, result)
    27622752        result = (val[0] << val[1])
     
    27662756.,.,
    27672757
    2768 module_eval(<<'.,.,', 'parser.y', 535)
     2758module_eval(<<'.,.,', 'parser.y', 546)
    27692759  def _reduce_106(val, _values, result)
    2770         @@log.info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
     2760        @@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}")
    27712761    result = {:object_key => val[0], :object_block => val[1]}
    27722762 
     
    27752765.,.,
    27762766
    2777 module_eval(<<'.,.,', 'parser.y', 541)
     2767module_eval(<<'.,.,', 'parser.y', 552)
    27782768  def _reduce_107(val, _values, result)
    2779         @@log.info("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
     2769        @@logger.debug("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
    27802770    result = val[1]
    27812771 
     
    27842774.,.,
    27852775
    2786 module_eval(<<'.,.,', 'parser.y', 547)
     2776module_eval(<<'.,.,', 'parser.y', 558)
    27872777  def _reduce_108(val, _values, result)
    27882778        result = {:untyped_single_attr_object_block => val[0]}
     
    27922782.,.,
    27932783
    2794 module_eval(<<'.,.,', 'parser.y', 551)
     2784module_eval(<<'.,.,', 'parser.y', 562)
    27952785  def _reduce_109(val, _values, result)
    27962786        result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]}
     
    28002790.,.,
    28012791
    2802 module_eval(<<'.,.,', 'parser.y', 556)
     2792module_eval(<<'.,.,', 'parser.y', 567)
    28032793  def _reduce_110(val, _values, result)
    2804         @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
     2794        @@logger.debug("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
    28052795    result = {:single_attr_object_complex_head => val[0]}
    28062796 
     
    28092799.,.,
    28102800
    2811 module_eval(<<'.,.,', 'parser.y', 561)
     2801module_eval(<<'.,.,', 'parser.y', 572)
    28122802  def _reduce_111(val, _values, result)
    2813         @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]}, attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
     2803        @@logger.debug("#{__FILE__}:#{__LINE__}: attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
    28142804    result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]}
    28152805 
     
    28202810# reduce 112 omitted
    28212811
    2822 module_eval(<<'.,.,', 'parser.y', 567)
     2812module_eval(<<'.,.,', 'parser.y', 578)
    28232813  def _reduce_113(val, _values, result)
    2824         @@log.info("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
     2814        @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
    28252815    result = {:untyped_primitive_object_block => val[0]}
    28262816 
     
    28292819.,.,
    28302820
    2831 module_eval(<<'.,.,', 'parser.y', 572)
     2821module_eval(<<'.,.,', 'parser.y', 583)
    28322822  def _reduce_114(val, _values, result)
    2833         @@log.info("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
     2823        @@logger.debug("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
    28342824    result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]}
    28352825 
     
    28382828.,.,
    28392829
    2840 module_eval(<<'.,.,', 'parser.y', 577)
     2830module_eval(<<'.,.,', 'parser.y', 588)
    28412831  def _reduce_115(val, _values, result)
    2842         @@log.info("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
     2832        @@logger.debug("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
    28432833    result = val[1]
    28442834 
     
    28472837.,.,
    28482838
    2849 module_eval(<<'.,.,', 'parser.y', 582)
     2839module_eval(<<'.,.,', 'parser.y', 593)
    28502840  def _reduce_116(val, _values, result)
    28512841        result = val[0]
     
    28552845.,.,
    28562846
    2857 module_eval(<<'.,.,', 'parser.y', 586)
     2847module_eval(<<'.,.,', 'parser.y', 597)
    28582848  def _reduce_117(val, _values, result)
    28592849        result = val[0]
     
    28632853.,.,
    28642854
    2865 module_eval(<<'.,.,', 'parser.y', 590)
     2855module_eval(<<'.,.,', 'parser.y', 601)
    28662856  def _reduce_118(val, _values, result)
    28672857        result = val[0]
     
    28712861.,.,
    28722862
    2873 module_eval(<<'.,.,', 'parser.y', 594)
     2863module_eval(<<'.,.,', 'parser.y', 605)
    28742864  def _reduce_119(val, _values, result)
    28752865        result = val[0]
     
    28792869.,.,
    28802870
    2881 module_eval(<<'.,.,', 'parser.y', 598)
     2871module_eval(<<'.,.,', 'parser.y', 609)
    28822872  def _reduce_120(val, _values, result)
    28832873        result = val[0]
     
    28872877.,.,
    28882878
    2889 module_eval(<<'.,.,', 'parser.y', 602)
     2879module_eval(<<'.,.,', 'parser.y', 613)
    28902880  def _reduce_121(val, _values, result)
    2891         @@log.info("string_value: #{val[0]} at #{@filename}:#{@lineno}")
     2881        @@logger.debug("string_value: #{val[0]} at #{@filename}:#{@lineno}")
    28922882    result = val[0]
    28932883 
     
    28962886.,.,
    28972887
    2898 module_eval(<<'.,.,', 'parser.y', 607)
     2888module_eval(<<'.,.,', 'parser.y', 618)
    28992889  def _reduce_122(val, _values, result)
    2900         @@log.info("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
     2890        @@logger.debug("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
    29012891    result = val[0]
    29022892 
     
    29052895.,.,
    29062896
    2907 module_eval(<<'.,.,', 'parser.y', 612)
     2897module_eval(<<'.,.,', 'parser.y', 623)
    29082898  def _reduce_123(val, _values, result)
    2909         @@log.info("real_value: #{val[0]} at #{@filename}:#{@lineno}")
     2899        @@logger.debug("real_value: #{val[0]} at #{@filename}:#{@lineno}")
    29102900    result = val[0]
    29112901 
     
    29142904.,.,
    29152905
    2916 module_eval(<<'.,.,', 'parser.y', 617)
     2906module_eval(<<'.,.,', 'parser.y', 628)
    29172907  def _reduce_124(val, _values, result)
    2918         @@log.info("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
     2908        @@logger.debug("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
    29192909    result = val[0]
    29202910 
     
    29232913.,.,
    29242914
    2925 module_eval(<<'.,.,', 'parser.y', 622)
     2915module_eval(<<'.,.,', 'parser.y', 633)
    29262916  def _reduce_125(val, _values, result)
    2927         @@log.info("character_value: #{val[0]} at #{@filename}:#{@lineno}")
     2917        @@logger.debug("character_value: #{val[0]} at #{@filename}:#{@lineno}")
    29282918    result = val[0]
    29292919 
     
    29322922.,.,
    29332923
    2934 module_eval(<<'.,.,', 'parser.y', 627)
     2924module_eval(<<'.,.,', 'parser.y', 638)
    29352925  def _reduce_126(val, _values, result)
    2936         @@log.info("date_value: #{val[0]} at #{@filename}:#{@lineno}")
     2926        @@logger.debug("date_value: #{val[0]} at #{@filename}:#{@lineno}")
    29372927    result = val[0]
    29382928 
     
    29412931.,.,
    29422932
    2943 module_eval(<<'.,.,', 'parser.y', 632)
     2933module_eval(<<'.,.,', 'parser.y', 643)
    29442934  def _reduce_127(val, _values, result)
    2945         @@log.info("time_value: #{val[0]} at #{@filename}:#{@lineno}")
     2935        @@logger.debug("time_value: #{val[0]} at #{@filename}:#{@lineno}")
    29462936    result = val[0]
    29472937 
     
    29502940.,.,
    29512941
    2952 module_eval(<<'.,.,', 'parser.y', 637)
     2942module_eval(<<'.,.,', 'parser.y', 648)
    29532943  def _reduce_128(val, _values, result)
    2954         @@log.info("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
     2944        @@logger.debug("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
    29552945    result = val[0]
    29562946 
     
    29592949.,.,
    29602950
    2961 module_eval(<<'.,.,', 'parser.y', 642)
     2951module_eval(<<'.,.,', 'parser.y', 653)
    29622952  def _reduce_129(val, _values, result)
    2963         @@log.info("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
     2953        @@logger.debug("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
    29642954    result = val[0]
    29652955 
     
    29682958.,.,
    29692959
    2970 module_eval(<<'.,.,', 'parser.y', 647)
     2960module_eval(<<'.,.,', 'parser.y', 658)
    29712961  def _reduce_130(val, _values, result)
    2972         @@log.info("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
     2962        @@logger.debug("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
    29732963    result = val[0]
    29742964 
     
    30072997# reduce 145 omitted
    30082998
    3009 module_eval(<<'.,.,', 'parser.y', 670)
     2999module_eval(<<'.,.,', 'parser.y', 681)
    30103000  def _reduce_146(val, _values, result)
    3011         @@log.info("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     3001        @@logger.debug("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
    30123002    result = val[0]
    30133003 
     
    30163006.,.,
    30173007
    3018 module_eval(<<'.,.,', 'parser.y', 675)
     3008module_eval(<<'.,.,', 'parser.y', 686)
    30193009  def _reduce_147(val, _values, result)
    3020         @@log.info("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     3010        @@logger.debug("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
    30213011    result = val[0]
    30223012 
     
    30253015.,.,
    30263016
    3027 module_eval(<<'.,.,', 'parser.y', 681)
     3017module_eval(<<'.,.,', 'parser.y', 692)
    30283018  def _reduce_148(val, _values, result)
    3029         @@log.info("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
     3019        @@logger.debug("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
    30303020    result = val[0]
    30313021 
     
    30403030# reduce 151 omitted
    30413031
    3042 module_eval(<<'.,.,', 'parser.y', 691)
     3032module_eval(<<'.,.,', 'parser.y', 702)
    30433033  def _reduce_152(val, _values, result)
    30443034        begin
     
    30533043.,.,
    30543044
    3055 module_eval(<<'.,.,', 'parser.y', 700)
     3045module_eval(<<'.,.,', 'parser.y', 711)
    30563046  def _reduce_153(val, _values, result)
    30573047        begin
     
    30663056.,.,
    30673057
    3068 module_eval(<<'.,.,', 'parser.y', 709)
     3058module_eval(<<'.,.,', 'parser.y', 720)
    30693059  def _reduce_154(val, _values, result)
    30703060        begin
     
    31033093# reduce 166 omitted
    31043094
    3105 module_eval(<<'.,.,', 'parser.y', 735)
     3095module_eval(<<'.,.,', 'parser.y', 746)
    31063096  def _reduce_167(val, _values, result)
    31073097        begin
     
    31163106.,.,
    31173107
    3118 module_eval(<<'.,.,', 'parser.y', 744)
     3108module_eval(<<'.,.,', 'parser.y', 755)
    31193109  def _reduce_168(val, _values, result)
    31203110        begin
     
    31293119.,.,
    31303120
    3131 module_eval(<<'.,.,', 'parser.y', 753)
     3121module_eval(<<'.,.,', 'parser.y', 764)
    31323122  def _reduce_169(val, _values, result)
    31333123        begin
     
    31663156# reduce 181 omitted
    31673157
    3168 module_eval(<<'.,.,', 'parser.y', 778)
     3158module_eval(<<'.,.,', 'parser.y', 789)
    31693159  def _reduce_182(val, _values, result)
    31703160        result = true
     
    31743164.,.,
    31753165
    3176 module_eval(<<'.,.,', 'parser.y', 782)
     3166module_eval(<<'.,.,', 'parser.y', 793)
    31773167  def _reduce_183(val, _values, result)
    31783168        result = false
     
    32743264# reduce 229 omitted
    32753265
    3276 module_eval(<<'.,.,', 'parser.y', 845)
     3266module_eval(<<'.,.,', 'parser.y', 856)
    32773267  def _reduce_230(val, _values, result)
    3278         @@log.info("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
     3268        @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
    32793269    result = val[0]
    32803270 
     
    33073297# reduce 242 omitted
    33083298
    3309 module_eval(<<'.,.,', 'parser.y', 865)
     3299module_eval(<<'.,.,', 'parser.y', 876)
    33103300  def _reduce_243(val, _values, result)
    3311         @@log.info("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
     3301        @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
    33123302    result = val[0]
    33133303 
     
    33223312# reduce 246 omitted
    33233313
    3324 module_eval(<<'.,.,', 'parser.y', 875)
     3314module_eval(<<'.,.,', 'parser.y', 886)
    33253315  def _reduce_247(val, _values, result)
    3326         @@log.info("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
     3316        @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
    33273317    result = val[0]
    33283318 
     
    34113401# reduce 287 omitted
    34123402
    3413 module_eval(<<'.,.,', 'parser.y', 945)
     3403module_eval(<<'.,.,', 'parser.y', 956)
    34143404  def _reduce_288(val, _values, result)
    3415         @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
    3416  
    3417     result
    3418   end
    3419 .,.,
    3420 
    3421 module_eval(<<'.,.,', 'parser.y', 949)
     3405        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     3406 
     3407    result
     3408  end
     3409.,.,
     3410
     3411module_eval(<<'.,.,', 'parser.y', 960)
    34223412  def _reduce_289(val, _values, result)
    3423         @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
    3424  
    3425     result
    3426   end
    3427 .,.,
    3428 
    3429 module_eval(<<'.,.,', 'parser.y', 960)
     3413        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     3414 
     3415    result
     3416  end
     3417.,.,
     3418
     3419module_eval(<<'.,.,', 'parser.y', 971)
    34303420  def _reduce_290(val, _values, result)
    34313421        result = Range.new(1,1)
     
    34353425.,.,
    34363426
    3437 module_eval(<<'.,.,', 'parser.y', 964)
     3427module_eval(<<'.,.,', 'parser.y', 975)
    34383428  def _reduce_291(val, _values, result)
    34393429        result = val[3]
     
    34433433.,.,
    34443434
    3445 module_eval(<<'.,.,', 'parser.y', 969)
     3435module_eval(<<'.,.,', 'parser.y', 980)
    34463436  def _reduce_292(val, _values, result)
    34473437        begin
     
    34563446.,.,
    34573447
    3458 module_eval(<<'.,.,', 'parser.y', 978)
     3448module_eval(<<'.,.,', 'parser.y', 989)
    34593449  def _reduce_293(val, _values, result)
    34603450        begin
     
    34703460.,.,
    34713461
    3472 module_eval(<<'.,.,', 'parser.y', 989)
     3462module_eval(<<'.,.,', 'parser.y', 1000)
    34733463  def _reduce_294(val, _values, result)
    34743464        result = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new
     
    34943484# reduce 302 omitted
    34953485
    3496 module_eval(<<'.,.,', 'parser.y', 1003)
     3486module_eval(<<'.,.,', 'parser.y', 1014)
    34973487  def _reduce_303(val, _values, result)
    34983488        result = val[0]
     
    35023492.,.,
    35033493
    3504 module_eval(<<'.,.,', 'parser.y', 1007)
     3494module_eval(<<'.,.,', 'parser.y', 1018)
    35053495  def _reduce_304(val, _values, result)
    35063496        result = val[0]
     
    35123502# reduce 305 omitted
    35133503
    3514 module_eval(<<'.,.,', 'parser.y', 1014)
     3504module_eval(<<'.,.,', 'parser.y', 1025)
    35153505  def _reduce_306(val, _values, result)
    35163506        result = val[3]
     
    36123602# reduce 352 omitted
    36133603
    3614 module_eval(<<'.,.,', 'parser.y', 1084)
     3604module_eval(<<'.,.,', 'parser.y', 1095)
    36153605  def _reduce_353(val, _values, result)
    36163606        result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true)
     
    36203610.,.,
    36213611
    3622 module_eval(<<'.,.,', 'parser.y', 1088)
     3612module_eval(<<'.,.,', 'parser.y', 1099)
    36233613  def _reduce_354(val, _values, result)
    36243614        result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false)
     
    36283618.,.,
    36293619
    3630 module_eval(<<'.,.,', 'parser.y', 1092)
     3620module_eval(<<'.,.,', 'parser.y', 1103)
    36313621  def _reduce_355(val, _values, result)
    36323622        result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
     
    36363626.,.,
    36373627
    3638 module_eval(<<'.,.,', 'parser.y', 1096)
     3628module_eval(<<'.,.,', 'parser.y', 1107)
    36393629  def _reduce_356(val, _values, result)
    36403630        result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
     
    36443634.,.,
    36453635
    3646 module_eval(<<'.,.,', 'parser.y', 1101)
     3636module_eval(<<'.,.,', 'parser.y', 1112)
    36473637  def _reduce_357(val, _values, result)
    36483638        result = val[0]
     
    36523642.,.,
    36533643
    3654 module_eval(<<'.,.,', 'parser.y', 1105)
     3644module_eval(<<'.,.,', 'parser.y', 1116)
    36553645  def _reduce_358(val, _values, result)
    36563646        raise 'Not implemented yet'
     
    36603650.,.,
    36613651
    3662 module_eval(<<'.,.,', 'parser.y', 1109)
     3652module_eval(<<'.,.,', 'parser.y', 1120)
    36633653  def _reduce_359(val, _values, result)
    36643654        raise 'Not implemented yet'
     
    36783668# reduce 364 omitted
    36793669
    3680 module_eval(<<'.,.,', 'parser.y', 1121)
     3670module_eval(<<'.,.,', 'parser.y', 1132)
    36813671  def _reduce_365(val, _values, result)
    36823672        @in_interval = false
    3683     @@log.info("#{__FILE__}:#{__LINE__}, #{val[0]}|#{val[2]} at #{@filename}")
    3684  
    3685     result
    3686   end
    3687 .,.,
    3688 
    3689 module_eval(<<'.,.,', 'parser.y', 1128)
     3673    @@logger.debug("#{__FILE__}:#{__LINE__}, #{val[0]}|#{val[2]} at #{@filename}")
     3674 
     3675    result
     3676  end
     3677.,.,
     3678
     3679module_eval(<<'.,.,', 'parser.y', 1139)
    36903680  def _reduce_366(val, _values, result)
    36913681          result = val[0]
     
    36953685.,.,
    36963686
    3697 module_eval(<<'.,.,', 'parser.y', 1132)
     3687module_eval(<<'.,.,', 'parser.y', 1143)
    36983688  def _reduce_367(val, _values, result)
    36993689          result = val[0]
     
    37033693.,.,
    37043694
    3705 # reduce 368 omitted
     3695module_eval(<<'.,.,', 'parser.y', 1149)
     3696  def _reduce_368(val, _values, result)
     3697        @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}")
     3698    @@logger.debug("#{__FILE__}:#{__LINE__}, term_code_body = #{val[1]}")
     3699    @@logger.debug("#{__FILE__}:#{__LINE__}, END_TERM_CODE_CONSTRAINT = #{val[2]}")
     3700    result = val[1]
     3701 
     3702    result
     3703  end
     3704.,.,
    37063705
    37073706# reduce 369 omitted
     
    37113710# reduce 371 omitted
    37123711
    3713 module_eval(<<'.,.,', 'parser.y', 1147)
     3712module_eval(<<'.,.,', 'parser.y', 1165)
    37143713  def _reduce_372(val, _values, result)
    37153714          result = val[0]
     
    37193718.,.,
    37203719
    3721 module_eval(<<'.,.,', 'parser.y', 1152)
     3720module_eval(<<'.,.,', 'parser.y', 1170)
    37223721  def _reduce_373(val, _values, result)
    37233722          result = val[0]
     
    37273726.,.,
    37283727
    3729 module_eval(<<'.,.,', 'parser.y', 1156)
     3728module_eval(<<'.,.,', 'parser.y', 1174)
    37303729  def _reduce_374(val, _values, result)
    3731         @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
     3730        @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
    37323731      result = val[0]
    37333732 
     
    37363735.,.,
    37373736
    3738 module_eval(<<'.,.,', 'parser.y', 1167)
     3737module_eval(<<'.,.,', 'parser.y', 1185)
    37393738  def _reduce_375(val, _values, result)
    37403739        result = val[0]
  • ruby/trunk/lib/adl_parser/lib/parser.y

    r258 r261  
    5555      archetype.original_language = language
    5656    end
    57     @@log.info("#{__FILE__}:#{__LINE__}: archetype = #{archetype} at #{@filename}:#{@lineno}")
     57    @@logger.debug("#{__FILE__}:#{__LINE__}: archetype = #{archetype} at #{@filename}:#{@lineno}")
    5858    result = archetype
    5959  }
     
    155155  {
    156156    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)}
    157     @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
     157    @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
    158158    result = val[0]
    159159  }
     
    206206
    207207#------------------------- node types -----------------------
    208 
    209 c_object: v_c_domain_type
    210   {
    211     result = val[0]
    212   }
    213   | c_complex_object
    214   {
    215     @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}")
     208### http://www.openehr.org/svn/ref_impl_eiffel/TRUNK/components/adl_parser/src/syntax/cadl/parser/cadl_validator.html
     209### c_object:  c_complex_object
     210### | archetype_internal_ref
     211### | archetype_slot
     212### | constraint_ref
     213### | c_code_phrase
     214### | c_ordinal
     215### | c_primitive_object
     216### | V_C_DOMAIN_TYPE
     217### | ERR_C_DOMAIN_TYPE
     218### | error
     219c_object: c_complex_object
     220  {
     221    @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}")
    216222    result = val[0]
    217223  }
     
    246252    result = val[0]
    247253  }
     254  | v_c_domain_type
     255  {
     256    result = val[0]
     257  }
     258
    248259#  | v_c_domain_type
    249260#  | V_C_DOMAIN_TYPE
     
    302313c_primitive: c_integer
    303314  {
    304     @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
     315    @@logger.debug("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
    305316    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.create do |c_integer|
    306317      c_integer.list
     
    311322  | c_real
    312323  {
    313     @@log.info("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
     324    @@logger.debug("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
    314325    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
    315326  }
    316327  | c_date
    317328  {
    318     @@log.info("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
     329    @@logger.debug("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
    319330    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
    320331  }
    321332  | c_time
    322333  {
    323     @@log.info("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
     334    @@logger.debug("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
    324335    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
    325336  }
    326337  | c_date_time
    327338  {
    328     @@log.info("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
     339    @@logger.debug("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
    329340    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
    330341  }
    331342  | c_duration
    332343  {
    333     @@log.info("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
     344    @@logger.debug("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
    334345    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
    335346  }
    336347  | c_string
    337348  {
    338     @@log.info("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
     349    @@logger.debug("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
    339350    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
    340351  }
     
    342353  {
    343354    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN)}
    344     @@log.info("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}")
     355    @@logger.debug("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}")
    345356    result = val[0]
    346357  }
     
    382393c_attr_head: V_ATTRIBUTE_IDENTIFIER c_existence
    383394  {
    384     @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
     395    @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
    385396    result = OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new(
    386397                                                                              :rm_attribute_name => val[0],
     
    392403  {
    393404    assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY) }
    394     @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}")
     405    @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}")
    395406    result = OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(
    396407                                                                                :rm_attribute_name => val[0],
     
    474485attr_val: attr_id SYM_EQ object_block
    475486  {
    476     @@log.info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
     487    @@logger.debug("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]} at #{@filename}:#{@lineno}")
    477488    result = {:attr_id => val[0], :object_block => val[2]}
    478489  }
     
    480491attr_id: V_ATTRIBUTE_IDENTIFIER
    481492  {
    482     @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}")
     493    @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}")
    483494    result = val[0]
    484495  }
     
    519530multiple_attr_object_block_head: SYM_START_DBLOCK
    520531  {
    521     @@log.info("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}")
     532    @@logger.debug("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}")
    522533    result = val[0]
    523534  }
     
    534545keyed_object: object_key SYM_EQ object_block
    535546  {
    536     @@log.info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
     547    @@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}")
    537548    result = {:object_key => val[0], :object_block => val[1]}
    538549  }
     
    540551object_key: Left_bracket_code simple_value Right_bracket_code
    541552  {
    542     @@log.info("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
     553    @@logger.debug("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
    543554    result = val[1]
    544555  }
     
    555566untyped_single_attr_object_block: single_attr_object_complex_head SYM_END_DBLOCK # >
    556567  {
    557     @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
     568    @@logger.debug("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
    558569    result = {:single_attr_object_complex_head => val[0]}
    559570  }
    560571  | single_attr_object_complex_head attr_vals SYM_END_DBLOCK
    561572  {
    562     @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]}, attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
     573    @@logger.debug("#{__FILE__}:#{__LINE__}: attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
    563574    result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]}
    564575  }
     
    566577primitive_object_block: untyped_primitive_object_block
    567578  {
    568     @@log.info("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
     579    @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
    569580    result = {:untyped_primitive_object_block => val[0]}
    570581  }
    571582  | type_identifier untyped_primitive_object_block
    572583  {
    573     @@log.info("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
     584    @@logger.debug("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
    574585    result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]}
    575586  }
    576587untyped_primitive_object_block: SYM_START_DBLOCK primitive_object_value SYM_END_DBLOCK
    577588  {
    578     @@log.info("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
     589    @@logger.debug("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
    579590    result = val[1]
    580591  }
     
    601612simple_value: string_value
    602613  {
    603     @@log.info("string_value: #{val[0]} at #{@filename}:#{@lineno}")
     614    @@logger.debug("string_value: #{val[0]} at #{@filename}:#{@lineno}")
    604615    result = val[0]
    605616  }
    606617  | integer_value
    607618  {
    608     @@log.info("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
     619    @@logger.debug("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
    609620    result = val[0]
    610621  }
    611622  | real_value
    612623  {
    613     @@log.info("real_value: #{val[0]} at #{@filename}:#{@lineno}")
     624    @@logger.debug("real_value: #{val[0]} at #{@filename}:#{@lineno}")
    614625    result = val[0]
    615626  }
    616627  | boolean_value
    617628  {
    618     @@log.info("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
     629    @@logger.debug("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
    619630    result = val[0]
    620631  }
    621632  | character_value
    622633  {
    623     @@log.info("character_value: #{val[0]} at #{@filename}:#{@lineno}")
     634    @@logger.debug("character_value: #{val[0]} at #{@filename}:#{@lineno}")
    624635    result = val[0]
    625636  }
    626637  | date_value
    627638  {
    628     @@log.info("date_value: #{val[0]} at #{@filename}:#{@lineno}")
     639    @@logger.debug("date_value: #{val[0]} at #{@filename}:#{@lineno}")
    629640    result = val[0]
    630641  }
    631642  | time_value
    632643  {
    633     @@log.info("time_value: #{val[0]} at #{@filename}:#{@lineno}")
     644    @@logger.debug("time_value: #{val[0]} at #{@filename}:#{@lineno}")
    634645    result = val[0]
    635646  }
    636647  | date_time_value
    637648  {
    638     @@log.info("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
     649    @@logger.debug("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
    639650    result = val[0]
    640651  }
    641652  | duration_value
    642653  {
    643     @@log.info("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
     654    @@logger.debug("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
    644655    result = val[0]
    645656  }
    646657  | uri_value
    647658  {
    648     @@log.info("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
     659    @@logger.debug("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
    649660    result = val[0]
    650661  }
     
    669680type_identifier: V_TYPE_IDENTIFIER
    670681  {
    671     @@log.info("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     682    @@logger.debug("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
    672683    result = val[0]
    673684  }
    674685  | V_GENERIC_TYPE_IDENTIFIER
    675686  {
    676     @@log.info("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     687    @@logger.debug("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
    677688    result = val[0]
    678689  }
     
    680691string_value: V_STRING
    681692  {
    682     @@log.info("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
     693    @@logger.debug("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
    683694    result = val[0]
    684695  }
     
    844855duration_value: V_ISO8601_DURATION
    845856  {
    846     @@log.info("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
     857    @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
    847858    result = val[0]
    848859  }
     
    864875term_code: V_QUALIFIED_TERM_CODE_REF
    865876  {
    866     @@log.info("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
     877    @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
    867878    result = val[0]
    868879  }
     
    874885uri_value: V_URI
    875886  {
    876     @@log.info("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
     887    @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
    877888    result = val[0]
    878889  }
     
    944955path_segment: V_ATTRIBUTE_IDENTIFIER V_LOCAL_TERM_CODE_REF
    945956  {
    946     @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     957    @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
    947958  }
    948959  | V_ATTRIBUTE_IDENTIFIER
    949960  {
    950     @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     961    @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
    951962  }
    952963
     
    11211132  {
    11221133    @in_interval = false
    1123     @@log.info("#{__FILE__}:#{__LINE__}, #{val[0]}|#{val[2]} at #{@filename}")
     1134    @@logger.debug("#{__FILE__}:#{__LINE__}, #{val[0]}|#{val[2]} at #{@filename}")
    11241135  }
    11251136
     
    11341145  }
    11351146
    1136 #term_code_constraint_section: START_TERM_CODE_CONSTRAINT term_code_body Right_bracket_code
     1147#                             [[a-zA-Z0-9\(\)\._\-]+::[ \t\n]*          [[a-zA-Z0-9\._\-]*[ \t]*]
    11371148term_code_constraint_section: START_TERM_CODE_CONSTRAINT term_code_body END_TERM_CODE_CONSTRAINT
     1149  {
     1150    @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}")
     1151    @@logger.debug("#{__FILE__}:#{__LINE__}, term_code_body = #{val[1]}")
     1152    @@logger.debug("#{__FILE__}:#{__LINE__}, END_TERM_CODE_CONSTRAINT = #{val[2]}")
     1153    result = val[1]
     1154  }
     1155
     1156
    11381157term_code_body: # empty
    11391158  | TERM_CODE
    11401159  | term_code_body TERM_CODE
    1141 ### term_code_constraint_section: START_TERM_CODE_CONSTRAINT term_code_body END_TERM_CODE_CONSTRAINT
    11421160### term_code_body: TERM_CODE
    11431161###   | term_code_body TERM_CODE
     
    11551173  | V_ATTRIBUTE_IDENTIFIER
    11561174  {
    1157     @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
     1175    @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
    11581176      result = val[0]
    11591177  }
     
    11941212
    11951213if $DEBUG
    1196   @@log = Logger.new('log/parser.log','daily')
    1197   @@log.level = Logger::INFO
     1214  @@logger = Logger.new('log/parser.log','daily')
     1215  @@logger.level = Logger::INFO
    11981216else
    1199   @@log = Logger.new(STDOUT)
    1200   @@log.level = Logger::WARN
     1217  @@logger = Logger.new(STDOUT)
     1218  @@logger.level = Logger::WARN
    12011219end
    12021220
     
    12631281
    12641282def scan
     1283  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan at #{@filename}:#{@lineno}:")
    12651284  until @data.nil?  do
    12661285    case @adl_type.last
     
    12791298    when :regexp
    12801299      @data = scan_regexp(@data) do |sym, val|
     1300        yield sym, val
     1301      end
     1302    when :term_constraint
     1303      @@logger.debug("#{__FILE__}:#{__LINE__}: scan: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     1304      @data = scan_term_constraint(@data) do |sym, val|
    12811305        yield sym, val
    12821306      end
     
    12911315
    12921316def scan_adl(data)
     1317  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_adl at #{@filename}:#{@lineno}: data = #{data.inspect}")
    12931318  until data.nil?  do
    12941319    case @adl_type.last
    12951320    when :adl
    1296 #      puts "Entering scan_adl"
    12971321      case data
    12981322      when /\A\n/ # carriage return
     
    13031327      when /\A--.*\n/ # single line comment
    13041328        @lineno += 1
    1305         @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     1329        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    13061330        ;
    13071331      when /\Adescription/   # description
     
    13091333      when /\Adefinition/   # definition
    13101334        yield :SYM_DEFINITION, :SYM_DEFINITION
    1311 #        @adl_type.push(:cadl)
    13121335        ###----------/* symbols */ -------------------------------------------------
    13131336      when /\A[A-Z][a-zA-Z0-9_]*/
    13141337        yield :V_TYPE_IDENTIFIER, $&
    13151338#      when /\A[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z0-9]+/   #V_ARCHETYPE_ID
    1316       when /\A(\w+)-(\w+)-(\w+)\.(\w+)(-\w+)?\.(v[0-9]+)/   #V_ARCHETYPE_ID
     1339      when /\A(\w+)-(\w+)-(\w+)\.(\w+)(-\w+)?\.(v\w+)/   #V_ARCHETYPE_ID
    13171340        object_id, rm_originator, rm_name, rm_entity, concept_name, specialisation, version_id = $&, $1, $2, $3, $4, $5, $6
    13181341        archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)
     
    13231346        word = $&
    13241347        if @@adl_reserved[word]
    1325           @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: @@adl_reserved = #{@@adl_reserved[word]} at #{@filename}:#{@lineno}")
     1348          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: @@adl_reserved = #{@@adl_reserved[word]} at #{@filename}:#{@lineno}")
    13261349          yield @@adl_reserved[word], @@adl_reserved[word]
    13271350        elsif #/\A[A-Z][a-zA-Z0-9_]*/
    1328           @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: V_ATTRIBUTE_IDENTIFIER = #{$&} at #{@filename}:#{@lineno}")
     1351          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: V_ATTRIBUTE_IDENTIFIER = #{$&} at #{@filename}:#{@lineno}")
    13291352          yield :V_ATTRIBUTE_IDENTIFIER, $&
    13301353        end
     
    13491372        else
    13501373          adl_type = @adl_type.pop
    1351 #          puts "Escaping #{adl_type}"
    13521374          assert_at(__FILE__,__LINE__){adl_type == :dadl}
    13531375          yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
     
    13551377      when /\A\{/   # {
    13561378        @adl_type.push(:cadl)
    1357         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
     1379        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
    13581380        yield :SYM_START_CBLOCK, :SYM_START_CBLOCK
    13591381      when /\A\}/   # }
     
    13611383#        puts "Escaping #{adl_type}"
    13621384        assert_at(__FILE__,__LINE__){adl_type == :cadl}
    1363         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
     1385        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
    13641386        yield :SYM_END_CBLOCK, $&
    13651387      when /\A\-/   # -
     
    14461468      data = $' # variable $' receives the string after the match
    14471469    when :dadl
    1448 #      puts "Entering scan_dadl"
    14491470      data = scan_dadl(data) do |sym, val|
    14501471        yield sym, val
    14511472      end
    14521473    when :cadl
    1453 #      puts "Entering scan_cadl"
    14541474      data = scan_cadl(data) do |sym, val|
    14551475        yield sym, val
    14561476      end
    14571477    when :regexp
    1458 #      puts "Entering scan_regexp"
    14591478      data = scan_regexp(data) do |sym, val|
    14601479        yield sym, val
    14611480      end
    14621481    when :term_constraint
    1463 #      puts "Entering scan_term_constraint"
     1482      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     1483
    14641484      data = scan_term_constraint(data) do |sym, val|
    14651485        yield sym, val
     
    14731493
    14741494def scan_cadl(data)
     1495  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_cadl at #{@filename}:#{@lineno}: data = #{data.inspect}")
    14751496  until data.nil?  do
    14761497    case @adl_type.last
    14771498    when :cadl
    1478 #      puts "Entering scan_cadl"
    14791499      case scanned = @@cadl_scanner.parse(data)
    14801500      when Yaparc::Result::OK
     
    14971517      when /\A--.*\n/ # single line comment
    14981518        @lineno += 1
    1499         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     1519        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    15001520        ;
    15011521        ###----------/* symbols */ -------------------------------------------------
     
    15651585      when /\A\{/   # {
    15661586        @adl_type.push(:cadl)
    1567         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
     1587        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
    15681588        yield :SYM_START_CBLOCK, :SYM_START_CBLOCK
    15691589      when /\A\}/   # }
     
    15711591#        puts "Escaping #{adl_type}"
    15721592        assert_at(__FILE__,__LINE__){adl_type == :cadl}
    1573         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
     1593        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
    15741594        yield :SYM_END_CBLOCK, :SYM_END_CBLOCK
    15751595      when /\A\$/   # $
     
    15801600        yield :Question_mark_code, :Question_mark_code
    15811601      when /\A\|/   # |
    1582         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
     1602        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
    15831603        if @in_interval
    15841604          @in_interval = false
     
    15871607          @in_interval = true
    15881608        end
    1589         @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
     1609        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
    15901610        yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM
    15911611
    1592       when /\A\[[a-zA-Z0-9._\-]+::[a-zA-Z0-9._\-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
     1612      when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/  #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
     1613#      when /\A\[[a-zA-Z0-9._\-]+::[a-zA-Z0-9._\-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
    15931614        yield :V_QUALIFIED_TERM_CODE_REF, $&
    15941615      when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/   #ERR_V_QUALIFIED_TERM_CODE_REF
    15951616        yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&
    1596       when /\A\[([a-zA-Z0-9()._\-]+::[a-zA-Z0-9._\_-]+)\]/
    1597         yield :V_TERM_CODE_CONSTRAINT, :V_TERM_CODE_CONSTRAINT
    1598       when /\A\[[a-zA-Z0-9\(\)\._\-]+::[ \t\n]*/
     1617      when /\A\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/
    15991618        @adl_type.push(:term_constraint)
    1600         yield :START_TERM_CODE_CONSTRAINT, $&
     1619        yield :START_TERM_CODE_CONSTRAINT, $1
    16011620      when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/   #V_LOCAL_TERM_CODE_REF
    16021621        yield :V_LOCAL_TERM_CODE_REF, $&
     
    16181637          yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]
    16191638        else
    1620           @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}:#{@lineno}")
     1639          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}:#{@lineno}")
    16211640          yield :V_ATTRIBUTE_IDENTIFIER, word #V_ATTRIBUTE_IDENTIFIER /\A[a-z][a-zA-Z0-9_]*/
    16221641        end
     
    16541673      data = $' # variable $' receives the string after the match
    16551674    when :adl
    1656 #      puts "Entering scan_adl"
    16571675      data = scan_adl(data) do |sym, val|
    16581676        yield sym, val
    16591677      end
    16601678    when :dadl
    1661 #      puts "Entering scan_dadl"
    16621679      data = scan_dadl(data) do |sym, val|
    16631680        yield sym, val
    16641681      end
    16651682    when :regexp
    1666 #      puts "Entering scan_regexp"
    16671683      data = scan_regexp(data) do |sym, val|
    16681684        yield sym, val
    16691685      end
    16701686    when :term_constraint
    1671 #      puts "Entering scan_term_constraint"
     1687      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     1688     
    16721689      data = scan_term_constraint(data) do |sym, val|
    16731690        yield sym, val
     
    16801697
    16811698def scan_dadl(data)
     1699  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_dadl at #{@filename}:#{@lineno}: data = #{data.inspect}")
    16821700  until data.nil?  do
    16831701    case @adl_type.last
    16841702    when :dadl
    1685 #      puts "Entering scan_dadl"
    16861703      case scanned = @@dadl_scanner.parse(data)
    16871704      when Yaparc::Result::OK
     
    16991716      when /\A--.*\n/ # single line comment
    17001717        @lineno += 1
    1701         @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     1718        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    17021719        ;
    17031720        ###----------/* symbols */ -------------------------------------------------
     
    17301747        elsif @in_c_domain_type == false
    17311748          adl_type = @adl_type.pop
    1732 #          puts "Escaping #{adl_type}"
    17331749          assert_at(__FILE__,__LINE__){adl_type == :dadl}
    17341750          yield :SYM_END_DBLOCK, $&
     
    17711787        yield :Question_mark_code, :Question_mark_code
    17721788      when /\A\|/   # |
    1773         @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
     1789        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
    17741790        if @in_interval
    17751791          @in_interval = false
     
    17781794          @in_interval = true
    17791795        end
    1780         @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
     1796        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
    17811797        yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM
    17821798###       when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
     
    18271843      data = $' # variable $' receives the string after the match
    18281844    when :adl
    1829 #      puts "Entering scan_adl"
    18301845      data = scan_adl(data) do |sym, val|
    18311846        yield sym, val
    18321847      end
    18331848    when :cadl
    1834 #      puts "Entering scan_cadl"
    18351849      data = scan_cadl(data) do |sym, val|
    18361850        yield sym, val
     
    18421856      end
    18431857    when :term_constraint
    1844 #      puts "Entering scan_term_constraint"
     1858      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
     1859
    18451860      data = scan_term_constraint(data) do |sym, val|
    18461861        yield sym, val
     
    18531868
    18541869def scan_regexp(data)
     1870  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_regexp at #{@filename}:#{@lineno}: data = #{data.inspect}")
    18551871  until data.nil?  do
    18561872    case @adl_type.last
    18571873    when :regexp
    1858 #      puts "Entering scan_regexp"
    18591874      case data
    18601875      when /\A\/\}/ #V_REGEXP
     
    18801895      data = $' # variable $' receives the string after the match
    18811896    when :adl
    1882 #      puts "Entering scan_adl"
    18831897      data = scan_adl(data) do |sym, val|
    18841898        yield sym, val
    18851899      end
    18861900    when :dadl
    1887 #      puts "Entering scan_dadl"
    18881901      data = scan_dadl(data) do |sym, val|
    18891902        yield sym, val
    18901903      end
    18911904    when :cadl
    1892 #      puts "Entering scan_cadl"
    18931905      data = scan_cadl(data) do |sym, val|
    18941906        yield sym, val
    18951907      end
    18961908    when :term_constraint
    1897 #      puts "Entering scan_term_constraint"
     1909      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_regexp: Entering scan_term_constraint at #{@filename}:#{@lineno}")
    18981910      data = scan_term_constraint(data) do |sym, val|
    18991911        yield sym, val
     
    19061918
    19071919def scan_term_constraint(data)
     1920  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_term_constraint")
    19081921  until data.nil?  do
    19091922    case @adl_type.last
    19101923    when :term_constraint
    1911 #      puts "Entering scan_term_constraint"
    19121924      case data
    19131925      when /\A\n/ # carriage return
     
    19181930      when /\A--.*$/ # single line comment
    19191931        @lineno += 1
    1920         @@log.info("#{__FILE__}:#{__LINE__}: scan_term_constraint: COMMENT = #{$&} at #{@filename}:#{@lineno}")
     1932        #@@logger.debug("#{__FILE__}:#{__LINE__}: scan_term_constraint: COMMENT = #{$&} at #{@filename}:#{@lineno}")
    19211933        ;
    1922       when /\A[a-zA-Z0-9\._\-]+[ \t]*,/ # match any line, with ',' termination
    1923         yield :TERM_CODE, $&
    1924       when /\A[a-zA-Z0-9\._\-]+[ \t]*;/ #match second last line with ';' termination (assumed value)
    1925         yield :TERM_CODE, $&
    1926 #      when /\A[a-zA-Z0-9\._\-]+[ \t]*\]/ # match final line, terminating in ']'
    1927       when /\A[a-zA-Z0-9\._\-]*[ \t]*\]/ # match final line, terminating in ']'
     1934      when /\A([a-zA-Z0-9\._\-])+[ \t]*,/ # match any line, with ',' termination
     1935        yield :TERM_CODE, $1
     1936      when /\A([a-zA-Z0-9\._\-])+[ \t]*;/ # match second last line with ';' termination (assumed value)
     1937        yield :TERM_CODE, $1
     1938      when /\A([a-zA-Z0-9\._\-])*[ \t]*\]/ # match final line, terminating in ']'
    19281939        adl_type = @adl_type.pop
    19291940        assert_at(__FILE__,__LINE__){adl_type == :term_constraint}
    1930         yield :END_TERM_CODE_CONSTRAINT, $&
     1941        yield :END_TERM_CODE_CONSTRAINT, $1
    19311942      else
    19321943        raise "data = #{data}"
     
    19341945      data = $' # variable $' receives the string after the match
    19351946    when :adl
    1936 #      puts "Entering scan_adl"
    19371947      data = scan_adl(data) do |sym, val|
    19381948        yield sym, val
    19391949      end
    19401950    when :dadl
    1941 #      puts "Entering scan_dadl"
    19421951      data = scan_dadl(data) do |sym, val|
    19431952        yield sym, val
    19441953      end
    19451954    when :cadl
    1946 #      puts "Entering scan_cadl"
    19471955      data = scan_cadl(data) do |sym, val|
    19481956        yield sym, val
  • ruby/trunk/lib/adl_parser/test/parser_test.rb

    r258 r261  
    1 #require 'lib/adl_parser.rb'
    21require File.dirname(__FILE__) + '/test_helper.rb'
    32
     
    76  end
    87
    9   def test_init
     8  must "assert parser instance" do
    109    assert_instance_of ::OpenEHR::ADL::Parser,@parser
    1110  end
    1211
    13   def test_parse
     12  must "openEHR-EHR-OBSERVATION.body_mass_index.v1.adl be properly parsed" do
    1413    body_mass_index =  File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl")
    15 #    body_mass_index = File.read('test/adl/openEHR-EHR-OBSERVATION.body_mass_index.v1.adl')
    1614    assert_nothing_raised do
    1715      ast = @parser.parse(body_mass_index, 'openEHR-EHR-OBSERVATION.body_mass_index.v1.adl')
    1816      assert_instance_of OpenEHR::RM::Support::Identification::Archetype_ID, ast.archetype_id
    1917    end
    20 
     18  end
     19
     20  must "openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl be properly parsed" do
    2121    laboratory_request = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.Laboratory_request.v1.adl")
    2222    assert_nothing_raised do
     
    2626      assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, result.definition
    2727    end
    28 
     28  end
     29
     30  must "openEHR-EHR-OBSERVATION.apgar.v1.adl be properly parsed" do
    2931    apgar = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-OBSERVATION.apgar.v1.adl")
    3032    assert_nothing_raised do
     
    3436      assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, result.definition
    3537    end
    36 
     38  end
     39
     40  must "openEHR-EHR-EVALUATION.adverse.v1.adl be properly parsed" do
    3741    evaluation = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-EVALUATION.adverse.v1.adl")
    3842    assert_nothing_raised do
    3943      @parser.parse(evaluation, 'openEHR-EHR-EVALUATION.adverse.v1')
    4044    end
    41 
     45  end
     46
     47  must "openEHR-EHR-ITEM_TREE.referral.v1.adl be properly parsed" do
    4248    referral = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.referral.v1.adl")
    4349    assert_nothing_raised do
    4450      @parser.parse(referral, 'openEHR-EHR-ITEM_TREE.referral.v1')
    4551    end
    46 
     52  end
     53
     54  must "openEHR-EHR-CLUSTER.exam-fetus.v1.adl be properly parsed" do
    4755    exam_fetus = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-fetus.v1.adl")
    4856    assert_nothing_raised do
    4957      @parser.parse(exam_fetus, 'openEHR-EHR-CLUSTER.exam-fetus.v1')
    5058    end
    51 
     59  end
     60
     61  must "openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl be properly parsed" do
    5262    exam_uterine_cervix = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl")
    5363    assert_nothing_raised do
    5464      @parser.parse(exam_uterine_cervix, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1')
    5565    end
    56 
     66  end
     67
     68  must "openEHR-EHR-ACTION.imaging.v1.adl be properly parsed" do
    5769    imaging = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.imaging.v1.adl")
    5870    assert_nothing_raised do
    5971      @parser.parse(imaging, 'openEHR-EHR-ACTION.imaging.v1')
    6072    end
    61 
     73  end
     74
     75  must "openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl be properly parsed" do
    6276    exam_nervous_system = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl")
    6377    assert_nothing_raised do
    6478      @parser.parse(exam_nervous_system, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1')
    6579    end
    66 
     80  end
     81
     82  must "openEHR-EHR-CLUSTER.exam-generic.v1.adl be properly parsed" do
    6783    exam_generic = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic.v1.adl")
    6884    assert_nothing_raised do
    6985      @parser.parse(exam_generic, 'openEHR-EHR-CLUSTER.exam-generic.v1')
    7086    end
    71 
     87  end
     88
     89  must "openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl be properly parsed" do
    7290    exam_generic_mass = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-mass.v1.adl")
    7391    assert_nothing_raised do
    7492      @parser.parse(exam_generic_mass, 'openEHR-EHR-CLUSTER.exam-generic-mass.v1')
    7593    end
    76 
    77 #     exam_generic_lymphnode = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl")
    78 #     assert_nothing_raised do
    79 #       @parser.parse(exam_generic_lymphnode, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1')
    80 #     end
    81 
    82 #     exam_generic_joint = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl")
    83 #     assert_nothing_raised do
    84 #       @parser.parse(exam_generic_joint, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1')
    85 #     end
    86 
    87 #     exam_chest = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl")
    88 #     assert_nothing_raised do
    89 #       @parser.parse(exam_chest, 'openEHR-EHR-CLUSTER.exam-chest.v1')
    90 #     end
    91 
    92 #     exam_abdomen = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl")
    93 #     assert_nothing_raised do
    94 #       @parser.parse(exam_abdomen, 'openEHR-EHR-CLUSTER.exam-abdomen.v1')
    95 #     end
    96 
    97 #     cluster_auscultation = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl")
    98 #     assert_nothing_raised do
    99 #       @parser.parse(cluster_auscultation, 'openEHR-EHR-CLUSTER.auscultation.v1')
    100 #     end
    101 
    102 #     cluster_auscultation_chest = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl")
    103 #     assert_nothing_raised do
    104 #       @parser.parse(cluster_auscultation_chest, 'openEHR-EHR-CLUSTER.auscultation-chest.v1')
    105 #     end
    106 
    107 #     vital_signs = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.vital_signs.v1.adl")
    108 #     assert_nothing_raised do
    109 #       @parser.parse(vital_signs, 'openEHR-EHR-SECTION.vital_signs.v1')
    110 #     end
    111 
    112 #     summary = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.summary.v1.adl")
    113 #     assert_nothing_raised do
    114 #       @parser.parse(summary, 'openEHR-EHR-SECTION.summary.v1')
    115 #     end
    116 
    117 #     findings = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.findings.v1.adl")
    118 #     assert_nothing_raised do
    119 #       @parser.parse(findings, 'openEHR-EHR-SECTION.findings.v1')
    120 #     end
    121 
    122 #     reason_for_encounter = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl")
    123 #     assert_nothing_raised do
    124 #       @parser.parse(reason_for_encounter, 'openEHR-EHR-SECTION.reason_for_encounter.v1')
    125 #     end
    126 
    127 #     imaging = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.imaging.v1.adl")
    128 #     assert_nothing_raised do
    129 #       @parser.parse(imaging, 'openEHR-EHR-ITEM_TREE.imaging.v1')
    130 #     end
    131 
    132 #     instruction_referral = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl")
    133 #     assert_nothing_raised do
    134 #       @parser.parse(instruction_referral, 'openEHR-EHR-INSTRUCTION.referral.v1')
    135 #     end
    136 
    137 #     instruction_medication = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl")
    138 #     assert_nothing_raised do
    139 #       @parser.parse(instruction_medication, 'openEHR-EHR-INSTRUCTION.medication.v1')
    140 #     end
    141 
    142 #     action_referral = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.referral.v1.adl")
    143 #     assert_nothing_raised do
    144 #       @parser.parse(action_referral, 'openEHR-EHR-ACTION.referral.v1')
    145 #     end
    146 
    147 #     dimensions_circumference = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl")
    148 #     assert_nothing_raised do
    149 #       @parser.parse(dimensions_circumference, 'openEHR-EHR-CLUSTER.dimensions.v1')
    150 #     end
    151 
    152 #     discharge = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl")
    153 #     assert_nothing_raised do
    154 #       @parser.parse(discharge, 'openEHR-EHR-COMPOSITION.discharge.v1draft')
    155 #     end
    156 
    157 #     encounter = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl")
    158 #     assert_nothing_raised do
    159 #       @parser.parse(encounter, 'openEHR-EHR-COMPOSITION.encounter.v1draft')
    160 #     end
    161 
    162 
    163 #     medication = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.medication.v1.adl")
    164 #     assert_nothing_raised do
    165 #       @parser.parse(medication, 'openEHR-EHR-ITEM_TREE.medication.v1.adl")
    166 #     end
     94  end
     95
     96  must "openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl be properly parsed" do
     97    exam_generic_lymphnode = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1.adl")
     98    assert_nothing_raised do
     99      @parser.parse(exam_generic_lymphnode, 'openEHR-EHR-CLUSTER.exam-generic-lymphnode.v1')
     100    end
     101  end
     102
     103  must "openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl be properly parsed" do
     104    exam_generic_joint = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-generic-joint.v1.adl")
     105    assert_nothing_raised do
     106      @parser.parse(exam_generic_joint, 'openEHR-EHR-CLUSTER.exam-generic-joint.v1')
     107    end
     108  end
     109
     110  must "openEHR-EHR-CLUSTER.exam-chest.v1.adl be properly parsed" do
     111    exam_chest = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-chest.v1.adl")
     112    assert_nothing_raised do
     113      @parser.parse(exam_chest, 'openEHR-EHR-CLUSTER.exam-chest.v1')
     114    end
     115  end
     116
     117  must "openEHR-EHR-CLUSTER.exam-abdomen.v1.adl be properly parsed" do
     118    exam_abdomen = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-abdomen.v1.adl")
     119    assert_nothing_raised do
     120      @parser.parse(exam_abdomen, 'openEHR-EHR-CLUSTER.exam-abdomen.v1')
     121    end
     122  end
     123
     124  must "openEHR-EHR-CLUSTER.auscultation.v1.adl be properly parsed" do
     125    cluster_auscultation = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation.v1.adl")
     126    assert_nothing_raised do
     127      @parser.parse(cluster_auscultation, 'openEHR-EHR-CLUSTER.auscultation.v1')
     128    end
     129  end
     130
     131  must "openEHR-EHR-CLUSTER.auscultation-chest.v1.adl be properly parsed" do
     132    cluster_auscultation_chest = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.auscultation-chest.v1.adl")
     133    assert_nothing_raised do
     134      @parser.parse(cluster_auscultation_chest, 'openEHR-EHR-CLUSTER.auscultation-chest.v1')
     135    end
     136  end
     137
     138  must "openEHR-EHR-SECTION.vital_signs.v1.adl be properly parsed" do
     139    vital_signs = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.vital_signs.v1.adl")
     140    assert_nothing_raised do
     141      @parser.parse(vital_signs, 'openEHR-EHR-SECTION.vital_signs.v1')
     142    end
     143  end
     144
     145  must "openEHR-EHR-SECTION.summary.v1.adl be properly parsed" do
     146    summary = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.summary.v1.adl")
     147    assert_nothing_raised do
     148      @parser.parse(summary, 'openEHR-EHR-SECTION.summary.v1')
     149    end
     150  end
     151
     152  must "openEHR-EHR-SECTION.findings.v1.adl be properly parsed" do
     153    findings = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.findings.v1.adl")
     154    assert_nothing_raised do
     155      @parser.parse(findings, 'openEHR-EHR-SECTION.findings.v1')
     156    end
     157  end
     158
     159  must "openEHR-EHR-SECTION.reason_for_encounter.v1.adl be properly parsed" do
     160    reason_for_encounter = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-SECTION.reason_for_encounter.v1.adl")
     161    assert_nothing_raised do
     162      @parser.parse(reason_for_encounter, 'openEHR-EHR-SECTION.reason_for_encounter.v1')
     163    end
     164  end
     165
     166  must "openEHR-EHR-ITEM_TREE.imaging.v1.adl be properly parsed" do
     167    imaging = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.imaging.v1.adl")
     168    assert_nothing_raised do
     169      @parser.parse(imaging, 'openEHR-EHR-ITEM_TREE.imaging.v1')
     170    end
     171  end
     172
     173  must "openEHR-EHR-INSTRUCTION.referral.v1.adl be properly parsed" do
     174    instruction_referral = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.referral.v1.adl")
     175    assert_nothing_raised do
     176      @parser.parse(instruction_referral, 'openEHR-EHR-INSTRUCTION.referral.v1')
     177    end
     178  end
     179
     180  must "openEHR-EHR-INSTRUCTION.medication.v1.adl be properly parsed" do
     181    instruction_medication = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-INSTRUCTION.medication.v1.adl")
     182    assert_nothing_raised do
     183      @parser.parse(instruction_medication, 'openEHR-EHR-INSTRUCTION.medication.v1')
     184    end
     185  end
     186
     187  must "openEHR-EHR-ACTION.referral.v1.adl be properly parsed" do
     188    action_referral = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ACTION.referral.v1.adl")
     189    assert_nothing_raised do
     190      @parser.parse(action_referral, 'openEHR-EHR-ACTION.referral.v1')
     191    end
     192  end
     193
     194  must "openEHR-EHR-CLUSTER.dimensions.v1.adl be properly parsed" do
     195    dimensions_circumference = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.dimensions.v1.adl")
     196    assert_nothing_raised do
     197      @parser.parse(dimensions_circumference, 'openEHR-EHR-CLUSTER.dimensions.v1')
     198    end
     199  end
     200
     201  must "openEHR-EHR-COMPOSITION.discharge.v1draft.adl be properly parsed" do
     202    discharge = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.discharge.v1draft.adl")
     203    assert_nothing_raised do
     204      @parser.parse(discharge, 'openEHR-EHR-COMPOSITION.discharge.v1draft')
     205    end
     206  end
     207
     208  must "openEHR-EHR-COMPOSITION.encounter.v1draft.adl be properly parsed" do
     209    encounter = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-COMPOSITION.encounter.v1draft.adl")
     210    assert_nothing_raised do
     211      @parser.parse(encounter, 'openEHR-EHR-COMPOSITION.encounter.v1draft')
     212    end
     213  end
     214
     215  must "openEHR-EHR-ITEM_TREE.medication.v1.adl be properly parsed" do
     216    medication = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-ITEM_TREE.medication.v1.adl")
     217    assert_nothing_raised do
     218      @parser.parse(medication, 'openEHR-EHR-ITEM_TREE.medication.v1.adl')
     219    end
    167220  end
    168221end
  • ruby/trunk/lib/adl_parser/test/scanner_test.rb

    r116 r261  
    1 require 'lib/adl_parser.rb'
    2 #require 'lib/scanner.rb'
    3 require 'test/unit'
     1require File.dirname(__FILE__) + '/test_helper.rb'
    42
    53class YaparcParserTest < Test::Unit::TestCase
    6   def test_RootScanner
     4  must "assert root scanner instance" do
    75    parser = OpenEHR::ADL::Scanner::DADL::RootScanner.new
    86    assert_instance_of OpenEHR::ADL::Scanner::DADL::RootScanner,parser
     
    108  end
    119
    12   def test_V_LOCAL_TERM_CODE_REF
     10  # \[{ALPHANUM}{NAMECHAR}*\]
     11  must "assert V_LOCAL_TERM_CODE_REF scanner is properly working" do
    1312    parser = OpenEHR::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF.new
    1413    assert_instance_of OpenEHR::ADL::Scanner::Common::V_LOCAL_TERM_CODE_REF,parser
     
    1716  end
    1817
    19   def test_V_QUALIFIED_TERM_CODE_REF
     18  must "assert V_QUALIFIED_TERM_CODE_REF scanner is properly working" do
    2019    parser = OpenEHR::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF.new
    2120    assert_instance_of OpenEHR::ADL::Scanner::Common::V_QUALIFIED_TERM_CODE_REF,parser
     
    2625  end
    2726
    28   def test_V_STRING
     27  must "assert V_STRING scanner is properly working" do
    2928    parser = OpenEHR::ADL::Scanner::Common::V_STRING.new
    3029    assert_instance_of OpenEHR::ADL::Scanner::Common::V_STRING,parser
     
    3534  end
    3635
    37   def test_V_REAL
     36  must "assert V_REAL scanner is properly working" do
    3837    parser = OpenEHR::ADL::Scanner::Common::V_REAL.new
    3938    assert_instance_of OpenEHR::ADL::Scanner::Common::V_REAL,parser
     
    4645  end
    4746
    48   def test_V_ISO8601_DURATION
     47  must "assert V_ISO8601_DURATION scanner is properly working" do
    4948    parser = OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION.new
    5049    assert_instance_of OpenEHR::ADL::Scanner::Common::V_ISO8601_DURATION,parser
     
    5655  end
    5756
    58   def test_V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN
     57  must "assert V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN scanner is properly working" do
    5958    parser = OpenEHR::ADL::Scanner::CADL::V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN.new
    6059    assert_instance_of OpenEHR::ADL::Scanner::CADL::V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN,parser
     
    6362  end
    6463
    65   def test_V_ISO8601_DATE_CONSTRAINT_PATTERN
     64  must "assert V_ISO8601_DATE_CONSTRAINT_PATTERN scanner is properly working" do
    6665    parser = OpenEHR::ADL::Scanner::CADL::V_ISO8601_DATE_CONSTRAINT_PATTERN.new
    6766    assert_instance_of OpenEHR::ADL::Scanner::CADL::V_ISO8601_DATE_CONSTRAINT_PATTERN,parser
     
    7069  end
    7170
    72   def test_V_ISO8601_TIME_CONSTRAINT_PATTERN
     71  must "assert V_ISO8601_TIME_CONSTRAINT_PATTERN scanner is properly working" do
    7372    parser = OpenEHR::ADL::Scanner::CADL::V_ISO8601_TIME_CONSTRAINT_PATTERN.new
    7473    assert_instance_of OpenEHR::ADL::Scanner::CADL::V_ISO8601_TIME_CONSTRAINT_PATTERN,parser
     
    7776  end
    7877
    79   def test_dadl_reserved
     78  must "assert reserved words in dADL scanner is properly working" do
    8079    parser = OpenEHR::ADL::Scanner::DADL::RootScanner.new
    8180    result = parser.parse('then')
     
    8685  end
    8786
    88   def test_cadl
     87  must "assert reserved words in cADL scanner is properly working" do
    8988    parser = OpenEHR::ADL::Scanner::CADL::RootScanner.new
    9089    assert_instance_of OpenEHR::ADL::Scanner::CADL::RootScanner,parser
     
    9796  end
    9897
    99   def test_cadl_reserved
     98  must "assert other reserved words in cADL scanner is properly working" do
    10099    parser = OpenEHR::ADL::Scanner::CADL::RootScanner.new
    101100    result = parser.parse('then')
     
    109108    assert_equal [:SYM_ORDERED, :SYM_ORDERED], result.value
    110109  end
    111 
    112  
    113110end
  • ruby/trunk/lib/adl_parser/test/semantic_test.rb

    r116 r261  
    1 require 'lib/adl_parser.rb'
    2 require 'test/unit'
     1require File.dirname(__FILE__) + '/test_helper.rb'
    32
    43class ADLSemanticTest < Test::Unit::TestCase
     
    76  end
    87
    9   def test_init
     8  must "assert adl parser instance" do
    109    assert_instance_of ::OpenEHR::ADL::Parser,@parser
    1110  end
  • ruby/trunk/lib/adl_parser/test/shell_test.rb

    r116 r261  
    1 require 'lib/adl_parser.rb'
    2 require 'test/unit'
     1require File.dirname(__FILE__) + '/test_helper.rb'
    32
    43class ShellADLValidatorTest < Test::Unit::TestCase
     
    76  end
    87
    9   def test_init
     8  must "assert application validator instance" do
    109    assert_instance_of ::OpenEHR::Application::ADLValidator,@adl_validator
    1110  end
    1211
    13   def test_run
     12
     13  must "validating openEHR-EHR-CLUSTER.exam-nervous_system.v1 using File.open not raised" do
    1414    assert_nothing_raised do
    15       adl_file = File.open('test/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
     15      adl_file = File.open("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl")
    1616      @adl_validator.run(adl_file)
    1717    end
     18  end
     19
     20  must "validating openEHR-EHR-CLUSTER.exam-nervous_system.v1 using File.read not raised" do
    1821    assert_nothing_raised do
    19       adl_string = File.open('test/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
    20       @adl_validator.run(adl_string)
    21     end
    22     assert_nothing_raised do
    23       adl_string = File.read('test/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
     22      adl_string = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl")
    2423      stringio = StringIO.new(adl_string)
    2524      @adl_validator.run(stringio)
  • ruby/trunk/lib/adl_parser/test/test_helper.rb

    r258 r261  
    55require "rubygems"
    66require 'adl_parser.rb'
     7require 'adl_scanner.rb'
    78require 'rm.rb'
    89require 'am.rb'
    910
    1011
     12# c.f. "Ruby Best Practice",p.75
     13module Test::Unit
     14  class TestCase
     15    def self.must(name, &block)
     16      test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
     17      defined = instance_method(test_name) rescue false
     18      raise "#{test_name} is already defined in #{self}" if defined
     19      if block_given?
     20        define_method(test_name, &block)
     21      else
     22        define_method(test_name) do
     23          flunk "No implementation provided for #{name}"
     24        end
     25      end
     26    end
     27  end
     28end
  • ruby/trunk/lib/adl_parser/test/validator_test.rb

    r116 r261  
    1 require 'lib/adl_parser.rb'
    2 require 'test/unit'
     1require File.dirname(__FILE__) + '/test_helper.rb'
     2
    33
    44class ADLValidatorTest < Test::Unit::TestCase
     
    77  end
    88
    9   def test_init
     9  must "assert adl validator instance" do
    1010    assert_instance_of ::OpenEHR::ADL::Validator,@validator
    1111  end
    1212
    13   def test_validate
    14     exam_nervous_system = File.read('test/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
     13  must "assert validation openEHR-EHR-CLUSTER.exam-nervous_system.v1" do
     14    exam_nervous_system = File.read("#{TEST_ROOT_DIR}/adl/openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl")
    1515    assert_nothing_raised do
    16       @validator.validate(exam_nervous_system, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1.adl')
     16      @validator.validate(exam_nervous_system, 'openEHR-EHR-CLUSTER.exam-nervous_system.v1')
    1717    end
    18 
     18  end
    1919#     exam_uterine_cervix = File.read('tests/openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
    2020# #    assert_raise(Racc::ParseError) do
    2121#    @validator.validate(exam_uterine_cervix, 'openEHR-EHR-CLUSTER.exam-uterine_cervix.v1.adl')
    2222# #    end
    23 
    24   end
    2523end
Note: See TracChangeset for help on using the changeset viewer.