Ignore:
Timestamp:
Apr 30, 2008, 8:34:43 PM (16 years ago)
Author:
Tatsukawa, Akimichi
Message:

created an experimental openehr_models gem package

File:
1 edited

Legend:

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

    r20 r21  
    2828
    2929input: archetype EOF
     30  {
     31    result = val[0]
     32  }
    3033  | error
    3134
    32 archetype: arch_identification
    33   arch_specialisation
    34   arch_concept
    35   arch_language
    36   arch_description
    37   arch_definition
    38   arch_invariant
    39   arch_ontology
     35archetype: arch_identification arch_specialisation arch_concept arch_language arch_description arch_definition arch_invariant arch_ontology
     36  {
     37    result = OpenEHR::AM::Archetype::ARCHETYPE.new(
     38                                                   :description => val[4],
     39                                                   :definition => val[5]
     40                                                   )
     41  }
    4042
    4143
     
    8183arch_description: #-- no meta-data ok
    8284    | SYM_DESCRIPTION dadl_section
    83     | SYM_DESCRIPTION error
    84 
     85  {
     86    result = OpenEHR::AM::Archetype::Archetype_Description::ARCHETYPE_DESCRIPTION.new(:details => val[1])
     87  }
     88  | SYM_DESCRIPTION error
     89 
    8590#arch_definition: SYM_DEFINITION V_CADL_TEXT
    8691#  | SYM_DEFINITION error
    8792arch_definition: SYM_DEFINITION cadl_section
     93  {
     94    result = val[1]
     95  }
    8896  | SYM_DEFINITION error
    8997
     
    9199### cADL section
    92100cadl_section: c_complex_object
     101  {
     102    result = val[0]
     103  }
    93104  | assertions
    94105#  | error
     
    96107#c_complex_object: c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK
    97108c_complex_object: c_complex_object_head SYM_MATCHES START_REGEXP_BLOCK REGEXP_BODY END_REGEXP_BLOCK # added by akimichi
     109  {
     110    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
     111  }
    98112    | c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body SYM_END_CBLOCK
    99 #     | c_complex_object_head error SYM_END_CBLOCK
    100 #   {
    101 #     @adl_type.push(:cadl)
    102 #     yyerror
    103 #   }
     113  {
     114    result = OpenEHR::AM::Archetype::Constraint_Model::C_COMPLEX_OBJECT.new
     115  }
     116#    | c_complex_object_head error SYM_END_CBLOCK
    104117#    | c_complex_object_head SYM_MATCHES SYM_START_CBLOCK c_complex_object_body c_invariants SYM_END_CBLOCK
    105118
     
    159172
    160173c_primitive: c_integer
     174  {
     175    @@log.info("#{__FILE__}:#{__LINE__}: c_integer = #{val[0]} at #{@filename}")
     176    result = OpenEHR::AM::Archetype::Constraint_Model::Primitive::C_Integer.new
     177  }
    161178  | c_real
    162179  | c_date
     
    731748require 'lib/util.rb'
    732749require 'lib/scanner.rb'
    733 require 'lib/model.rb'
     750#require 'lib/model.rb'
     751require 'rubygems'
     752require 'am.rb'
    734753$DEBUG = true
    735754
Note: See TracChangeset for help on using the changeset viewer.