Project

General

Profile

Feature #2078

provide support for malformed label names

Added by Constantin Asofiei about 11 years ago. Updated over 5 years ago.

Status:
Hold
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

50%

billable:
No
vendor_id:
GCD
version:

ca_upd20130305f.zip (2.1 KB) Constantin Asofiei, 03/05/2013 04:09 PM

History

#1 Updated by Constantin Asofiei about 11 years ago

In 4GL, it is possible to support malformed label names, as in:

IF AVAILABLE tncy THEN
123abc:
DO:
END.

or as in:
abc%^&*123: do i = 1 to 10:
   if i mod 2 = 0 then
     next abc%^&*123.
end.

(the later case does not go through the P2J parser, as it does't support these malformed symbols)

At this time, we need to provide support for the first case, when the label starts with a non-character element. To solve this, the simplest solution is to prefix the label name with an underscore, if it was marked as malformed by the parser. The attached update does just that.

OTOH, at some point we will need to enance this to provide full support for malformed names for variables/functions/procedures/etc (as Greg has mentioned on some other occasions).

#2 Updated by Constantin Asofiei about 11 years ago

I'm putting this through conversion regression testing.

#3 Updated by Constantin Asofiei about 11 years ago

Passed conversion regression testing.

#4 Updated by Greg Shah about 11 years ago

I'm OK with the code. You can check it in and distribute.

#5 Updated by Constantin Asofiei about 11 years ago

  • % Done changed from 90 to 100

Committed to bzr revision 10247.

#6 Updated by Greg Shah about 11 years ago

  • Status changed from WIP to Closed

#7 Updated by Greg Shah over 7 years ago

  • Target version changed from Milestone 4 to Conversion Support for Server Features

#8 Updated by Greg Shah over 5 years ago

The parser now handles a wide range of malformed symbols. These are marked with the "malformed" boolean annotation.

The following resource types are affected:

  • labels
  • frame names
  • query names
  • stream names
  • procedure names
  • function names

Conversion must be enhanced to handle all of the cases which can be matched now. The following token types are the only types that CANNOT be matched at the beginning (or in the middle) of one of these symbols:

  • DOT
  • COLON
  • COMMA
  • EQUALS
  • LPARENS
  • RPARENS
  • NOT_EQ
  • LT
  • LTE
  • GT
  • GTE

All other tokens can be matched as the first token.

#9 Updated by Greg Shah over 5 years ago

  • % Done changed from 100 to 50
  • Status changed from Closed to Hold
  • Target version deleted (Conversion Support for Server Features)
  • Start date deleted (03/05/2013)

Also available in: Atom PDF