Index: ruby/trunk/lib/adl_parser/lib/parser.rb
===================================================================
--- ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 265)
+++ ruby/trunk/lib/adl_parser/lib/parser.rb	(revision 283)
@@ -11,9 +11,10 @@
 $:.unshift File.join(File.dirname(__FILE__))
 require 'logger'
+require 'yaml'
 require 'rubygems'
 require 'adl_parser.rb'
 require 'am.rb'
 require 'rm.rb'
-$DEBUG = true
+$DEBUG = false
 
 
@@ -23,5 +24,5 @@
     class Parser < Racc::Parser
 
-module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1205)
+module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1208)
 
 def assert_at(file,line, message = "")
@@ -39,6 +40,4 @@
 end
 
-@@dadl_scanner = OpenEHR::ADL::Scanner::DADL::RootScanner.new
-@@cadl_scanner = OpenEHR::ADL::Scanner::CADL::RootScanner.new
 
 ###----------/* keywords */ --------------------------------------------- 
@@ -103,35 +102,9 @@
 def scan
   @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan at #{@filename}:#{@lineno}:")
-  adl_scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename)
-  cadl_scanner = OpenEHR::ADL::Scanner::CADLScanner.new(@adl_type, @filename)
-  dadl_scanner = OpenEHR::ADL::Scanner::DADLScanner.new(@adl_type, @filename)
-  regex_scanner = OpenEHR::ADL::Scanner::RegexScanner.new(@adl_type, @filename)
-  term_constraint_scanner = OpenEHR::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename)
+  scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename)
 
   until @data.nil?  do
-    case @adl_type.last
-    when :adl
-      @data = adl_scanner.scan(@data) do |sym, val|
+    @data = scanner.scan(@data) do |sym, val|
         yield sym, val
-      end
-    when :dadl
-      @data = dadl_scanner.scan(@data) do |sym, val|
-        yield sym, val
-      end
-    when :cadl
-      @data = cadl_scanner.scan(@data) do |sym, val|
-        yield sym, val
-      end
-    when :regexp
-      @data = regex_scanner.scan(@data) do |sym, val|
-        yield sym, val
-      end
-    when :term_constraint
-      @@logger.debug("#{__FILE__}:#{__LINE__}: scan: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{@data.inspect}")
-      @data = term_constraint_scanner.scan(@data) do |sym, val|
-        yield sym, val
-      end
-    else
-      raise
     end
     @data = $' # variable $' receives the string after the match
@@ -140,687 +113,4 @@
   yield false, '$'
 end # of scan
