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

working on adl_parser semantic functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.