Project

General

Profile

com_self_changes_to_implement_1.patch

Sergey Ivanovskiy, 05/05/2020 11:37 AM

Download (3.05 KB)

View differences:

rules/annotations/ocx_conversion.rules 2020-05-05 14:11:56 +0000
168 168
   <variable name="methodName"     type="java.lang.String" />
169 169
   <variable name="isAssign"       type="java.lang.Boolean" />
170 170
   <variable name="num"            type="java.lang.Integer" />
171
   <variable name="typeOld"        type="java.lang.Long" />
172
   <variable name="isComSelf"      type="java.lang.Boolean" />
171 173

  
172 174
   <init-rules>
173 175
      <!-- load hints -->
......
344 346
      <rule>type == prog.com_invocation
345 347
         <action>javaClass = null</action>
346 348
         <action>ref = null</action>
347
         <rule>downPath("COM_INVOCATION") or downPath("VAR_COM_HANDLE")
349
         <rule>downPath("COM_INVOCATION") or downPath("VAR_COM_HANDLE") or downPath("SYS_HANDLE")
348 350
            <action>ref = copy.getChildAt(0)</action>
349 351
            <action>className = ref.getAnnotation("java-class-name")</action>
350 352
            <!-- check for null for LoadControls for example -->
......
517 519
               </action>
518 520
            </rule>
519 521
         </rule>
520

  
522
         
523
         <action>isComSelf = false</action>
524
         
525
         <rule>type == prog.sys_handle
526
            <action>typeOld = #(java.lang.Long) this.getAnnotation("oldtype")</action>
527
            <rule>typeOld != null and typeOld.longValue() == prog.kw_com_self
528
               <action>isComSelf = true</action>
529
            </rule>
530
         </rule>
531
         
521 532
         <!-- 4. Convert chained com property from <chCF>:<com-property-name>:<meth-or-attr> to hWidget:<meth-or-attr> -->
522
         <rule>type == prog.var_com_handle
533
         <rule>(type == prog.var_com_handle) or (isComSelf == true)
523 534
            <variable name="invoc"             type="com.goldencode.ast.Aast"/>
524 535
            <variable name="rootComInvocCpy"   type="com.goldencode.ast.Aast"/>
525 536
            <variable name="methPropCpy"       type="com.goldencode.ast.Aast"/>
rules/convert/variable_references.rules 2020-05-05 14:48:31 +0000
351 351
            <action>smimport = true</action>
352 352
         </rule>
353 353
         
354
         <rule>oldtype == prog.kw_com_self
355
            <rule>this.isAnnotation("hwrap") and #(java.lang.Boolean) this.getAnnotation("hwrap")
356
               <action>methodTxt = this.getAnnotation("java-class-name")</action>
357
               <action>methodTxt = getClassSimpleName(methodTxt)</action>
358
               <rule>methodTxt != null
359
                  <action>methodTxt = sprintf("self().unwrap%s", methodTxt)</action>
360
               </rule>
361
            </rule>
362
            <rule>methodTxt == null
363
               <action>methodTxt = "self"</action>
364
            </rule>
365
            <action>smimport = true</action>
366
         </rule>
367
         
354 368
         <!-- direct resource access -->
355 369
         <rule>this.parent.type == prog.colon
356 370
            <rule>oldtype == prog.kw_log_mgr