Project

General

Profile

Bug #3354

func_class return type not recognized

Added by Greg Shah over 6 years ago. Updated over 5 years ago.

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

100%

billable:
No
vendor_id:
GCD
case_num:
version:

cvt_f2_20171011_091816.log Magnifier (8.02 KB) Neil Treeby, 10/11/2017 10:34 AM

3353a_20171013a.patch Magnifier - common-progress.rules change to add func_class support to post-parse-fixups (1.16 KB) Greg Shah, 10/20/2017 07:48 AM

3353a_20171014a.patch Magnifier - progress.g patch to find the qualified class name for the return type in the correct location (child of the returns) (498 Bytes) Greg Shah, 10/20/2017 07:49 AM


Related issues

Related to Conversion Tools - Bug #3353: lexer num_literal should support hexadecimal literals Closed

History

#1 Updated by Greg Shah over 6 years ago

Submitted by Neil in a forum post:

Walking the AST throws an error when it encounters a user-defined function that returns a CLASS:

    FUNCTION newAppError RETURNS /*CLASS*/ Progress.Lang.AppError PRIVATE
        (INPUT ipcMessage AS CHARACTER) FORWARD.

results in the following errors thrown during the AST walk, which results in termination of the analysis at that point:

        [java] EXPRESSION EXECUTION ERROR:
     [java] ---------------------------
     [java] throwException(errmsg)
     [java] ^  { Unrecognized return type FUNC_CLASS [KW_FUNCT id <1451698947492> 356:1] }
     [java] ---------------------------
     [java] EXPRESSION EXECUTION ERROR:
     [java] ---------------------------
     [java] cls = execLib("get_function_return_class", ftype)
     [java]       ^  { Expression execution error @1:1 }
     [java] ---------------------------
     [java] ERROR:
     [java] com.goldencode.p2j.pattern.TreeWalkException: ERROR!  Active Rule:
     [java] -----------------------
     [java]       RULE REPORT      
     [java] -----------------------
     [java] Rule Type :   WALK
     [java] Source AST:  [ FUNCTION ] BLOCK/FUNCTION/KW_FUNCT/ @356:1 {1451698947492}
     [java] Copy AST  :  [ FUNCTION ] BLOCK/FUNCTION/KW_FUNCT/ @356:1 {1451698947492}
     [java] Condition :  throwException(errmsg)
     [java] Loop      :  false
     [java] --- END RULE REPORT ---
     [java] 
     [java] 
     [java] 
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1068)
     [java]     at com.goldencode.p2j.convert.ConversionDriver.processTrees(ConversionDriver.java:1128)
     [java]     at com.goldencode.p2j.convert.ConversionDriver.front(ConversionDriver.java:382)
     [java]     at com.goldencode.p2j.convert.ConversionDriver.main(ConversionDriver.java:2005)
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:7 [KW_FUNCT id=1451698947492]
     [java]     at com.goldencode.p2j.pattern.AstWalker.walk(AstWalker.java:274)
     [java]     at com.goldencode.p2j.pattern.AstWalker.walk(AstWalker.java:209)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.apply(PatternEngine.java:1631)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1529)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1477)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1032)
     [java]     ... 3 more
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:7
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:484)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:491)
     [java]     at com.goldencode.p2j.pattern.Rule.executeActions(Rule.java:738)
     [java]     at com.goldencode.p2j.pattern.Rule.coreProcessing(Rule.java:707)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:530)
     [java]     at com.goldencode.p2j.pattern.RuleContainer.apply(RuleContainer.java:583)
     [java]     at com.goldencode.p2j.pattern.RuleSet.apply(RuleSet.java:98)
     [java]     at com.goldencode.p2j.pattern.AstWalker.walk(AstWalker.java:261)
     [java]     ... 8 more
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:1
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:484)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:491)
     [java]     at com.goldencode.p2j.pattern.Rule.executeActions(Rule.java:738)
     [java]     at com.goldencode.p2j.pattern.Rule.coreProcessing(Rule.java:707)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:530)
     [java]     at com.goldencode.p2j.pattern.NamedFunction.execute(NamedFunction.java:449)
     [java]     at com.goldencode.p2j.pattern.AstSymbolResolver.execute(AstSymbolResolver.java:709)
     [java]     at com.goldencode.p2j.pattern.CommonAstSupport$Library.execLib(CommonAstSupport.java:1262)
     [java]     at com.goldencode.expr.CE107.execute(Unknown Source)
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:391)
     [java]     ... 15 more
     [java] Caused by: com.goldencode.p2j.pattern.CommonAstSupport$UserGeneratedException: Unrecognized return type FUNC_CLASS [KW_FUNCT id <1451698947492> 356:1]
     [java]     at com.goldencode.p2j.pattern.CommonAstSupport$Library.throwException(CommonAstSupport.java:2528)
     [java]     at com.goldencode.p2j.pattern.CommonAstSupport$Library.throwException(CommonAstSupport.java:2513)
     [java]     at com.goldencode.expr.CE126.execute(Unknown Source)
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:391)
     [java]     ... 24 more

#2 Updated by Greg Shah over 6 years ago

During what phase of the ConversionDriver was this reported?

I ask because we do support OO 4GL for the purposes of parsing and for Code Analytics. But we don't yet support OO 4GL for conversion to Java. If this was reported during Annotations or Core Conversion, then it would be expected.

#3 Updated by Neil Treeby over 6 years ago

I've attached a log where I ran ant convert.front.list for a single program that throws this error. Is there a way to get more detailed log output?

#4 Updated by Greg Shah over 6 years ago

No additional logging is needed. It is clear this is during "Post Parse Fixups" which is part of the front-end. It should work, so this is a bug to fix.

#5 Updated by Greg Shah over 6 years ago

Revision 11178 of branch 3353a contains the fix to this bug. The problem is resolved for the front end. General OO support is not there yet for conversion or runtime.

#6 Updated by Greg Shah over 6 years ago

  • Related to Bug #3353: lexer num_literal should support hexadecimal literals added

#7 Updated by Greg Shah over 6 years ago

  • Status changed from New to Test
  • % Done changed from 0 to 100
  • Assignee set to Greg Shah

#8 Updated by Greg Shah over 6 years ago

I'm attaching the patches needed to fix this issue. Both patches need to be applied and FWD rebuilt.

#9 Updated by Greg Shah over 6 years ago

Branch 3353a was merged to trunk as revision 11187. It will soon be available publicly as FWD v3.2.

#10 Updated by Greg Shah over 5 years ago

  • Status changed from Test to Closed

FWD v3.2.0 has been released. This issue is being closed accordingly.

Also available in: Atom PDF