lib/sfrp/mono/type.rb
# Generate struct for this type.
Generate struct for this type.
Generate struct for this type .
def gen_struct(src_set, dest_set)
        return if native? || infinite?
        dest_set << L.struct(@str) do |top|
          if has_meta_in_struct?
            top << L.member_structure('struct', 'meta') do |meta|
              meta << L.member('unsigned char term_id : 7')
              meta << L.member('unsigned char mark : 1')
            end
          end
          top << L.member_structure('union', 'terms') do |terms|
            @vconst_strs.each_with_index do |v_str, term_id|
              vconst = src_set.vconst(v_str)
              vconst.gen_term_definition(src_set, term_id, terms)
            end
          end
        end
      end
def gen_struct ( src_set , dest_set ) return if native? || infinite? dest_set << L . struct ( @str ) do | top | if has_meta_in_struct? top << L . member_structure ( 'struct' , 'meta' ) do | meta | meta << L . member ( 'unsigned char term_id : 7' ) meta << L . member ( 'unsigned char mark : 1' ) end end top << L . member_structure ( 'union' , 'terms' ) do | terms | @vconst_strs . each_with_index do | v_str , term_id | vconst = src_set . vconst ( v_str ) vconst . gen_term_definition ( src_set , term_id , terms ) end end end end
Generate struct for this type.
Generate struct for this type .
src_set
dest_set