Project

General

Profile

schema.g_3489a_rev_11231.patch

Greg Shah, 03/07/2018 06:29 PM

Download (2.32 KB)

View differences:

src/com/goldencode/p2j/schema/schema.g 2018-03-07 23:19:44 +0000
2 2
** Module   : schema.g
3 3
** Abstract : Progress database schema dump file (.df) parser
4 4
**
5
** Copyright (c) 2004-2017, Golden Code Development Corporation.
5
** Copyright (c) 2004-2018, Golden Code Development Corporation.
6 6
**
7 7
** -#- -I- --Date-- --JPRM-- ----------------------------Description-----------------------------
8 8
** 001 ECF 20041130   @18769 First version implementing a complete lexer,
......
87 87
** 029 EVL 20160224          Javadoc fixes to make compatible with Oracle Java 8 for Solaris 10.
88 88
** 030 CA  20160721          Empty string initializer for numeric fields is emitted as 0.
89 89
** 031 GES 20170704          Added mergeUntilWS() and the any_ridiculous_symbol rule for matching
90
**                           symbols that start with numeric digits or other unexpected text. 
90
**                           symbols that start with numeric digits or other unexpected text.
91
** 032 GES 20180307          Add support for silently dealing with garbage initial date values.
91 92
*/
92 93

  
93 94
/*
......
1433 1434
                  }
1434 1435
               }
1435 1436
            
1436
               // use of 'today' as a date literal manhandling! 
1437
               if (ftype == FIELD_DATE && newType == KW_TODAY)
1437
               // date-specific fixups
1438
               if (ftype == FIELD_DATE)
1438 1439
               {
1439
                  oldtype = KW_TODAY;
1440
                  fixed.setType(DATE_LITERAL);
1440
                  if (newType == KW_TODAY)
1441
                  {
1442
                     // use of 'today' as a date literal manhandling!
1443
                     oldtype = KW_TODAY;
1444
                     fixed.setType(DATE_LITERAL);
1445
                  }
1446
                  else if (newType != DATE_LITERAL)
1447
                  {
1448
                     // deal with garbage input;  it is possible to code something like:
1449
                     // INITIAL "this is total crap for a date initial value"
1450
                     // we treat this as unknown value
1451
                     fixed.setText("?");
1452
                     fixed.setType(UNKNOWN_VAL);
1453
                  }
1441 1454
               }
1442 1455
            
1443 1456
               // use of 'now' as a datetime literal manhandling!