-
-### def scan
-###   @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan at #{@filename}:#{@lineno}:")
-  
-###   until @data.nil?  do
-###     case @adl_type.last
-###     when :adl
-###       @data = scan_adl(@data) do |sym, val|
-###         yield sym, val
-###       end
-###     when :dadl
-###       @data = scan_dadl(@data) do |sym, val|
-###         yield sym, val
-###       end
-###     when :cadl
-###       @data = scan_cadl(@data) do |sym, val|
-###         yield sym, val
-###       end
-###     when :regexp
-###       @data = scan_regexp(@data) do |sym, val|
-###         yield sym, val
-###       end
-###     when :term_constraint
-###       @@logger.debug("#{__FILE__}:#{__LINE__}: scan: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
-###       @data = scan_term_constraint(@data) do |sym, val|
-###         yield sym, val
-###       end
-###     else
-###       raise
-###     end
-###     @data = $' # variable $' receives the string after the match
-###   end
-###   yield :EOF, nil
-###   yield false, '$'
-### end # of scan
-
-def scan_adl(data)
-  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_adl at #{@filename}:#{@lineno}: data = #{data.inspect}")
-  until data.nil?  do
-    case @adl_type.last
-    when :adl
-      case data
-      when /\A\n/ # carriage return
-        @lineno += 1
-        ;
-      when /\A[ \t\r\f]+/ #just drop it
-        ;
-      when /\A--.*\n/ # single line comment
-        @lineno += 1
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
-        ;
-      when /\Adescription/   # description
-        yield :SYM_DESCRIPTION, :SYM_DESCRIPTION
-      when /\Adefinition/   # definition
-        yield :SYM_DEFINITION, :SYM_DEFINITION
-        ###----------/* symbols */ ------------------------------------------------- 
-      when /\A[A-Z][a-zA-Z0-9_]*/
-        yield :V_TYPE_IDENTIFIER, $&
-#      when /\A[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z0-9]+/   #V_ARCHETYPE_ID
-      when /\A(\w+)-(\w+)-(\w+)\.(\w+)(-\w+)?\.(v\w+)/   #V_ARCHETYPE_ID
-        object_id, rm_originator, rm_name, rm_entity, concept_name, specialisation, version_id = $&, $1, $2, $3, $4, $5, $6
-        archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)
-#        yield :V_ARCHETYPE_ID, $&
-        yield :V_ARCHETYPE_ID, archetype_id
-      when /\A[a-z][a-zA-Z0-9_]*/
-#        word = $&.downcase
-        word = $&
-        if @@adl_reserved[word]
-          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: @@adl_reserved = #{@@adl_reserved[word]} at #{@filename}:#{@lineno}")
-          yield @@adl_reserved[word], @@adl_reserved[word]
-        elsif #/\A[A-Z][a-zA-Z0-9_]*/
-          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: V_ATTRIBUTE_IDENTIFIER = #{$&} at #{@filename}:#{@lineno}")
-          yield :V_ATTRIBUTE_IDENTIFIER, $&
-        end
-      when /\A\=/   # =
-        yield :SYM_EQ, :SYM_EQ
-      when /\A\>=/   # >=
-        yield :SYM_GE, :SYM_GE
-      when /\A\<=/   # <=
-        yield :SYM_LE, :SYM_LE
-      when /\A\</   # <
-        if @in_interval
-#          @start_block_received = false
-          yield :SYM_LT, :SYM_LT
-        else
-#          @start_block_received = true
-          @adl_type.push(:dadl)
-          yield :SYM_START_DBLOCK,  $&
-        end
-      when /\A\>/   # >
-        if @in_interval
-          yield :SYM_GT, :SYM_GT
-        else
-          adl_type = @adl_type.pop
-          assert_at(__FILE__,__LINE__){adl_type == :dadl}
-          yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
-        end
-      when /\A\{/   # {
-        @adl_type.push(:cadl)
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
-        yield :SYM_START_CBLOCK, :SYM_START_CBLOCK
-      when /\A\}/   # }
-        adl_type = @adl_type.pop
-#        puts "Escaping #{adl_type}"
-        assert_at(__FILE__,__LINE__){adl_type == :cadl}
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
-        yield :SYM_END_CBLOCK, $&
-      when /\A\-/   # -
-        yield :Minus_code, :Minus_code
-      when /\A\+/   # +
-        yield :Plus_code, :Plus_code
-      when /\A\*/   # *
-        yield :Star_code, :Star_code
-      when /\A\//   # /
-        yield :Slash_code, :Slash_code
-      when /\A\^/   # ^
-        yield :Caret_code, :Caret_code
-      when /\A\=/   # =
-        yield :Equal_code, :Equal_code
-      when /\A\.\.\./   # ...
-        yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE
-      when /\A\.\./   # ..
-        yield :SYM_ELLIPSIS, :SYM_ELLIPSIS
-      when /\A\./   # .
-        yield :Dot_code, :Dot_code
-      when /\A\;/   # ;
-        yield :Semicolon_code, :Semicolon_code
-      when /\A\,/   # ,
-        yield :Comma_code, :Comma_code
-      when /\A\:/   # :
-        yield :Colon_code, :Colon_code
-      when /\A\!/   # !
-        yield :Exclamation_code, :Exclamation_code
-      when /\A\(/   # (
-        yield :Left_parenthesis_code, :Left_parenthesis_code
-      when /\A\)/   # )
-        yield :Right_parenthesis_code, :Right_parenthesis_code
-      when /\A\$/   # $
-        yield :Dollar_code, :Dollar_code
-      when /\A\?\?/   # ??
-        yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN
-      when /\A\?/   # ?
-        yield :Question_mark_code, :Question_mark_code
-      when /\A[0-9]+\.[0-9]+(\.[0-9]+)*/   # ?
-        yield :V_VERSION_STRING, $&
-      when /\A\|/   # |
-        if @in_interval
-          @in_interval = false
-        else
-          @in_interval = true
-        end
-        yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM
-      when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/
-#      when /\A\[[a-zA-Z0-9()\._-]+\:\:[a-zA-Z0-9\._-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
-        yield :V_QUALIFIED_TERM_CODE_REF, $&
-      when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/   #V_LOCAL_TERM_CODE_REF
-        yield :V_LOCAL_TERM_CODE_REF, $&
-      when /\A\[/   # [
-        yield :Left_bracket_code, :Left_bracket_code
-      when /\A\]/   # ]
-        yield :Right_bracket_code, :Right_bracket_code
-
-      when /\A"([^"]*)"/m #V_STRING
-        yield :V_STRING, $1
-      when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/   #ERR_V_QUALIFIED_TERM_CODE_REF
-        yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&
-      when /\Aa[ct][0-9.]+/   #V_LOCAL_CODE
-        yield :V_LOCAL_CODE, $&
-      when /\A[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](,[0-9]+)?(Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9](Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9](Z|[+-][0-9]{4})?/   #V_ISO8601_EXTENDED_DATE_TIME YYYY-MM-DDThh:mm:ss[,sss][Z|+/- -n-n-n-n-]-
-        yield :V_ISO8601_EXTENDED_DATE_TIME, $&
-      when /\A[0-2][0-9]:[0-6][0-9]:[0-6][0-9](,[0-9]+)?(Z|[+-][0-9]{4})?|[0-2][0-9]:[0-6][0-9](Z|[+-][0-9]{4})? /   #V_ISO8601_EXTENDED_TIME hh:mm:ss[,sss][Z|+/-nnnn]
-        yield :V_ISO8601_EXTENDED_TIME, $&
-      when /\A[0-9]{4}-[0-1][0-9]-[0-3][0-9]|[0-9]{4}-[0-1][0-9]/   #V_ISO8601_EXTENDED_DATE YYYY-MM-DD
-        yield :V_ISO8601_EXTENDED_DATE, $&
-      when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/   #V_GENERIC_TYPE_IDENTIFIER
-        yield :V_GENERIC_TYPE_IDENTIFIER, $&
-      when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/   #V_INTEGER
-        yield :V_INTEGER, $&
-      when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ /   #V_REAL
-        yield :V_REAL, $&
-        #    when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING
-      when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI
-        yield :V_URI, $&
-      when /\AP([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?T([0-9]+[hH])?([0-9]+[mM])?([0-9]+[sS])?|P([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?/   #V_ISO8601_DURATION PnYnMnWnDTnnHnnMnnS
-        yield :V_ISO8601_DURATION, $&
-      when /\A\S/ #UTF8CHAR
-        yield :UTF8CHAR, $&
-      end
-      data = $' # variable $' receives the string after the match
-    when :dadl
-      data = scan_dadl(data) do |sym, val|
-        yield sym, val
-      end
-    when :cadl
-      data = scan_cadl(data) do |sym, val|
-        yield sym, val
-      end
-    when :regexp
-      data = scan_regexp(data) do |sym, val|
-        yield sym, val
-      end
-    when :term_constraint
-      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
-
-      data = scan_term_constraint(data) do |sym, val|
-        yield sym, val
-      end
-    else
-      raise
-    end
-  end
-end # scan_adl
-
-
-def scan_cadl(data)
-  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_cadl at #{@filename}:#{@lineno}: data = #{data.inspect}")
-  until data.nil?  do
-    case @adl_type.last
-    when :cadl
-      case scanned = @@cadl_scanner.parse(data)
-      when Yaparc::Result::OK
-        if scanned.value[0] == :START_V_C_DOMAIN_TYPE_BLOCK
-          @in_c_domain_type = true
-          @adl_type.push(:dadl)
-          yield scanned.value
-        else
-          yield scanned.value
-        end
-        data = scanned.input
-      end
-
-      case data
-      when /\A\n/ # carriage return
-        @lineno += 1
-        ;
-      when /\A[ \t\r\f]+/ #just drop it
-        ;
-      when /\A--.*\n/ # single line comment
-        @lineno += 1
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
-        ;
-        ###----------/* symbols */ ------------------------------------------------- 
-      when /\A\=/   # =
-        yield :SYM_EQ, :SYM_EQ
-      when /\A\>=/   # >=
-        yield :SYM_GE, :SYM_GE
-      when /\A\<=/   # <=
-        yield :SYM_LE, :SYM_LE
-###       when /\A[A-Z][a-zA-Z0-9_]*[ \n]*\</   # V_C_DOMAIN_TYPE
-###         @in_c_domain_type = true
-###         @adl_type.push(:dadl)
-###         yield :START_V_C_DOMAIN_TYPE_BLOCK, $&
-      when /\A\</   # <
-        if @in_interval
-          yield :SYM_LT, :SYM_LT
-        else
-          @adl_type.push(:dadl)
-          yield :SYM_START_DBLOCK,  $&
-        end
-      when /\A\>/   # >
-        if @in_interval
-          yield :SYM_GT, :SYM_GT
-        else
-          adl_type = @adl_type.pop
-#          puts "Escaping #{adl_type}"
-          assert_at(__FILE__,__LINE__){adl_type == :dadl}
-          yield :SYM_END_DBLOCK, :SYM_END_DBLOCK
-        end
-      when /\A\-/   # -
-        yield :Minus_code, :Minus_code
-      when /\A\+/   # +
-        yield :Plus_code, :Plus_code
-      when /\A\*/   # *
-        yield :Star_code, :Star_code
-      when /\A\//   # /
-        yield :Slash_code, :Slash_code
-      when /\A\^/   # ^
-        yield :Caret_code, :Caret_code
-      when /\A\.\.\./   # ...
-        yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE
-      when /\A\.\./   # ..
-        yield :SYM_ELLIPSIS, :SYM_ELLIPSIS
-      when /\A\./   # .
-        yield :Dot_code, :Dot_code
-      when /\A\;/   # ;
-        yield :Semicolon_code, :Semicolon_code
-      when /\A\,/   # ,
-        yield :Comma_code, :Comma_code
-      when /\A\:/   # :
-        yield :Colon_code, :Colon_code
-      when /\A\!/   # !
-        yield :Exclamation_code, :Exclamation_code
-      when /\A\(/   # (
-        yield :Left_parenthesis_code, :Left_parenthesis_code
-      when /\A\)/   # )
-        yield :Right_parenthesis_code, :Right_parenthesis_code
-      when /\A\{\// #V_REGEXP
-        if @adl_type.last != :regexp
-          @in_regexp = true
-          @adl_type.push(:regexp)
-          yield :START_REGEXP_BLOCK, :START_REGEXP_BLOCK
-        else
-          raise
-        end
-#        yield :V_REGEXP, :V_REGEXP
-      when /\A\{/   # {
-        @adl_type.push(:cadl)
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")
-        yield :SYM_START_CBLOCK, :SYM_START_CBLOCK
-      when /\A\}/   # }
-        adl_type = @adl_type.pop
-#        puts "Escaping #{adl_type}"
-        assert_at(__FILE__,__LINE__){adl_type == :cadl}
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")
-        yield :SYM_END_CBLOCK, :SYM_END_CBLOCK
-      when /\A\$/   # $
-        yield :Dollar_code, :Dollar_code
-      when /\A\?\?/   # ??
-        yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN
-      when /\A\?/   # ?
-        yield :Question_mark_code, :Question_mark_code
-      when /\A\|/   # |
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
-        if @in_interval
-          @in_interval = false
-        else
-#          @in_interval = false
-          @in_interval = true
-        end
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
-        yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM
-
-      when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/  #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
-#      when /\A\[[a-zA-Z0-9._\-]+::[a-zA-Z0-9._\-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
-        yield :V_QUALIFIED_TERM_CODE_REF, $&
-      when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/   #ERR_V_QUALIFIED_TERM_CODE_REF
-        yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&
-      when /\A\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/
-        @adl_type.push(:term_constraint)
-        yield :START_TERM_CODE_CONSTRAINT, $1
-      when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/   #V_LOCAL_TERM_CODE_REF
-        yield :V_LOCAL_TERM_CODE_REF, $&
-      when /\A\[/   # [
-        yield :Left_bracket_code, :Left_bracket_code
-      when /\A\]/   # ]
-        yield :Right_bracket_code, :Right_bracket_code
-      when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/   #V_GENERIC_TYPE_IDENTIFIER
-        yield :V_GENERIC_TYPE_IDENTIFIER, $&
-      when /\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]/
-        yield :V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, $&
-      when /\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/
-        yield :V_ISO8601_DATE_CONSTRAINT_PATTERN, $&
-      when /\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/
-        yield :V_ISO8601_TIME_CONSTRAINT_PATTERN, $&
-      when /\A[a-z][a-zA-Z0-9_]*/
-        word = $&.dup
-        if @@cadl_reserved[word.downcase]
-          yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]
-        else
-          @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}:#{@lineno}")
-          yield :V_ATTRIBUTE_IDENTIFIER, word #V_ATTRIBUTE_IDENTIFIER /\A[a-z][a-zA-Z0-9_]*/
-        end
-      when /\A[A-Z][a-zA-Z0-9_]*/
-        word = $&.dup
-        if @@cadl_reserved[word.downcase]
-          yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]
-        else
-          yield :V_TYPE_IDENTIFIER, $&
-        end
-      when /\Aa[ct][0-9.]+/   #V_LOCAL_CODE
-        yield :V_LOCAL_CODE, $&
-      when /\A[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](,[0-9]+)?(Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9](Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9](Z|[+-][0-9]{4})?/   #V_ISO8601_EXTENDED_DATE_TIME YYYY-MM-DDThh:mm:ss[,sss][Z|+/- -n-n-n-n-]-
-        yield :V_ISO8601_EXTENDED_DATE_TIME, $&
-      when /\A[0-2][0-9]:[0-6][0-9]:[0-6][0-9](,[0-9]+)?(Z|[+-][0-9]{4})?|[0-2][0-9]:[0-6][0-9](Z|[+-][0-9]{4})? /   #V_ISO8601_EXTENDED_TIME hh:mm:ss[,sss][Z|+/-nnnn]
-        yield :V_ISO8601_EXTENDED_TIME, $&
-      when /\A[0-9]{4}-[0-1][0-9]-[0-3][0-9]|[0-9]{4}-[0-1][0-9]/   #V_ISO8601_EXTENDED_DATE YYYY-MM-DD
-        yield :V_ISO8601_EXTENDED_DATE, $&
-      when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/   #V_INTEGER
-        yield :V_INTEGER, $&
-      when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ /   #V_REAL
-        yield :V_REAL, $&
-           when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING
-      when /\A"([^"]*)"/m #V_STRING
-        yield :V_STRING, $1
-      when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI
-        yield :V_URI, $&
-###       when /\AP([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?T([0-9]+[hH])?([0-9]+[mM])?([0-9]+[sS])?|P([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?/   #V_ISO8601_DURATION PnYnMnWnDTnnHnnMnnS
-###         yield :V_ISO8601_DURATION, $&
-      when /\A\S/ #UTF8CHAR
-        yield :UTF8CHAR, $&
-      else
-        raise
-      end
-      data = $' # variable $' receives the string after the match
-    when :adl
-      data = scan_adl(data) do |sym, val|
-        yield sym, val
-      end
-    when :dadl
-      data = scan_dadl(data) do |sym, val|
-        yield sym, val
-      end
-    when :regexp
-      data = scan_regexp(data) do |sym, val|
-        yield sym, val
-      end
-    when :term_constraint
-      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
-      
-      data = scan_term_constraint(data) do |sym, val|
-        yield sym, val
-      end
-    else
-      raise
-    end
-  end # of until
-end # of scan_cadl
-
-def scan_dadl(data)
-  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_dadl at #{@filename}:#{@lineno}: data = #{data.inspect}")
-  until data.nil?  do
-    case @adl_type.last
-    when :dadl
-      case scanned = @@dadl_scanner.parse(data)
-      when Yaparc::Result::OK
-        yield scanned.value
-        data = scanned.input
-      else
-      end
-
-      case data
-      when /\A\n/ # carriage return
-        @lineno += 1
-        ;
-      when /\A[ \t\r\f]+/ #just drop it
-        ;
-      when /\A--.*\n/ # single line comment
-        @lineno += 1
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")
-        ;
-        ###----------/* symbols */ ------------------------------------------------- 
-      when /\A\=/   # =
-        yield :SYM_EQ, :SYM_EQ
-      when /\A\>\=/   # >=
-        yield :SYM_GE, :SYM_GE
-      when /\A\<\=/   # <=
-        yield :SYM_LE, :SYM_LE
-      when /\A\</   # <
-        if @in_interval
-          yield :SYM_LT, :SYM_LT
-        else
-          @adl_type.push(:dadl)
-          yield :SYM_START_DBLOCK, :SYM_START_DBLOCK
-        end
-      when /\A\>/   # >
-        if @in_interval
-#          @in_interval = false
-          yield :SYM_GT, :SYM_GT
-        elsif @in_c_domain_type == true
-          assert_at(__FILE__,__LINE__){@adl_type.last == :dadl}
-          adl_type = @adl_type.pop
-          if @adl_type.last == :cadl
-            @in_c_domain_type = false
-            yield :END_V_C_DOMAIN_TYPE_BLOCK, $&
-          else
-            yield :SYM_END_DBLOCK, $&
-          end
-        elsif @in_c_domain_type == false
-          adl_type = @adl_type.pop
-          assert_at(__FILE__,__LINE__){adl_type == :dadl}
-          yield :SYM_END_DBLOCK, $&
-        else
-          raise
-        end
-      when /\A\-/   # -
-        yield :Minus_code, :Minus_code
-      when /\A\+/   # +
-        yield :Plus_code, :Plus_code
-      when /\A\*/   # *
-        yield :Star_code, :Star_code
-      when /\A\//   # /
-        yield :Slash_code, :Slash_code
-      when /\A\^/   # ^
-        yield :Caret_code, :Caret_code
-      when /\A\.\.\./   # ...
-        yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE
-      when /\A\.\./   # ..
-        yield :SYM_ELLIPSIS, :SYM_ELLIPSIS
-      when /\A\./   # .
-        yield :Dot_code, :Dot_code
-      when /\A\;/   # ;
-        yield :Semicolon_code, :Semicolon_code
-      when /\A\,/   # ,
-        yield :Comma_code, :Comma_code
-      when /\A\:/   # :
-        yield :Colon_code, :Colon_code
-      when /\A\!/   # !
-        yield :Exclamation_code, :Exclamation_code
-      when /\A\(/   # (
-        yield :Left_parenthesis_code, :Left_parenthesis_code
-      when /\A\)/   # )
-        yield :Right_parenthesis_code, :Right_parenthesis_code
-      when /\A\$/   # $
-        yield :Dollar_code, :Dollar_code
-      when /\A\?\?/   # ??
-        yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN
-      when /\A\?/   # ?
-        yield :Question_mark_code, :Question_mark_code
-      when /\A\|/   # |
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")
-        if @in_interval
-          @in_interval = false
-        else
-#          @in_interval = false
-          @in_interval = true
-        end
-        @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")
-        yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM
-###       when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/   #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]
-###         yield :V_QUALIFIED_TERM_CODE_REF, $&
-###       when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/   #V_LOCAL_TERM_CODE_REF
-###         yield :V_LOCAL_TERM_CODE_REF, $&
-###       when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/   #ERR_V_QUALIFIED_TERM_CODE_REF
-###         yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&
-      when /\A\[/   # [
-        yield :Left_bracket_code, :Left_bracket_code
-      when /\A\]/   # ]
-        yield :Right_bracket_code, :Right_bracket_code
-###       when /\A[A-Z][a-zA-Z0-9_-]*/
-###         yield :V_TYPE_IDENTIFIER, $&
-###       when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/   #V_GENERIC_TYPE_IDENTIFIER
-###         yield :V_GENERIC_TYPE_IDENTIFIER, $&
-###       when /\A[a-z][a-zA-Z0-9_]*/
-###         word = $&.downcase
-###         if @@dadl_reserved[word]
-###           yield @@dadl_reserved[word], @@dadl_reserved[word]
-###         else
-###           yield :V_ATTRIBUTE_IDENTIFIER, $&
-###         end
-###       when /\Aa[ct][0-9.]+/   #V_LOCAL_CODE
-###         yield :V_LOCAL_CODE, $&
-      when /\A[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9]:[0-6][0-9](,[0-9]+)?(Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9]:[0-6][0-9](Z|[+-][0-9]{4})?|[0-9]{4}-[0-1][0-9]-[0-3][0-9]T[0-2][0-9](Z|[+-][0-9]{4})?/   #V_ISO8601_EXTENDED_DATE_TIME YYYY-MM-DDThh:mm:ss[,sss][Z|+/- -n-n-n-n-]-
-        yield :V_ISO8601_EXTENDED_DATE_TIME, $&
-      when /\A[0-2][0-9]:[0-6][0-9]:[0-6][0-9](,[0-9]+)?(Z|[+-][0-9]{4})?|[0-2][0-9]:[0-6][0-9](Z|[+-][0-9]{4})? /   #V_ISO8601_EXTENDED_TIME hh:mm:ss[,sss][Z|+/-nnnn]
-        yield :V_ISO8601_EXTENDED_TIME, $&
-      when /\A[0-9]{4}-[0-1][0-9]-[0-3][0-9]|[0-9]{4}-[0-1][0-9]/   #V_ISO8601_EXTENDED_DATE YYYY-MM-DD
-        yield :V_ISO8601_EXTENDED_DATE, $&
-      when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/   #V_GENERIC_TYPE_IDENTIFIER
-        yield :V_GENERIC_TYPE_IDENTIFIER, $&
-      when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/   #V_INTEGER
-        yield :V_INTEGER, $&
-###       when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ /   #V_REAL
-###         yield :V_REAL, $&
-        #    when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING
-###       when /\A"([^"]*)"/m #V_STRING
-###         yield :V_STRING, $1
-      when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI
-        yield :V_URI, $&
-###       when /\AP([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?T([0-9]+[hH])?([0-9]+[mM])?([0-9]+[sS])?|P([0-9]+[yY])?([0-9]+[mM])?([0-9]+[wW])?([0-9]+[dD])?/   #V_ISO8601_DURATION PnYnMnWnDTnnHnnMnnS
-###         yield :V_ISO8601_DURATION, $&
-      when /\A\S/ #UTF8CHAR
-        yield :UTF8CHAR, $&
-      end
-      data = $' # variable $' receives the string after the match
-    when :adl
-      data = scan_adl(data) do |sym, val|
-        yield sym, val
-      end
-    when :cadl
-      data = scan_cadl(data) do |sym, val|
-        yield sym, val
-      end
-    when :regexp
-#      puts "Entering scan_regexp"
-      data = scan_regexp(data) do |sym, val|
-        yield sym, val
-      end
-    when :term_constraint
-      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")
-
-      data = scan_term_constraint(data) do |sym, val|
-        yield sym, val
-      end
-    else
-      raise
-    end
-  end
-end # of scan_dadl
-
-def scan_regexp(data)
-  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_regexp at #{@filename}:#{@lineno}: data = #{data.inspect}")
-  until data.nil?  do
-    case @adl_type.last
-    when :regexp
-      case data
-      when /\A\/\}/ #V_REGEXP
-        if @adl_type.last == :regexp
-          @in_regexp = false
-          @adl_type.pop
-          yield :END_REGEXP_BLOCK, :END_REGEXP_BLOCK
-        else
-          raise
-        end
-      when /\A(.*)(\/\})/ #V_REGEXP
-        yield :REGEXP_BODY, $1
-        if @adl_type.last == :regexp
-          @in_regexp = false
-          @adl_type.pop
-          yield :END_REGEXP_BLOCK, :END_REGEXP_BLOCK
-        else
-          raise
-        end
-      else
-        raise data
-      end
-      data = $' # variable $' receives the string after the match
-    when :adl
-      data = scan_adl(data) do |sym, val|
-        yield sym, val
-      end
-    when :dadl
-      data = scan_dadl(data) do |sym, val|
-        yield sym, val
-      end
-    when :cadl
-      data = scan_cadl(data) do |sym, val|
-        yield sym, val
-      end
-    when :term_constraint
-      @@logger.debug("#{__FILE__}:#{__LINE__}: scan_regexp: Entering scan_term_constraint at #{@filename}:#{@lineno}")
-      data = scan_term_constraint(data) do |sym, val|
-        yield sym, val
-      end
-    else
-      raise
-    end
-  end
-end # of scan_regexp
-
-def scan_term_constraint(data)
-  @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_term_constraint")
-  until data.nil?  do
-    case @adl_type.last
-    when :term_constraint
-      case data
-      when /\A\n/ # carriage return
-        @lineno += 1
-        ;
-      when /\A[ \t\r\f]+/ #just drop it
-        ;
-      when /\A--.*$/ # single line comment
-        @lineno += 1
-        #@@logger.debug("#{__FILE__}:#{__LINE__}: scan_term_constraint: COMMENT = #{$&} at #{@filename}:#{@lineno}")
-        ;
-      when /\A([a-zA-Z0-9\._\-])+[ \t]*,/ # match any line, with ',' termination
-        yield :TERM_CODE, $1
-      when /\A([a-zA-Z0-9\._\-])+[ \t]*;/ # match second last line with ';' termination (assumed value)
-        yield :TERM_CODE, $1
-      when /\A([a-zA-Z0-9\._\-])*[ \t]*\]/ # match final line, terminating in ']'
-        adl_type = @adl_type.pop
-        assert_at(__FILE__,__LINE__){adl_type == :term_constraint}
-        yield :END_TERM_CODE_CONSTRAINT, $1
-      else
-        raise "data = #{data}"
-      end
-      data = $' # variable $' receives the string after the match
-    when :adl
-      data = scan_adl(data) do |sym, val|
-        yield sym, val
-      end
-    when :dadl
-      data = scan_dadl(data) do |sym, val|
-        yield sym, val
-      end
-    when :cadl
-      data = scan_cadl(data) do |sym, val|
-        yield sym, val
-      end
-    else
-      raise
-    end
-  end
-end # of scan_term_constraint
 
 
@@ -843,5 +133,5 @@
 
 
-
+__END__
 
 
@@ -1518,5 +808,5 @@
   3, 189, :_reduce_none,
   3, 189, :_reduce_none,
