Project

General

Profile

variable-sig.patch

Marian Edu, 04/24/2020 07:21 AM

Download (2.97 KB)

View differences:

rules/convert/variable_definitions.rules
332 332
   <variable name="isAbstract" type="java.lang.Boolean" />
333 333
   <variable name="ooplist"    type="java.util.List" />
334 334
   <variable name="iter"       type="java.util.Iterator" />
335
   <variable name="imptype"    type="java.lang.Boolean" />
335 336
   
336 337
   <func-library access="private">
337 338
      <function name="resolve_classname">
......
424 425
      <rule>isIface = descendant(prog.interface_def, 1)</rule>
425 426
      <rule>isOO = descendant(prog.class_def, 1) or isIface</rule>
426 427
      <rule>ooplist = create("java.util.LinkedList")</rule>
428
      <rule>imptype = false</rule>
427 429
   </init-rules>  
428 430
   
429 431
   <walk-rules>
......
536 538
                 handled differently -->
537 539
            <action>lastid = getSectionAnchor(java.cs_instance_vars).id</action>
538 540
            
541
            <action>
542
               tempid = createJavaAst(java.annotation, "LegacySignature", lastid, -1)
543
            </action>
544
            <action>imptype = true</action>
545
            
546
            <rule>type == prog.define_property
547
               <action>
548
                  execLib("add_annotation_setting", "type", java.reference, "Type.PROPERTY", tempid)
549
               </action>
550
               <action on="false">
551
                  execLib("add_annotation_setting", "type", java.reference, "Type.VARIABLE", tempid)
552
               </action>
553
            </rule>
554
            
555
            <action>
556
               execLib("add_annotation_setting", 
557
                       "name", 
558
                       java.string, 
559
                       getNoteString("name"), 
560
                       tempid)
561
            </action>
562
            
539 563
            <!-- define parameter needs to emit reference definitions
540 564
                 off the "parmroot" -->
541 565
            <rule on="false">type == prog.define_parameter and !(isAbstract or isIface)
......
1874 1898
      <rule>secimp
1875 1899
         <action>help.createImport("com.goldencode.p2j.security.*")</action>
1876 1900
      </rule>
1901
      <rule>imptype
1902
         <action>createStaticImport("com.goldencode.p2j.util.InternalEntry.Type")</action>
1903
      </rule>
1877 1904
   </post-rules>
1878 1905
   
1879 1906
</rule-set>
src/com/goldencode/p2j/util/InternalEntry.java
148 148
      EXTERN("EXTERN"),
149 149
      
150 150
      /** Main procedure */
151
      MAIN("MAIN");
151
      MAIN("MAIN"),
152
      
153
      /** Object variable */
154
      VARIABLE("VARIABLE"),
155
      
156
      /** Object property */
157
      PROPERTY("PROPERTY"),
158
      ;
152 159
      
153 160
      /** Map of Progress entry names to enum values */
154 161
      private static Map<String, Type> map = new HashMap<>(8);