Changeset 32 for ruby/trunk/adl_parser/lib/parser.y
- Timestamp:
- May 6, 2008, 12:18:06 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/adl_parser/lib/parser.y
r26 r32 160 160 161 161 #c_complex_object: c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK 162 c_complex_object: c_compl ex_object_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi162 c_complex_object: c_complx_object_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi 163 163 { 164 164 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.create(:attributes => val[3]) do |c_complex_object| … … 203 203 204 204 c_object: v_c_domain_type 205 { 205 { 206 206 result = val[0] 207 207 } 208 208 | c_complex_object 209 { 210 result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new 209 { 210 @@log.info("#{__FILE__}:#{__LINE__}: c_complex_object = #{val[0].inspect} at #{@filename}:#{@lineno}") 211 result = val[0] 211 212 } 212 213 | archetype_internal_ref 213 { 214 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.new 214 { 215 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_INTERNAL_REF.create do |archetype_internal_ref| 216 archetype_internal_ref.target_path = val[0][:absolute_path] 217 archetype_internal_ref.rm_type_name = val[0][:type_identifier] 218 archetype_internal_ref.occurrences = val[0][:c_occurrences] 219 end 215 220 } 216 221 | archetype_slot 217 { 218 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.new222 { 223 result = val[0] 219 224 } 220 225 | constraint_ref 221 { 222 result = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.new 226 { 227 result = OpenEHR::AM::Archetype::Constraint_Model::CONSTRAINT_REF.create do |constraint_ref| 228 constraint_ref.reference = val[0] 229 end 223 230 } 224 231 | c_code_phrase 225 { 232 { 226 233 result = val[0] 227 234 } 228 235 | c_ordinal 229 { 236 { 230 237 result = val[0] 231 238 } 232 239 | c_primitive_object 233 { 240 { 234 241 result = val[0] 235 242 } … … 252 259 # 'archetype_internal_ref' is a node that refers to a previously defined object node in the same archetype. 253 260 archetype_internal_ref: SYM_USE_NODE type_identifier c_occurrences absolute_path 261 { 262 result = {:type_identifier => val[1], :c_occurrences => val[2], :absolute_path => val[3] } 263 } 254 264 | SYM_USE_NODE type_identifier error 255 265 256 266 # 'archetype_slot' is a node whose statements define a constraint that determines which other archetypes may appear at that point in the current archetype. 257 267 archetype_slot: c_archetype_slot_head SYM_MATCHES SYM_START_CBLOCK c_includes c_excludes SYM_END_CBLOCK 258 268 { 269 result = OpenEHR::AM::Archetype::Constraint_Model::ARCHETYPE_SLOT.create do |archetype_slot| 270 archetype_slot.includes = val[3] 271 archetype_slot.excludes = val[4] 272 archetype_slot.rm_type_name = val[0][:c_archetype_slot_id] 273 archetype_slot.occurrences = val[0][:c_occurrences] 274 end 275 } 259 276 c_archetype_slot_head: c_archetype_slot_id c_occurrences 277 { 278 result = {:c_archetype_slot_id => val[0],:c_occurrences => val[1]} 279 } 260 280 261 281 c_archetype_slot_id: SYM_ALLOW_ARCHETYPE type_identifier 282 { 283 result = val[1] 284 } 262 285 | SYM_ALLOW_ARCHETYPE type_identifier V_LOCAL_TERM_CODE_REF 263 286 | SYM_ALLOW_ARCHETYPE error … … 267 290 { 268 291 assert_at(__FILE__,__LINE__){val[0].kind_of?(OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_PRIMITIVE)} 269 result = OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.new(:item => val[0]) 292 result = OpenEHR::AM::Archetype::Constraint_Model::C_PRIMITIVE_OBJECT.create do |c_primitive_object| 293 c_primitive_object.item = val[0] 294 end 270 295 } 271 296 … … 273 298 { 274 299 @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}:#{@lineno}") 275 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.new 300 result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_INTEGER.create do |c_integer| 301 c_integer.list 302 c_integer.range 303 c_integer.assumed_value 304 end 276 305 } 277 306 | c_real … … 383 412 c_includes: #-- Empty 384 413 | SYM_INCLUDE invariants 414 { 415 result = val[1] 416 } 385 417 386 418 ### c_excludes: #-- Empty … … 388 420 c_excludes: #-- Empty 389 421 | SYM_EXCLUDE invariants 422 { 423 result = val[1] 424 } 390 425 391 426 invariants: invariant … … 1080 1115 #c_code_phrase: V_TERM_CODE_CONSTRAINT #-- e.g. "[local::at0040, at0041; at0040]" 1081 1116 c_code_phrase: term_code_constraint_section #-- e.g. "[local::at0040, at0041; at0040]" 1117 { 1118 result = val[0] 1119 } 1082 1120 | V_QUALIFIED_TERM_CODE_REF 1121 { 1122 result = val[0] 1123 } 1083 1124 1084 1125 #term_code_constraint_section: START_TERM_CODE_CONSTRAINT term_code_body Right_bracket_code … … 1093 1134 # A Constraint_Ref is a proxy for a set of constraints on an object. 1094 1135 constraint_ref: V_LOCAL_TERM_CODE_REF #-- e.g. "ac0003" 1136 { 1137 result = val[0] 1138 } 1095 1139 1096 1140 any_identifier: type_identifier 1141 { 1142 result = val[0] 1143 } 1097 1144 | V_ATTRIBUTE_IDENTIFIER 1098 1145 { 1099 1146 @@log.info("#{__FILE__}:#{__LINE__}, V_ATTRIBUTE_IDENTIFIER = #{word} at #{@filename}") 1147 result = val[0] 1100 1148 } 1101 1149
Note:
See TracChangeset
for help on using the changeset viewer.