Changeset 23


Ignore:
Timestamp:
May 1, 2008, 8:21:09 AM (16 years ago)
Author:
Tatsukawa, Akimichi
Message:

working on adl_parser semantic functions

Location:
ruby/trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/adl_parser/lib/parser.rb

    r22 r23  
    2727    class Parser < Racc::Parser
    2828
    29 module_eval <<'..end lib/parser.y modeval..idc7c14292e8', 'lib/parser.y', 1010
     29module_eval <<'..end lib/parser.y modeval..id4cf2f1104b', 'lib/parser.y', 1079
    3030
    3131def assert_at(file,line, message = "")
     
    820820
    821821
    822 ..end lib/parser.y modeval..idc7c14292e8
     822..end lib/parser.y modeval..id4cf2f1104b
    823823
    824824##### racc 1.4.5 generates ###
     
    852852 2, 102, :_reduce_none,
    853853 1, 110, :_reduce_26,
    854  1, 110, :_reduce_none,
     854 1, 110, :_reduce_27,
    855855 5, 111, :_reduce_28,
    856856 5, 111, :_reduce_29,
    857  2, 113, :_reduce_none,
     857 2, 113, :_reduce_30,
    858858 1, 115, :_reduce_31,
    859859 2, 115, :_reduce_32,
     
    870870 1, 120, :_reduce_none,
    871871 1, 120, :_reduce_none,
    872  3, 121, :_reduce_none,
     872 3, 121, :_reduce_45,
    873873 4, 122, :_reduce_none,
    874874 3, 122, :_reduce_none,
     
    915915 1, 151, :_reduce_none,
    916916 1, 151, :_reduce_none,
    917  1, 152, :_reduce_none,
    918  2, 152, :_reduce_none,
    919  3, 152, :_reduce_none,
     917 1, 152, :_reduce_90,
     918 2, 152, :_reduce_91,
     919 3, 152, :_reduce_92,
    920920 3, 154, :_reduce_93,
    921921 1, 155, :_reduce_94,
     
    929929 3, 160, :_reduce_102,
    930930 1, 161, :_reduce_103,
    931  1, 162, :_reduce_none,
    932  2, 162, :_reduce_none,
     931 1, 162, :_reduce_104,
     932 2, 162, :_reduce_105,
    933933 3, 163, :_reduce_106,
    934934 3, 164, :_reduce_107,
    935  1, 158, :_reduce_none,
    936  2, 158, :_reduce_none,
     935 1, 158, :_reduce_108,
     936 2, 158, :_reduce_109,
    937937 2, 166, :_reduce_110,
    938938 3, 166, :_reduce_111,
     
    992992 4, 193, :_reduce_none,
    993993 3, 193, :_reduce_none,
    994  1, 176, :_reduce_none,
    995  2, 176, :_reduce_none,
    996  2, 176, :_reduce_none,
     994 1, 176, :_reduce_167,
     995 2, 176, :_reduce_168,
     996 2, 176, :_reduce_169,
    997997 3, 186, :_reduce_none,
    998998 3, 186, :_reduce_none,
     
    10071007 4, 194, :_reduce_none,
    10081008 3, 194, :_reduce_none,
    1009  1, 177, :_reduce_none,
    1010  1, 177, :_reduce_none,
     1009 1, 177, :_reduce_182,
     1010 1, 177, :_reduce_183,
    10111011 3, 187, :_reduce_none,
    10121012 3, 187, :_reduce_none,
     
    11311131 1, 210, :_reduce_none,
    11321132 0, 116, :_reduce_none,
    1133  5, 116, :_reduce_none,
     1133 5, 116, :_reduce_306,
    11341134 2, 116, :_reduce_none,
    11351135 1, 209, :_reduce_none,
     
    21062106  def _reduce_26( val, _values, result )
    21072107    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)}
    2108                      
    2109     result = val[0]
    2110    result
    2111   end
    2112 .,.,
    2113 
    2114  # reduce 27 omitted
    2115 
    2116 module_eval <<'.,.,', 'lib/parser.y', 118
     2108    @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
     2109    result = val[0]
     2110   result
     2111  end
     2112.,.,
     2113
     2114module_eval <<'.,.,', 'lib/parser.y', 114
     2115  def _reduce_27( val, _values, result )
     2116    result = val[0]
     2117   result
     2118  end
     2119.,.,
     2120
     2121module_eval <<'.,.,', 'lib/parser.y', 125
    21172122  def _reduce_28( val, _values, result )
    2118     result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
    2119    result
    2120   end
    2121 .,.,
    2122 
    2123 module_eval <<'.,.,', 'lib/parser.y', 125
     2123    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
     2124      c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
     2125      c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
     2126      c_complex_object.occurrences = val[0][:c_occurrences]
     2127    end
     2128   result
     2129  end
     2130.,.,
     2131
     2132module_eval <<'.,.,', 'lib/parser.y', 133
    21242133  def _reduce_29( val, _values, result )
    2125     result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(
    2126                                                                             :assumed_value => val[0],
    2127                                                                             :attributes => val[2]
    2128                                                                             )
    2129    result
    2130   end
    2131 .,.,
    2132 
    2133  # reduce 30 omitted
    2134 
    2135 module_eval <<'.,.,', 'lib/parser.y', 134
     2134    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
     2135      c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
     2136      c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
     2137      c_complex_object.occurrences = val[0][:c_occurrences]
     2138    end
     2139   result
     2140  end
     2141.,.,
     2142
     2143module_eval <<'.,.,', 'lib/parser.y', 140
     2144  def _reduce_30( val, _values, result )
     2145    result = {:c_complex_object_id => val[0], :c_occurrences => val[1]}
     2146   result
     2147  end
     2148.,.,
     2149
     2150module_eval <<'.,.,', 'lib/parser.y', 145
    21362151  def _reduce_31( val, _values, result )
    2137     result = val[0]
    2138    result
    2139   end
    2140 .,.,
    2141 
    2142 module_eval <<'.,.,', 'lib/parser.y', 138
     2152    result = {:type_identifier => val[0]}
     2153   result
     2154  end
     2155.,.,
     2156
     2157module_eval <<'.,.,', 'lib/parser.y', 149
    21432158  def _reduce_32( val, _values, result )
    2144     result = {:c_complex_object_id => {:type_identifier => val[0], :V_LOCAL_TERM_CODE_REF => val[1]}}
     2159    result = {:type_identifier => val[0], :local_term_code_ref => val[1]}
    21452160   result
    21462161  end
     
    21492164 # reduce 33 omitted
    21502165
    2151 module_eval <<'.,.,', 'lib/parser.y', 144
     2166module_eval <<'.,.,', 'lib/parser.y', 155
    21522167  def _reduce_34( val, _values, result )
    21532168    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => val[0])
     
    21562171.,.,
    21572172
    2158 module_eval <<'.,.,', 'lib/parser.y', 152
     2173module_eval <<'.,.,', 'lib/parser.y', 163
    21592174  def _reduce_35( val, _values, result )
    21602175    result = val[0]
     
    21632178.,.,
    21642179
    2165 module_eval <<'.,.,', 'lib/parser.y', 156
     2180module_eval <<'.,.,', 'lib/parser.y', 167
    21662181  def _reduce_36( val, _values, result )
    21672182    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
     
    21702185.,.,
    21712186
    2172 module_eval <<'.,.,', 'lib/parser.y', 160
     2187module_eval <<'.,.,', 'lib/parser.y', 171
    21732188  def _reduce_37( val, _values, result )
    21742189    result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.new
     
    21772192.,.,
    21782193
    2179 module_eval <<'.,.,', 'lib/parser.y', 164
     2194module_eval <<'.,.,', 'lib/parser.y', 175
    21802195  def _reduce_38( val, _values, result )
    21812196    result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.new
     
    21842199.,.,
    21852200
    2186 module_eval <<'.,.,', 'lib/parser.y', 168
     2201module_eval <<'.,.,', 'lib/parser.y', 179
    21872202  def _reduce_39( val, _values, result )
    21882203    result = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new
     
    21912206.,.,
    21922207
    2193 module_eval <<'.,.,', 'lib/parser.y', 172
     2208module_eval <<'.,.,', 'lib/parser.y', 183
    21942209  def _reduce_40( val, _values, result )
    21952210    result = val[0]
     
    21982213.,.,
    21992214
    2200 module_eval <<'.,.,', 'lib/parser.y', 176
     2215module_eval <<'.,.,', 'lib/parser.y', 187
    22012216  def _reduce_41( val, _values, result )
    22022217    result = val[0]
     
    22052220.,.,
    22062221
    2207 module_eval <<'.,.,', 'lib/parser.y', 180
     2222module_eval <<'.,.,', 'lib/parser.y', 191
    22082223  def _reduce_42( val, _values, result )
    22092224    result = val[0]
     
    22162231 # reduce 44 omitted
    22172232
    2218  # reduce 45 omitted
     2233module_eval <<'.,.,', 'lib/parser.y', 206
     2234  def _reduce_45( val, _values, result )
     2235    result = val[1]
     2236   result
     2237  end
     2238.,.,
    22192239
    22202240 # reduce 46 omitted
     
    22322252 # reduce 52 omitted
    22332253
    2234 module_eval <<'.,.,', 'lib/parser.y', 212
     2254module_eval <<'.,.,', 'lib/parser.y', 226
    22352255  def _reduce_53( val, _values, result )
    22362256    assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE)}
     
    22402260.,.,
    22412261
    2242 module_eval <<'.,.,', 'lib/parser.y', 218
     2262module_eval <<'.,.,', 'lib/parser.y', 232
    22432263  def _reduce_54( val, _values, result )
    22442264    @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}")
     
    22482268.,.,
    22492269
    2250 module_eval <<'.,.,', 'lib/parser.y', 223
     2270module_eval <<'.,.,', 'lib/parser.y', 237
    22512271  def _reduce_55( val, _values, result )
    22522272    @@log.info("#{__FILE__}:#{__LINE__}: c_real = #{val[0]} at #{@filename}:#{@lineno}")
     
    22562276.,.,
    22572277
    2258 module_eval <<'.,.,', 'lib/parser.y', 228
     2278module_eval <<'.,.,', 'lib/parser.y', 242
    22592279  def _reduce_56( val, _values, result )
    22602280    @@log.info("#{__FILE__}:#{__LINE__}: c_date = #{val[0]} at #{@filename}:#{@lineno}")
     
    22642284.,.,
    22652285
    2266 module_eval <<'.,.,', 'lib/parser.y', 233
     2286module_eval <<'.,.,', 'lib/parser.y', 247
    22672287  def _reduce_57( val, _values, result )
    22682288    @@log.info("#{__FILE__}:#{__LINE__}: c_time = #{val[0]} at #{@filename}:#{@lineno}")
     
    22722292.,.,
    22732293
    2274 module_eval <<'.,.,', 'lib/parser.y', 238
     2294module_eval <<'.,.,', 'lib/parser.y', 252
    22752295  def _reduce_58( val, _values, result )
    22762296    @@log.info("#{__FILE__}:#{__LINE__}: c_date_time = #{val[0]} at #{@filename}:#{@lineno}")
     
    22802300.,.,
    22812301
    2282 module_eval <<'.,.,', 'lib/parser.y', 243
     2302module_eval <<'.,.,', 'lib/parser.y', 257
    22832303  def _reduce_59( val, _values, result )
    22842304    @@log.info("#{__FILE__}:#{__LINE__}: c_duration = #{val[0]} at #{@filename}:#{@lineno}")
     
    22882308.,.,
    22892309
    2290 module_eval <<'.,.,', 'lib/parser.y', 248
     2310module_eval <<'.,.,', 'lib/parser.y', 262
    22912311  def _reduce_60( val, _values, result )
    22922312    @@log.info("#{__FILE__}:#{__LINE__}: c_string = #{val[0]} at #{@filename}:#{@lineno}")
     
    22962316.,.,
    22972317
    2298 module_eval <<'.,.,', 'lib/parser.y', 254
     2318module_eval <<'.,.,', 'lib/parser.y', 268
    22992319  def _reduce_61( val, _values, result )
    23002320    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN)}
     
    23072327 # reduce 62 omitted
    23082328
    2309 module_eval <<'.,.,', 'lib/parser.y', 264
     2329module_eval <<'.,.,', 'lib/parser.y', 278
    23102330  def _reduce_63( val, _values, result )
    23112331    result = [val[0]]
     
    23142334.,.,
    23152335
    2316 module_eval <<'.,.,', 'lib/parser.y', 268
     2336module_eval <<'.,.,', 'lib/parser.y', 282
    23172337  def _reduce_64( val, _values, result )
    23182338    result = (val[0] << val[1])
     
    23212341.,.,
    23222342
    2323 module_eval <<'.,.,', 'lib/parser.y', 277
     2343module_eval <<'.,.,', 'lib/parser.y', 291
    23242344  def _reduce_65( val, _values, result )
    23252345    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
     
    23312351.,.,
    23322352
    2333 module_eval <<'.,.,', 'lib/parser.y', 282
     2353module_eval <<'.,.,', 'lib/parser.y', 296
    23342354  def _reduce_66( val, _values, result )
    23352355    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
     
    23392359.,.,
    23402360
    2341 module_eval <<'.,.,', 'lib/parser.y', 287
     2361module_eval <<'.,.,', 'lib/parser.y', 301
    23422362  def _reduce_67( val, _values, result )
    23432363    assert_at(__FILE__,__LINE__){ val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE)}
     
    23472367.,.,
    23482368
    2349 module_eval <<'.,.,', 'lib/parser.y', 298
     2369module_eval <<'.,.,', 'lib/parser.y', 312
    23502370  def _reduce_68( val, _values, result )
    23512371    @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]}, c_existence = #{val[1]} at #{@filename}")
     
    23582378.,.,
    23592379
    2360 module_eval <<'.,.,', 'lib/parser.y', 308
     2380module_eval <<'.,.,', 'lib/parser.y', 322
    23612381  def _reduce_69( val, _values, result )
    23622382    assert_at(__FILE__,__LINE__){ val[2].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY) }
     
    23712391.,.,
    23722392
    2373 module_eval <<'.,.,', 'lib/parser.y', 313
     2393module_eval <<'.,.,', 'lib/parser.y', 327
    23742394  def _reduce_70( val, _values, result )
    23752395    result = Array[val[0]]
     
    23782398.,.,
    23792399
    2380 module_eval <<'.,.,', 'lib/parser.y', 317
     2400module_eval <<'.,.,', 'lib/parser.y', 331
    23812401  def _reduce_71( val, _values, result )
    23822402    result = (val[0] << val[1])
     
    23852405.,.,
    23862406
    2387 module_eval <<'.,.,', 'lib/parser.y', 321
     2407module_eval <<'.,.,', 'lib/parser.y', 335
    23882408  def _reduce_72( val, _values, result )
    23892409    result = Array[val[0]]
     
    24162436 # reduce 84 omitted
    24172437
    2418 module_eval <<'.,.,', 'lib/parser.y', 351
     2438module_eval <<'.,.,', 'lib/parser.y', 366
    24192439  def _reduce_85( val, _values, result )
     2440    dadl_sections = val[1]
    24202441    result = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
    24212442   result
     
    24312452 # reduce 89 omitted
    24322453
    2433  # reduce 90 omitted
    2434 
    2435  # reduce 91 omitted
    2436 
    2437  # reduce 92 omitted
    2438 
    2439 module_eval <<'.,.,', 'lib/parser.y', 370
     2454module_eval <<'.,.,', 'lib/parser.y', 380
     2455  def _reduce_90( val, _values, result )
     2456    result = Array[val[0]]
     2457   result
     2458  end
     2459.,.,
     2460
     2461module_eval <<'.,.,', 'lib/parser.y', 384
     2462  def _reduce_91( val, _values, result )
     2463    result = (val[0] << val[1])
     2464   result
     2465  end
     2466.,.,
     2467
     2468module_eval <<'.,.,', 'lib/parser.y', 388
     2469  def _reduce_92( val, _values, result )
     2470    result = (val[0] << val[2])
     2471   result
     2472  end
     2473.,.,
     2474
     2475module_eval <<'.,.,', 'lib/parser.y', 394
    24402476  def _reduce_93( val, _values, result )
    24412477    @@log.info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
    2442    result
    2443   end
    2444 .,.,
    2445 
    2446 module_eval <<'.,.,', 'lib/parser.y', 376
     2478    result = {:attr_id => val[0], :object_block => val[2]}
     2479   result
     2480  end
     2481.,.,
     2482
     2483module_eval <<'.,.,', 'lib/parser.y', 400
    24472484  def _reduce_94( val, _values, result )
    24482485    @@log.info("#{__FILE__}:#{__LINE__}: V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}:#{@lineno}")
     
    24542491 # reduce 95 omitted
    24552492
    2456 module_eval <<'.,.,', 'lib/parser.y', 382
     2493module_eval <<'.,.,', 'lib/parser.y', 406
    24572494  def _reduce_96( val, _values, result )
    24582495    result = val[0]
     
    24612498.,.,
    24622499
    2463 module_eval <<'.,.,', 'lib/parser.y', 386
     2500module_eval <<'.,.,', 'lib/parser.y', 410
    24642501  def _reduce_97( val, _values, result )
    24652502    result = val[0]
     
    24682505.,.,
    24692506
    2470 module_eval <<'.,.,', 'lib/parser.y', 391
     2507module_eval <<'.,.,', 'lib/parser.y', 415
    24712508  def _reduce_98( val, _values, result )
    24722509    result = val[0]
     
    24752512.,.,
    24762513
    2477 module_eval <<'.,.,', 'lib/parser.y', 395
     2514module_eval <<'.,.,', 'lib/parser.y', 419
    24782515  def _reduce_99( val, _values, result )
    24792516    result = val[0]
     
    24822519.,.,
    24832520
    2484 module_eval <<'.,.,', 'lib/parser.y', 400
     2521module_eval <<'.,.,', 'lib/parser.y', 424
    24852522  def _reduce_100( val, _values, result )
    2486     result = val[0]
    2487    result
    2488   end
    2489 .,.,
    2490 
    2491 module_eval <<'.,.,', 'lib/parser.y', 404
     2523    result = {:untyped_multiple_attr_object_block => val[0]}
     2524   result
     2525  end
     2526.,.,
     2527
     2528module_eval <<'.,.,', 'lib/parser.y', 428
    24922529  def _reduce_101( val, _values, result )
    2493     result = val[0]
    2494    result
    2495   end
    2496 .,.,
    2497 
    2498 module_eval <<'.,.,', 'lib/parser.y', 409
     2530    result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]}
     2531   result
     2532  end
     2533.,.,
     2534
     2535module_eval <<'.,.,', 'lib/parser.y', 433
    24992536  def _reduce_102( val, _values, result )
    2500     result = val[0]
    2501    result
    2502   end
    2503 .,.,
    2504 
    2505 module_eval <<'.,.,', 'lib/parser.y', 415
     2537    result = {:multiple_attr_object_block_head => val[0], :keyed_objects => val[1]}
     2538   result
     2539  end
     2540.,.,
     2541
     2542module_eval <<'.,.,', 'lib/parser.y', 439
    25062543  def _reduce_103( val, _values, result )
    25072544    @@log.info("SYM_START_DBLOCK: #{val[0]} at #{@filename}:#{@lineno}")
     
    25112548.,.,
    25122549
    2513  # reduce 104 omitted
    2514 
    2515  # reduce 105 omitted
    2516 
    2517 module_eval <<'.,.,', 'lib/parser.y', 423
     2550module_eval <<'.,.,', 'lib/parser.y', 444
     2551  def _reduce_104( val, _values, result )
     2552    result = Array[val[0]]
     2553   result
     2554  end
     2555.,.,
     2556
     2557module_eval <<'.,.,', 'lib/parser.y', 448
     2558  def _reduce_105( val, _values, result )
     2559    result = (val[0] << val[1])
     2560   result
     2561  end
     2562.,.,
     2563
     2564module_eval <<'.,.,', 'lib/parser.y', 454
    25182565  def _reduce_106( val, _values, result )
    25192566    @@log.info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
    2520    result
    2521   end
    2522 .,.,
    2523 
    2524 module_eval <<'.,.,', 'lib/parser.y', 429
     2567    result = {:object_key => val[0], :object_block => val[1]}
     2568   result
     2569  end
     2570.,.,
     2571
     2572module_eval <<'.,.,', 'lib/parser.y', 460
    25252573  def _reduce_107( val, _values, result )
    25262574    @@log.info("object_key: [#{val[1]}] at #{@filename}:#{@lineno}")
     
    25302578.,.,
    25312579
    2532  # reduce 108 omitted
    2533 
    2534  # reduce 109 omitted
    2535 
    2536 module_eval <<'.,.,', 'lib/parser.y', 437
     2580module_eval <<'.,.,', 'lib/parser.y', 465
     2581  def _reduce_108( val, _values, result )
     2582    result = {:untyped_single_attr_object_block => val[0]}
     2583   result
     2584  end
     2585.,.,
     2586
     2587module_eval <<'.,.,', 'lib/parser.y', 469
     2588  def _reduce_109( val, _values, result )
     2589    result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]}
     2590   result
     2591  end
     2592.,.,
     2593
     2594module_eval <<'.,.,', 'lib/parser.y', 475
    25372595  def _reduce_110( val, _values, result )
    25382596    @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
    2539     result = val[0]
    2540    result
    2541   end
    2542 .,.,
    2543 
    2544 module_eval <<'.,.,', 'lib/parser.y', 442
     2597    result = {:single_attr_object_complex_head => val[0]}
     2598   result
     2599  end
     2600.,.,
     2601
     2602module_eval <<'.,.,', 'lib/parser.y', 480
    25452603  def _reduce_111( val, _values, result )
    25462604    @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]}, attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
    2547     result = val[0]
     2605    result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]}
    25482606   result
    25492607  end
     
    25522610 # reduce 112 omitted
    25532611
    2554 module_eval <<'.,.,', 'lib/parser.y', 448
     2612module_eval <<'.,.,', 'lib/parser.y', 486
    25552613  def _reduce_113( val, _values, result )
    25562614    @@log.info("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
    2557     result = val[0]
    2558    result
    2559   end
    2560 .,.,
    2561 
    2562 module_eval <<'.,.,', 'lib/parser.y', 453
     2615    result = {:untyped_primitive_object_block => val[0]}
     2616   result
     2617  end
     2618.,.,
     2619
     2620module_eval <<'.,.,', 'lib/parser.y', 491
    25632621  def _reduce_114( val, _values, result )
    25642622    @@log.info("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
    2565     result = val[0]
    2566    result
    2567   end
    2568 .,.,
    2569 
    2570 module_eval <<'.,.,', 'lib/parser.y', 458
     2623    result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]}
     2624   result
     2625  end
     2626.,.,
     2627
     2628module_eval <<'.,.,', 'lib/parser.y', 496
    25712629  def _reduce_115( val, _values, result )
    25722630    @@log.info("#{__FILE__}:#{__LINE__}: primitive_object_block = <#{val[1]}> at #{@filename}:#{@lineno}")
     
    25762634.,.,
    25772635
    2578 module_eval <<'.,.,', 'lib/parser.y', 462
     2636module_eval <<'.,.,', 'lib/parser.y', 500
    25792637  def _reduce_116( val, _values, result )
    25802638    result = val[0]
     
    25832641.,.,
    25842642
    2585 module_eval <<'.,.,', 'lib/parser.y', 466
     2643module_eval <<'.,.,', 'lib/parser.y', 504
    25862644  def _reduce_117( val, _values, result )
    25872645    result = val[0]
     
    25902648.,.,
    25912649
    2592 module_eval <<'.,.,', 'lib/parser.y', 470
     2650module_eval <<'.,.,', 'lib/parser.y', 508
    25932651  def _reduce_118( val, _values, result )
    25942652    result = val[0]
     
    25972655.,.,
    25982656
    2599 module_eval <<'.,.,', 'lib/parser.y', 474
     2657module_eval <<'.,.,', 'lib/parser.y', 512
    26002658  def _reduce_119( val, _values, result )
    26012659    result = val[0]
     
    26042662.,.,
    26052663
    2606 module_eval <<'.,.,', 'lib/parser.y', 478
     2664module_eval <<'.,.,', 'lib/parser.y', 516
    26072665  def _reduce_120( val, _values, result )
    26082666    result = val[0]
     
    26112669.,.,
    26122670
    2613 module_eval <<'.,.,', 'lib/parser.y', 483
     2671module_eval <<'.,.,', 'lib/parser.y', 521
    26142672  def _reduce_121( val, _values, result )
    26152673    @@log.info("string_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26192677.,.,
    26202678
    2621 module_eval <<'.,.,', 'lib/parser.y', 488
     2679module_eval <<'.,.,', 'lib/parser.y', 526
    26222680  def _reduce_122( val, _values, result )
    26232681    @@log.info("integer_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26272685.,.,
    26282686
    2629 module_eval <<'.,.,', 'lib/parser.y', 493
     2687module_eval <<'.,.,', 'lib/parser.y', 531
    26302688  def _reduce_123( val, _values, result )
    26312689    @@log.info("real_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26352693.,.,
    26362694
    2637 module_eval <<'.,.,', 'lib/parser.y', 498
     2695module_eval <<'.,.,', 'lib/parser.y', 536
    26382696  def _reduce_124( val, _values, result )
    26392697    @@log.info("boolean_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26432701.,.,
    26442702
    2645 module_eval <<'.,.,', 'lib/parser.y', 503
     2703module_eval <<'.,.,', 'lib/parser.y', 541
    26462704  def _reduce_125( val, _values, result )
    26472705    @@log.info("character_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26512709.,.,
    26522710
    2653 module_eval <<'.,.,', 'lib/parser.y', 508
     2711module_eval <<'.,.,', 'lib/parser.y', 546
    26542712  def _reduce_126( val, _values, result )
    26552713    @@log.info("date_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26592717.,.,
    26602718
    2661 module_eval <<'.,.,', 'lib/parser.y', 513
     2719module_eval <<'.,.,', 'lib/parser.y', 551
    26622720  def _reduce_127( val, _values, result )
    26632721    @@log.info("time_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26672725.,.,
    26682726
    2669 module_eval <<'.,.,', 'lib/parser.y', 518
     2727module_eval <<'.,.,', 'lib/parser.y', 556
    26702728  def _reduce_128( val, _values, result )
    26712729    @@log.info("date_time_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26752733.,.,
    26762734
    2677 module_eval <<'.,.,', 'lib/parser.y', 523
     2735module_eval <<'.,.,', 'lib/parser.y', 561
    26782736  def _reduce_129( val, _values, result )
    26792737    @@log.info("duration_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    26832741.,.,
    26842742
    2685 module_eval <<'.,.,', 'lib/parser.y', 528
     2743module_eval <<'.,.,', 'lib/parser.y', 566
    26862744  def _reduce_130( val, _values, result )
    26872745    @@log.info("uri_value: #{val[0]} at #{@filename}:#{@lineno}")
     
    27212779 # reduce 145 omitted
    27222780
    2723 module_eval <<'.,.,', 'lib/parser.y', 551
     2781module_eval <<'.,.,', 'lib/parser.y', 589
    27242782  def _reduce_146( val, _values, result )
    27252783    @@log.info("V_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     
    27292787.,.,
    27302788
    2731 module_eval <<'.,.,', 'lib/parser.y', 556
     2789module_eval <<'.,.,', 'lib/parser.y', 594
    27322790  def _reduce_147( val, _values, result )
    27332791    @@log.info("V_GENERIC_TYPE_IDENTIFIER: #{val[0]} at #{@filename}:#{@lineno}")
     
    27372795.,.,
    27382796
    2739 module_eval <<'.,.,', 'lib/parser.y', 562
     2797module_eval <<'.,.,', 'lib/parser.y', 600
    27402798  def _reduce_148( val, _values, result )
    27412799    @@log.info("V_STRING: #{val[0]} at #{@filename}:#{@lineno}")
     
    27512809 # reduce 151 omitted
    27522810
    2753 module_eval <<'.,.,', 'lib/parser.y', 576
     2811module_eval <<'.,.,', 'lib/parser.y', 614
    27542812  def _reduce_152( val, _values, result )
    27552813    begin
     
    27632821.,.,
    27642822
    2765 module_eval <<'.,.,', 'lib/parser.y', 585
     2823module_eval <<'.,.,', 'lib/parser.y', 623
    27662824  def _reduce_153( val, _values, result )
    27672825    begin
     
    27752833.,.,
    27762834
    2777 module_eval <<'.,.,', 'lib/parser.y', 594
     2835module_eval <<'.,.,', 'lib/parser.y', 632
    27782836  def _reduce_154( val, _values, result )
    27792837    begin
     
    28112869 # reduce 166 omitted
    28122870
    2813  # reduce 167 omitted
    2814 
    2815  # reduce 168 omitted
    2816 
    2817  # reduce 169 omitted
     2871module_eval <<'.,.,', 'lib/parser.y', 658
     2872  def _reduce_167( val, _values, result )
     2873    begin
     2874      real = Float(val[0])
     2875    rescue
     2876      raise
     2877    end
     2878    result = real
     2879   result
     2880  end
     2881.,.,
     2882
     2883module_eval <<'.,.,', 'lib/parser.y', 667
     2884  def _reduce_168( val, _values, result )
     2885    begin
     2886      real = Float(val[0])
     2887    rescue
     2888      raise
     2889    end
     2890    result = real
     2891   result
     2892  end
     2893.,.,
     2894
     2895module_eval <<'.,.,', 'lib/parser.y', 676
     2896  def _reduce_169( val, _values, result )
     2897    begin
     2898      real = Float(val[0])
     2899    rescue
     2900      raise
     2901    end
     2902    result = - real
     2903   result
     2904  end
     2905.,.,
    28182906
    28192907 # reduce 170 omitted
     
    28412929 # reduce 181 omitted
    28422930
    2843  # reduce 182 omitted
    2844 
    2845  # reduce 183 omitted
     2931module_eval <<'.,.,', 'lib/parser.y', 696
     2932  def _reduce_182( val, _values, result )
     2933    result = true
     2934   result
     2935  end
     2936.,.,
     2937
     2938module_eval <<'.,.,', 'lib/parser.y', 700
     2939  def _reduce_183( val, _values, result )
     2940    result = false
     2941   result
     2942  end
     2943.,.,
    28462944
    28472945 # reduce 184 omitted
     
    29373035 # reduce 229 omitted
    29383036
    2939 module_eval <<'.,.,', 'lib/parser.y', 698
     3037module_eval <<'.,.,', 'lib/parser.y', 764
    29403038  def _reduce_230( val, _values, result )
    29413039    @@log.info("V_ISO8601_DURATION: #{val[0]} at #{@filename}:#{@lineno}")
     
    29693067 # reduce 242 omitted
    29703068
    2971 module_eval <<'.,.,', 'lib/parser.y', 717
     3069module_eval <<'.,.,', 'lib/parser.y', 783
    29723070  def _reduce_243( val, _values, result )
    29733071    @@log.info("#{__FILE__}:#{__LINE__}: V_QUALIFIED_TERM_CODE_REF = #{val[0]} at #{@filename}:#{@lineno}")
     
    29823080 # reduce 246 omitted
    29833081
    2984 module_eval <<'.,.,', 'lib/parser.y', 726
     3082module_eval <<'.,.,', 'lib/parser.y', 792
    29853083  def _reduce_247( val, _values, result )
    29863084    @@log.info("#{__FILE__}:#{__LINE__}: V_URI = #{val[0]} at #{@filename}:#{@lineno}")
     
    30693167 # reduce 287 omitted
    30703168
    3071 module_eval <<'.,.,', 'lib/parser.y', 795
     3169module_eval <<'.,.,', 'lib/parser.y', 861
    30723170  def _reduce_288( val, _values, result )
    30733171    @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     
    30763174.,.,
    30773175
    3078 module_eval <<'.,.,', 'lib/parser.y', 799
     3176module_eval <<'.,.,', 'lib/parser.y', 865
    30793177  def _reduce_289( val, _values, result )
    30803178    @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{val[0]} at #{@filename}")
     
    30833181.,.,
    30843182
    3085 module_eval <<'.,.,', 'lib/parser.y', 810
     3183module_eval <<'.,.,', 'lib/parser.y', 876
    30863184  def _reduce_290( val, _values, result )
    30873185    result = Range.new(1,1)
     
    30903188.,.,
    30913189
    3092 module_eval <<'.,.,', 'lib/parser.y', 814
     3190module_eval <<'.,.,', 'lib/parser.y', 880
    30933191  def _reduce_291( val, _values, result )
    30943192    result = val[3]
     
    30973195.,.,
    30983196
    3099 module_eval <<'.,.,', 'lib/parser.y', 824
     3197module_eval <<'.,.,', 'lib/parser.y', 890
    31003198  def _reduce_292( val, _values, result )
    31013199    begin
     
    31093207.,.,
    31103208
    3111 module_eval <<'.,.,', 'lib/parser.y', 834
     3209module_eval <<'.,.,', 'lib/parser.y', 900
    31123210  def _reduce_293( val, _values, result )
    31133211    begin
     
    31223220.,.,
    31233221
    3124 module_eval <<'.,.,', 'lib/parser.y', 839
     3222module_eval <<'.,.,', 'lib/parser.y', 905
    31253223  def _reduce_294( val, _values, result )
    31263224    result = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new
     
    31513249 # reduce 305 omitted
    31523250
    3153  # reduce 306 omitted
     3251module_eval <<'.,.,', 'lib/parser.y', 924
     3252  def _reduce_306( val, _values, result )
     3253    result = val[3]
     3254   result
     3255  end
     3256.,.,
    31543257
    31553258 # reduce 307 omitted
     
    32453348 # reduce 352 omitted
    32463349
    3247 module_eval <<'.,.,', 'lib/parser.y', 925
     3350module_eval <<'.,.,', 'lib/parser.y', 994
    32483351  def _reduce_353( val, _values, result )
    32493352    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true)
     
    32523355.,.,
    32533356
    3254 module_eval <<'.,.,', 'lib/parser.y', 929
     3357module_eval <<'.,.,', 'lib/parser.y', 998
    32553358  def _reduce_354( val, _values, result )
    32563359    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false)
     
    32593362.,.,
    32603363
    3261 module_eval <<'.,.,', 'lib/parser.y', 933
     3364module_eval <<'.,.,', 'lib/parser.y', 1002
    32623365  def _reduce_355( val, _values, result )
    32633366    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,:false_valid => false)
     
    32663369.,.,
    32673370
    3268 module_eval <<'.,.,', 'lib/parser.y', 937
     3371module_eval <<'.,.,', 'lib/parser.y', 1006
    32693372  def _reduce_356( val, _values, result )
    32703373    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => false,:false_valid => true)
     
    32733376.,.,
    32743377
    3275 module_eval <<'.,.,', 'lib/parser.y', 942
     3378module_eval <<'.,.,', 'lib/parser.y', 1011
    32763379  def _reduce_357( val, _values, result )
    32773380    result = val[0]
     
    32803383.,.,
    32813384
    3282 module_eval <<'.,.,', 'lib/parser.y', 946
     3385module_eval <<'.,.,', 'lib/parser.y', 1015
    32833386  def _reduce_358( val, _values, result )
    32843387    raise 'Not implemented yet'
     
    32873390.,.,
    32883391
    3289 module_eval <<'.,.,', 'lib/parser.y', 950
     3392module_eval <<'.,.,', 'lib/parser.y', 1019
    32903393  def _reduce_359( val, _values, result )
    32913394    raise 'Not implemented yet'
     
    33043407 # reduce 364 omitted
    33053408
    3306 module_eval <<'.,.,', 'lib/parser.y', 963
     3409module_eval <<'.,.,', 'lib/parser.y', 1032
    33073410  def _reduce_365( val, _values, result )
    33083411    @in_interval = false
     
    33283431 # reduce 373 omitted
    33293432
    3330 module_eval <<'.,.,', 'lib/parser.y', 985
     3433module_eval <<'.,.,', 'lib/parser.y', 1054
    33313434  def _reduce_374( val, _values, result )
    33323435    @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}")
  • ruby/trunk/adl_parser/lib/parser.y

    r22 r23  
    106106  {
    107107    assert_at(__FILE__,__LINE__){val[0].instance_of?(OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT)}
    108                      
     108    @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0]} at #{@filename}:#{@lineno}")
    109109    result = val[0]
    110110  }
    111111  | assertions
     112  {
     113    result = val[0]
     114  }
    112115#  | error
    113116
     
    115118c_complex_object: c_complex_object_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi
    116119  {
    117     result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
     120    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
     121      c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
     122      c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
     123      c_complex_object.occurrences = val[0][:c_occurrences]
     124    end
    118125  }
    119126    | c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK
    120127  {
    121     result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(
    122                                                                             :assumed_value => val[0],
    123                                                                             :attributes => val[2]
    124                                                                             )
     128    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object|
     129      c_complex_object.node_id = val[0][:c_complex_object_id][:local_term_code_ref]
     130      c_complex_object.rm_type_name = val[0][:c_complex_object_id][:type_identifier]
     131      c_complex_object.occurrences = val[0][:c_occurrences]
     132    end
    125133  }
    126134#    | c_complex_object_head error SYM_END_CBLOCK
     
    128136
    129137c_complex_object_head: c_complex_object_id c_occurrences
     138  {
     139    result = {:c_complex_object_id => val[0], :c_occurrences => val[1]}
     140  }
    130141
    131142c_complex_object_id: type_identifier
    132143  {
    133     result = val[0]
     144    result = {:type_identifier => val[0]}
    134145  }
    135146  | type_identifier V_LOCAL_TERM_CODE_REF
    136147  {
    137     result = {:c_complex_object_id => {:type_identifier => val[0], :V_LOCAL_TERM_CODE_REF => val[1]}}
     148    result = {:type_identifier => val[0], :local_term_code_ref => val[1]}
    138149  }
    139150
     
    191202
    192203v_c_domain_type: START_V_C_DOMAIN_TYPE_BLOCK dadl_section END_V_C_DOMAIN_TYPE_BLOCK
     204  {
     205    result = val[1]
     206  }
    193207
    194208# 'archetype_internal_ref' is a node that refers to a previously defined object node in the same archetype.
     
    348362arch_ontology: SYM_ONTOLOGY dadl_section
    349363  {
     364    dadl_sections = val[1]
    350365    result = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
    351366  }
     
    361376
    362377attr_vals: attr_val
     378  {
     379    result = Array[val[0]]
     380  }
    363381  | attr_vals attr_val
     382  {
     383    result = (val[0] << val[1])
     384  }
    364385  | attr_vals Semicolon_code attr_val
    365 #  | attr_vals ';' attr_val
     386  {
     387    result = (val[0] << val[2])
     388  }
    366389
    367390attr_val: attr_id SYM_EQ object_block
    368391  {
    369392    @@log.info("#{__FILE__}:#{__LINE__}: attr_id = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
     393    result = {:attr_id => val[0], :object_block => val[2]}
    370394  }
    371395
     
    397421multiple_attr_object_block: untyped_multiple_attr_object_block
    398422  {
    399     result = val[0]
     423    result = {:untyped_multiple_attr_object_block => val[0]}
    400424  }
    401425  | type_identifier untyped_multiple_attr_object_block
    402426  {
    403     result = val[0]
     427    result = {:type_identifier => val[0], :untyped_multiple_attr_object_block => val[1]}
    404428  }
    405429
    406430untyped_multiple_attr_object_block: multiple_attr_object_block_head keyed_objects SYM_END_DBLOCK
    407431  {
    408     result = val[0]
     432    result = {:multiple_attr_object_block_head => val[0], :keyed_objects => val[1]}
    409433  }
    410434
     
    416440
    417441keyed_objects: keyed_object
     442  {
     443    result = Array[val[0]]
     444  }
    418445  | keyed_objects keyed_object
     446  {
     447    result = (val[0] << val[1])
     448  }
    419449
    420450keyed_object: object_key SYM_EQ object_block
    421451  {
    422452    @@log.info("#{__FILE__}:#{__LINE__}: keyed_object = #{val[0]}, object_block = #{val[2]} at #{@filename}:#{@lineno}")
     453    result = {:object_key => val[0], :object_block => val[1]}
    423454  }
    424455
     
    430461
    431462single_attr_object_block: untyped_single_attr_object_block
     463  {
     464    result = {:untyped_single_attr_object_block => val[0]}
     465  }
    432466  | type_identifier untyped_single_attr_object_block
     467  {
     468    result = {:type_identifier => val[0], :untyped_single_attr_object_block => val[1]}
     469  }
     470
    433471untyped_single_attr_object_block: single_attr_object_complex_head SYM_END_DBLOCK # <>
    434472  {
    435473    @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]} at #{@filename}:#{@lineno}")
    436     result = val[0]
     474    result = {:single_attr_object_complex_head => val[0]}
    437475  }
    438476  | single_attr_object_complex_head attr_vals SYM_END_DBLOCK
    439477  {
    440478    @@log.info("#{__FILE__}:#{__LINE__}: single_attr_object_complex_head = #{val[0]}, attr_vals = #{val[1]} at #{@filename}:#{@lineno}")
    441     result = val[0]
     479    result = {:single_attr_object_complex_head => val[0], :attr_vals => val[1]}
    442480  }
    443481single_attr_object_complex_head: SYM_START_DBLOCK
     
    445483  {
    446484    @@log.info("#{__FILE__}:#{__LINE__}: untyped_primitive_object_block = #{val[0]} at #{@filename}:#{@lineno}")
    447     result = val[0]
     485    result = {:untyped_primitive_object_block => val[0]}
    448486  }
    449487  | type_identifier untyped_primitive_object_block
    450488  {
    451489    @@log.info("#{__FILE__}:#{__LINE__}: type_identifier = #{val[0]}, untyped_primitive_object_block = #{val[1]} at #{@filename}:#{@lineno}")
    452     result = val[0]
     490    result = {:type_identifier => val[0], :untyped_primitive_object_block => val[1]}
    453491  }
    454492untyped_primitive_object_block: SYM_START_DBLOCK primitive_object_value SYM_END_DBLOCK
     
    611649
    612650real_value: V_REAL
     651  {
     652    begin
     653      real = Float(val[0])
     654    rescue
     655      raise
     656    end
     657    result = real
     658  }
    613659  | Plus_code V_REAL
     660  {
     661    begin
     662      real = Float(val[0])
     663    rescue
     664      raise
     665    end
     666    result = real
     667  }
    614668  | Minus_code V_REAL
    615 #  | '+' V_REAL
    616 #  | '-' V_REAL
     669  {
     670    begin
     671      real = Float(val[0])
     672    rescue
     673      raise
     674    end
     675    result = - real
     676  }
    617677
    618678real_list_value: real_value Comma_code real_value
     
    632692
    633693boolean_value: SYM_TRUE
     694  {
     695    result = true
     696  }
    634697  | SYM_FALSE
     698  {
     699    result = false
     700  }
    635701
    636702boolean_list_value: boolean_value Comma_code boolean_value
     
    854920c_occurrences:  #-- default to 1..1
    855921  | SYM_OCCURRENCES SYM_MATCHES SYM_START_CBLOCK occurrence_spec SYM_END_CBLOCK
     922  {
     923    result = val[3]
     924  }
    856925  | SYM_OCCURRENCES error
    857926
  • ruby/trunk/adl_parser/tests/parser_test.rb

    r22 r23  
    1818      assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, result.description
    1919      assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, result.definition
     20#      assert_equal '', result.definition
    2021    end
    2122
  • ruby/trunk/models/Rakefile

    r21 r23  
    4848#  s.require_paths += [".","am","rm"]
    4949  s.require_path = "."
    50 #  s.has_rdoc = true
     50  s.has_rdoc = true
    5151#  s.extra_rdoc_files = ["README"]
    5252end
  • ruby/trunk/models/am.rb

    r21 r23  
    2727      module Constraint_Model
    2828        autoload :ARCHETYPE_CONSTRAINT, "am/archetype/constraint_model/archetype_constraint.rb"
    29         autoload :Assertion, "am/archetype/constraint_model/assertion.rb"
    3029        autoload :Primitive, "am/archetype/constraint_model/primitive.rb"
    3130      end #end of ConstraintModel
     31
     32      module Assertion
     33        autoload :ASSERTION, "am/archetype/constraint_model/assertion.rb"
     34      end
     35
    3236    end # of Archetype
     37
     38    module OpenEHR_Profile
     39      module Data_Types
     40        module Basic
     41          autoload :C_DV_STATE, "am/openehr_profile/data_types/basic.rb"
     42        end
     43
     44        module Text
     45          autoload :C_CODE_PHASE, "am/openehr_profile/data_types/text.rb"
     46        end
     47
     48        module Quantity
     49          autoload :C_DV_QUANTITY, "am/openehr_profile/data_types/quantity.rb"
     50          autoload :C_DV_ORDINAL, "am/openehr_profile/data_types/quantity.rb"
     51          autoload :C_QUANTITY_ITEM, "am/openehr_profile/data_types/quantity.rb"
     52        end
     53      end
     54    end
    3355  end # of AM
    3456end # of OpenEHR
  • ruby/trunk/models/am/archetype/archetype.rb

    r21 r23  
    7777        def version
    7878        end
    79       end
     79      end # end of ARCHETYPE
    8080      # original file:
    8181      # ref_imple_eiffel/components/adl_parser/src/interface/adl_definition.e
    82     end # end of Archetype
     82
     83      class VALIDITY_KIND
     84      end
     85    end
     86
     87
    8388  end # end of AM
    8489end # end of OpenEHR
  • ruby/trunk/models/am/archetype/archetype_description/archetype_description.rb

    r21 r23  
    1111        end
    1212
    13         class Archetype_Description_Item
     13        class ARCHETYPE_DESCRIPTION_ITEM
    1414          attr_accessor :archetype_package_uri, :lifecycle_state, :original_author, :other_contributors, :other_details
    1515        end
  • ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb

    r21 r23  
    88        end
    99
    10         class C_OBJECT < ARCHETYPE_CONSTRAINT
     10        class CARDINALITY
    1111         
    1212        end
    1313
     14        class C_OBJECT < ARCHETYPE_CONSTRAINT
     15          attr_accessor :node_id, :occurrences, :rm_type_name
     16
     17          def initialize(args = { })
     18            @node_id = args[:node_id] if args[:node_id]
     19            @occurrences = args[:occurrences] if args[:occurrences]
     20            @rm_type_name = args[:rm_type_name] if args[:rm_type_name]
     21          end
     22        end
     23
    1424        class C_ATTRIBUTE < ARCHETYPE_CONSTRAINT
    15          
     25          attr_accessor :rm_attribute_name, :existence, :children
     26
     27          def initialize(args = { })
     28            @rm_attribute_name = args[:rm_attribute_name] if args[:rm_attribute_name]
     29            @existence = args[:existence] if args[:existence]
     30            @children = args[:children] ? args[:children] : []
     31           
     32          end
    1633        end
    1734
    1835        class C_DEFINED_OBJECT < C_OBJECT
     36          attr_accessor :assumed_value
    1937         
     38          def initialize(args = { })
     39            @assumed_value = args[:assumed_value] if args[:assumed_value]
     40            super
     41          end
    2042        end
    2143
    2244        class C_PRIMITIVE_OBJECT < C_DEFINED_OBJECT
     45          attr_accessor :item
    2346         
     47          def initialize(args = { })
     48            @attributes = args[:item] if args[:item]
     49            super
     50          end
    2451        end
    2552
     
    2754          attr_accessor :attributes, :attributes_valid
    2855         
     56          def initialize(args = { })
     57            @attributes = args[:attributes] ? args[:attributes] : []
     58            super
     59          end
     60
     61          def self.create(args = { }, &block)
     62            c_complex_object = new(args)
     63            if block_given?
     64              yield c_complex_object
     65            end
     66            return c_complex_object
     67          end
    2968        end
    3069
     
    4988        end
    5089
     90        class C_SINGLE_ATTRIBUTE < C_ATTRIBUTE
     91          attr_accessor :alternatives
     92
     93          def initialize(args = { })
     94            @alternatives = args[:alternatives] ? args[:alternatives] : []
     95            super
     96          end
     97        end
     98
     99        class C_MULTIPLE_ATTRIBUTE < C_ATTRIBUTE
     100          attr_accessor :members, :cardinality
     101         
     102          def initialize(args = { })
     103            @members = args[:members] ? args[:members] : []
     104            @cardinality = args[:cardinality] if args[:cardinality]
     105            super
     106          end
     107        end
    51108      end
    52109    end
  • ruby/trunk/models/am/archetype/constraint_model/assertion.rb

    r4 r23  
    22  module AM
    33    module Archetype
    4       module Constraint_Model
    5         module Assertion
    6           class Assertion
    7           end
     4      module Assertion
     5        class ASSERTION
     6        end
     7
     8        class ASSERTION_VARIABLE
     9        end
     10
     11        class OPERATOR_KIND
     12        end
     13
     14        class EXPR_ITEM
     15        end
     16
     17        class EXPR_LEAF < EXPR_ITEM
     18        end
     19
     20        class EXPR_OPERATOR < EXPR_ITEM
     21        end
     22
     23        class EXPR_UNARY_OPERATOR < EXPR_OPERATOR
     24        end
     25
     26        class EXPR_BINARY_OPERATOR < EXPR_OPERATOR
    827        end
    928      end
  • ruby/trunk/models/am/archetype/constraint_model/primitive.rb

    r21 r23  
    66        module Primitive
    77
    8           class C_Primitive
     8          class C_PRIMITIVE
    99            def assumed_value
    1010              raise NotImplementedError, "assumed_value should be implemented"
     
    2121          end
    2222
    23           class C_Boolean < C_Primitive
    24             attr_accessor :assumed_value
    25             def initialize(true_valid, false_valid, assumed_value)
    26               binary_consistency(true_valid, false_valid)
    27               @true_valid = true_valid
    28               @false_valid = false_valid
    29               @assumed_value = assumed_value
     23          class C_BOOLEAN < C_PRIMITIVE
     24            attr_reader :true_valid, :false_valid, :assumed_value
     25
     26            def initialize(args = { })
     27              @true_valid = args[:true_valid] ? args[:true_valid] : false
     28              @false_valid = args[:false_valid] ? args[:false_valid] : false
     29              @assumed_value = args[:assumed_value] ? args[:assumed_value] : false
     30              binary_consistency(@true_valid, @false_valid)
    3031            end
    31             def set_true_valid(true_valid)
     32
     33            def true_valid=(true_valid)
    3234              binary_consistency(true_valid, @false_valid)
    3335              @true_valid = true_valid
    3436            end
    35             def set_false_valid(false_valid)
     37
     38            def false_valid=(false_valid)
    3639              binary_consistency(@true_valid,false_valid)
    3740              @false_valid = false_valid
    3841            end
    39             def true_valid?
    40               @true_valid
    41             end
    42             def false_valid?
    43               @false_valid
    44             end
     42
    4543            def valid_value?
    4644             
    4745            end
    48             def default_value(a_value=nil)
     46
     47            def default_value(a_value = nil)
    4948              if a_value == nil
    5049                @true_valid
     
    6362          end # of C_Boolean
    6463
    65           class C_Integer < C_Primitive
     64          class C_STRING < C_PRIMITIVE
    6665           
    6766          end
     67
     68          class C_INTEGER < C_PRIMITIVE
     69           
     70          end
     71
     72          class C_REAL < C_PRIMITIVE
     73           
     74          end
     75
     76          class C_TIME < C_PRIMITIVE
     77           
     78          end
     79
     80          class C_DATE < C_PRIMITIVE
     81           
     82          end
     83
     84          class C_DATE_TIME < C_PRIMITIVE
     85           
     86          end
     87
     88          class C_DURATION < C_PRIMITIVE
     89           
     90          end
     91
     92
     93
    6894        end # of Primitive
    6995      end # of Constraint_Model
  • ruby/trunk/models/am/archetype/ontology.rb

    r4 r23  
    33    module Archetype
    44      module Ontology
    5         class Archetype_Ontology
     5        class ARCHETYPE_ONTOLOGY
    66          attr_accessor :constraint_codes, :specialisation_depth
    77          attr_accessor :term_attribute_names, :term_codes
    88          attr_accessor :terminologies_available
     9
    910          def constraint_binding(a_terminology, a_code)
    1011          end
     12
    1113          def constraint_definition(a_lang, a_code)
    1214          end
     15
    1316          def has_language?(a_lang)
    1417          end
     18
    1519          def has_terminology?(a_terminology)
    1620          end
     21
    1722          def term_binding(a_terminology, a_code)
    1823          end
     24
    1925          def term_definition(a_lang, a_code)
    2026          end
    2127        end
    22         class Archetype_Term
     28
     29        class ARCHETYPE_TERM
    2330          attr_accessor :code, :items
    24           def initialize(code, items)
    25             if code == nil
    26               raise ArgumentError, "Code is empty"
    27             end
    28             if items.keys == nil
    29               raise ArgumentError, "Items is empty"
    30             end
    31             @code = code
    32             @items = items
     31
     32          def initialize(args = { })
     33                         
     34            @code = if args[:code]
     35                      args[:code]
     36                    else
     37                      raise ArgumentError, "Code is empty"
     38                    end
     39            @items = if args[:items]
     40                       args[:items]
     41                     else
     42                       raise ArgumentError, "Items is empty"
     43                     end
    3344          end
     45
    3446          def keys
    35             items.keys
     47            @items.keys
    3648          end
    3749        end
  • ruby/trunk/models/am/openehr_profile/data_types/basic.rb

    r4 r23  
    11module OpenEHR
    2   module RM
     2  module AM
    33    module OpenEHR_Profile
    44      module Data_Types
     5        module Basic
     6          class C_DV_STATE
     7          end
     8
     9          class STATE_MACHINE
     10          end
     11
     12          class STATE
     13          end
     14
     15          class TERMINAL_STATE < STATE
     16          end
     17
     18          class NON_TERMINAL_STATE < STATE
     19          end
     20
     21          class TRANSITION
     22          end
     23        end
     24
     25       
    526      end # of Data_Types
    627    end # of OpenEHR Profile
  • ruby/trunk/models/tests/test_archetype_model.rb

    r21 r23  
    55class ArchetypeModelTest < Test::Unit::TestCase
    66  def setup
    7     @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new #(nil,nil,nil,nil,nil,nil,nil,nil)
     7    @archetype = OpenEHR::AM::Archetype::ARCHETYPE.new
     8    @validity_kind = OpenEHR::AM::Archetype::VALIDITY_KIND.new
     9
    810    @archetype_description = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new
     11    @archetype_description_item = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM.new
     12  end
     13 
     14  def test_init
     15    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
     16    assert_instance_of OpenEHR::AM::Archetype::VALIDITY_KIND, @validity_kind
     17    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description
     18    assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION_ITEM, @archetype_description_item
     19    assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
     20  end
     21end
     22
     23class ArchetypeModelConstraintTest < Test::Unit::TestCase
     24  def setup
    925    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
    10     @assertion = OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion.new
    11     @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive.new
    12     @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(true, true, true)
    13     @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new
    14     @archetype_ontology = OpenEHR::AM::Archetype::Ontology::Archetype_Ontology.new
    15 
     26    @cardinality = OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY.new   
     27   
    1628    @archetype_constraint = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT.new
    1729    @c_object = OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT.new
    1830    @c_defined_object = OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT.new
    1931    @c_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE.new
     32    @c_single_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE.new
     33    @c_multiple_attribute = OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE.new(:rm_attribute_name => 'attribute_name', :cardinality => @cardinality)
    2034    @c_primitive_object = OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.new
    2135    @c_reference_object =  OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT.new
     
    2438    @constraint_ref = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new
    2539    @c_domain_type = OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE.new
    26     @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
     40    @c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new(:attributes => [@c_single_attribute])
    2741  end
    28  
     42
    2943  def test_init
    30     assert_instance_of OpenEHR::AM::Archetype::Ontology::Archetype_Ontology, @archetype_ontology
    31     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
    32     assert_instance_of OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION, @archetype_description
    33     assert_instance_of OpenEHR::AM::Archetype::ARCHETYPE, @archetype
    34     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Assertion::Assertion, @assertion
    35     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Primitive, @c_primitive
    36     assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean, @c_boolean
    3744    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
    3845    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_OBJECT, @c_object
    3946    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DEFINED_OBJECT, @c_defined_object
    4047    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_ATTRIBUTE, @c_attribute
     48    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_SINGLE_ATTRIBUTE, @c_single_attribute
     49    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_MULTIPLE_ATTRIBUTE, @c_multiple_attribute
     50    assert_equal 'attribute_name', @c_multiple_attribute.rm_attribute_name
     51    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @c_multiple_attribute.cardinality
    4152    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT, @c_primitive_object
    4253    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_REFERENCE_OBJECT, @c_reference_object
     
    4657    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_DOMAIN_TYPE, @c_domain_type
    4758    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, @c_complex_object
     59    assert_instance_of Array, @c_complex_object.attributes
     60    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_CONSTRAINT, @archetype_constraint
     61    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::CARDINALITY, @cardinality
     62  end
     63
     64  def test_create
     65    c_complex_object = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:node_id => 'test_node',
     66                                                                                         :attributes => [1,2],
     67                                                                                         :assumed_value => Array
     68                                                                                         )
     69    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT, c_complex_object
     70    assert_equal 'test_node', c_complex_object.node_id
     71  end
     72end
     73
     74class ArchetypeModelPrimitiveTest < Test::Unit::TestCase
     75  def setup
     76    @c_primitive = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE.new
     77    @c_boolean = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid => true,
     78                                                                                    :false_valid => true,
     79                                                                                    :assumed_value => true)
     80    @c_string = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING.new
     81    @c_integer = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.new
     82    @c_real = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL.new
     83    @c_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME.new
     84    @c_date = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE.new
     85    @c_date_time = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME.new
     86    @c_duration = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION.new
     87  end
     88
     89  def test_init
     90    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE, @c_primitive
     91    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN, @c_boolean
     92    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_STRING, @c_string
     93    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER, @c_integer
     94    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_REAL, @c_real
     95    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_TIME, @c_time
     96    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE, @c_date
     97    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DATE_TIME, @c_date_time
     98    assert_instance_of OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_DURATION, @c_duration
    4899  end
    49100
    50101  def test_primitive
    51     assert @c_boolean.true_valid?
    52     assert @c_boolean.false_valid?
     102    assert @c_boolean.true_valid
     103    assert @c_boolean.false_valid
    53104    assert @c_boolean.assumed_value
    54105    assert @c_boolean.has_assumed_value?
    55106    assert @c_boolean.default_value
    56107    assert @c_boolean.default_value(true)
    57     assert_raise(ArgumentError) {@c_boolean.set_true_valid(false); @c_boolean.set_false_valid(false)}
    58     assert_raise(ArgumentError) {OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Boolean.new(false,false,false)}
     108    assert_raise(ArgumentError) do
     109      @c_boolean.true_valid = false
     110      @c_boolean.false_valid = false
     111    end
     112    assert_raise(ArgumentError) do
     113      OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_BOOLEAN.new(:true_valid =>false,
     114                                                                         :false_valid => false,
     115                                                                         :assumed_value => false)
     116    end
     117  end
     118 
     119end
     120
     121class ArchetypeModelOntologyTest < Test::Unit::TestCase
     122  def setup
     123    @archetype_ontology = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY.new
     124    @archetype_term = OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM.new(:code => '', :items => '')
     125  end
     126
     127  def test_init
     128    assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_ONTOLOGY, @archetype_ontology
     129    assert_instance_of OpenEHR::AM::Archetype::Ontology::ARCHETYPE_TERM, @archetype_term
     130  end
     131end
     132   
     133class ArchetypeModelAssertionTest < Test::Unit::TestCase
     134  def setup
     135    @assertion = OpenEHR::AM::Archetype::Assertion::ASSERTION.new
     136    @assertion_variable = OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE.new
     137    @operator_kind = OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND.new
     138    @expr_item = OpenEHR::AM::Archetype::Assertion::EXPR_ITEM.new
     139    @expr_leaf = OpenEHR::AM::Archetype::Assertion::EXPR_LEAF.new
     140    @expr_operator = OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR.new
     141    @expr_unary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR.new
     142    @expr_binary_operator = OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR.new
     143  end
     144
     145  def test_init
     146    assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION, @assertion
     147    assert_instance_of OpenEHR::AM::Archetype::Assertion::ASSERTION_VARIABLE, @assertion_variable
     148    assert_instance_of OpenEHR::AM::Archetype::Assertion::OPERATOR_KIND, @operator_kind
     149    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_ITEM, @expr_item
     150    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_LEAF, @expr_leaf
     151    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_OPERATOR, @expr_operator
     152    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_UNARY_OPERATOR, @expr_unary_operator
     153    assert_instance_of OpenEHR::AM::Archetype::Assertion::EXPR_BINARY_OPERATOR, @expr_binary_operator
    59154  end
    60155end
    61156
     157class ArchetypeModelProfileTest < Test::Unit::TestCase
     158  def setup
     159    @c_dv_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE.new
     160    @state_machine = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE.new
     161    @state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE.new
     162    @terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE.new
     163    @non_terminal_state = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE.new
     164    @transition = OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION.new
     165
     166    @c_code_phase = OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE.new
     167
     168    @c_dv_quantity = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY.new
     169    @c_dv_ordinal = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL.new
     170    @c_quantity_item = OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM.new
     171  end
     172
     173  def test_init
     174    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::C_DV_STATE, @c_dv_state
     175    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE_MACHINE, @state_machine
     176    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::STATE, @state
     177    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TERMINAL_STATE, @terminal_state
     178    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::NON_TERMINAL_STATE, @non_terminal_state
     179    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Basic::TRANSITION, @transition
     180    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Text::C_CODE_PHASE, @c_code_phase
     181    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_QUANTITY, @c_dv_quantity
     182    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_DV_ORDINAL, @c_dv_ordinal
     183    assert_instance_of OpenEHR::AM::OpenEHR_Profile::Data_Types::Quantity::C_QUANTITY_ITEM, @c_quantity_item
     184  end
     185end
Note: See TracChangeset for help on using the changeset viewer.