Project

General

Profile

Bug #4240

wrong labels for fill-in fields from array.

Added by Marius Gligor over 4 years ago. Updated over 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
08/22/2019
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version:

population.p Magnifier (258 Bytes) Marius Gligor, 08/22/2019 02:50 AM

fwd-labels.png (3.89 KB) Marius Gligor, 08/22/2019 03:08 AM

oe-labels.png (4.72 KB) Marius Gligor, 08/22/2019 03:08 AM

History

#1 Updated by Marius Gligor over 4 years ago

  • File population.pMagnifier added
  • File oe-labels.png added
  • File fwd-labels.png added

#2 Updated by Marius Gligor over 4 years ago

  • File deleted (fwd-labels.png)

#3 Updated by Marius Gligor over 4 years ago

  • File deleted (oe-labels.png)

#4 Updated by Marius Gligor over 4 years ago

#5 Updated by Greg Shah over 4 years ago

From Marius via email:

I found a bug in one test which was successfully converted but the generated labels for widgets are wrong!

Looking inside the conversion generated files I found:

      - population.p.lexer and population.p.parser looks good.
      - inside population.p.ast I found:

        <annotation datatype="java.util.ArrayList" key="label">
          <listitem datatype="java.lang.String" value="&quot;Romania&quot;"/>
          <listitem datatype="java.lang.String" value="&quot;USA&quot;"/>
        </annotation>

    and

        <ast col="4" hidden="true" id="167503724561" line="2" text="LABEL" type="KW_LABEL">
          <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
          <ast col="10" id="167503724563" line="2" text="&quot;Romania&quot;" type="STRING">
            <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
          </ast>
          <ast col="21" id="167503724566" line="2" text="&quot;USA&quot;" type="STRING">
            <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
          </ast>
        </ast>

      - but, inside PopulationFrame1.jast I found:
                <ast col="0" id="176093659247" line="0" text="setLabel" type="METHOD_CALL">
                  <ast col="0" id="176093659248" line="0" text="populationsArray1" type="REFERENCE"/>
                  <ast col="0" id="176093659249" line="0" text="Romania\nUSA[2]" type="STRING"/>
                </ast>
                <ast col="0" id="176093659250" line="0" text="setLabel" type="METHOD_CALL">
                  <ast col="0" id="176093659251" line="0" text="populationsArray0" type="REFERENCE"/>
                  <ast col="0" id="176093659252" line="0" text="Romania\nUSA[1]" type="STRING"/>
                </ast>
         which are wrong labels: Romania\nUSA[2] respectiv Romania\nUSA[1].

       - the generated Java class PopulationFrame1.java contains:

            populationsArray1.setLabel("Romania\nUSA[2]");
            populationsArray0.setLabel("Romania\nUSA[1]");

         which are wrong values due to the bug in PopulationFrame1.jast

#6 Updated by Greg Shah over 4 years ago

Although we parse LABEL "one", "two" in the format phrase for an extent variable, the downstream conversion does not properly handle the case where there are more than one STRING children of the KW_LABEL. This syntax is meant to provide different labels for elements in an extent variable.

We must correct all the downstream label processing.

#7 Updated by Marius Gligor over 4 years ago

In the mean time I simplified the 4GL code in population.p keeping only relevant statements and I renamed the frame as f, so the correct file names are now PopulationF.jast and PopulationF.java when you convert the attached sample.

Also available in: Atom PDF