Ignore:
Timestamp:
Apr 16, 2008, 11:11:40 PM (16 years ago)
Author:
Tatsukawa, Akimichi
Message:

working on V_C_DOMAIN_TYPE mini parser

File:
1 edited

Legend:

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

    r4 r14  
    119119  | c_ordinal
    120120  | c_primitive_object
    121   | V_C_DOMAIN_TYPE
     121  | v_c_domain_type
     122#  | V_C_DOMAIN_TYPE
     123  #   this is an attempt to match a dADL section inside cADL. It will
     124  #   probably never work 100% properly since there can be '>' inside "||"
     125  #   ranges, and also strings containing any character, e.g. units string
     126  #   contining "{}" chars. The real solution is to use the dADL parser on
     127  #   the buffer from the current point on and be able to fast-forward the
     128  #   cursor to the last character matched by the dADL scanner
    122129  | ERR_C_DOMAIN_TYPE
    123130  | error
     131
     132v_c_domain_type: START_V_C_DOMAIN_TYPE v_c_domain_type_body END_V_C_DOMAIN_TYPE
     133v_c_domain_type_body: dadl_section
    124134
    125135# 'archetype_internal_ref' is a node that refers to a previously defined object node in the same archetype.
     
    904914      when /\A\<=/   # <=
    905915        yield :SYM_LE, :SYM_LE
     916      when /\A[A-Z][a-zA-Z0-9_]*[ \n]*\</   # V_C_DOMAIN_TYPE
     917        @in_c_domain_type = true
     918        @adl_type.push(:dadl)
     919          yield :START_V_C_DOMAIN_TYPE_BLOCK, :START_V_C_DOMAIN_TYPE_BLOCK
     920###         else
     921###           raise
     922###         end
    906923      when /\A\</   # <
    907924        if @in_interval
     
    11011118          @in_interval = false
    11021119          yield :SYM_GT, :SYM_GT
     1120        elsif @in_c_domain_type
     1121          @in_c_domain_type = false
     1122          adl_type = @adl_type.pop
     1123          assert_at(__FILE__,__LINE__){adl_type == :dadl}
     1124          yield :END_V_C_DOMAIN_TYPE_BLOCK, :END_V_C_DOMAIN_TYPE_BLOCK
    11031125        else
    11041126          adl_type = @adl_type.pop
     
    13341356  @in_regexp = false
    13351357  @in_interval = false
     1358  @in_c_domain_type = false
    13361359  yyparse self, :scan
    13371360end
Note: See TracChangeset for help on using the changeset viewer.