Changeset 283 for ruby/trunk/lib/adl_parser/lib/parser.rb
- Timestamp:
- Sep 20, 2009, 1:20:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/adl_parser/lib/parser.rb
r265 r283 11 11 $:.unshift File.join(File.dirname(__FILE__)) 12 12 require 'logger' 13 require 'yaml' 13 14 require 'rubygems' 14 15 require 'adl_parser.rb' 15 16 require 'am.rb' 16 17 require 'rm.rb' 17 $DEBUG = true18 $DEBUG = false 18 19 19 20 … … 23 24 class Parser < Racc::Parser 24 25 25 module_eval(<<'...end parser.y/module_eval...', 'parser.y', 120 5)26 module_eval(<<'...end parser.y/module_eval...', 'parser.y', 1208) 26 27 27 28 def assert_at(file,line, message = "") … … 39 40 end 40 41 41 @@dadl_scanner = OpenEHR::ADL::Scanner::DADL::RootScanner.new42 @@cadl_scanner = OpenEHR::ADL::Scanner::CADL::RootScanner.new43 42 44 43 ###----------/* keywords */ --------------------------------------------- … … 103 102 def scan 104 103 @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan at #{@filename}:#{@lineno}:") 105 adl_scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename) 106 cadl_scanner = OpenEHR::ADL::Scanner::CADLScanner.new(@adl_type, @filename) 107 dadl_scanner = OpenEHR::ADL::Scanner::DADLScanner.new(@adl_type, @filename) 108 regex_scanner = OpenEHR::ADL::Scanner::RegexScanner.new(@adl_type, @filename) 109 term_constraint_scanner = OpenEHR::ADL::Scanner::TermConstraintScanner.new(@adl_type, @filename) 104 scanner = OpenEHR::ADL::Scanner::ADLScanner.new(@adl_type, @filename) 110 105 111 106 until @data.nil? do 112 case @adl_type.last 113 when :adl 114 @data = adl_scanner.scan(@data) do |sym, val| 107 @data = scanner.scan(@data) do |sym, val| 115 108 yield sym, val 116 end117 when :dadl118 @data = dadl_scanner.scan(@data) do |sym, val|119 yield sym, val120 end121 when :cadl122 @data = cadl_scanner.scan(@data) do |sym, val|123 yield sym, val124 end125 when :regexp126 @data = regex_scanner.scan(@data) do |sym, val|127 yield sym, val128 end129 when :term_constraint130 @@logger.debug("#{__FILE__}:#{__LINE__}: scan: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{@data.inspect}")131 @data = term_constraint_scanner.scan(@data) do |sym, val|132 yield sym, val133 end134 else135 raise136 109 end 137 110 @data = $' # variable $' receives the string after the match … … 140 113 yield false, '$' 141 114 end # of scan 142 143 ### def scan144 ### @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan at #{@filename}:#{@lineno}:")145 146 ### until @data.nil? do147 ### case @adl_type.last148 ### when :adl149 ### @data = scan_adl(@data) do |sym, val|150 ### yield sym, val151 ### end152 ### when :dadl153 ### @data = scan_dadl(@data) do |sym, val|154 ### yield sym, val155 ### end156 ### when :cadl157 ### @data = scan_cadl(@data) do |sym, val|158 ### yield sym, val159 ### end160 ### when :regexp161 ### @data = scan_regexp(@data) do |sym, val|162 ### yield sym, val163 ### end164 ### when :term_constraint165 ### @@logger.debug("#{__FILE__}:#{__LINE__}: scan: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")166 ### @data = scan_term_constraint(@data) do |sym, val|167 ### yield sym, val168 ### end169 ### else170 ### raise171 ### end172 ### @data = $' # variable $' receives the string after the match173 ### end174 ### yield :EOF, nil175 ### yield false, '$'176 ### end # of scan177 178 def scan_adl(data)179 @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_adl at #{@filename}:#{@lineno}: data = #{data.inspect}")180 until data.nil? do181 case @adl_type.last182 when :adl183 case data184 when /\A\n/ # carriage return185 @lineno += 1186 ;187 when /\A[ \t\r\f]+/ #just drop it188 ;189 when /\A--.*\n/ # single line comment190 @lineno += 1191 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: COMMENT = #{$&} at #{@filename}:#{@lineno}")192 ;193 when /\Adescription/ # description194 yield :SYM_DESCRIPTION, :SYM_DESCRIPTION195 when /\Adefinition/ # definition196 yield :SYM_DEFINITION, :SYM_DEFINITION197 ###----------/* symbols */ -------------------------------------------------198 when /\A[A-Z][a-zA-Z0-9_]*/199 yield :V_TYPE_IDENTIFIER, $&200 # when /\A[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z][a-zA-Z0-9_-]+\.[a-zA-Z0-9]+/ #V_ARCHETYPE_ID201 when /\A(\w+)-(\w+)-(\w+)\.(\w+)(-\w+)?\.(v\w+)/ #V_ARCHETYPE_ID202 object_id, rm_originator, rm_name, rm_entity, concept_name, specialisation, version_id = $&, $1, $2, $3, $4, $5, $6203 archetype_id = OpenEHR::RM::Support::Identification::Archetype_ID.new(object_id, concept_name, rm_name, rm_entity, rm_originator, specialisation, version_id)204 # yield :V_ARCHETYPE_ID, $&205 yield :V_ARCHETYPE_ID, archetype_id206 when /\A[a-z][a-zA-Z0-9_]*/207 # word = $&.downcase208 word = $&209 if @@adl_reserved[word]210 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: @@adl_reserved = #{@@adl_reserved[word]} at #{@filename}:#{@lineno}")211 yield @@adl_reserved[word], @@adl_reserved[word]212 elsif #/\A[A-Z][a-zA-Z0-9_]*/213 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: V_ATTRIBUTE_IDENTIFIER = #{$&} at #{@filename}:#{@lineno}")214 yield :V_ATTRIBUTE_IDENTIFIER, $&215 end216 when /\A\=/ # =217 yield :SYM_EQ, :SYM_EQ218 when /\A\>=/ # >=219 yield :SYM_GE, :SYM_GE220 when /\A\<=/ # <=221 yield :SYM_LE, :SYM_LE222 when /\A\</ # <223 if @in_interval224 # @start_block_received = false225 yield :SYM_LT, :SYM_LT226 else227 # @start_block_received = true228 @adl_type.push(:dadl)229 yield :SYM_START_DBLOCK, $&230 end231 when /\A\>/ # >232 if @in_interval233 yield :SYM_GT, :SYM_GT234 else235 adl_type = @adl_type.pop236 assert_at(__FILE__,__LINE__){adl_type == :dadl}237 yield :SYM_END_DBLOCK, :SYM_END_DBLOCK238 end239 when /\A\{/ # {240 @adl_type.push(:cadl)241 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")242 yield :SYM_START_CBLOCK, :SYM_START_CBLOCK243 when /\A\}/ # }244 adl_type = @adl_type.pop245 # puts "Escaping #{adl_type}"246 assert_at(__FILE__,__LINE__){adl_type == :cadl}247 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")248 yield :SYM_END_CBLOCK, $&249 when /\A\-/ # -250 yield :Minus_code, :Minus_code251 when /\A\+/ # +252 yield :Plus_code, :Plus_code253 when /\A\*/ # *254 yield :Star_code, :Star_code255 when /\A\// # /256 yield :Slash_code, :Slash_code257 when /\A\^/ # ^258 yield :Caret_code, :Caret_code259 when /\A\=/ # =260 yield :Equal_code, :Equal_code261 when /\A\.\.\./ # ...262 yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE263 when /\A\.\./ # ..264 yield :SYM_ELLIPSIS, :SYM_ELLIPSIS265 when /\A\./ # .266 yield :Dot_code, :Dot_code267 when /\A\;/ # ;268 yield :Semicolon_code, :Semicolon_code269 when /\A\,/ # ,270 yield :Comma_code, :Comma_code271 when /\A\:/ # :272 yield :Colon_code, :Colon_code273 when /\A\!/ # !274 yield :Exclamation_code, :Exclamation_code275 when /\A\(/ # (276 yield :Left_parenthesis_code, :Left_parenthesis_code277 when /\A\)/ # )278 yield :Right_parenthesis_code, :Right_parenthesis_code279 when /\A\$/ # $280 yield :Dollar_code, :Dollar_code281 when /\A\?\?/ # ??282 yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN283 when /\A\?/ # ?284 yield :Question_mark_code, :Question_mark_code285 when /\A[0-9]+\.[0-9]+(\.[0-9]+)*/ # ?286 yield :V_VERSION_STRING, $&287 when /\A\|/ # |288 if @in_interval289 @in_interval = false290 else291 @in_interval = true292 end293 yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM294 when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/295 # when /\A\[[a-zA-Z0-9()\._-]+\:\:[a-zA-Z0-9\._-]+\]/ #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]296 yield :V_QUALIFIED_TERM_CODE_REF, $&297 when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/ #V_LOCAL_TERM_CODE_REF298 yield :V_LOCAL_TERM_CODE_REF, $&299 when /\A\[/ # [300 yield :Left_bracket_code, :Left_bracket_code301 when /\A\]/ # ]302 yield :Right_bracket_code, :Right_bracket_code303 304 when /\A"([^"]*)"/m #V_STRING305 yield :V_STRING, $1306 when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/ #ERR_V_QUALIFIED_TERM_CODE_REF307 yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&308 when /\Aa[ct][0-9.]+/ #V_LOCAL_CODE309 yield :V_LOCAL_CODE, $&310 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-]-311 yield :V_ISO8601_EXTENDED_DATE_TIME, $&312 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]313 yield :V_ISO8601_EXTENDED_TIME, $&314 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-DD315 yield :V_ISO8601_EXTENDED_DATE, $&316 when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER317 yield :V_GENERIC_TYPE_IDENTIFIER, $&318 when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/ #V_INTEGER319 yield :V_INTEGER, $&320 when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ / #V_REAL321 yield :V_REAL, $&322 # when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING323 when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI324 yield :V_URI, $&325 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 PnYnMnWnDTnnHnnMnnS326 yield :V_ISO8601_DURATION, $&327 when /\A\S/ #UTF8CHAR328 yield :UTF8CHAR, $&329 end330 data = $' # variable $' receives the string after the match331 when :dadl332 data = scan_dadl(data) do |sym, val|333 yield sym, val334 end335 when :cadl336 data = scan_cadl(data) do |sym, val|337 yield sym, val338 end339 when :regexp340 data = scan_regexp(data) do |sym, val|341 yield sym, val342 end343 when :term_constraint344 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_adl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")345 346 data = scan_term_constraint(data) do |sym, val|347 yield sym, val348 end349 else350 raise351 end352 end353 end # scan_adl354 355 356 def scan_cadl(data)357 @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_cadl at #{@filename}:#{@lineno}: data = #{data.inspect}")358 until data.nil? do359 case @adl_type.last360 when :cadl361 case scanned = @@cadl_scanner.parse(data)362 when Yaparc::Result::OK363 if scanned.value[0] == :START_V_C_DOMAIN_TYPE_BLOCK364 @in_c_domain_type = true365 @adl_type.push(:dadl)366 yield scanned.value367 else368 yield scanned.value369 end370 data = scanned.input371 end372 373 case data374 when /\A\n/ # carriage return375 @lineno += 1376 ;377 when /\A[ \t\r\f]+/ #just drop it378 ;379 when /\A--.*\n/ # single line comment380 @lineno += 1381 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")382 ;383 ###----------/* symbols */ -------------------------------------------------384 when /\A\=/ # =385 yield :SYM_EQ, :SYM_EQ386 when /\A\>=/ # >=387 yield :SYM_GE, :SYM_GE388 when /\A\<=/ # <=389 yield :SYM_LE, :SYM_LE390 ### when /\A[A-Z][a-zA-Z0-9_]*[ \n]*\</ # V_C_DOMAIN_TYPE391 ### @in_c_domain_type = true392 ### @adl_type.push(:dadl)393 ### yield :START_V_C_DOMAIN_TYPE_BLOCK, $&394 when /\A\</ # <395 if @in_interval396 yield :SYM_LT, :SYM_LT397 else398 @adl_type.push(:dadl)399 yield :SYM_START_DBLOCK, $&400 end401 when /\A\>/ # >402 if @in_interval403 yield :SYM_GT, :SYM_GT404 else405 adl_type = @adl_type.pop406 # puts "Escaping #{adl_type}"407 assert_at(__FILE__,__LINE__){adl_type == :dadl}408 yield :SYM_END_DBLOCK, :SYM_END_DBLOCK409 end410 when /\A\-/ # -411 yield :Minus_code, :Minus_code412 when /\A\+/ # +413 yield :Plus_code, :Plus_code414 when /\A\*/ # *415 yield :Star_code, :Star_code416 when /\A\// # /417 yield :Slash_code, :Slash_code418 when /\A\^/ # ^419 yield :Caret_code, :Caret_code420 when /\A\.\.\./ # ...421 yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE422 when /\A\.\./ # ..423 yield :SYM_ELLIPSIS, :SYM_ELLIPSIS424 when /\A\./ # .425 yield :Dot_code, :Dot_code426 when /\A\;/ # ;427 yield :Semicolon_code, :Semicolon_code428 when /\A\,/ # ,429 yield :Comma_code, :Comma_code430 when /\A\:/ # :431 yield :Colon_code, :Colon_code432 when /\A\!/ # !433 yield :Exclamation_code, :Exclamation_code434 when /\A\(/ # (435 yield :Left_parenthesis_code, :Left_parenthesis_code436 when /\A\)/ # )437 yield :Right_parenthesis_code, :Right_parenthesis_code438 when /\A\{\// #V_REGEXP439 if @adl_type.last != :regexp440 @in_regexp = true441 @adl_type.push(:regexp)442 yield :START_REGEXP_BLOCK, :START_REGEXP_BLOCK443 else444 raise445 end446 # yield :V_REGEXP, :V_REGEXP447 when /\A\{/ # {448 @adl_type.push(:cadl)449 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: entering cADL at #{@filename}:#{@lineno}")450 yield :SYM_START_CBLOCK, :SYM_START_CBLOCK451 when /\A\}/ # }452 adl_type = @adl_type.pop453 # puts "Escaping #{adl_type}"454 assert_at(__FILE__,__LINE__){adl_type == :cadl}455 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: exiting cADL at #{@filename}:#{@lineno}")456 yield :SYM_END_CBLOCK, :SYM_END_CBLOCK457 when /\A\$/ # $458 yield :Dollar_code, :Dollar_code459 when /\A\?\?/ # ??460 yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN461 when /\A\?/ # ?462 yield :Question_mark_code, :Question_mark_code463 when /\A\|/ # |464 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")465 if @in_interval466 @in_interval = false467 else468 # @in_interval = false469 @in_interval = true470 end471 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")472 yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM473 474 when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/ #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]475 # when /\A\[[a-zA-Z0-9._\-]+::[a-zA-Z0-9._\-]+\]/ #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]476 yield :V_QUALIFIED_TERM_CODE_REF, $&477 when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/ #ERR_V_QUALIFIED_TERM_CODE_REF478 yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&479 when /\A\[([a-zA-Z0-9\(\)\._\-]+)::[ \t\n]*/480 @adl_type.push(:term_constraint)481 yield :START_TERM_CODE_CONSTRAINT, $1482 when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/ #V_LOCAL_TERM_CODE_REF483 yield :V_LOCAL_TERM_CODE_REF, $&484 when /\A\[/ # [485 yield :Left_bracket_code, :Left_bracket_code486 when /\A\]/ # ]487 yield :Right_bracket_code, :Right_bracket_code488 when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER489 yield :V_GENERIC_TYPE_IDENTIFIER, $&490 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]/491 yield :V_ISO8601_DATE_TIME_CONSTRAINT_PATTERN, $&492 when /\A[yY][yY][yY][yY]-[mM?X][mM?X]-[dD?X][dD?X]/493 yield :V_ISO8601_DATE_CONSTRAINT_PATTERN, $&494 when /\A[hH][hH]:[mM?X][mM?X]:[sS?X][sS?X]/495 yield :V_ISO8601_TIME_CONSTRAINT_PATTERN, $&496 when /\A[a-z][a-zA-Z0-9_]*/497 word = $&.dup498 if @@cadl_reserved[word.downcase]499 yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]500 else501 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}:#{@lineno}")502 yield :V_ATTRIBUTE_IDENTIFIER, word #V_ATTRIBUTE_IDENTIFIER /\A[a-z][a-zA-Z0-9_]*/503 end504 when /\A[A-Z][a-zA-Z0-9_]*/505 word = $&.dup506 if @@cadl_reserved[word.downcase]507 yield @@cadl_reserved[word.downcase], @@cadl_reserved[word.downcase]508 else509 yield :V_TYPE_IDENTIFIER, $&510 end511 when /\Aa[ct][0-9.]+/ #V_LOCAL_CODE512 yield :V_LOCAL_CODE, $&513 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-]-514 yield :V_ISO8601_EXTENDED_DATE_TIME, $&515 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]516 yield :V_ISO8601_EXTENDED_TIME, $&517 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-DD518 yield :V_ISO8601_EXTENDED_DATE, $&519 when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/ #V_INTEGER520 yield :V_INTEGER, $&521 when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ / #V_REAL522 yield :V_REAL, $&523 when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING524 when /\A"([^"]*)"/m #V_STRING525 yield :V_STRING, $1526 when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI527 yield :V_URI, $&528 ### 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 PnYnMnWnDTnnHnnMnnS529 ### yield :V_ISO8601_DURATION, $&530 when /\A\S/ #UTF8CHAR531 yield :UTF8CHAR, $&532 else533 raise534 end535 data = $' # variable $' receives the string after the match536 when :adl537 data = scan_adl(data) do |sym, val|538 yield sym, val539 end540 when :dadl541 data = scan_dadl(data) do |sym, val|542 yield sym, val543 end544 when :regexp545 data = scan_regexp(data) do |sym, val|546 yield sym, val547 end548 when :term_constraint549 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_cadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")550 551 data = scan_term_constraint(data) do |sym, val|552 yield sym, val553 end554 else555 raise556 end557 end # of until558 end # of scan_cadl559 560 def scan_dadl(data)561 @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_dadl at #{@filename}:#{@lineno}: data = #{data.inspect}")562 until data.nil? do563 case @adl_type.last564 when :dadl565 case scanned = @@dadl_scanner.parse(data)566 when Yaparc::Result::OK567 yield scanned.value568 data = scanned.input569 else570 end571 572 case data573 when /\A\n/ # carriage return574 @lineno += 1575 ;576 when /\A[ \t\r\f]+/ #just drop it577 ;578 when /\A--.*\n/ # single line comment579 @lineno += 1580 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: COMMENT = #{$&} at #{@filename}:#{@lineno}")581 ;582 ###----------/* symbols */ -------------------------------------------------583 when /\A\=/ # =584 yield :SYM_EQ, :SYM_EQ585 when /\A\>\=/ # >=586 yield :SYM_GE, :SYM_GE587 when /\A\<\=/ # <=588 yield :SYM_LE, :SYM_LE589 when /\A\</ # <590 if @in_interval591 yield :SYM_LT, :SYM_LT592 else593 @adl_type.push(:dadl)594 yield :SYM_START_DBLOCK, :SYM_START_DBLOCK595 end596 when /\A\>/ # >597 if @in_interval598 # @in_interval = false599 yield :SYM_GT, :SYM_GT600 elsif @in_c_domain_type == true601 assert_at(__FILE__,__LINE__){@adl_type.last == :dadl}602 adl_type = @adl_type.pop603 if @adl_type.last == :cadl604 @in_c_domain_type = false605 yield :END_V_C_DOMAIN_TYPE_BLOCK, $&606 else607 yield :SYM_END_DBLOCK, $&608 end609 elsif @in_c_domain_type == false610 adl_type = @adl_type.pop611 assert_at(__FILE__,__LINE__){adl_type == :dadl}612 yield :SYM_END_DBLOCK, $&613 else614 raise615 end616 when /\A\-/ # -617 yield :Minus_code, :Minus_code618 when /\A\+/ # +619 yield :Plus_code, :Plus_code620 when /\A\*/ # *621 yield :Star_code, :Star_code622 when /\A\// # /623 yield :Slash_code, :Slash_code624 when /\A\^/ # ^625 yield :Caret_code, :Caret_code626 when /\A\.\.\./ # ...627 yield :SYM_LIST_CONTINUE, :SYM_LIST_CONTINUE628 when /\A\.\./ # ..629 yield :SYM_ELLIPSIS, :SYM_ELLIPSIS630 when /\A\./ # .631 yield :Dot_code, :Dot_code632 when /\A\;/ # ;633 yield :Semicolon_code, :Semicolon_code634 when /\A\,/ # ,635 yield :Comma_code, :Comma_code636 when /\A\:/ # :637 yield :Colon_code, :Colon_code638 when /\A\!/ # !639 yield :Exclamation_code, :Exclamation_code640 when /\A\(/ # (641 yield :Left_parenthesis_code, :Left_parenthesis_code642 when /\A\)/ # )643 yield :Right_parenthesis_code, :Right_parenthesis_code644 when /\A\$/ # $645 yield :Dollar_code, :Dollar_code646 when /\A\?\?/ # ??647 yield :SYM_DT_UNKNOWN, :SYM_DT_UNKNOWN648 when /\A\?/ # ?649 yield :Question_mark_code, :Question_mark_code650 when /\A\|/ # |651 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: @in_interval = #{@in_interval} at #{@filename}:#{@lineno}")652 if @in_interval653 @in_interval = false654 else655 # @in_interval = false656 @in_interval = true657 end658 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: SYM_INTERVAL_DELIM at #{@filename}:#{@lineno}")659 yield :SYM_INTERVAL_DELIM, :SYM_INTERVAL_DELIM660 ### when /\A\[[a-zA-Z0-9()\._-]+::[a-zA-Z0-9\._-]+\]/ #V_QUALIFIED_TERM_CODE_REF form [ICD10AM(1998)::F23]661 ### yield :V_QUALIFIED_TERM_CODE_REF, $&662 ### when /\A\[[a-zA-Z0-9][a-zA-Z0-9._\-]*\]/ #V_LOCAL_TERM_CODE_REF663 ### yield :V_LOCAL_TERM_CODE_REF, $&664 ### when /\A\[[a-zA-Z0-9._\- ]+::[a-zA-Z0-9._\- ]+\]/ #ERR_V_QUALIFIED_TERM_CODE_REF665 ### yield :ERR_V_QUALIFIED_TERM_CODE_REF, $&666 when /\A\[/ # [667 yield :Left_bracket_code, :Left_bracket_code668 when /\A\]/ # ]669 yield :Right_bracket_code, :Right_bracket_code670 ### when /\A[A-Z][a-zA-Z0-9_-]*/671 ### yield :V_TYPE_IDENTIFIER, $&672 ### when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER673 ### yield :V_GENERIC_TYPE_IDENTIFIER, $&674 ### when /\A[a-z][a-zA-Z0-9_]*/675 ### word = $&.downcase676 ### if @@dadl_reserved[word]677 ### yield @@dadl_reserved[word], @@dadl_reserved[word]678 ### else679 ### yield :V_ATTRIBUTE_IDENTIFIER, $&680 ### end681 ### when /\Aa[ct][0-9.]+/ #V_LOCAL_CODE682 ### yield :V_LOCAL_CODE, $&683 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-]-684 yield :V_ISO8601_EXTENDED_DATE_TIME, $&685 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]686 yield :V_ISO8601_EXTENDED_TIME, $&687 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-DD688 yield :V_ISO8601_EXTENDED_DATE, $&689 when /\A[A-Z][a-zA-Z0-9_]*<[a-zA-Z0-9,_<>]+>/ #V_GENERIC_TYPE_IDENTIFIER690 yield :V_GENERIC_TYPE_IDENTIFIER, $&691 when /\A[0-9]+|[0-9]+[eE][+-]?[0-9]+/ #V_INTEGER692 yield :V_INTEGER, $&693 ### when /\A[0-9]+\.[0-9]+|[0-9]+\.[0-9]+[eE][+-]?[0-9]+ / #V_REAL694 ### yield :V_REAL, $&695 # when /\A"((?:[^"\\]+|\\.)*)"/ #V_STRING696 ### when /\A"([^"]*)"/m #V_STRING697 ### yield :V_STRING, $1698 when /\A[a-z]+:\/\/[^<>|\\{}^~"\[\] ]*/ #V_URI699 yield :V_URI, $&700 ### 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 PnYnMnWnDTnnHnnMnnS701 ### yield :V_ISO8601_DURATION, $&702 when /\A\S/ #UTF8CHAR703 yield :UTF8CHAR, $&704 end705 data = $' # variable $' receives the string after the match706 when :adl707 data = scan_adl(data) do |sym, val|708 yield sym, val709 end710 when :cadl711 data = scan_cadl(data) do |sym, val|712 yield sym, val713 end714 when :regexp715 # puts "Entering scan_regexp"716 data = scan_regexp(data) do |sym, val|717 yield sym, val718 end719 when :term_constraint720 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_dadl: Entering scan_term_constraint at #{@filename}:#{@lineno}: data = #{data.inspect}")721 722 data = scan_term_constraint(data) do |sym, val|723 yield sym, val724 end725 else726 raise727 end728 end729 end # of scan_dadl730 731 def scan_regexp(data)732 @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_regexp at #{@filename}:#{@lineno}: data = #{data.inspect}")733 until data.nil? do734 case @adl_type.last735 when :regexp736 case data737 when /\A\/\}/ #V_REGEXP738 if @adl_type.last == :regexp739 @in_regexp = false740 @adl_type.pop741 yield :END_REGEXP_BLOCK, :END_REGEXP_BLOCK742 else743 raise744 end745 when /\A(.*)(\/\})/ #V_REGEXP746 yield :REGEXP_BODY, $1747 if @adl_type.last == :regexp748 @in_regexp = false749 @adl_type.pop750 yield :END_REGEXP_BLOCK, :END_REGEXP_BLOCK751 else752 raise753 end754 else755 raise data756 end757 data = $' # variable $' receives the string after the match758 when :adl759 data = scan_adl(data) do |sym, val|760 yield sym, val761 end762 when :dadl763 data = scan_dadl(data) do |sym, val|764 yield sym, val765 end766 when :cadl767 data = scan_cadl(data) do |sym, val|768 yield sym, val769 end770 when :term_constraint771 @@logger.debug("#{__FILE__}:#{__LINE__}: scan_regexp: Entering scan_term_constraint at #{@filename}:#{@lineno}")772 data = scan_term_constraint(data) do |sym, val|773 yield sym, val774 end775 else776 raise777 end778 end779 end # of scan_regexp780 781 def scan_term_constraint(data)782 @@logger.debug("#{__FILE__}:#{__LINE__}: Entering scan_term_constraint")783 until data.nil? do784 case @adl_type.last785 when :term_constraint786 case data787 when /\A\n/ # carriage return788 @lineno += 1789 ;790 when /\A[ \t\r\f]+/ #just drop it791 ;792 when /\A--.*$/ # single line comment793 @lineno += 1794 #@@logger.debug("#{__FILE__}:#{__LINE__}: scan_term_constraint: COMMENT = #{$&} at #{@filename}:#{@lineno}")795 ;796 when /\A([a-zA-Z0-9\._\-])+[ \t]*,/ # match any line, with ',' termination797 yield :TERM_CODE, $1798 when /\A([a-zA-Z0-9\._\-])+[ \t]*;/ # match second last line with ';' termination (assumed value)799 yield :TERM_CODE, $1800 when /\A([a-zA-Z0-9\._\-])*[ \t]*\]/ # match final line, terminating in ']'801 adl_type = @adl_type.pop802 assert_at(__FILE__,__LINE__){adl_type == :term_constraint}803 yield :END_TERM_CODE_CONSTRAINT, $1804 else805 raise "data = #{data}"806 end807 data = $' # variable $' receives the string after the match808 when :adl809 data = scan_adl(data) do |sym, val|810 yield sym, val811 end812 when :dadl813 data = scan_dadl(data) do |sym, val|814 yield sym, val815 end816 when :cadl817 data = scan_cadl(data) do |sym, val|818 yield sym, val819 end820 else821 raise822 end823 end824 end # of scan_term_constraint825 115 826 116 … … 843 133 844 134 845 135 __END__ 846 136 847 137 … … 1518 808 3, 189, :_reduce_none, 1519 809 3, 189, :_reduce_none, 1520 1, 180, :_reduce_ none,810 1, 180, :_reduce_191, 1521 811 3, 190, :_reduce_none, 1522 812 3, 190, :_reduce_none, … … 2090 1380 archetype.original_language = language 2091 1381 end 2092 @@logger.debug("#{__FILE__}:#{__LINE__}: archetype = #{archetype } at #{@filename}:#{@lineno}")1382 @@logger.debug("#{__FILE__}:#{__LINE__}: archetype = #{archetype.to_yaml} at #{@filename}:#{@lineno}") 2093 1383 result = archetype 2094 1384 … … 2774 2064 module_eval(<<'.,.,', 'parser.y', 531) 2775 2065 def _reduce_103(val, _values, result) 2776 @@logger.debug("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}") 2777 result = val[0] 2778 2779 result 2780 end 2781 .,., 2782 2783 module_eval(<<'.,.,', 'parser.y', 537) 2066 result = val[0] 2067 2068 result 2069 end 2070 .,., 2071 2072 module_eval(<<'.,.,', 'parser.y', 536) 2784 2073 def _reduce_104(val, _values, result) 2785 2074 result = Array[val[0]] … … 2789 2078 .,., 2790 2079 2791 module_eval(<<'.,.,', 'parser.y', 54 1)2080 module_eval(<<'.,.,', 'parser.y', 540) 2792 2081 def _reduce_105(val, _values, result) 2793 2082 result = (val[0] << val[1]) … … 2797 2086 .,., 2798 2087 2799 module_eval(<<'.,.,', 'parser.y', 54 6)2088 module_eval(<<'.,.,', 'parser.y', 545) 2800 2089 def _reduce_106(val, _values, result) 2801 2090 @@logger.debug("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]} at #{@filename}:#{@lineno}") 2802 result = {:object_key => val[0], :object_block => val[ 1]}2803 2804 result 2805 end 2806 .,., 2807 2808 module_eval(<<'.,.,', 'parser.y', 55 2)2091 result = {:object_key => val[0], :object_block => val[2]} 2092 2093 result 2094 end 2095 .,., 2096 2097 module_eval(<<'.,.,', 'parser.y', 551) 2809 2098 def _reduce_107(val, _values, result) 2810 2099 @@logger.debug("object_key: [#{val[1]}] at #{@filename}:#{@lineno}") … … 2815 2104 .,., 2816 2105 2817 module_eval(<<'.,.,', 'parser.y', 55 8)2106 module_eval(<<'.,.,', 'parser.y', 557) 2818 2107 def _reduce_108(val, _values, result) 2819 2108 result = {:untyped_single_attr_object_block => val[0]} … … 2823 2112 .,., 2824 2113 2825 module_eval(<<'.,.,', 'parser.y', 56 2)2114 module_eval(<<'.,.,', 'parser.y', 561) 2826 2115 def _reduce_109(val, _values, result) 2827 2116 result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]} … … 2831 2120 .,., 2832 2121 2833 module_eval(<<'.,.,', 'parser.y', 56 7)2122 module_eval(<<'.,.,', 'parser.y', 566) 2834 2123 def _reduce_110(val, _values, result) 2835 2124 @@logger.debug("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}") … … 2840 2129 .,., 2841 2130 2842 module_eval(<<'.,.,', 'parser.y', 57 2)2131 module_eval(<<'.,.,', 'parser.y', 571) 2843 2132 def _reduce_111(val, _values, result) 2844 2133 @@logger.debug("#{__FILE__}:#{__LINE__}: attr_vals = #{val[1]} at #{@filename}:#{@lineno}") … … 2851 2140 # reduce 112 omitted 2852 2141 2853 module_eval(<<'.,.,', 'parser.y', 57 8)2142 module_eval(<<'.,.,', 'parser.y', 577) 2854 2143 def _reduce_113(val, _values, result) 2855 2144 @@logger.debug("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}") … … 2860 2149 .,., 2861 2150 2862 module_eval(<<'.,.,', 'parser.y', 58 3)2151 module_eval(<<'.,.,', 'parser.y', 582) 2863 2152 def _reduce_114(val, _values, result) 2864 2153 @@logger.debug("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}") … … 2869 2158 .,., 2870 2159 2871 module_eval(<<'.,.,', 'parser.y', 58 8)2160 module_eval(<<'.,.,', 'parser.y', 587) 2872 2161 def _reduce_115(val, _values, result) 2873 2162 @@logger.debug("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}") … … 2878 2167 .,., 2879 2168 2880 module_eval(<<'.,.,', 'parser.y', 59 3)2169 module_eval(<<'.,.,', 'parser.y', 592) 2881 2170 def _reduce_116(val, _values, result) 2882 2171 result = val[0] … … 2886 2175 .,., 2887 2176 2888 module_eval(<<'.,.,', 'parser.y', 59 7)2177 module_eval(<<'.,.,', 'parser.y', 596) 2889 2178 def _reduce_117(val, _values, result) 2890 2179 result = val[0] … … 2894 2183 .,., 2895 2184 2896 module_eval(<<'.,.,', 'parser.y', 60 1)2185 module_eval(<<'.,.,', 'parser.y', 600) 2897 2186 def _reduce_118(val, _values, result) 2898 2187 result = val[0] … … 2902 2191 .,., 2903 2192 2904 module_eval(<<'.,.,', 'parser.y', 60 5)2193 module_eval(<<'.,.,', 'parser.y', 604) 2905 2194 def _reduce_119(val, _values, result) 2906 2195 result = val[0] … … 2910 2199 .,., 2911 2200 2912 module_eval(<<'.,.,', 'parser.y', 60 9)2201 module_eval(<<'.,.,', 'parser.y', 608) 2913 2202 def _reduce_120(val, _values, result) 2914 2203 result = val[0] … … 2918 2207 .,., 2919 2208 2920 module_eval(<<'.,.,', 'parser.y', 61 3)2209 module_eval(<<'.,.,', 'parser.y', 612) 2921 2210 def _reduce_121(val, _values, result) 2922 2211 @@logger.debug("string_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2927 2216 .,., 2928 2217 2929 module_eval(<<'.,.,', 'parser.y', 61 8)2218 module_eval(<<'.,.,', 'parser.y', 617) 2930 2219 def _reduce_122(val, _values, result) 2931 2220 @@logger.debug("integer_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2936 2225 .,., 2937 2226 2938 module_eval(<<'.,.,', 'parser.y', 62 3)2227 module_eval(<<'.,.,', 'parser.y', 622) 2939 2228 def _reduce_123(val, _values, result) 2940 2229 @@logger.debug("real_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2945 2234 .,., 2946 2235 2947 module_eval(<<'.,.,', 'parser.y', 62 8)2236 module_eval(<<'.,.,', 'parser.y', 627) 2948 2237 def _reduce_124(val, _values, result) 2949 2238 @@logger.debug("boolean_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2954 2243 .,., 2955 2244 2956 module_eval(<<'.,.,', 'parser.y', 63 3)2245 module_eval(<<'.,.,', 'parser.y', 632) 2957 2246 def _reduce_125(val, _values, result) 2958 2247 @@logger.debug("character_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2963 2252 .,., 2964 2253 2965 module_eval(<<'.,.,', 'parser.y', 63 8)2254 module_eval(<<'.,.,', 'parser.y', 637) 2966 2255 def _reduce_126(val, _values, result) 2967 2256 @@logger.debug("date_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2972 2261 .,., 2973 2262 2974 module_eval(<<'.,.,', 'parser.y', 64 3)2263 module_eval(<<'.,.,', 'parser.y', 642) 2975 2264 def _reduce_127(val, _values, result) 2976 2265 @@logger.debug("time_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2981 2270 .,., 2982 2271 2983 module_eval(<<'.,.,', 'parser.y', 64 8)2272 module_eval(<<'.,.,', 'parser.y', 647) 2984 2273 def _reduce_128(val, _values, result) 2985 2274 @@logger.debug("date_time_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2990 2279 .,., 2991 2280 2992 module_eval(<<'.,.,', 'parser.y', 65 3)2281 module_eval(<<'.,.,', 'parser.y', 652) 2993 2282 def _reduce_129(val, _values, result) 2994 2283 @@logger.debug("duration_value: #{val[0]} at #{@filename}:#{@lineno}") … … 2999 2288 .,., 3000 2289 3001 module_eval(<<'.,.,', 'parser.y', 65 8)2290 module_eval(<<'.,.,', 'parser.y', 657) 3002 2291 def _reduce_130(val, _values, result) 3003 2292 @@logger.debug("uri_value: #{val[0]} at #{@filename}:#{@lineno}") … … 3038 2327 # reduce 145 omitted 3039 2328 3040 module_eval(<<'.,.,', 'parser.y', 68 1)2329 module_eval(<<'.,.,', 'parser.y', 680) 3041 2330 def _reduce_146(val, _values, result) 3042 2331 @@logger.debug("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}") … … 3047 2336 .,., 3048 2337 3049 module_eval(<<'.,.,', 'parser.y', 68 6)2338 module_eval(<<'.,.,', 'parser.y', 685) 3050 2339 def _reduce_147(val, _values, result) 3051 2340 @@logger.debug("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}") … … 3056 2345 .,., 3057 2346 3058 module_eval(<<'.,.,', 'parser.y', 69 2)2347 module_eval(<<'.,.,', 'parser.y', 691) 3059 2348 def _reduce_148(val, _values, result) 3060 2349 @@logger.debug("V_STRING: #{val[0]} at #{@filename}:#{@lineno}") … … 3071 2360 # reduce 151 omitted 3072 2361 3073 module_eval(<<'.,.,', 'parser.y', 70 2)2362 module_eval(<<'.,.,', 'parser.y', 701) 3074 2363 def _reduce_152(val, _values, result) 3075 2364 begin … … 3084 2373 .,., 3085 2374 3086 module_eval(<<'.,.,', 'parser.y', 71 1)2375 module_eval(<<'.,.,', 'parser.y', 710) 3087 2376 def _reduce_153(val, _values, result) 3088 2377 begin … … 3097 2386 .,., 3098 2387 3099 module_eval(<<'.,.,', 'parser.y', 7 20)2388 module_eval(<<'.,.,', 'parser.y', 719) 3100 2389 def _reduce_154(val, _values, result) 3101 2390 begin … … 3134 2423 # reduce 166 omitted 3135 2424 3136 module_eval(<<'.,.,', 'parser.y', 74 6)2425 module_eval(<<'.,.,', 'parser.y', 745) 3137 2426 def _reduce_167(val, _values, result) 3138 2427 begin … … 3147 2436 .,., 3148 2437 3149 module_eval(<<'.,.,', 'parser.y', 75 5)2438 module_eval(<<'.,.,', 'parser.y', 754) 3150 2439 def _reduce_168(val, _values, result) 3151 2440 begin … … 3160 2449 .,., 3161 2450 3162 module_eval(<<'.,.,', 'parser.y', 76 4)2451 module_eval(<<'.,.,', 'parser.y', 763) 3163 2452 def _reduce_169(val, _values, result) 3164 2453 begin … … 3197 2486 # reduce 181 omitted 3198 2487 3199 module_eval(<<'.,.,', 'parser.y', 78 9)2488 module_eval(<<'.,.,', 'parser.y', 788) 3200 2489 def _reduce_182(val, _values, result) 3201 2490 result = true … … 3205 2494 .,., 3206 2495 3207 module_eval(<<'.,.,', 'parser.y', 79 3)2496 module_eval(<<'.,.,', 'parser.y', 792) 3208 2497 def _reduce_183(val, _values, result) 3209 2498 result = false … … 3227 2516 # reduce 190 omitted 3228 2517 3229 # 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 .,., 3230 2525 3231 2526 # reduce 192 omitted … … 3305 2600 # reduce 229 omitted 3306 2601 3307 module_eval(<<'.,.,', 'parser.y', 85 6)2602 module_eval(<<'.,.,', 'parser.y', 858) 3308 2603 def _reduce_230(val, _values, result) 3309 2604 @@logger.debug("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}") … … 3338 2633 # reduce 242 omitted 3339 2634 3340 module_eval(<<'.,.,', 'parser.y', 87 6)2635 module_eval(<<'.,.,', 'parser.y', 878) 3341 2636 def _reduce_243(val, _values, result) 3342 2637 @@logger.debug("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}") … … 3353 2648 # reduce 246 omitted 3354 2649 3355 module_eval(<<'.,.,', 'parser.y', 88 6)2650 module_eval(<<'.,.,', 'parser.y', 888) 3356 2651 def _reduce_247(val, _values, result) 3357 2652 @@logger.debug("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}") … … 3442 2737 # reduce 287 omitted 3443 2738 3444 module_eval(<<'.,.,', 'parser.y', 95 6)2739 module_eval(<<'.,.,', 'parser.y', 958) 3445 2740 def _reduce_288(val, _values, result) 3446 2741 @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") … … 3450 2745 .,., 3451 2746 3452 module_eval(<<'.,.,', 'parser.y', 96 0)2747 module_eval(<<'.,.,', 'parser.y', 962) 3453 2748 def _reduce_289(val, _values, result) 3454 2749 @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}") … … 3458 2753 .,., 3459 2754 3460 module_eval(<<'.,.,', 'parser.y', 97 1)2755 module_eval(<<'.,.,', 'parser.y', 973) 3461 2756 def _reduce_290(val, _values, result) 3462 2757 result = Range.new(1,1) … … 3466 2761 .,., 3467 2762 3468 module_eval(<<'.,.,', 'parser.y', 97 5)2763 module_eval(<<'.,.,', 'parser.y', 977) 3469 2764 def _reduce_291(val, _values, result) 3470 2765 result = val[3] … … 3474 2769 .,., 3475 2770 3476 module_eval(<<'.,.,', 'parser.y', 98 0)2771 module_eval(<<'.,.,', 'parser.y', 982) 3477 2772 def _reduce_292(val, _values, result) 3478 2773 begin … … 3487 2782 .,., 3488 2783 3489 module_eval(<<'.,.,', 'parser.y', 9 89)2784 module_eval(<<'.,.,', 'parser.y', 991) 3490 2785 def _reduce_293(val, _values, result) 3491 2786 begin … … 3501 2796 .,., 3502 2797 3503 module_eval(<<'.,.,', 'parser.y', 100 0)2798 module_eval(<<'.,.,', 'parser.y', 1002) 3504 2799 def _reduce_294(val, _values, result) 3505 2800 result = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new … … 3525 2820 # reduce 302 omitted 3526 2821 3527 module_eval(<<'.,.,', 'parser.y', 101 4)2822 module_eval(<<'.,.,', 'parser.y', 1016) 3528 2823 def _reduce_303(val, _values, result) 3529 2824 result = val[0] … … 3533 2828 .,., 3534 2829 3535 module_eval(<<'.,.,', 'parser.y', 10 18)2830 module_eval(<<'.,.,', 'parser.y', 1020) 3536 2831 def _reduce_304(val, _values, result) 3537 2832 result = val[0] … … 3543 2838 # reduce 305 omitted 3544 2839 3545 module_eval(<<'.,.,', 'parser.y', 102 5)2840 module_eval(<<'.,.,', 'parser.y', 1027) 3546 2841 def _reduce_306(val, _values, result) 3547 2842 result = val[3] … … 3643 2938 # reduce 352 omitted 3644 2939 3645 module_eval(<<'.,.,', 'parser.y', 109 5)2940 module_eval(<<'.,.,', 'parser.y', 1097) 3646 2941 def _reduce_353(val, _values, result) 3647 2942 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true) … … 3651 2946 .,., 3652 2947 3653 module_eval(<<'.,.,', 'parser.y', 1 099)2948 module_eval(<<'.,.,', 'parser.y', 1101) 3654 2949 def _reduce_354(val, _values, result) 3655 2950 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false) … … 3659 2954 .,., 3660 2955 3661 module_eval(<<'.,.,', 'parser.y', 110 3)2956 module_eval(<<'.,.,', 'parser.y', 1105) 3662 2957 def _reduce_355(val, _values, result) 3663 2958 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false) … … 3667 2962 .,., 3668 2963 3669 module_eval(<<'.,.,', 'parser.y', 110 7)2964 module_eval(<<'.,.,', 'parser.y', 1109) 3670 2965 def _reduce_356(val, _values, result) 3671 2966 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true) … … 3675 2970 .,., 3676 2971 3677 module_eval(<<'.,.,', 'parser.y', 111 2)2972 module_eval(<<'.,.,', 'parser.y', 1114) 3678 2973 def _reduce_357(val, _values, result) 3679 2974 result = val[0] … … 3683 2978 .,., 3684 2979 3685 module_eval(<<'.,.,', 'parser.y', 111 6)2980 module_eval(<<'.,.,', 'parser.y', 1118) 3686 2981 def _reduce_358(val, _values, result) 3687 2982 raise 'Not implemented yet' … … 3691 2986 .,., 3692 2987 3693 module_eval(<<'.,.,', 'parser.y', 112 0)2988 module_eval(<<'.,.,', 'parser.y', 1122) 3694 2989 def _reduce_359(val, _values, result) 3695 2990 raise 'Not implemented yet' … … 3709 3004 # reduce 364 omitted 3710 3005 3711 module_eval(<<'.,.,', 'parser.y', 113 2)3006 module_eval(<<'.,.,', 'parser.y', 1134) 3712 3007 def _reduce_365(val, _values, result) 3713 3008 @in_interval = false … … 3718 3013 .,., 3719 3014 3720 module_eval(<<'.,.,', 'parser.y', 11 39)3015 module_eval(<<'.,.,', 'parser.y', 1141) 3721 3016 def _reduce_366(val, _values, result) 3722 3017 result = val[0] … … 3726 3021 .,., 3727 3022 3728 module_eval(<<'.,.,', 'parser.y', 114 3)3023 module_eval(<<'.,.,', 'parser.y', 1145) 3729 3024 def _reduce_367(val, _values, result) 3730 3025 result = val[0] … … 3734 3029 .,., 3735 3030 3736 module_eval(<<'.,.,', 'parser.y', 11 49)3031 module_eval(<<'.,.,', 'parser.y', 1151) 3737 3032 def _reduce_368(val, _values, result) 3738 3033 @@logger.debug("#{__FILE__}:#{__LINE__}, START_TERM_CODE_CONSTRAINT = #{val[0]} at #{@filename}") … … 3751 3046 # reduce 371 omitted 3752 3047 3753 module_eval(<<'.,.,', 'parser.y', 116 5)3048 module_eval(<<'.,.,', 'parser.y', 1167) 3754 3049 def _reduce_372(val, _values, result) 3755 3050 result = val[0] … … 3759 3054 .,., 3760 3055 3761 module_eval(<<'.,.,', 'parser.y', 117 0)3056 module_eval(<<'.,.,', 'parser.y', 1172) 3762 3057 def _reduce_373(val, _values, result) 3763 3058 result = val[0] … … 3767 3062 .,., 3768 3063 3769 module_eval(<<'.,.,', 'parser.y', 117 4)3064 module_eval(<<'.,.,', 'parser.y', 1176) 3770 3065 def _reduce_374(val, _values, result) 3771 3066 @@logger.debug("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}") … … 3776 3071 .,., 3777 3072 3778 module_eval(<<'.,.,', 'parser.y', 118 5)3073 module_eval(<<'.,.,', 'parser.y', 1187) 3779 3074 def _reduce_375(val, _values, result) 3780 3075 result = val[0]
Note:
See TracChangeset
for help on using the changeset viewer.