-  1, 180, :_reduce_none,
+  1, 180, :_reduce_191,
   3, 190, :_reduce_none,
   3, 190, :_reduce_none,
@@ -2090,5 +1380,5 @@
       archetype.original_language = language
     end
-    @@logger.debug("#{__FILE__}:#{__LINE__}: archetype = #{archetype} at #{@filename}:#{@lineno}")
+    @@logger.debug("#{__FILE__}:#{__LINE__}: archetype = #{archetype.to_yaml} at #{@filename}:#{@lineno}")
     result = archetype
   
@@ -2774,12 +2064,11 @@
 module_eval(<<'.,.,', 'parser.y', 531)
   def _reduce_103(val, _values, result)
-        @@logger.debug("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}")
-    result = val[0]
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 537)
+        result = val[0]
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 536)
   def _reduce_104(val, _values, result)
         result = Array[val[0]]
@@ -2789,5 +2078,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 541)
+module_eval(<<'.,.,', 'parser.y', 540)
   def _reduce_105(val, _values, result)
         result = (val[0] << val[1])
@@ -2797,14 +2086,14 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 546)
+module_eval(<<'.,.,', 'parser.y', 545)
   def _reduce_106(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}")
-    result = {:object_key => val[0], :object_block => val[1]}
-  
-    result
-  end
-.,.,
-
-module_eval(<<'.,.,', 'parser.y', 552)
+    result = {:object_key => val[0], :object_block => val[2]}
+  
+    result
+  end
+.,.,
+
+module_eval(<<'.,.,', 'parser.y', 551)
   def _reduce_107(val, _values, result)
         @@logger.debug("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
@@ -2815,5 +2104,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 558)
+module_eval(<<'.,.,', 'parser.y', 557)
   def _reduce_108(val, _values, result)
         result = {:untyped_single_attr_object_block => val[0]}
