consultingwerk / proparse

Proparse, forked from http://www.oehive.org/proparse/
Other
18 stars 9 forks source link

Bad DEFINED function in &IF preprocessor condition #55

Open DanielBaciu opened 2 years ago

DanielBaciu commented 2 years ago

Hi,

We have the following structure in many include files, to make sure that definition of temp-table is included only once.

&if defined(i_tt{&prefix}companydata{&suffix}) = 0 &then &global-define i_tt{&prefix}companydata{&suffix} yes
define temp-table tt{&prefix}CompanyData{&suffix} ... &endif

When parsing the .p file we get this error:

Bad DEFINED function in &IF preprocessor condition

I'm using proparse.dll version 4.1.0.1219. Please fix it if possible.

The complete error stack is:

    java.lang.RuntimeException: java.lang.IllegalArgumentException: C:\Projects\reverse-engineering-oe\src\ttCompanyData.i:14 Bad DEFINED function in &IF preprocessor condition
        at com.joanju.proparse.Postlexer.nextToken(Postlexer.java:81)
        at com.joanju.proparse.Postlexer.<bridge>nextToken(Postlexer.java:1)
        at com.joanju.proparse.TokenList.build(TokenList.java:37)
        at com.joanju.proparse.DoParse.doParse(DoParse.java:146)
        at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:270)
        at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:226)
        at org.prorefactor.treeparser.ParseUnit.treeParser01(ParseUnit.java:348)
        at cli.Progress.ClrBridge.ClrApi.InvokeMethod(Unknown Source)
    Caused by: java.lang.IllegalArgumentException: C:\Projects\reverse-engineering-oe\src\ttCompanyData.i:14 Bad DEFINED function in &IF preprocessor condition
        at com.joanju.proparse.Postlexer.throwMessage(Postlexer.java:322)
        at com.joanju.proparse.Postlexer.defined(Postlexer.java:98)
        at com.joanju.proparse.Postlexer.preproIfCond(Postlexer.java:278)
        at com.joanju.proparse.Postlexer.preproIf(Postlexer.java:172)
        at com.joanju.proparse.Postlexer.nextToken(Postlexer.java:53)
        at com.joanju.proparse.Postlexer.<bridge>nextToken(Postlexer.java:1)
        at com.joanju.proparse.TokenList.build(TokenList.java:37)
        at com.joanju.proparse.DoParse.doParse(DoParse.java:147)
        at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:271)
        ... 3 more

An example can be found in attachment below. Bad_DEFINED_function.zip

Thank you!

DanielBaciu commented 2 years ago

HI,

I add another example where a simple ADM2 SmartdataObject generates the same error.

java.lang.RuntimeException: java.lang.IllegalArgumentException: c:\ws\dev\11.7relatief\src/adm2/query.i:184 Bad DEFINED function in &IF preprocessor condition at com.joanju.proparse.Postlexer.nextToken(Postlexer.java:81) at com.joanju.proparse.Postlexer.nextToken(Postlexer.java:1) at com.joanju.proparse.TokenList.build(TokenList.java:37) at com.joanju.proparse.DoParse.doParse(DoParse.java:146) at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:270) at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:226) at org.prorefactor.treeparser.ParseUnit.treeParser01(ParseUnit.java:348) at cli.Progress.ClrBridge.ClrApi.InvokeMethod(Unknown Source) Caused by: java.lang.IllegalArgumentException: c:\ws\dev\11.7relatief\src/adm2/query.i:184 Bad DEFINED function in &IF preprocessor condition at com.joanju.proparse.Postlexer.throwMessage(Postlexer.java:322) at com.joanju.proparse.Postlexer.defined(Postlexer.java:98) at com.joanju.proparse.Postlexer.preproIfCond(Postlexer.java:278) at com.joanju.proparse.Postlexer.preproIf(Postlexer.java:172) at com.joanju.proparse.Postlexer.nextToken(Postlexer.java:53) at com.joanju.proparse.Postlexer.nextToken(Postlexer.java:1) at com.joanju.proparse.TokenList.build(TokenList.java:37) at com.joanju.proparse.DoParse.doParse(DoParse.java:147) at org.prorefactor.treeparser.ParseUnit.parse(ParseUnit.java:271) ... 3 more

ADM2 SmartDataObject.zip