DBTYPE was added as preprocessor function in OpenEdge 10.1A or so.
&IF DBTYPE( "dictdb" ) = "PROGRESS" &THEN
MESSAGE DBTYPE( "dictdb":u ) VIEW-AS ALERT-BOX INFORMATION.
&ENDIF
This page will provide a few starter hints for using the Proparse libraries.
Follow along in the source code, or else in the 'javadoc' here:
www.joanju.com/analyst/javadoc/
(Ignore the packages 'com.joanju.cg' and 'com.joanju.cgs'. Those are not part of Proparse.)
We use an instance of this class:
RefactorSession prsession = RefactorSession.getInstance();
For .Net, proparse.net.dll was compiled from proparse.jar and its required third party libraries using IKVM (ikvm.net).
This should allow us to build Proparse applications from .Net as well as from OpenEdge 10.2 on Windows.
To use proparse.net.dll, the IKVM assemblies (.DLL files) are required - please download IKVM
from its project site (sourceforge.net/projects/ikvm/).
Here is a C# example which uses proparse.net.dll to print Proparse's syntax tree to the console:
Parent page for retired (no longer used) Proparse pages.
line:
define variable dtDatumVanaf as datetime no-undo initial now.
does not parse, unexpected token now.
When trim is used in the expression in a preprocessor directive parsing crashes with an unknown exception.
Sample code:
1.p:
{c:\temp\1.i " "}
1.i:
&if trim("{1}") = ""
&then
find first _user no-lock no-error.
&endif
The problem is in passing an "empty" unnamed preprocessor. In the example when you delete the empty preprocessor in 1.p it parses just fine. I know the trim in 1.i is not necessary, if I remove that it parses just fine. If I change "trim" to "string" in 1.i it parses just fine.
Is there a way to get an "absolute" linenumber as opposed to the "relative" linenumber from parserGetNodeLine?
In stead of "line 3 in include something.i" I would like to have line 103 since the include was coded on line 100 of the .p
Is this posible?
I know it is kinda far fetched, but... I was testing the Prolint nameconv rule.
So I had a procedure name like 1ip_pp-1-&-%#$@ and it gave me an unexpected token error.
Turns out proparse can't parse this when it has a number and @ in it and there is no space between the name and the colon.
See attached file.
I posted proparse.jar build 1049 to http://www.joanju.com/proparse/ . This build adds early (alpha) support for 10.1C and 10.2A syntax.
Proparse has not been updated since 10.1B, so both 10.1C and 10.2A new language features need to be added.
This page serves as a checklist and to encourage input.
Is Proparse known to have issues with nested includes and/or 'many preprocessors'?
I have code that compiles fine, but when I try to Prolint it it gives me "unexpected token: return"
on code like:
if not available bPROG_DICT
then do:
/* Program Definition not found */
{lib/message.i &message={lib/msg/msg001}}
return.
end.
When I preprocess the code Prolint/ProParse have no problems.
Is anyone alive in the hive? Anyways can someone please help me with an error I have in joanju_autodox_err.txt. It is "...unexpected token: erSysError". My code is this:
CATCH erSysError AS Progress.Lang.SysError:
RUN ReturnResult (erSysError:GetMessageNum(1),erSysError:GetMessage(1)).
DELETE OBJECT erSysError.
END CATCH.
I try using parserDictAdd("erSysError", "ERROR") but no success. Any suggestions?
This is a sample of how we could implement the colon-t prolint rule:
DEF VAR lv_String AS CHAR NO-UNDO.
FOR EACH TTNode NO-LOCK WHERE TTnode.NodeTypeNum EQ NodeTypes:QSTRING#:
IF SUBSTR(TTnode.NodeText,LENGTH(TTnode.NodeText) - 1) NE ":T" THEN NEXT.
ASSIGN lv_String = SUBSTRING(TTnode.NodeText,2,LENGTH(TTnode.NodeText) - 4).
IF LENGTH(TRIM(lv_String)) = LENGTH(lv_String) THEN NEXT.
MESSAGE SUBSTITUTE('Line: &1, Column: &2 attrib :T will trim string "&3"',TTnode.NodeLine,TTNode.NodeCol, lv_String) VIEW-AS ALERT-BOX INFORMATION.
END.
Once the parseunit has been initialized and the cu parsed, the following is an example of a "missing NO-UNDO" rule:
DEF BUFFER ChildNode FOR TTNode. FOR EACH TTnode WHERE nodetypenum EQ NodeTypes:DEFINE# AND NodeTypenum2 EQ NodeTypes:VARIABLE# NO-LOCK: /* DEFINE and VARIABLE */ IF CAN-FIND(FIRST ChildNode WHERE ChildNode.Parent EQ TTNode.Nodenum AND ChildNode.NodeTypeNum EQ NodeTypes:NOUNDO#) THEN NEXT. /* move to the next DEF VAR */
Has anyone thought about running the API on an appserver process ? I see some advantages in this ..