@@ -2823,5 +2112,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 562)
+module_eval(<<'.,.,', 'parser.y', 561)
   def _reduce_109(val, _values, result)
         result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]}
@@ -2831,5 +2120,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 567)
+module_eval(<<'.,.,', 'parser.y', 566)
   def _reduce_110(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2840,5 +2129,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 572)
+module_eval(<<'.,.,', 'parser.y', 571)
   def _reduce_111(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
@@ -2851,5 +2140,5 @@
 # reduce 112 omitted
 
-module_eval(<<'.,.,', 'parser.y', 578)
+module_eval(<<'.,.,', 'parser.y', 577)
   def _reduce_113(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
@@ -2860,5 +2149,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 583)
+module_eval(<<'.,.,', 'parser.y', 582)
   def _reduce_114(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
@@ -2869,5 +2158,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 588)
+module_eval(<<'.,.,', 'parser.y', 587)
   def _reduce_115(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
@@ -2878,5 +2167,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 593)
+module_eval(<<'.,.,', 'parser.y', 592)
   def _reduce_116(val, _values, result)
         result = val[0]
@@ -2886,5 +2175,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 597)
+module_eval(<<'.,.,', 'parser.y', 596)
   def _reduce_117(val, _values, result)
         result = val[0]
@@ -2894,5 +2183,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 601)
+module_eval(<<'.,.,', 'parser.y', 600)
   def _reduce_118(val, _values, result)
         result = val[0]
