Bug #3352
non-reserved keywords in temp-table field names
100%
Related issues
History
#1 Updated by Greg Shah almost 9 years ago
Submitted by Neil in a forum post:
ABL allows temp-table definitions to have non-reserved keywords as field names. This causes parsing errors. For example:
DEFINE TEMP-TABLE ttOut NO-UNDO
FIELD Branch AS INTEGER
FIELD Dept AS CHARACTER
FIELD InvoiceYear AS INTEGER
FIELD InvoiceMonth AS INTEGER
FIELD Shipments AS DECIMAL
FIELD RETURNS AS DECIMAL
INDEX pu-idx IS PRIMARY UNIQUE Branch Dept InvoiceYear InvoiceMonth.
The above is a valid temp-table definition that compiles and executes; RETURNS is a non-reserved keyword. The FWD parser throws an error when it encounters the definition of the "RETURNS" field:
[java] com.goldencode.ast.AstException: Error processing .\abl\Source\responseShipmentsAndReturns.p
[java] at com.goldencode.p2j.uast.AstGenerator.processFile(AstGenerator.java:962)
[java] at com.goldencode.p2j.uast.ScanDriver.lambda$scan$0(ScanDriver.java:375)
[java] at com.goldencode.p2j.uast.ScanDriver.scan(ScanDriver.java:410)
[java] at com.goldencode.p2j.uast.ScanDriver.scan(ScanDriver.java:248)
[java] at com.goldencode.p2j.convert.ConversionDriver.runScanDriver(ConversionDriver.java:496)
[java] at com.goldencode.p2j.convert.ConversionDriver.front(ConversionDriver.java:377)
[java] at com.goldencode.p2j.convert.ConversionDriver.main(ConversionDriver.java:2005)
[java] Caused by: java.lang.RuntimeException: Cannot find class/interface DECIMAL in PROPATH.
[java] at com.goldencode.p2j.uast.SymbolResolver.loadClass(SymbolResolver.java:2337)
[java] at com.goldencode.p2j.uast.ProgressParser.user_defined_type_name(ProgressParser.java:7304)
[java] at com.goldencode.p2j.uast.ProgressParser.as_field_clause(ProgressParser.java:50085)
[java] at com.goldencode.p2j.uast.ProgressParser.add_temp_table_field(ProgressParser.java:49582)
[java] at com.goldencode.p2j.uast.ProgressParser.def_temp_table_stmt(ProgressParser.java:10821)
[java] at com.goldencode.p2j.uast.ProgressParser.define_stmt(ProgressParser.java:9436)
[java] at com.goldencode.p2j.uast.ProgressParser.stmt_list(ProgressParser.java:23372)
[java] at com.goldencode.p2j.uast.ProgressParser.statement(ProgressParser.java:6087)
[java] at com.goldencode.p2j.uast.ProgressParser.single_block(ProgressParser.java:4958)
[java] at com.goldencode.p2j.uast.ProgressParser.block(ProgressParser.java:4678)
[java] at com.goldencode.p2j.uast.ProgressParser.external_proc(ProgressParser.java:4605)
[java] at com.goldencode.p2j.uast.AstGenerator.parse(AstGenerator.java:1487)
[java] at com.goldencode.p2j.uast.AstGenerator.processFile(AstGenerator.java:957)
[java] ... 6 more
#2 Updated by Greg Shah almost 9 years ago
- File returns_is_marked_reserved.png added
RETURNS is a non-reserved keyword.
Yes, you are right. The problem here is that the Progress documentation lists it as reserved:

We coded the keyword in our progress.g based on that documentation and had not yet found the fact that it was wrong. I will fix this in our parser.
BTW, we do already support non-reserved keywords as field names. The issue is purely that the keyword is marked reserved in our code.
#3 Updated by Greg Shah almost 9 years ago
This change is in revision in 11177 of branch 3353a.
#4 Updated by Greg Shah almost 9 years ago
- Related to Bug #3353: lexer num_literal should support hexadecimal literals added
#5 Updated by Greg Shah almost 9 years ago
- Status changed from New to Test
- % Done changed from 0 to 100
- Assignee set to Greg Shah
#6 Updated by Greg Shah over 8 years ago
Branch 3353a was merged to trunk as revision 11187. It will soon be available publicly as FWD v3.2.
#7 Updated by Greg Shah almost 8 years ago
- Status changed from Test to Closed
FWD v3.2.0 has been released. This issue is being closed accordingly.