Changeset 290 for ruby/branches/0.5/lib/adl_parser/lib/parser.rb
- Timestamp:
- Sep 24, 2009, 9:51:27 AM (15 years ago)
- Location:
- ruby/branches/0.5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/branches/0.5
-
Property svn:mergeinfo
set to
/ruby/trunk merged eligible
-
Property svn:mergeinfo
set to
-
ruby/branches/0.5/lib/adl_parser/lib/parser.rb
r167 r290 11 11 $:.unshift File.join(File.dirname(__FILE__)) 12 12 require 'logger' 13 #require 'lib/util.rb' 14 #require 'lib/scanner.rb' 15 require 'lib/adl_parser.rb' 13 require 'yaml' 16 14 require 'rubygems' 15 require 'adl_parser.rb' 17 16 require 'am.rb' 17 require 'rm.rb' 18 18 $DEBUG = false 19 19 … … 24 24 class Parser < Racc::Parser 25 25 26 module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1 183)26 module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1208) 27 27 28 28 def assert_at(file,line, message = "") … … 33 33 34 34 if $DEBUG 35 @@log = Logger.new('log/parser.log','daily')36 @@log .level = Logger::INFO35 @@logger = Logger.new('log/parser.log','daily') 36 @@logger.level = Logger::DEBUG 37 37 else 38 @@log = Logger.new(STDOUT)39 @@log .level = Logger::WARN38 @@logger = Logger.new(STDOUT) 39 @@logger.level = Logger::WARN 40 40 end 41 41 42 @@dadl_scanner = OpenEHR::ADL::Scanner::DADL::RootScanner.new43 @@cadl_scanner = OpenEHR::ADL::Scanner::CADL::RootScanner.new44 42 45 43 ###----------/* keywords */ --------------------------------------------- … … 101 99 ###----------/* Scanner */ ----------------------------------------------- 102 100 101 103 102 def scan 103 @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan at #{@filename}:#{@lineno}:") 104 scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename) 105 104 106 until @data.nil? do 105 case @adl_type.last 106 when :adl 107 @data = scan_adl(@data) do |sym, val| 107 @data = scanner.scan(@data) do |sym, val| 108 108 yield sym, val 109 end110 when :dadl111 @data = scan_dadl(@data) do |sym, val|112 yield sym, val113 end114 when :cadl115 @data = scan_cadl(@data) do |sym, val|116 yield sym, val117 end118 when :regexp119 @data = scan_regexp(@data) do |sym, val|120 yield sym, val121 end122 else123 raise124 109 end 125 110 @data = $' # variable $' receives the string after the match … … 128 113 yield false, '$' 129 114 end # of scan 130 131 def scan_adl(data)132 until data.nil? do133 case @adl_type.last134 when :adl135 # puts "Entering scan_adl"136 case data137 when /\A\n/ # carriage return138 @lineno += 1139 ;140 when /\A[ \t\r\f]+/ #just drop it141 ;142 when /\A--.*\n/ # single line comment143 @lineno += 1144 @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: COMMENT = #{$&} at #{@filename}:#{@lineno}")145 ;146 when /\Adescription/ # description147 yield :SYM_DESCRIPTION, :SYM_DESCRIPTION148 when /\Adefinition/ # definition149 yield :SYM_DEFINITION, :SYM_DEFINITION150 # @adl_type.push(:cadl)151 ###----------/* symbols */ -------------------------------------------------152 when /\A[A-Z][a-zA-Z0-9_]*/153 yield :V_TYPE_IDENTIFIER, $&154 when /\A[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z0-9]+/ #V_ARCHETYPE_ID155 yield :V_ARCHETYPE_ID, $&156 when /\A[a-z][a-zA-Z0-9_]*/157 # word = $&.downcase158 word = $&159 if @@adl_reserved[word]160 @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: @@adl_reserved = #{@@adl_reserved[word]} at #{@filename}:#{@lineno}")161 yield @@adl_reserved[word], @@adl_reserved[word]162 elsif #/\A[A-Z][a-zA-Z0-9_]*/163 @@log.info("#{__FILE__}:#{__LINE__}: scan_adl: V_ATTRIBUTE_IDENTIFIER = #{$&} at #{@filename}:#{@lineno}")164 yield :V_ATTRIBUTE_IDENTIFIER, $&165 end166 when /\A\=/ # =167 yield :SYM_EQ, :SYM_EQ168 when /\A\>=/ # >=169 yield :SYM_GE, :SYM_GE170 when /\A\<=/ # <=171 yield :SYM_LE, :SYM_LE172 when /\A\</ # <173 if @in_interval174 # @start_block_received = false175 yield :SYM_LT, :SYM_LT176 else177 # @start_block_received = true178 @adl_type.push(:dadl)179 yield :SYM_START_DBLOCK, $&180 end181 when /\A\>/ # >182 if @in_interval183 yield :SYM_GT, :SYM_GT184 else185 adl_type = @adl_type.pop186 # puts "Escaping #{adl_type}"187 assert_at(__FILE__,__LINE__){adl_type == :dadl}188 yield :SYM_END_DBLOCK, :SYM_END_DBLOCK189 end190 when /\A\{/ # {191 @adl_type.push(:cadl)192 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")193 yield :SYM_START_CBLOCK, :SYM_START_CBLOCK194 when /\A\}/ # }195 adl_type = @adl_type.pop196 # puts "Escaping #{adl_type}"197 assert_at(__FILE__,__LINE__){adl_type == :cadl}198 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")199 yield :SYM_END_CBLOCK, $&200 when /\A\-/ # -201 yield :Minus_code, :Minus_code202 when /\A\+/ # +203 yield :Plus_code, :Plus_code204 when /\A\*/ # *205 yield :Star_code, :Star_code206 when /\A\// # /207 yield :Slash_code, :Slash_code208 when /\A\^/ # ^209 yield :Caret_code, :Caret_code210 when /\A\=/ # =211 yield :Equal_code, :Equal_code212 when /\A\.\.\./ # ...213 yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE214 when /\A\.\./ # ..215 yield :SYM_ELLIPSIS, :SYM_ELLIPSIS216 when /\A\./ # .217 yield :Dot_code, :Dot_code218 when /\A\;/ # ;219 yield :Semicolon_code, :Semicolon_code220 when /\A\,/ # ,221 yield :Comma_code, :Comma_code222 when /\A\:/ # :223 yield :Colon_code, :Colon_code224 when /\A\!/ # !225 yield :Exclamation_code, :Exclamation_code226 when /\A\(/ # (227 yield :Left_parenthesis_code, :Left_parenthesis_code228 when /\A\)/ # )229 yield :Right_parenthesis_code, :Right_parenthesis_code230 when /\A\$/ # $231 yield :Dollar_code, :Dollar_code232 when /\A\?\?/ # ??233 yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN234 when /\A\?/ # ?235 yield :Question_mark_code, :Question_mark_code236 when /\A[0-9]+\.[0-9]+(\.[0-9]+)*/ # ?237 yield :V_VERSION_STRING, :V_VERSION_STRING238 when /\A\|/ # |239 if @in_interval240 @in_interval = false241 else242 @in_interval = true243 end244 yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM245 when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/246 # when /\A\[[a-zA-Z0-9()\._-]+\:\:[a-zA-Z0-9\._-]+\]/ #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]247 yield :V_QUALIFIED_TERM_CODE_REF, $&248 when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/ #V_LOCAL_TERM_CODE_REF249 yield :V_LOCAL_TERM_CODE_REF, $&250 when /\A\[/ # [251 yield :Left_bracket_code, :Left_bracket_code252 when /\A\]/ # ]253 yield :Right_bracket_code, :Right_bracket_code254 255 when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/ #ERR_V_QUALIFIED_TERM_CODE_REF256 yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&257 when /\Aa[ct][0-9.]+/ #V_LOCAL_CODE258 yield :V_LOCAL_CODE, $&259 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-]-260 yield :V_ISO8601_EXTENDED_DATE_TIME, $&261 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]262 yield :V_ISO8601_EXTENDED_TIME, $&263 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-DD264 yield :V_ISO8601_EXTENDED_DATE, $&265 when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER266 yield :V_GENERIC_TYPE_IDENTIFIER, $&267 when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/ #V_INTEGER268 yield :V_INTEGER, $&269 when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ / #V_REAL270 yield :V_REAL, $&271 # when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING272 when /\A"([^"]*)"/m #V_STRING273 yield :V_STRING, $1274 when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI275 yield :V_URI, $&276 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 PnYnMnWnDTnnHnnMnnS277 yield :V_ISO8601_DURATION, $&278 when /\A\S/ #UTF8CHAR279 yield :UTF8CHAR, $&280 end281 data = $' # variable $' receives the string after the match282 when :dadl283 # puts "Entering scan_dadl"284 data = scan_dadl(data) do |sym, val|285 yield sym, val286 end287 when :cadl288 # puts "Entering scan_cadl"289 data = scan_cadl(data) do |sym, val|290 yield sym, val291 end292 when :regexp293 # puts "Entering scan_regexp"294 data = scan_regexp(data) do |sym, val|295 yield sym, val296 end297 when :term_constraint298 # puts "Entering scan_term_constraint"299 data = scan_term_constraint(data) do |sym, val|300 yield sym, val301 end302 else303 raise304 end305 end306 end # scan_adl307 308 309 def scan_cadl(data)310 until data.nil? do311 case @adl_type.last312 when :cadl313 # puts "Entering scan_cadl"314 case scanned = @@cadl_scanner.parse(data)315 when Yaparc::Result::OK316 if scanned.value[0] == :START_V_C_DOMAIN_TYPE_BLOCK317 @in_c_domain_type = true318 @adl_type.push(:dadl)319 yield scanned.value320 else321 yield scanned.value322 end323 data = scanned.input324 end325 326 case data327 when /\A\n/ # carriage return328 @lineno += 1329 ;330 when /\A[ \t\r\f]+/ #just drop it331 ;332 when /\A--.*\n/ # single line comment333 @lineno += 1334 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")335 ;336 ###----------/* symbols */ -------------------------------------------------337 when /\A\=/ # =338 yield :SYM_EQ, :SYM_EQ339 when /\A\>=/ # >=340 yield :SYM_GE, :SYM_GE341 when /\A\<=/ # <=342 yield :SYM_LE, :SYM_LE343 ### when /\A[A-Z][a-zA-Z0-9_]*[ \n]*\</ # V_C_DOMAIN_TYPE344 ### @in_c_domain_type = true345 ### @adl_type.push(:dadl)346 ### yield :START_V_C_DOMAIN_TYPE_BLOCK, $&347 when /\A\</ # <348 if @in_interval349 yield :SYM_LT, :SYM_LT350 else351 @adl_type.push(:dadl)352 yield :SYM_START_DBLOCK, $&353 end354 when /\A\>/ # >355 if @in_interval356 yield :SYM_GT, :SYM_GT357 else358 adl_type = @adl_type.pop359 # puts "Escaping #{adl_type}"360 assert_at(__FILE__,__LINE__){adl_type == :dadl}361 yield :SYM_END_DBLOCK, :SYM_END_DBLOCK362 end363 when /\A\-/ # -364 yield :Minus_code, :Minus_code365 when /\A\+/ # +366 yield :Plus_code, :Plus_code367 when /\A\*/ # *368 yield :Star_code, :Star_code369 when /\A\// # /370 yield :Slash_code, :Slash_code371 when /\A\^/ # ^372 yield :Caret_code, :Caret_code373 when /\A\.\.\./ # ...374 yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE375 when /\A\.\./ # ..376 yield :SYM_ELLIPSIS, :SYM_ELLIPSIS377 when /\A\./ # .378 yield :Dot_code, :Dot_code379 when /\A\;/ # ;380 yield :Semicolon_code, :Semicolon_code381 when /\A\,/ # ,382 yield :Comma_code, :Comma_code383 when /\A\:/ # :384 yield :Colon_code, :Colon_code385 when /\A\!/ # !386 yield :Exclamation_code, :Exclamation_code387 when /\A\(/ # (388 yield :Left_parenthesis_code, :Left_parenthesis_code389 when /\A\)/ # )390 yield :Right_parenthesis_code, :Right_parenthesis_code391 when /\A\{\// #V_REGEXP392 if @adl_type.last != :regexp393 @in_regexp = true394 @adl_type.push(:regexp)395 yield :START_REGEXP_BLOCK, :START_REGEXP_BLOCK396 else397 raise398 end399 # yield :V_REGEXP, :V_REGEXP400 when /\A\{/ # {401 @adl_type.push(:cadl)402 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")403 yield :SYM_START_CBLOCK, :SYM_START_CBLOCK404 when /\A\}/ # }405 adl_type = @adl_type.pop406 # puts "Escaping #{adl_type}"407 assert_at(__FILE__,__LINE__){adl_type == :cadl}408 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")409 yield :SYM_END_CBLOCK, :SYM_END_CBLOCK410 when /\A\$/ # $411 yield :Dollar_code, :Dollar_code412 when /\A\?\?/ # ??413 yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN414 when /\A\?/ # ?415 yield :Question_mark_code, :Question_mark_code416 when /\A\|/ # |417 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")418 if @in_interval419 @in_interval = false420 else421 # @in_interval = false422 @in_interval = true423 end424 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")425 yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM426 427 when /\A\[[a-zA-Z0-9._\-]+::[a-zA-Z0-9._\-]+\]/ #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]428 yield :V_QUALIFIED_TERM_CODE_REF, $&429 when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/ #ERR_V_QUALIFIED_TERM_CODE_REF430 yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&431 when /\A\[([a-zA-Z0-9()._\-]+::[a-zA-Z0-9._\_-]+)\]/432 yield :V_TERM_CODE_CONSTRAINT, :V_TERM_CODE_CONSTRAINT433 when /\A\[[a-zA-Z0-9\(\)\._\-]+::[ \t\n]*/434 @adl_type.push(:term_constraint)435 yield :START_TERM_CODE_CONSTRAINT, $&436 when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/ #V_LOCAL_TERM_CODE_REF437 yield :V_LOCAL_TERM_CODE_REF, $&438 when /\A\[/ # [439 yield :Left_bracket_code, :Left_bracket_code440 when /\A\]/ # ]441 yield :Right_bracket_code, :Right_bracket_code442 when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER443 yield :V_GENERIC_TYPE_IDENTIFIER, $&444 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]/445 yield :V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, $&446 when /\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/447 yield :V_ISO8601_DATE_CONSTRAINT_PATTERN, $&448 when /\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/449 yield :V_ISO8601_TIME_CONSTRAINT_PATTERN, $&450 when /\A[a-z][a-zA-Z0-9_]*/451 word = $&.dup452 if @@cadl_reserved[word.downcase]453 yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]454 else455 @@log.info("#{__FILE__}:#{__LINE__}: scan_cadl: V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}:#{@lineno}")456 yield :V_ATTRIBUTE_IDENTIFIER, word #V_ATTRIBUTE_IDENTIFIER /\A[a-z][a-zA-Z0-9_]*/457 end458 when /\A[A-Z][a-zA-Z0-9_]*/459 word = $&.dup460 if @@cadl_reserved[word.downcase]461 yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]462 else463 yield :V_TYPE_IDENTIFIER, $&464 end465 when /\Aa[ct][0-9.]+/ #V_LOCAL_CODE466 yield :V_LOCAL_CODE, $&467 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-]-468 yield :V_ISO8601_EXTENDED_DATE_TIME, $&469 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]470 yield :V_ISO8601_EXTENDED_TIME, $&471 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-DD472 yield :V_ISO8601_EXTENDED_DATE, $&473 when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/ #V_INTEGER474 yield :V_INTEGER, $&475 when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ / #V_REAL476 yield :V_REAL, $&477 when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING478 when /\A"([^"]*)"/m #V_STRING479 yield :V_STRING, $1480 when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI481 yield :V_URI, $&482 ### 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 PnYnMnWnDTnnHnnMnnS483 ### yield :V_ISO8601_DURATION, $&484 when /\A\S/ #UTF8CHAR485 yield :UTF8CHAR, $&486 else487 raise488 end489 data = $' # variable $' receives the string after the match490 when :adl491 # puts "Entering scan_adl"492 data = scan_adl(data) do |sym, val|493 yield sym, val494 end495 when :dadl496 # puts "Entering scan_dadl"497 data = scan_dadl(data) do |sym, val|498 yield sym, val499 end500 when :regexp501 # puts "Entering scan_regexp"502 data = scan_regexp(data) do |sym, val|503 yield sym, val504 end505 when :term_constraint506 # puts "Entering scan_term_constraint"507 data = scan_term_constraint(data) do |sym, val|508 yield sym, val509 end510 else511 raise512 end513 end # of until514 end # of scan_cadl515 516 def scan_dadl(data)517 until data.nil? do518 case @adl_type.last519 when :dadl520 # puts "Entering scan_dadl"521 case scanned = @@dadl_scanner.parse(data)522 when Yaparc::Result::OK523 yield scanned.value524 data = scanned.input525 else526 end527 528 case data529 when /\A\n/ # carriage return530 @lineno += 1531 ;532 when /\A[ \t\r\f]+/ #just drop it533 ;534 when /\A--.*\n/ # single line comment535 @lineno += 1536 @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")537 ;538 ###----------/* symbols */ -------------------------------------------------539 when /\A\=/ # =540 yield :SYM_EQ, :SYM_EQ541 when /\A\>\=/ # >=542 yield :SYM_GE, :SYM_GE543 when /\A\<\=/ # <=544 yield :SYM_LE, :SYM_LE545 when /\A\</ # <546 if @in_interval547 yield :SYM_LT, :SYM_LT548 else549 @adl_type.push(:dadl)550 yield :SYM_START_DBLOCK, :SYM_START_DBLOCK551 end552 when /\A\>/ # >553 if @in_interval554 # @in_interval = false555 yield :SYM_GT, :SYM_GT556 elsif @in_c_domain_type == true557 assert_at(__FILE__,__LINE__){@adl_type.last == :dadl}558 adl_type = @adl_type.pop559 if @adl_type.last == :cadl560 @in_c_domain_type = false561 yield :END_V_C_DOMAIN_TYPE_BLOCK, $&562 else563 yield :SYM_END_DBLOCK, $&564 end565 elsif @in_c_domain_type == false566 adl_type = @adl_type.pop567 # puts "Escaping #{adl_type}"568 assert_at(__FILE__,__LINE__){adl_type == :dadl}569 yield :SYM_END_DBLOCK, $&570 else571 raise572 end573 when /\A\-/ # -574 yield :Minus_code, :Minus_code575 when /\A\+/ # +576 yield :Plus_code, :Plus_code577 when /\A\*/ # *578 yield :Star_code, :Star_code579 when /\A\// # /580 yield :Slash_code, :Slash_code581 when /\A\^/ # ^582 yield :Caret_code, :Caret_code583 when /\A\.\.\./ # ...584 yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE585 when /\A\.\./ # ..586 yield :SYM_ELLIPSIS, :SYM_ELLIPSIS587 when /\A\./ # .588 yield :Dot_code, :Dot_code589 when /\A\;/ # ;590 yield :Semicolon_code, :Semicolon_code591 when /\A\,/ # ,592 yield :Comma_code, :Comma_code593 when /\A\:/ # :594 yield :Colon_code, :Colon_code595 when /\A\!/ # !596 yield :Exclamation_code, :Exclamation_code597 when /\A\(/ # (598 yield :Left_parenthesis_code, :Left_parenthesis_code599 when /\A\)/ # )600 yield :Right_parenthesis_code, :Right_parenthesis_code601 when /\A\$/ # $602 yield :Dollar_code, :Dollar_code603 when /\A\?\?/ # ??604 yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN605 when /\A\?/ # ?606 yield :Question_mark_code, :Question_mark_code607 when /\A\|/ # |608 @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")609 if @in_interval610 @in_interval = false611 else612 # @in_interval = false613 @in_interval = true614 end615 @@log.info("#{__FILE__}:#{__LINE__}: scan_dadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")616 yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM617 ### when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/ #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]618 ### yield :V_QUALIFIED_TERM_CODE_REF, $&619 ### when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/ #V_LOCAL_TERM_CODE_REF620 ### yield :V_LOCAL_TERM_CODE_REF, $&621 ### when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/ #ERR_V_QUALIFIED_TERM_CODE_REF622 ### yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&623 when /\A\[/ # [624 yield :Left_bracket_code, :Left_bracket_code625 when /\A\]/ # ]626 yield :Right_bracket_code, :Right_bracket_code627 ### when /\A[A-Z][a-zA-Z0-9_-]*/628 ### yield :V_TYPE_IDENTIFIER, $&629 ### when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER630 ### yield :V_GENERIC_TYPE_IDENTIFIER, $&631 ### when /\A[a-z][a-zA-Z0-9_]*/632 ### word = $&.downcase633 ### if @@dadl_reserved[word]634 ### yield @@dadl_reserved[word], @@dadl_reserved[word]635 ### else636 ### yield :V_ATTRIBUTE_IDENTIFIER, $&637 ### end638 ### when /\Aa[ct][0-9.]+/ #V_LOCAL_CODE639 ### yield :V_LOCAL_CODE, $&640 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-]-641 yield :V_ISO8601_EXTENDED_DATE_TIME, $&642 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]643 yield :V_ISO8601_EXTENDED_TIME, $&644 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-DD645 yield :V_ISO8601_EXTENDED_DATE, $&646 when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER647 yield :V_GENERIC_TYPE_IDENTIFIER, $&648 when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/ #V_INTEGER649 yield :V_INTEGER, $&650 ### when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ / #V_REAL651 ### yield :V_REAL, $&652 # when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING653 ### when /\A"([^"]*)"/m #V_STRING654 ### yield :V_STRING, $1655 when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI656 yield :V_URI, $&657 ### 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 PnYnMnWnDTnnHnnMnnS658 ### yield :V_ISO8601_DURATION, $&659 when /\A\S/ #UTF8CHAR660 yield :UTF8CHAR, $&661 end662 data = $' # variable $' receives the string after the match663 when :adl664 # puts "Entering scan_adl"665 data = scan_adl(data) do |sym, val|666 yield sym, val667 end668 when :cadl669 # puts "Entering scan_cadl"670 data = scan_cadl(data) do |sym, val|671 yield sym, val672 end673 when :regexp674 # puts "Entering scan_regexp"675 data = scan_regexp(data) do |sym, val|676 yield sym, val677 end678 when :term_constraint679 # puts "Entering scan_term_constraint"680 data = scan_term_constraint(data) do |sym, val|681 yield sym, val682 end683 else684 raise685 end686 end687 end # of scan_dadl688 689 def scan_regexp(data)690 until data.nil? do691 case @adl_type.last692 when :regexp693 # puts "Entering scan_regexp"694 case data695 when /\A\/\}/ #V_REGEXP696 if @adl_type.last == :regexp697 @in_regexp = false698 @adl_type.pop699 yield :END_REGEXP_BLOCK, :END_REGEXP_BLOCK700 else701 raise702 end703 when /\A(.*)(\/\})/ #V_REGEXP704 yield :REGEXP_BODY, $1705 if @adl_type.last == :regexp706 @in_regexp = false707 @adl_type.pop708 yield :END_REGEXP_BLOCK, :END_REGEXP_BLOCK709 else710 raise711 end712 else713 raise data714 end715 data = $' # variable $' receives the string after the match716 when :adl717 # puts "Entering scan_adl"718 data = scan_adl(data) do |sym, val|719 yield sym, val720 end721 when :dadl722 # puts "Entering scan_dadl"723 data = scan_dadl(data) do |sym, val|724 yield sym, val725 end726 when :cadl727 # puts "Entering scan_cadl"728 data = scan_cadl(data) do |sym, val|729 yield sym, val730 end731 when :term_constraint732 # puts "Entering scan_term_constraint"733 data = scan_term_constraint(data) do |sym, val|734 yield sym, val735 end736 else737 raise738 end739 end740 end # of scan_regexp741 742 def scan_term_constraint(data)743 until data.nil? do744 case @adl_type.last745 when :term_constraint746 # puts "Entering scan_term_constraint"747 case data748 when /\A\n/ # carriage return749 @lineno += 1750 ;751 when /\A[ \t\r\f]+/ #just drop it752 ;753 when /\A--.*$/ # single line comment754 @lineno += 1755 @@log.info("#{__FILE__}:#{__LINE__}: scan_term_constraint: COMMENT = #{$&} at #{@filename}:#{@lineno}")756 ;757 when /\A[a-zA-Z0-9\._\-]+[ \t]*,/ # match any line, with ',' termination758 yield :TERM_CODE, $&759 when /\A[a-zA-Z0-9\._\-]+[ \t]*;/ #match second last line with ';' termination (assumed value)760 yield :TERM_CODE, $&761 # when /\A[a-zA-Z0-9\._\-]+[ \t]*\]/ # match final line, terminating in ']'762 when /\A[a-zA-Z0-9\._\-]*[ \t]*\]/ # match final line, terminating in ']'763 adl_type = @adl_type.pop764 assert_at(__FILE__,__LINE__){adl_type == :term_constraint}765 yield :END_TERM_CODE_CONSTRAINT, $&766 else767 raise "data = #{data}"768 end769 data = $' # variable $' receives the string after the match770 when :adl771 # puts "Entering scan_adl"772 data = scan_adl(data) do |sym, val|773 yield sym, val774 end775 when :dadl776 # puts "Entering scan_dadl"777 data = scan_dadl(data) do |sym, val|778 yield sym, val779 end780 when :cadl781 # puts "Entering scan_cadl"782 data = scan_cadl(data) do |sym, val|783 yield sym, val784 end785 else786 raise787 end788 end789 end # of scan_term_constraint790 115 791 116 … … 808 133 809 134 810 135 __END__ 811 136 812 137 … … 1128 453 -376, -376, -376, -195, -376, -208, -376, -221, -376, -234, 1129 454 -376, -376, -376, -43, -305, -376, -53, -44, -376, -376, 1130 -31, -72, -310, -70, -3 5, -37, -372, -38, -39, -360,1131 -40, -376, -363, -41, -367, -366, -42, -369, -376, -3 6,455 -31, -72, -310, -70, -36, -37, -372, -38, -39, -360, 456 -40, -376, -363, -41, -367, -366, -42, -369, -376, -35, 1132 457 -376, -376, -376, -376, -376, -309, -160, -175, -159, -376, 1133 458 -174, -376, -196, -376, -209, -376, -222, -376, -235, -376, … … 1306 631 1, 109, :_reduce_12, 1307 632 0, 99, :_reduce_none, 1308 2, 99, :_reduce_ none,633 2, 99, :_reduce_14, 1309 634 2, 99, :_reduce_none, 1310 635 2, 100, :_reduce_16, … … 1337 662 1, 121, :_reduce_none, 1338 663 1, 121, :_reduce_none, 1339 3, 12 2, :_reduce_45,1340 4, 12 3, :_reduce_46,1341 3, 12 3, :_reduce_none,1342 6, 12 4, :_reduce_48,664 3, 128, :_reduce_45, 665 4, 122, :_reduce_46, 666 3, 122, :_reduce_none, 667 6, 123, :_reduce_48, 1343 668 2, 130, :_reduce_49, 1344 669 2, 133, :_reduce_50, 1345 670 3, 133, :_reduce_none, 1346 671 2, 133, :_reduce_none, 1347 1, 12 8, :_reduce_53,672 1, 127, :_reduce_53, 1348 673 1, 134, :_reduce_54, 1349 674 1, 134, :_reduce_55, … … 1483 808 3, 189, :_reduce_none, 1484 809 3, 189, :_reduce_none, 1485 1, 180, :_reduce_ none,810 1, 180, :_reduce_191, 1486 811 3, 190, :_reduce_none, 1487 812 3, 190, :_reduce_none, … … 1652 977 3, 142, :_reduce_358, 1653 978 3, 142, :_reduce_359, 1654 1, 12 7, :_reduce_none,1655 3, 12 7, :_reduce_none,1656 3, 12 7, :_reduce_none,979 1, 126, :_reduce_none, 980 3, 126, :_reduce_none, 981 3, 126, :_reduce_none, 1657 982 1, 221, :_reduce_none, 1658 983 3, 221, :_reduce_none, 1659 984 3, 222, :_reduce_365, 1660 1, 12 6, :_reduce_366,1661 1, 12 6, :_reduce_367,1662 3, 223, :_reduce_ none,985 1, 125, :_reduce_366, 986 1, 125, :_reduce_367, 987 3, 223, :_reduce_368, 1663 988 0, 224, :_reduce_none, 1664 989 1, 224, :_reduce_none, 1665 990 2, 224, :_reduce_none, 1666 1, 12 5, :_reduce_372,991 1, 124, :_reduce_372, 1667 992 1, 150, :_reduce_373, 1668 993 1, 150, :_reduce_374, … … 1913 1238 "c_attributes", 1914 1239 "c_object", 1915 "v_c_domain_type",1916 1240 "archetype_internal_ref", 1917 1241 "archetype_slot", … … 1920 1244 "c_ordinal", 1921 1245 "c_primitive_object", 1246 "v_c_domain_type", 1922 1247 "absolute_path", 1923 1248 "c_archetype_slot_head", … … 2040 1365 2041 1366 archetype_id = val[0][:archetype_id] 1367 parent_archtype_id = val[1][:parent_archtype_id] if val[1] 2042 1368 adl_version = val[0][:arch_head][:arch_meta_data][:adl_version] 2043 1369 concept = val[2] … … 2045 1371 archetype = OpenEHR::AM::Archetype::ARCHETYPE.create( 2046 1372 :archetype_id => archetype_id, 1373 :parent_archtype_id => parent_archtype_id, 2047 1374 :adl_version => adl_version, 2048 1375 :concept => concept, … … 2053 1380 archetype.original_language = language 2054 1381 end 2055 @@log .info("#{__FILE__}:#{__LINE__}: archetype = #{archetype} at #{@filename}:#{@lineno}")1382 @@logger.debug("#{__FILE__}:#{__LINE__}: archetype = #{archetype.to_yaml} at #{@filename}:#{@lineno}") 2056 1383 result = archetype 2057 1384 … … 2060 1387 .,., 2061 1388 2062 module_eval(<<'.,.,', 'parser.y', 6 1)1389 module_eval(<<'.,.,', 'parser.y', 63) 2063 1390 def _reduce_4(val, _values, result) 2064 1391 result = {:arch_head => val[0], :archetype_id => val[1] } … … 2068 1395 .,., 2069 1396 2070 module_eval(<<'.,.,', 'parser.y', 6 5)1397 module_eval(<<'.,.,', 'parser.y', 67) 2071 1398 def _reduce_5(val, _values, result) 2072 1399 raise … … 2076 1403 .,., 2077 1404 2078 module_eval(<<'.,.,', 'parser.y', 7 0)1405 module_eval(<<'.,.,', 'parser.y', 72) 2079 1406 def _reduce_6(val, _values, result) 2080 1407 result = {:arch_meta_data => nil } … … 2084 1411 .,., 2085 1412 2086 module_eval(<<'.,.,', 'parser.y', 7 4)1413 module_eval(<<'.,.,', 'parser.y', 76) 2087 1414 def _reduce_7(val, _values, result) 2088 1415 result = val[1] … … 2092 1419 .,., 2093 1420 2094 module_eval(<<'.,.,', 'parser.y', 79)1421 module_eval(<<'.,.,', 'parser.y', 81) 2095 1422 def _reduce_8(val, _values, result) 2096 1423 result = {:arch_meta_data => val[1] } … … 2100 1427 .,., 2101 1428 2102 module_eval(<<'.,.,', 'parser.y', 8 4)1429 module_eval(<<'.,.,', 'parser.y', 86) 2103 1430 def _reduce_9(val, _values, result) 2104 1431 result = val[0] … … 2108 1435 .,., 2109 1436 2110 module_eval(<<'.,.,', 'parser.y', 88)1437 module_eval(<<'.,.,', 'parser.y', 90) 2111 1438 def _reduce_10(val, _values, result) 2112 1439 result = val[0].merge(val[2]) … … 2116 1443 .,., 2117 1444 2118 module_eval(<<'.,.,', 'parser.y', 9 4)1445 module_eval(<<'.,.,', 'parser.y', 96) 2119 1446 def _reduce_11(val, _values, result) 2120 1447 result = {:adl_version => val[2], :is_controlled => false } … … 2124 1451 .,., 2125 1452 2126 module_eval(<<'.,.,', 'parser.y', 98)1453 module_eval(<<'.,.,', 'parser.y', 100) 2127 1454 def _reduce_12(val, _values, result) 2128 1455 result = {:is_controlled => true } … … 2134 1461 # reduce 13 omitted 2135 1462 2136 # reduce 14 omitted 1463 module_eval(<<'.,.,', 'parser.y', 108) 1464 def _reduce_14(val, _values, result) 1465 result = {:parent_archtype_id => val[1]} 1466 1467 result 1468 end 1469 .,., 2137 1470 2138 1471 # reduce 15 omitted 2139 1472 2140 module_eval(<<'.,.,', 'parser.y', 1 09)1473 module_eval(<<'.,.,', 'parser.y', 114) 2141 1474 def _reduce_16(val, _values, result) 2142 1475 result = {:arch_concept => val[1] } … … 2148 1481 # reduce 17 omitted 2149 1482 2150 module_eval(<<'.,.,', 'parser.y', 1 19)1483 module_eval(<<'.,.,', 'parser.y', 124) 2151 1484 def _reduce_18(val, _values, result) 2152 1485 result = {:arch_language => nil} … … 2156 1489 .,., 2157 1490 2158 module_eval(<<'.,.,', 'parser.y', 12 3)1491 module_eval(<<'.,.,', 'parser.y', 128) 2159 1492 def _reduce_19(val, _values, result) 2160 1493 result = {:arch_language => val[1]} … … 2168 1501 # reduce 21 omitted 2169 1502 2170 module_eval(<<'.,.,', 'parser.y', 13 4)1503 module_eval(<<'.,.,', 'parser.y', 139) 2171 1504 def _reduce_22(val, _values, result) 2172 1505 result = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new(:details => val[1]) … … 2178 1511 # reduce 23 omitted 2179 1512 2180 module_eval(<<'.,.,', 'parser.y', 14 2)1513 module_eval(<<'.,.,', 'parser.y', 147) 2181 1514 def _reduce_24(val, _values, result) 2182 1515 result = val[1] … … 2188 1521 # reduce 25 omitted 2189 1522 2190 module_eval(<<'.,.,', 'parser.y', 15 0)1523 module_eval(<<'.,.,', 'parser.y', 155) 2191 1524 def _reduce_26(val, _values, result) 2192 1525 assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)} 2193 @@log .info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")1526 @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}") 2194 1527 result = val[0] 2195 1528 … … 2198 1531 .,., 2199 1532 2200 module_eval(<<'.,.,', 'parser.y', 1 56)1533 module_eval(<<'.,.,', 'parser.y', 161) 2201 1534 def _reduce_27(val, _values, result) 2202 1535 result = val[0] … … 2206 1539 .,., 2207 1540 2208 module_eval(<<'.,.,', 'parser.y', 16 3)1541 module_eval(<<'.,.,', 'parser.y', 168) 2209 1542 def _reduce_28(val, _values, result) 2210 1543 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object| … … 2218 1551 .,., 2219 1552 2220 module_eval(<<'.,.,', 'parser.y', 17 1)1553 module_eval(<<'.,.,', 'parser.y', 176) 2221 1554 def _reduce_29(val, _values, result) 2222 1555 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object| … … 2230 1563 .,., 2231 1564 2232 module_eval(<<'.,.,', 'parser.y', 18 2)1565 module_eval(<<'.,.,', 'parser.y', 187) 2233 1566 def _reduce_30(val, _values, result) 2234 1567 result = {:c_complex_object_id => val[0], :c_occurrences => val[1]} … … 2238 1571 .,., 2239 1572 2240 module_eval(<<'.,.,', 'parser.y', 1 87)1573 module_eval(<<'.,.,', 'parser.y', 192) 2241 1574 def _reduce_31(val, _values, result) 2242 1575 result = {:type_identifier => val[0]} … … 2246 1579 .,., 2247 1580 2248 module_eval(<<'.,.,', 'parser.y', 19 1)1581 module_eval(<<'.,.,', 'parser.y', 196) 2249 1582 def _reduce_32(val, _values, result) 2250 1583 result = {:type_identifier => val[0], :local_term_code_ref => val[1]} … … 2256 1589 # reduce 33 omitted 2257 1590 2258 module_eval(<<'.,.,', 'parser.y', 197)1591 module_eval(<<'.,.,', 'parser.y', 202) 2259 1592 def _reduce_34(val, _values, result) 2260 1593 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => val[0]) … … 2264 1597 .,., 2265 1598 2266 module_eval(<<'.,.,', 'parser.y', 2 05)1599 module_eval(<<'.,.,', 'parser.y', 220) 2267 1600 def _reduce_35(val, _values, result) 2268 result = val[0] 2269 2270 result 2271 end 2272 .,., 2273 2274 module_eval(<<'.,.,', 'parser.y', 209) 1601 @@logger.debug("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}") 1602 result = val[0] 1603 1604 result 1605 end 1606 .,., 1607 1608 module_eval(<<'.,.,', 'parser.y', 225) 2275 1609 def _reduce_36(val, _values, result) 2276 @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}")2277 result = val[0]2278 2279 result2280 end2281 .,.,2282 2283 module_eval(<<'.,.,', 'parser.y', 214)2284 def _reduce_37(val, _values, result)2285 1610 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref| 2286 1611 archetype_internal_ref.target_path = val[0][:absolute_path] … … 2293 1618 .,., 2294 1619 2295 module_eval(<<'.,.,', 'parser.y', 222) 1620 module_eval(<<'.,.,', 'parser.y', 233) 1621 def _reduce_37(val, _values, result) 1622 result = val[0] 1623 1624 result 1625 end 1626 .,., 1627 1628 module_eval(<<'.,.,', 'parser.y', 237) 2296 1629 def _reduce_38(val, _values, result) 2297 result = val[0]2298 2299 result2300 end2301 .,.,2302 2303 module_eval(<<'.,.,', 'parser.y', 226)2304 def _reduce_39(val, _values, result)2305 1630 result = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.create do |constraint_ref| 2306 1631 constraint_ref.reference = val[0] … … 2311 1636 .,., 2312 1637 2313 module_eval(<<'.,.,', 'parser.y', 232) 1638 module_eval(<<'.,.,', 'parser.y', 243) 1639 def _reduce_39(val, _values, result) 1640 result = val[0] 1641 1642 result 1643 end 1644 .,., 1645 1646 module_eval(<<'.,.,', 'parser.y', 247) 2314 1647 def _reduce_40(val, _values, result) 2315 1648 result = val[0] … … 2319 1652 .,., 2320 1653 2321 module_eval(<<'.,.,', 'parser.y', 2 36)1654 module_eval(<<'.,.,', 'parser.y', 251) 2322 1655 def _reduce_41(val, _values, result) 2323 1656 result = val[0] … … 2327 1660 .,., 2328 1661 2329 module_eval(<<'.,.,', 'parser.y', 2 40)1662 module_eval(<<'.,.,', 'parser.y', 255) 2330 1663 def _reduce_42(val, _values, result) 2331 1664 result = val[0] … … 2339 1672 # reduce 44 omitted 2340 1673 2341 module_eval(<<'.,.,', 'parser.y', 2 55)1674 module_eval(<<'.,.,', 'parser.y', 271) 2342 1675 def _reduce_45(val, _values, result) 2343 1676 result = val[1] … … 2347 1680 .,., 2348 1681 2349 module_eval(<<'.,.,', 'parser.y', 2 61)1682 module_eval(<<'.,.,', 'parser.y', 277) 2350 1683 def _reduce_46(val, _values, result) 2351 1684 result = {:type_identifier => val[1], :c_occurrences => val[2], :absolute_path => val[3] } … … 2357 1690 # reduce 47 omitted 2358 1691 2359 module_eval(<<'.,.,', 'parser.y', 2 68)1692 module_eval(<<'.,.,', 'parser.y', 284) 2360 1693 def _reduce_48(val, _values, result) 2361 1694 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.create do |archetype_slot| … … 2370 1703 .,., 2371 1704 2372 module_eval(<<'.,.,', 'parser.y', 2 77)1705 module_eval(<<'.,.,', 'parser.y', 293) 2373 1706 def _reduce_49(val, _values, result) 2374 1707 result = {:c_archetype_slot_id => val[0],:c_occurrences => val[1]} … … 2378 1711 .,., 2379 1712 2380 module_eval(<<'.,.,', 'parser.y', 2 82)1713 module_eval(<<'.,.,', 'parser.y', 298) 2381 1714 def _reduce_50(val, _values, result) 2382 1715 result = val[1] … … 2390 1723 # reduce 52 omitted 2391 1724 2392 module_eval(<<'.,.,', 'parser.y', 290)1725 module_eval(<<'.,.,', 'parser.y', 306) 2393 1726 def _reduce_53(val, _values, result) 2394 1727 assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE)} … … 2401 1734 .,., 2402 1735 2403 module_eval(<<'.,.,', 'parser.y', 298)1736 module_eval(<<'.,.,', 'parser.y', 314) 2404 1737 def _reduce_54(val, _values, result) 2405 @@log .info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")1738 @@logger.debug("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}") 2406 1739 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.create do |c_integer| 2407 1740 c_integer.list … … 2414 1747 .,., 2415 1748 2416 module_eval(<<'.,.,', 'parser.y', 3 07)1749 module_eval(<<'.,.,', 'parser.y', 323) 2417 1750 def _reduce_55(val, _values, result) 2418 @@log .info("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")1751 @@logger.debug("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}") 2419 1752 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL.new 2420 1753 … … 2423 1756 .,., 2424 1757 2425 module_eval(<<'.,.,', 'parser.y', 3 12)1758 module_eval(<<'.,.,', 'parser.y', 328) 2426 1759 def _reduce_56(val, _values, result) 2427 @@log .info("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")1760 @@logger.debug("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}") 2428 1761 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE.new 2429 1762 … … 2432 1765 .,., 2433 1766 2434 module_eval(<<'.,.,', 'parser.y', 3 17)1767 module_eval(<<'.,.,', 'parser.y', 333) 2435 1768 def _reduce_57(val, _values, result) 2436 @@log .info("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")1769 @@logger.debug("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}") 2437 1770 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME.new 2438 1771 … … 2441 1774 .,., 2442 1775 2443 module_eval(<<'.,.,', 'parser.y', 3 22)1776 module_eval(<<'.,.,', 'parser.y', 338) 2444 1777 def _reduce_58(val, _values, result) 2445 @@log .info("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")1778 @@logger.debug("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}") 2446 1779 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new 2447 1780 … … 2450 1783 .,., 2451 1784 2452 module_eval(<<'.,.,', 'parser.y', 3 27)1785 module_eval(<<'.,.,', 'parser.y', 343) 2453 1786 def _reduce_59(val, _values, result) 2454 @@log .info("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")1787 @@logger.debug("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}") 2455 1788 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new 2456 1789 … … 2459 1792 .,., 2460 1793 2461 module_eval(<<'.,.,', 'parser.y', 3 32)1794 module_eval(<<'.,.,', 'parser.y', 348) 2462 1795 def _reduce_60(val, _values, result) 2463 @@log .info("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")1796 @@logger.debug("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}") 2464 1797 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING.new 2465 1798 … … 2468 1801 .,., 2469 1802 2470 module_eval(<<'.,.,', 'parser.y', 3 37)1803 module_eval(<<'.,.,', 'parser.y', 353) 2471 1804 def _reduce_61(val, _values, result) 2472 1805 assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN)} 2473 @@log .info("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}")1806 @@logger.debug("#{__FILE__}:#{__LINE__}: c_boolean = #{val[0]} at #{@filename}:#{@lineno}") 2474 1807 result = val[0] 2475 1808 … … 2480 1813 # reduce 62 omitted 2481 1814 2482 module_eval(<<'.,.,', 'parser.y', 3 49)1815 module_eval(<<'.,.,', 'parser.y', 365) 2483 1816 def _reduce_63(val, _values, result) 2484 1817 result = [val[0]] … … 2488 1821 .,., 2489 1822 2490 module_eval(<<'.,.,', 'parser.y', 3 53)1823 module_eval(<<'.,.,', 'parser.y', 369) 2491 1824 def _reduce_64(val, _values, result) 2492 1825 result = (val[0] << val[1]) … … 2496 1829 .,., 2497 1830 2498 module_eval(<<'.,.,', 'parser.y', 3 59)1831 module_eval(<<'.,.,', 'parser.y', 375) 2499 1832 def _reduce_65(val, _values, result) 2500 1833 assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)} … … 2507 1840 .,., 2508 1841 2509 module_eval(<<'.,.,', 'parser.y', 3 66)1842 module_eval(<<'.,.,', 'parser.y', 382) 2510 1843 def _reduce_66(val, _values, result) 2511 1844 assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)} … … 2516 1849 .,., 2517 1850 2518 module_eval(<<'.,.,', 'parser.y', 3 71)1851 module_eval(<<'.,.,', 'parser.y', 387) 2519 1852 def _reduce_67(val, _values, result) 2520 1853 assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)} … … 2525 1858 .,., 2526 1859 2527 module_eval(<<'.,.,', 'parser.y', 3 78)1860 module_eval(<<'.,.,', 'parser.y', 394) 2528 1861 def _reduce_68(val, _values, result) 2529 @@log .info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")1862 @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}") 2530 1863 result = OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new( 2531 1864 :rm_attribute_name => val[0], … … 2538 1871 .,., 2539 1872 2540 module_eval(<<'.,.,', 'parser.y', 387)1873 module_eval(<<'.,.,', 'parser.y', 403) 2541 1874 def _reduce_69(val, _values, result) 2542 1875 assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY) } 2543 @@log .info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}")1876 @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER: #{val[0]}, c_existence = #{val[1]}, c_cardinality = #{val[2]} at #{@filename}") 2544 1877 result = OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new( 2545 1878 :rm_attribute_name => val[0], … … 2552 1885 .,., 2553 1886 2554 module_eval(<<'.,.,', 'parser.y', 398)1887 module_eval(<<'.,.,', 'parser.y', 414) 2555 1888 def _reduce_70(val, _values, result) 2556 1889 result = Array[val[0]] … … 2560 1893 .,., 2561 1894 2562 module_eval(<<'.,.,', 'parser.y', 4 02)1895 module_eval(<<'.,.,', 'parser.y', 418) 2563 1896 def _reduce_71(val, _values, result) 2564 1897 result = (val[0] << val[1]) … … 2568 1901 .,., 2569 1902 2570 module_eval(<<'.,.,', 'parser.y', 4 06)1903 module_eval(<<'.,.,', 'parser.y', 422) 2571 1904 def _reduce_72(val, _values, result) 2572 1905 result = Array[val[0]] … … 2578 1911 # reduce 73 omitted 2579 1912 2580 module_eval(<<'.,.,', 'parser.y', 4 14)1913 module_eval(<<'.,.,', 'parser.y', 430) 2581 1914 def _reduce_74(val, _values, result) 2582 1915 result = val[1] … … 2588 1921 # reduce 75 omitted 2589 1922 2590 module_eval(<<'.,.,', 'parser.y', 4 22)1923 module_eval(<<'.,.,', 'parser.y', 438) 2591 1924 def _reduce_76(val, _values, result) 2592 1925 result = val[1] … … 2612 1945 # reduce 84 omitted 2613 1946 2614 module_eval(<<'.,.,', 'parser.y', 4 42)1947 module_eval(<<'.,.,', 'parser.y', 458) 2615 1948 def _reduce_85(val, _values, result) 2616 1949 dadl_section = val[1] … … 2629 1962 # reduce 89 omitted 2630 1963 2631 module_eval(<<'.,.,', 'parser.y', 4 57)1964 module_eval(<<'.,.,', 'parser.y', 473) 2632 1965 def _reduce_90(val, _values, result) 2633 1966 result = Array[val[0]] … … 2637 1970 .,., 2638 1971 2639 module_eval(<<'.,.,', 'parser.y', 4 61)1972 module_eval(<<'.,.,', 'parser.y', 477) 2640 1973 def _reduce_91(val, _values, result) 2641 1974 result = (val[0] << val[1]) … … 2645 1978 .,., 2646 1979 2647 module_eval(<<'.,.,', 'parser.y', 4 65)1980 module_eval(<<'.,.,', 'parser.y', 481) 2648 1981 def _reduce_92(val, _values, result) 2649 1982 result = (val[0] << val[2]) … … 2653 1986 .,., 2654 1987 2655 module_eval(<<'.,.,', 'parser.y', 4 70)1988 module_eval(<<'.,.,', 'parser.y', 486) 2656 1989 def _reduce_93(val, _values, result) 2657 @@log .info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")1990 @@logger.debug("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]} at #{@filename}:#{@lineno}") 2658 1991 result = {:attr_id => val[0], :object_block => val[2]} 2659 1992 … … 2662 1995 .,., 2663 1996 2664 module_eval(<<'.,.,', 'parser.y', 4 76)1997 module_eval(<<'.,.,', 'parser.y', 492) 2665 1998 def _reduce_94(val, _values, result) 2666 @@log .info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}")1999 @@logger.debug("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}") 2667 2000 result = val[0] 2668 2001 … … 2673 2006 # reduce 95 omitted 2674 2007 2675 module_eval(<<'.,.,', 'parser.y', 4 83)2008 module_eval(<<'.,.,', 'parser.y', 499) 2676 2009 def _reduce_96(val, _values, result) 2677 2010 result = val[0] … … 2681 2014 .,., 2682 2015 2683 module_eval(<<'.,.,', 'parser.y', 487)2016 module_eval(<<'.,.,', 'parser.y', 503) 2684 2017 def _reduce_97(val, _values, result) 2685 2018 result = val[0] … … 2689 2022 .,., 2690 2023 2691 module_eval(<<'.,.,', 'parser.y', 492)2024 module_eval(<<'.,.,', 'parser.y', 508) 2692 2025 def _reduce_98(val, _values, result) 2693 2026 result = val[0] … … 2697 2030 .,., 2698 2031 2699 module_eval(<<'.,.,', 'parser.y', 496)2032 module_eval(<<'.,.,', 'parser.y', 512) 2700 2033 def _reduce_99(val, _values, result) 2701 2034 result = val[0] … … 2705 2038 .,., 2706 2039 2707 module_eval(<<'.,.,', 'parser.y', 5 01)2040 module_eval(<<'.,.,', 'parser.y', 517) 2708 2041 def _reduce_100(val, _values, result) 2709 2042 result = {:untyped_multiple_attr_object_block => val[0]} … … 2713 2046 .,., 2714 2047 2715 module_eval(<<'.,.,', 'parser.y', 5 05)2048 module_eval(<<'.,.,', 'parser.y', 521) 2716 2049 def _reduce_101(val, _values, result) 2717 2050 result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]} … … 2721 2054 .,., 2722 2055 2723 module_eval(<<'.,.,', 'parser.y', 5 10)2056 module_eval(<<'.,.,', 'parser.y', 526) 2724 2057 def _reduce_102(val, _values, result) 2725 2058 result = {:multiple_attr_object_block_head => val[0], :keyed_objects => val[1]} … … 2729 2062 .,., 2730 2063 2731 module_eval(<<'.,.,', 'parser.y', 5 15)2064 module_eval(<<'.,.,', 'parser.y', 531) 2732 2065 def _reduce_103(val, _values, result) 2733 @@log.info("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}") 2734 result = val[0] 2735 2736 result 2737 end 2738 .,., 2739 2740 module_eval(<<'.,.,', 'parser.y', 521) 2066 result = val[0] 2067 2068 result 2069 end 2070 .,., 2071 2072 module_eval(<<'.,.,', 'parser.y', 536) 2741 2073 def _reduce_104(val, _values, result) 2742 2074 result = Array[val[0]] … … 2746 2078 .,., 2747 2079 2748 module_eval(<<'.,.,', 'parser.y', 5 25)2080 module_eval(<<'.,.,', 'parser.y', 540) 2749 2081 def _reduce_105(val, _values, result) 2750 2082 result = (val[0] << val[1]) … … 2754 2086 .,., 2755 2087 2756 module_eval(<<'.,.,', 'parser.y', 5 30)2088 module_eval(<<'.,.,', 'parser.y', 545) 2757 2089 def _reduce_106(val, _values, result) 2758 @@log .info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")2759 result = {:object_key => val[0], :object_block => val[ 1]}2760 2761 result 2762 end 2763 .,., 2764 2765 module_eval(<<'.,.,', 'parser.y', 5 36)2090 @@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}") 2091 result = {:object_key => val[0], :object_block => val[2]} 2092 2093 result 2094 end 2095 .,., 2096 2097 module_eval(<<'.,.,', 'parser.y', 551) 2766 2098 def _reduce_107(val, _values, result) 2767 @@log .info("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")2099 @@logger.debug("object_key: [#{val[1]}] at #{@filename}:#{@lineno}") 2768 2100 result = val[1] 2769 2101 … … 2772 2104 .,., 2773 2105 2774 module_eval(<<'.,.,', 'parser.y', 5 42)2106 module_eval(<<'.,.,', 'parser.y', 557) 2775 2107 def _reduce_108(val, _values, result) 2776 2108 result = {:untyped_single_attr_object_block => val[0]} … … 2780 2112 .,., 2781 2113 2782 module_eval(<<'.,.,', 'parser.y', 5 46)2114 module_eval(<<'.,.,', 'parser.y', 561) 2783 2115 def _reduce_109(val, _values, result) 2784 2116 result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]} … … 2788 2120 .,., 2789 2121 2790 module_eval(<<'.,.,', 'parser.y', 5 51)2122 module_eval(<<'.,.,', 'parser.y', 566) 2791 2123 def _reduce_110(val, _values, result) 2792 @@log .info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")2124 @@logger.debug("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}") 2793 2125 result = {:single_attr_object_complex_head => val[0]} 2794 2126 … … 2797 2129 .,., 2798 2130 2799 module_eval(<<'.,.,', 'parser.y', 5 56)2131 module_eval(<<'.,.,', 'parser.y', 571) 2800 2132 def _reduce_111(val, _values, result) 2801 @@log .info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]},attr_vals = #{val[1]} at #{@filename}:#{@lineno}")2133 @@logger.debug("#{__FILE__}:#{__LINE__}: attr_vals = #{val[1]} at #{@filename}:#{@lineno}") 2802 2134 result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]} 2803 2135 … … 2808 2140 # reduce 112 omitted 2809 2141 2810 module_eval(<<'.,.,', 'parser.y', 5 62)2142 module_eval(<<'.,.,', 'parser.y', 577) 2811 2143 def _reduce_113(val, _values, result) 2812 @@log .info("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")2144 @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}") 2813 2145 result = {:untyped_primitive_object_block => val[0]} 2814 2146 … … 2817 2149 .,., 2818 2150 2819 module_eval(<<'.,.,', 'parser.y', 5 67)2151 module_eval(<<'.,.,', 'parser.y', 582) 2820 2152 def _reduce_114(val, _values, result) 2821 @@log .info("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")2153 @@logger.debug("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}") 2822 2154 result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]} 2823 2155 … … 2826 2158 .,., 2827 2159 2828 module_eval(<<'.,.,', 'parser.y', 5 72)2160 module_eval(<<'.,.,', 'parser.y', 587) 2829 2161 def _reduce_115(val, _values, result) 2830 @@log .info("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")2162 @@logger.debug("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}") 2831 2163 result = val[1] 2832 2164 … … 2835 2167 .,., 2836 2168 2837 module_eval(<<'.,.,', 'parser.y', 5 77)2169 module_eval(<<'.,.,', 'parser.y', 592) 2838 2170 def _reduce_116(val, _values, result) 2839 2171 result = val[0] … … 2843 2175 .,., 2844 2176 2845 module_eval(<<'.,.,', 'parser.y', 5 81)2177 module_eval(<<'.,.,', 'parser.y', 596) 2846 2178 def _reduce_117(val, _values, result) 2847 2179 result = val[0] … … 2851 2183 .,., 2852 2184 2853 module_eval(<<'.,.,', 'parser.y', 585)2185 module_eval(<<'.,.,', 'parser.y', 600) 2854 2186 def _reduce_118(val, _values, result) 2855 2187 result = val[0] … … 2859 2191 .,., 2860 2192 2861 module_eval(<<'.,.,', 'parser.y', 589)2193 module_eval(<<'.,.,', 'parser.y', 604) 2862 2194 def _reduce_119(val, _values, result) 2863 2195 result = val[0] … … 2867 2199 .,., 2868 2200 2869 module_eval(<<'.,.,', 'parser.y', 593)2201 module_eval(<<'.,.,', 'parser.y', 608) 2870 2202 def _reduce_120(val, _values, result) 2871 2203 result = val[0] … … 2875 2207 .,., 2876 2208 2877 module_eval(<<'.,.,', 'parser.y', 597)2209 module_eval(<<'.,.,', 'parser.y', 612) 2878 2210 def _reduce_121(val, _values, result) 2879 @@log .info("string_value: #{val[0]} at #{@filename}:#{@lineno}")2211 @@logger.debug("string_value: #{val[0]} at #{@filename}:#{@lineno}") 2880 2212 result = val[0] 2881 2213 … … 2884 2216 .,., 2885 2217 2886 module_eval(<<'.,.,', 'parser.y', 6 02)2218 module_eval(<<'.,.,', 'parser.y', 617) 2887 2219 def _reduce_122(val, _values, result) 2888 @@log .info("integer_value: #{val[0]} at #{@filename}:#{@lineno}")2220 @@logger.debug("integer_value: #{val[0]} at #{@filename}:#{@lineno}") 2889 2221 result = val[0] 2890 2222 … … 2893 2225 .,., 2894 2226 2895 module_eval(<<'.,.,', 'parser.y', 6 07)2227 module_eval(<<'.,.,', 'parser.y', 622) 2896 2228 def _reduce_123(val, _values, result) 2897 @@log .info("real_value: #{val[0]} at #{@filename}:#{@lineno}")2229 @@logger.debug("real_value: #{val[0]} at #{@filename}:#{@lineno}") 2898 2230 result = val[0] 2899 2231 … … 2902 2234 .,., 2903 2235 2904 module_eval(<<'.,.,', 'parser.y', 6 12)2236 module_eval(<<'.,.,', 'parser.y', 627) 2905 2237 def _reduce_124(val, _values, result) 2906 @@log .info("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")2238 @@logger.debug("boolean_value: #{val[0]} at #{@filename}:#{@lineno}") 2907 2239 result = val[0] 2908 2240 … … 2911 2243 .,., 2912 2244 2913 module_eval(<<'.,.,', 'parser.y', 6 17)2245 module_eval(<<'.,.,', 'parser.y', 632) 2914 2246 def _reduce_125(val, _values, result) 2915 @@log .info("character_value: #{val[0]} at #{@filename}:#{@lineno}")2247 @@logger.debug("character_value: #{val[0]} at #{@filename}:#{@lineno}") 2916 2248 result = val[0] 2917 2249 … … 2920 2252 .,., 2921 2253 2922 module_eval(<<'.,.,', 'parser.y', 6 22)2254 module_eval(<<'.,.,', 'parser.y', 637) 2923 2255 def _reduce_126(val, _values, result) 2924 @@log .info("date_value: #{val[0]} at #{@filename}:#{@lineno}")2256 @@logger.debug("date_value: #{val[0]} at #{@filename}:#{@lineno}") 2925 2257 result = val[0] 2926 2258 … … 2929 2261 .,., 2930 2262 2931 module_eval(<<'.,.,', 'parser.y', 6 27)2263 module_eval(<<'.,.,', 'parser.y', 642) 2932 2264 def _reduce_127(val, _values, result) 2933 @@log .info("time_value: #{val[0]} at #{@filename}:#{@lineno}")2265 @@logger.debug("time_value: #{val[0]} at #{@filename}:#{@lineno}") 2934 2266 result = val[0] 2935 2267 … … 2938 2270 .,., 2939 2271 2940 module_eval(<<'.,.,', 'parser.y', 6 32)2272 module_eval(<<'.,.,', 'parser.y', 647) 2941 2273 def _reduce_128(val, _values, result) 2942 @@log .info("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")2274 @@logger.debug("date_time_value: #{val[0]} at #{@filename}:#{@lineno}") 2943 2275 result = val[0] 2944 2276 … … 2947 2279 .,., 2948 2280 2949 module_eval(<<'.,.,', 'parser.y', 6 37)2281 module_eval(<<'.,.,', 'parser.y', 652) 2950 2282 def _reduce_129(val, _values, result) 2951 @@log .info("duration_value: #{val[0]} at #{@filename}:#{@lineno}")2283 @@logger.debug("duration_value: #{val[0]} at #{@filename}:#{@lineno}") 2952 2284 result = val[0] 2953 2285 … … 2956 2288 .,., 2957 2289 2958 module_eval(<<'.,.,', 'parser.y', 6 42)2290 module_eval(<<'.,.,', 'parser.y', 657) 2959 2291 def _reduce_130(val, _values, result) 2960 @@log .info("uri_value: #{val[0]} at #{@filename}:#{@lineno}")2292 @@logger.debug("uri_value: #{val[0]} at #{@filename}:#{@lineno}") 2961 2293 result = val[0] 2962 2294 … … 2995 2327 # reduce 145 omitted 2996 2328 2997 module_eval(<<'.,.,', 'parser.y', 6 65)2329 module_eval(<<'.,.,', 'parser.y', 680) 2998 2330 def _reduce_146(val, _values, result) 2999 @@log .info("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")2331 @@logger.debug("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}") 3000 2332 result = val[0] 3001 2333 … … 3004 2336 .,., 3005 2337 3006 module_eval(<<'.,.,', 'parser.y', 6 70)2338 module_eval(<<'.,.,', 'parser.y', 685) 3007 2339 def _reduce_147(val, _values, result) 3008 @@log .info("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")2340 @@logger.debug("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}") 3009 2341 result = val[0] 3010 2342 … … 3013 2345 .,., 3014 2346 3015 module_eval(<<'.,.,', 'parser.y', 6 76)2347 module_eval(<<'.,.,', 'parser.y', 691) 3016 2348 def _reduce_148(val, _values, result) 3017 @@log .info("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")2349 @@logger.debug("V_STRING: #{val[0]} at #{@filename}:#{@lineno}") 3018 2350 result = val[0] 3019 2351 … … 3028 2360 # reduce 151 omitted 3029 2361 3030 module_eval(<<'.,.,', 'parser.y', 686)2362 module_eval(<<'.,.,', 'parser.y', 701) 3031 2363 def _reduce_152(val, _values, result) 3032 2364 begin … … 3041 2373 .,., 3042 2374 3043 module_eval(<<'.,.,', 'parser.y', 695)2375 module_eval(<<'.,.,', 'parser.y', 710) 3044 2376 def _reduce_153(val, _values, result) 3045 2377 begin … … 3054 2386 .,., 3055 2387 3056 module_eval(<<'.,.,', 'parser.y', 7 04)2388 module_eval(<<'.,.,', 'parser.y', 719) 3057 2389 def _reduce_154(val, _values, result) 3058 2390 begin … … 3091 2423 # reduce 166 omitted 3092 2424 3093 module_eval(<<'.,.,', 'parser.y', 7 30)2425 module_eval(<<'.,.,', 'parser.y', 745) 3094 2426 def _reduce_167(val, _values, result) 3095 2427 begin … … 3104 2436 .,., 3105 2437 3106 module_eval(<<'.,.,', 'parser.y', 7 39)2438 module_eval(<<'.,.,', 'parser.y', 754) 3107 2439 def _reduce_168(val, _values, result) 3108 2440 begin … … 3117 2449 .,., 3118 2450 3119 module_eval(<<'.,.,', 'parser.y', 7 48)2451 module_eval(<<'.,.,', 'parser.y', 763) 3120 2452 def _reduce_169(val, _values, result) 3121 2453 begin … … 3154 2486 # reduce 181 omitted 3155 2487 3156 module_eval(<<'.,.,', 'parser.y', 7 73)2488 module_eval(<<'.,.,', 'parser.y', 788) 3157 2489 def _reduce_182(val, _values, result) 3158 2490 result = true … … 3162 2494 .,., 3163 2495 3164 module_eval(<<'.,.,', 'parser.y', 7 77)2496 module_eval(<<'.,.,', 'parser.y', 792) 3165 2497 def _reduce_183(val, _values, result) 3166 2498 result = false … … 3184 2516 # reduce 190 omitted 3185 2517 3186 # reduce 191 omitted 2518 module_eval(<<'.,.,', 'parser.y', 807) 2519 def _reduce_191(val, _values, result) 2520 result = val[0] 2521 2522 result 2523 end 2524 .,., 3187 2525 3188 2526 # reduce 192 omitted … … 3262 2600 # reduce 229 omitted 3263 2601 3264 module_eval(<<'.,.,', 'parser.y', 8 40)2602 module_eval(<<'.,.,', 'parser.y', 858) 3265 2603 def _reduce_230(val, _values, result) 3266 @@log .info("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")2604 @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}") 3267 2605 result = val[0] 3268 2606 … … 3295 2633 # reduce 242 omitted 3296 2634 3297 module_eval(<<'.,.,', 'parser.y', 8 60)2635 module_eval(<<'.,.,', 'parser.y', 878) 3298 2636 def _reduce_243(val, _values, result) 3299 @@log .info("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")2637 @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}") 3300 2638 result = val[0] 3301 2639 … … 3310 2648 # reduce 246 omitted 3311 2649 3312 module_eval(<<'.,.,', 'parser.y', 8 70)2650 module_eval(<<'.,.,', 'parser.y', 888) 3313 2651 def _reduce_247(val, _values, result) 3314 @@log .info("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")2652 @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}") 3315 2653 result = val[0] 3316 2654 … … 3399 2737 # reduce 287 omitted 3400 2738 3401 module_eval(<<'.,.,', 'parser.y', 9 40)2739 module_eval(<<'.,.,', 'parser.y', 958) 3402 2740 def _reduce_288(val, _values, result) 3403 @@log .info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")3404 3405 result 3406 end 3407 .,., 3408 3409 module_eval(<<'.,.,', 'parser.y', 9 44)2741 @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 2742 2743 result 2744 end 2745 .,., 2746 2747 module_eval(<<'.,.,', 'parser.y', 962) 3410 2748 def _reduce_289(val, _values, result) 3411 @@log .info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")3412 3413 result 3414 end 3415 .,., 3416 3417 module_eval(<<'.,.,', 'parser.y', 9 55)2749 @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") 2750 2751 result 2752 end 2753 .,., 2754 2755 module_eval(<<'.,.,', 'parser.y', 973) 3418 2756 def _reduce_290(val, _values, result) 3419 2757 result = Range.new(1,1) … … 3423 2761 .,., 3424 2762 3425 module_eval(<<'.,.,', 'parser.y', 9 59)2763 module_eval(<<'.,.,', 'parser.y', 977) 3426 2764 def _reduce_291(val, _values, result) 3427 2765 result = val[3] … … 3431 2769 .,., 3432 2770 3433 module_eval(<<'.,.,', 'parser.y', 9 64)2771 module_eval(<<'.,.,', 'parser.y', 982) 3434 2772 def _reduce_292(val, _values, result) 3435 2773 begin … … 3444 2782 .,., 3445 2783 3446 module_eval(<<'.,.,', 'parser.y', 9 73)2784 module_eval(<<'.,.,', 'parser.y', 991) 3447 2785 def _reduce_293(val, _values, result) 3448 2786 begin … … 3458 2796 .,., 3459 2797 3460 module_eval(<<'.,.,', 'parser.y', 984)2798 module_eval(<<'.,.,', 'parser.y', 1002) 3461 2799 def _reduce_294(val, _values, result) 3462 2800 result = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new … … 3482 2820 # reduce 302 omitted 3483 2821 3484 module_eval(<<'.,.,', 'parser.y', 998)2822 module_eval(<<'.,.,', 'parser.y', 1016) 3485 2823 def _reduce_303(val, _values, result) 3486 2824 result = val[0] … … 3490 2828 .,., 3491 2829 3492 module_eval(<<'.,.,', 'parser.y', 10 02)2830 module_eval(<<'.,.,', 'parser.y', 1020) 3493 2831 def _reduce_304(val, _values, result) 3494 2832 result = val[0] … … 3500 2838 # reduce 305 omitted 3501 2839 3502 module_eval(<<'.,.,', 'parser.y', 10 09)2840 module_eval(<<'.,.,', 'parser.y', 1027) 3503 2841 def _reduce_306(val, _values, result) 3504 2842 result = val[3] … … 3600 2938 # reduce 352 omitted 3601 2939 3602 module_eval(<<'.,.,', 'parser.y', 10 79)2940 module_eval(<<'.,.,', 'parser.y', 1097) 3603 2941 def _reduce_353(val, _values, result) 3604 2942 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true) … … 3608 2946 .,., 3609 2947 3610 module_eval(<<'.,.,', 'parser.y', 1 083)2948 module_eval(<<'.,.,', 'parser.y', 1101) 3611 2949 def _reduce_354(val, _values, result) 3612 2950 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false) … … 3616 2954 .,., 3617 2955 3618 module_eval(<<'.,.,', 'parser.y', 1 087)2956 module_eval(<<'.,.,', 'parser.y', 1105) 3619 2957 def _reduce_355(val, _values, result) 3620 2958 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false) … … 3624 2962 .,., 3625 2963 3626 module_eval(<<'.,.,', 'parser.y', 1 091)2964 module_eval(<<'.,.,', 'parser.y', 1109) 3627 2965 def _reduce_356(val, _values, result) 3628 2966 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true) … … 3632 2970 .,., 3633 2971 3634 module_eval(<<'.,.,', 'parser.y', 1 096)2972 module_eval(<<'.,.,', 'parser.y', 1114) 3635 2973 def _reduce_357(val, _values, result) 3636 2974 result = val[0] … … 3640 2978 .,., 3641 2979 3642 module_eval(<<'.,.,', 'parser.y', 11 00)2980 module_eval(<<'.,.,', 'parser.y', 1118) 3643 2981 def _reduce_358(val, _values, result) 3644 2982 raise 'Not implemented yet' … … 3648 2986 .,., 3649 2987 3650 module_eval(<<'.,.,', 'parser.y', 11 04)2988 module_eval(<<'.,.,', 'parser.y', 1122) 3651 2989 def _reduce_359(val, _values, result) 3652 2990 raise 'Not implemented yet' … … 3666 3004 # reduce 364 omitted 3667 3005 3668 module_eval(<<'.,.,', 'parser.y', 11 16)3006 module_eval(<<'.,.,', 'parser.y', 1134) 3669 3007 def _reduce_365(val, _values, result) 3670 3008 @in_interval = false 3671 @@log .info("#{__FILE__}:#{__LINE__}, #{val[0]}|#{val[2]} at #{@filename}")3672 3673 result 3674 end 3675 .,., 3676 3677 module_eval(<<'.,.,', 'parser.y', 11 23)3009 @@logger.debug("#{__FILE__}:#{__LINE__}, #{val[0]}|#{val[2]} at #{@filename}") 3010 3011 result 3012 end 3013 .,., 3014 3015 module_eval(<<'.,.,', 'parser.y', 1141) 3678 3016 def _reduce_366(val, _values, result) 3679 3017 result = val[0] … … 3683 3021 .,., 3684 3022 3685 module_eval(<<'.,.,', 'parser.y', 11 27)3023 module_eval(<<'.,.,', 'parser.y', 1145) 3686 3024 def _reduce_367(val, _values, result) 3687 3025 result = val[0] … … 3691 3029 .,., 3692 3030 3693 # reduce 368 omitted 3031 module_eval(<<'.,.,', 'parser.y', 1151) 3032 def _reduce_368(val, _values, result) 3033 @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}") 3034 @@logger.debug("#{__FILE__}:#{__LINE__}, term_code_body = #{val[1]}") 3035 @@logger.debug("#{__FILE__}:#{__LINE__}, END_TERM_CODE_CONSTRAINT = #{val[2]}") 3036 result = val[1] 3037 3038 result 3039 end 3040 .,., 3694 3041 3695 3042 # reduce 369 omitted … … 3699 3046 # reduce 371 omitted 3700 3047 3701 module_eval(<<'.,.,', 'parser.y', 11 42)3048 module_eval(<<'.,.,', 'parser.y', 1167) 3702 3049 def _reduce_372(val, _values, result) 3703 3050 result = val[0] … … 3707 3054 .,., 3708 3055 3709 module_eval(<<'.,.,', 'parser.y', 11 47)3056 module_eval(<<'.,.,', 'parser.y', 1172) 3710 3057 def _reduce_373(val, _values, result) 3711 3058 result = val[0] … … 3715 3062 .,., 3716 3063 3717 module_eval(<<'.,.,', 'parser.y', 11 51)3064 module_eval(<<'.,.,', 'parser.y', 1176) 3718 3065 def _reduce_374(val, _values, result) 3719 @@log .info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")3066 @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}") 3720 3067 result = val[0] 3721 3068 … … 3724 3071 .,., 3725 3072 3726 module_eval(<<'.,.,', 'parser.y', 11 62)3073 module_eval(<<'.,.,', 'parser.y', 1187) 3727 3074 def _reduce_375(val, _values, result) 3728 3075 result = val[0]
Note:
See TracChangeset
for help on using the changeset viewer.