@@ -2902,5 +2191,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 605)
+module_eval(<<'.,.,', 'parser.y', 604)
   def _reduce_119(val, _values, result)
         result = val[0]
@@ -2910,5 +2199,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 609)
+module_eval(<<'.,.,', 'parser.y', 608)
   def _reduce_120(val, _values, result)
         result = val[0]
@@ -2918,5 +2207,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 613)
+module_eval(<<'.,.,', 'parser.y', 612)
   def _reduce_121(val, _values, result)
         @@logger.debug("string_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2927,5 +2216,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 618)
+module_eval(<<'.,.,', 'parser.y', 617)
   def _reduce_122(val, _values, result)
         @@logger.debug("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2936,5 +2225,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 623)
+module_eval(<<'.,.,', 'parser.y', 622)
   def _reduce_123(val, _values, result)
         @@logger.debug("real_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2945,5 +2234,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 628)
+module_eval(<<'.,.,', 'parser.y', 627)
   def _reduce_124(val, _values, result)
         @@logger.debug("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2954,5 +2243,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 633)
+module_eval(<<'.,.,', 'parser.y', 632)
   def _reduce_125(val, _values, result)
         @@logger.debug("character_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2963,5 +2252,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 638)
+module_eval(<<'.,.,', 'parser.y', 637)
   def _reduce_126(val, _values, result)
         @@logger.debug("date_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2972,5 +2261,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 643)
+module_eval(<<'.,.,', 'parser.y', 642)
   def _reduce_127(val, _values, result)
         @@logger.debug("time_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2981,5 +2270,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 648)
+module_eval(<<'.,.,', 'parser.y', 647)
   def _reduce_128(val, _values, result)
         @@logger.debug("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2990,5 +2279,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 653)
+module_eval(<<'.,.,', 'parser.y', 652)
   def _reduce_129(val, _values, result)
         @@logger.debug("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -2999,5 +2288,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 658)
+module_eval(<<'.,.,', 'parser.y', 657)
   def _reduce_130(val, _values, result)
         @@logger.debug("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
@@ -3038,5 +2327,5 @@
 # reduce 145 omitted
 
-module_eval(<<'.,.,', 'parser.y', 681)
+module_eval(<<'.,.,', 'parser.y', 680)
   def _reduce_146(val, _values, result)
         @@logger.debug("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
@@ -3047,5 +2336,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 686)
+module_eval(<<'.,.,', 'parser.y', 685)
   def _reduce_147(val, _values, result)
         @@logger.debug("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
@@ -3056,5 +2345,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 692)
+module_eval(<<'.,.,', 'parser.y', 691)
   def _reduce_148(val, _values, result)
         @@logger.debug("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
@@ -3071,5 +2360,5 @@
 # reduce 151 omitted
 
-module_eval(<<'.,.,', 'parser.y', 702)
+module_eval(<<'.,.,', 'parser.y', 701)
   def _reduce_152(val, _values, result)
         begin
@@ -3084,5 +2373,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 711)
+module_eval(<<'.,.,', 'parser.y', 710)
   def _reduce_153(val, _values, result)
         begin
@@ -3097,5 +2386,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 720)
+module_eval(<<'.,.,', 'parser.y', 719)
   def _reduce_154(val, _values, result)
         begin
@@ -3134,5 +2423,5 @@
 # reduce 166 omitted
 
-module_eval(<<'.,.,', 'parser.y', 746)
+module_eval(<<'.,.,', 'parser.y', 745)
   def _reduce_167(val, _values, result)
         begin
@@ -3147,5 +2436,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 755)
+module_eval(<<'.,.,', 'parser.y', 754)
   def _reduce_168(val, _values, result)
         begin
@@ -3160,5 +2449,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 764)
+module_eval(<<'.,.,', 'parser.y', 763)
   def _reduce_169(val, _values, result)
         begin
@@ -3197,5 +2486,5 @@
 # reduce 181 omitted
 
-module_eval(<<'.,.,', 'parser.y', 789)
+module_eval(<<'.,.,', 'parser.y', 788)
   def _reduce_182(val, _values, result)
         result = true
@@ -3205,5 +2494,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 793)
+module_eval(<<'.,.,', 'parser.y', 792)
   def _reduce_183(val, _values, result)
         result = false
@@ -3227,5 +2516,11 @@
 # reduce 190 omitted
 
-# reduce 191 omitted
+module_eval(<<'.,.,', 'parser.y', 807)
+  def _reduce_191(val, _values, result)
+        result = val[0]
+  
+    result
+  end
+.,.,
 
 # reduce 192 omitted
@@ -3305,5 +2600,5 @@
 # reduce 229 omitted
 
-module_eval(<<'.,.,', 'parser.y', 856)
+module_eval(<<'.,.,', 'parser.y', 858)
   def _reduce_230(val, _values, result)
         @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
@@ -3338,5 +2633,5 @@
 # reduce 242 omitted
 
-module_eval(<<'.,.,', 'parser.y', 876)
+module_eval(<<'.,.,', 'parser.y', 878)
   def _reduce_243(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
@@ -3353,5 +2648,5 @@
 # reduce 246 omitted
 
-module_eval(<<'.,.,', 'parser.y', 886)
+module_eval(<<'.,.,', 'parser.y', 888)
   def _reduce_247(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
@@ -3442,5 +2737,5 @@
 # reduce 287 omitted
 
-module_eval(<<'.,.,', 'parser.y', 956)
+module_eval(<<'.,.,', 'parser.y', 958)
   def _reduce_288(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
@@ -3450,5 +2745,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 960)
+module_eval(<<'.,.,', 'parser.y', 962)
   def _reduce_289(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 
@@ -3458,5 +2753,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 971)
+module_eval(<<'.,.,', 'parser.y', 973)
   def _reduce_290(val, _values, result)
         result = Range.new(1,1)
@@ -3466,5 +2761,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 975)
+module_eval(<<'.,.,', 'parser.y', 977)
   def _reduce_291(val, _values, result)
         result = val[3]
@@ -3474,5 +2769,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 980)
+module_eval(<<'.,.,', 'parser.y', 982)
   def _reduce_292(val, _values, result)
         begin
@@ -3487,5 +2782,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 989)
+module_eval(<<'.,.,', 'parser.y', 991)
   def _reduce_293(val, _values, result)
         begin
@@ -3501,5 +2796,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1000)
+module_eval(<<'.,.,', 'parser.y', 1002)
   def _reduce_294(val, _values, result)
         result = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new
@@ -3525,5 +2820,5 @@
 # reduce 302 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1014)
+module_eval(<<'.,.,', 'parser.y', 1016)
   def _reduce_303(val, _values, result)
         result = val[0]
@@ -3533,5 +2828,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1018)
+module_eval(<<'.,.,', 'parser.y', 1020)
   def _reduce_304(val, _values, result)
         result = val[0]
@@ -3543,5 +2838,5 @@
 # reduce 305 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1025)
+module_eval(<<'.,.,', 'parser.y', 1027)
   def _reduce_306(val, _values, result)
         result = val[3]
@@ -3643,5 +2938,5 @@
 # reduce 352 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1095)
+module_eval(<<'.,.,', 'parser.y', 1097)
   def _reduce_353(val, _values, result)
         result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true)
@@ -3651,5 +2946,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1099)
+module_eval(<<'.,.,', 'parser.y', 1101)
   def _reduce_354(val, _values, result)
         result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false)
@@ -3659,5 +2954,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1103)
+module_eval(<<'.,.,', 'parser.y', 1105)
   def _reduce_355(val, _values, result)
         result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
@@ -3667,5 +2962,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1107)
+module_eval(<<'.,.,', 'parser.y', 1109)
   def _reduce_356(val, _values, result)
         result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
@@ -3675,5 +2970,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1112)
+module_eval(<<'.,.,', 'parser.y', 1114)
   def _reduce_357(val, _values, result)
         result = val[0]
@@ -3683,5 +2978,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1116)
+module_eval(<<'.,.,', 'parser.y', 1118)
   def _reduce_358(val, _values, result)
         raise 'Not implemented yet'
@@ -3691,5 +2986,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1120)
+module_eval(<<'.,.,', 'parser.y', 1122)
   def _reduce_359(val, _values, result)
         raise 'Not implemented yet'
@@ -3709,5 +3004,5 @@
 # reduce 364 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1132)
+module_eval(<<'.,.,', 'parser.y', 1134)
   def _reduce_365(val, _values, result)
         @in_interval = false
@@ -3718,5 +3013,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1139)
+module_eval(<<'.,.,', 'parser.y', 1141)
   def _reduce_366(val, _values, result)
           result = val[0]
@@ -3726,5 +3021,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1143)
+module_eval(<<'.,.,', 'parser.y', 1145)
   def _reduce_367(val, _values, result)
           result = val[0]
@@ -3734,5 +3029,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1149)
+module_eval(<<'.,.,', 'parser.y', 1151)
   def _reduce_368(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}")
@@ -3751,5 +3046,5 @@
 # reduce 371 omitted
 
-module_eval(<<'.,.,', 'parser.y', 1165)
+module_eval(<<'.,.,', 'parser.y', 1167)
   def _reduce_372(val, _values, result)
           result = val[0]
@@ -3759,5 +3054,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1170)
+module_eval(<<'.,.,', 'parser.y', 1172)
   def _reduce_373(val, _values, result)
           result = val[0]
@@ -3767,5 +3062,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1174)
+module_eval(<<'.,.,', 'parser.y', 1176)
   def _reduce_374(val, _values, result)
         @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
@@ -3776,5 +3071,5 @@
 .,.,
 
-module_eval(<<'.,.,', 'parser.y', 1185)
+module_eval(<<'.,.,', 'parser.y', 1187)
   def _reduce_375(val, _values, result)
         result = val[0]
