prolint-cvs Mailing List for Prolint (Page 2)
Brought to you by:
johnallengreen,
jurjen
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(22) |
Sep
(22) |
Oct
(40) |
Nov
(16) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(3) |
Feb
(1) |
Mar
(3) |
Apr
(43) |
May
(4) |
Jun
(1) |
Jul
|
Aug
|
Sep
(14) |
Oct
(24) |
Nov
(17) |
Dec
(20) |
2005 |
Jan
(4) |
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2006 |
Jan
(2) |
Feb
|
Mar
(18) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(11) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <ju...@us...> - 2006-03-07 23:14:34
|
Revision: 256 Author: jurjen Date: 2006-03-07 15:14:27 -0800 (Tue, 07 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=256&view=rev Log Message: ----------- added help for rule "nameconv" Added Paths: ----------- trunk/prolint/help/rules/nameconv.htxt Added: trunk/prolint/help/rules/nameconv.htxt =================================================================== --- trunk/prolint/help/rules/nameconv.htxt (rev 0) +++ trunk/prolint/help/rules/nameconv.htxt 2006-03-07 23:14:27 UTC (rev 256) @@ -0,0 +1,18 @@ +<h1>VARIABLE .... should start with "..."</h1> + +Rule "nameconv" looks at the names of variables (and parameters) to check +for naming conventions. + +<p> + +<b>How to customize this rule:</b><br /> +Since naming conventions are different in every organization, you +will probably want to customize this rule. To do so you only have to +override procedure "prolint/rules/namecheck.p": +<p> +Do not change procedure "prolint/rules/namecheck.p", because your changes will +be overwritten when you upgrade Prolint. Instead, copy +"prolint/rules/namecheck.p" to "prolint/custom/rules/namecheck.p" and +then change your custom copy. + + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2006-03-07 22:47:11
|
Revision: 255 Author: jurjen Date: 2006-03-07 14:46:56 -0800 (Tue, 07 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=255&view=rev Log Message: ----------- Added a Prolint menu-item in Appbuilder (under "Compile"). Submitted by Carl Verbiest. Added Paths: ----------- trunk/prolint/ab/ trunk/prolint/ab/ab_event.p trunk/prolint/ab/ablint.p trunk/prolint/ab/custom_evnt.i Added: trunk/prolint/ab/ab_event.p =================================================================== --- trunk/prolint/ab/ab_event.p (rev 0) +++ trunk/prolint/ab/ab_event.p 2006-03-07 22:46:56 UTC (rev 255) @@ -0,0 +1,261 @@ +&ANALYZE-SUSPEND _VERSION-NUMBER UIB_v9r12 +&ANALYZE-RESUME +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure +/* ============================================================================= + file : prolint/ab/ab_event.p + purpose : Integration between Prolint and AppBuilder/UIB + ----------------------------------------------------------------------------- + Copyright (C) 2005 Carl Verbiest + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ========================================================================== */ + +/* *************************** Definitions ************************** */ + +def var vABWindow as widget-handle no-undo. +def var vABMenu as widget-handle no-undo. +def var vABProcedure as handle no-undo. + +/* + +{ src/adeuib/triggers.i } +*/ + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +&ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK + +/* ******************** Preprocessor Definitions ******************** */ + +&Scoped-define PROCEDURE-TYPE Procedure +&Scoped-define DB-AWARE no + + + +/* _UIB-PREPROCESSOR-BLOCK-END */ +&ANALYZE-RESUME + + + +/* *********************** Procedure Settings ************************ */ + +&ANALYZE-SUSPEND _PROCEDURE-SETTINGS +/* Settings for THIS-PROCEDURE + Type: Procedure + Allow: + Frames: 0 + Add Fields to: Neither + Other Settings: CODE-ONLY COMPILE + */ +&ANALYZE-RESUME _END-PROCEDURE-SETTINGS + +/* ************************* Create Window ************************** */ + +&ANALYZE-SUSPEND _CREATE-WINDOW +/* DESIGN Window definition (used by the UIB) + CREATE WINDOW Procedure ASSIGN + HEIGHT = 15 + WIDTH = 60. +/* END WINDOW DEFINITION */ + */ +&ANALYZE-RESUME + + + + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure + + +/* *************************** Main Block *************************** */ + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + + +/* ********************** Internal Procedures *********************** */ + +&IF DEFINED(EXCLUDE-ABLint_Current) = 0 &THEN + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ABLint_Current Procedure +PROCEDURE ABLint_Current : +/*------------------------------------------------------------------------------ + Purpose: + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + def var vProcContext as char no-undo init ?. + def var vFileName as char no-undo init ?. + run adeuib/_uibinfo.p(?, ?, "procedure", output vProcContext). + run adeuib/_uibinfo.p(vProcContext, ?, "file-name", output vFileName). + if vFileName <> ? then run prolint/ab/ablint.p(vFileName). + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ENDIF + +&IF DEFINED(EXCLUDE-ABLint_ExpandMenu) = 0 &THEN + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ABLint_ExpandMenu Procedure +PROCEDURE ABLint_ExpandMenu : +/*------------------------------------------------------------------------------ + Purpose: + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + def var vhMenu as widget-handle no-undo. + def var vhMenuItem as widget-handle no-undo. + def var count as int no-undo. + + assign vhMenu = vABMenu:first-child. + do while valid-handle(vhMenu) and replace(vhMenu:label, "&", "") <> "Compile": + vhMenu = vhMenu:next-sibling. + end. + if valid-handle(vhMenu) + then do: + create menu-item vhMenuItem + assign + label = "Pro&lint ..." + parent = vhMenu + triggers: + on choose persistent run ABLint_Current in this-procedure. + end triggers. + end. + do while valid-handle(vhMenu) and replace(vhMenu:label, "&", "") <> "Tools": + vhMenu = vhMenu:next-sibling. + end. + if valid-handle(vhMenu) + then do: + end. + do while valid-handle(vhMenu) and replace(vhMenu:label, "&", "") <> "Options": + vhMenu = vhMenu:next-sibling. + end. + if valid-handle(vhMenu) + then do: + create menu-item vhMenuItem + assign + label = "Pro&lint ..." + parent = vhMenu + triggers: + on choose persistent run ABLint_Options in this-procedure. + end triggers. + end. + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ENDIF + +&IF DEFINED(EXCLUDE-ABLint_Options) = 0 &THEN + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ABLint_Options Procedure +PROCEDURE ABLint_Options : +/*------------------------------------------------------------------------------ + Purpose: Start Prolint config + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ + /* lintcfg has a conditional parameter, try it both with & without */ + RUN prolint/lintcfg.w PERSISTENT NO-ERROR. + IF ERROR-STATUS:ERROR AND ERROR-STATUS:GET-NUMBER(1) = 3234 /* mismatched number of parameters */ + THEN RUN prolint/lintcfg.w PERSISTENT ("AppBuilder") NO-ERROR. +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ENDIF + +&IF DEFINED(EXCLUDE-ABLint_Startup) = 0 &THEN + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ABLint_Startup Procedure +PROCEDURE ABLint_Startup : +/*------------------------------------------------------------------------------ + Purpose: + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ +DEFINE INPUT PARAMETER p_product AS CHAR NO-UNDO. +DEFINE INPUT PARAMETER p_event AS CHAR NO-UNDO. +DEFINE INPUT PARAMETER p_context AS CHAR NO-UNDO. +DEFINE INPUT PARAMETER p_other AS CHAR NO-UNDO. +DEFINE OUTPUT PARAMETER p_ok AS LOGICAL NO-UNDO INITIAL TRUE. + + def var proclist as char no-undo. + def var count as int no-undo. + def var UIBWinX as int no-undo. + def var UIBWinY as int no-undo. + def var WZ-CHAR as char no-undo. + def var WIND-HND as handle no-undo. + def var PROC-HND as handle no-undo. + + assign + WIND-HND = widget-handle(p_Other) + PROC-HND = widget-handle(p_Context) + no-error. + + if valid-handle(vABWindow) then return. /* already running */ + assign + vABWindow = widget-handle(p_Other) + vABProcedure = widget-handle(p_Context). + if valid-handle(vABWindow) + then do: + assign + vABMenu = vABWindow:menu-bar + vABWindow:title = substitute("&1+&2", vABWindow:title, "Prolint":U). + run ABLint_ExpandMenu in this-procedure. + end. + +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ENDIF + +&IF DEFINED(EXCLUDE-AppBuilderEvent) = 0 &THEN + +&ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE AppBuilderEvent Procedure +PROCEDURE AppBuilderEvent : +/*------------------------------------------------------------------------------ + Purpose: + Parameters: <none> + Notes: +------------------------------------------------------------------------------*/ +DEFINE INPUT PARAMETER p_product AS CHAR NO-UNDO. +DEFINE INPUT PARAMETER p_event AS CHAR NO-UNDO. +DEFINE INPUT PARAMETER p_context AS CHAR NO-UNDO. +DEFINE INPUT PARAMETER p_other AS CHAR NO-UNDO. +DEFINE OUTPUT PARAMETER p_ok AS LOGICAL NO-UNDO INITIAL TRUE. + +CASE p_event: + WHEN "Startup" THEN RUN ABLint_Startup + (p_product, p_event, p_context, p_other, output p_ok). +END CASE. +END PROCEDURE. + +/* _UIB-CODE-BLOCK-END */ +&ANALYZE-RESUME + +&ENDIF + Added: trunk/prolint/ab/ablint.p =================================================================== --- trunk/prolint/ab/ablint.p (rev 0) +++ trunk/prolint/ab/ablint.p 2006-03-07 22:46:56 UTC (rev 255) @@ -0,0 +1,32 @@ +/* ========================================================================= + file : prolint/ab/ablint.p + purpose : Lint object from AppBuilder + by : Carl Verbiest + ------------------------------------------------------------------------- + + Copyright (C) 2005 Carl Verbiest \ + Jurjen Dijkstra + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ========================================================================= */ + +DEFINE INPUT PARAMETER pSourceFile AS CHARACTER NO-UNDO. + +RUN prolint/prolint.p (pSourceFile, + ?, + "AppBuilder":U, + TRUE). Added: trunk/prolint/ab/custom_evnt.i =================================================================== --- trunk/prolint/ab/custom_evnt.i (rev 0) +++ trunk/prolint/ab/custom_evnt.i 2006-03-07 22:46:56 UTC (rev 255) @@ -0,0 +1,50 @@ +/* ============================================================================= + file : prolint/ab/custom_evnt.i + purpose : (to be included in adecomm/_adeevnt.p) + setup integration between Prolint and AppBuilder/UIB + ----------------------------------------------------------------------------- + Copyright (C) 2005 Carl Verbiest + Credits to Jurjen Dijkstra, Gerry Winning, Ildefonzo Arocha + for the RTB integration which served as a basis for this + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + ========================================================================== */ + +DEFINE NEW GLOBAL SHARED VARIABLE vhAbCustFunc AS HANDLE NO-UNDO. +/* save search result for performance */ +DEFINE NEW GLOBAL SHARED VARIABLE vProlintPath AS CHAR NO-UNDO. +&IF (DEFINED(prolint_ab_custom_evnt_i)=0) &THEN + &GLOBAL-DEFINE prolint_ab_custom_evnt_i FOO + + IF vProlintPath = "" + THEN DO: + vProlintPath = SEARCH("prolint/ab/ab_event.p"). + END. + IF vProlintPath <> ? AND NOT VALID-HANDLE(vhAbCustFunc) + THEN DO: + RUN VALUE(vProlintPath) PERSISTENT SET vhAbCustFunc. + END. + IF VALID-HANDLE(vhAbCustFunc) + THEN RUN AppBuilderEvent IN vhAbCustFunc ( + INPUT p_product, + INPUT p_event, + INPUT p_context, + INPUT p_other, + OUTPUT p_ok + ). +&ENDIF + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2006-03-07 22:19:48
|
Revision: 254 Author: jurjen Date: 2006-03-07 14:19:42 -0800 (Tue, 07 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=254&view=rev Log Message: ----------- Roundtable integration: position of the Prolint button improved by Carl Verbiest Modified Paths: -------------- trunk/prolint/rtb/addmenu.p trunk/prolint/rtb/custom_evnt.i Modified: trunk/prolint/rtb/addmenu.p =================================================================== --- trunk/prolint/rtb/addmenu.p 2006-03-07 21:45:04 UTC (rev 253) +++ trunk/prolint/rtb/addmenu.p 2006-03-07 22:19:42 UTC (rev 254) @@ -2,6 +2,10 @@ file : protools/rtb/addmenu.p by : Jurjen Dijkstra purpose : add Prolint to the menu of the Roundtable desktop + History : + April 21, 2005 Carl Verbiest + * add prolint button @ original compile position & size to accomodate for + old-standard PPU (default font size) ============================================================================ */ {rtb/g/rtbglobl.i} @@ -12,7 +16,10 @@ DEFINE VARIABLE hItem AS HANDLE NO-UNDO. DEFINE VARIABLE hButton AS HANDLE NO-UNDO. DEFINE VARIABLE added AS LOGICAL NO-UNDO INITIAL FALSE. +DEFINE VARIABLE iLintX AS INTEGER NO-UNDO. +DEFINE VARIABLE hCompItem AS HANDLE NO-UNDO. + /* Grtb-proc-handle is procedure handle to RTB desktop. */ IF NOT VALID-HANDLE(Grtb-proc-handle) THEN RETURN. @@ -91,7 +98,9 @@ hItem:X = hItem:X + 24. IF hItem:NAME="BT-visual-diff":U THEN hItem:X = hItem:X + 24. - IF hItem:NAME="BT-compile":U THEN + IF hItem:NAME="BT-compile":U THEN ASSIGN + iLintX = hItem:X + hCompItem = hItem hItem:X = hItem:X + 24. IF hItem:NAME="BT-compile-xref":U THEN hItem:X = hItem:X + 24. @@ -102,10 +111,10 @@ ASSIGN FRAME = hFrame NAME = "BT-prolint":U TOOLTIP = "Prolint Object" - X = 179 - Y = 4 - WIDTH-PIXELS = 24 - HEIGHT-PIXELS = 22 + X = iLintX /* 179 */ + Y = hCompItem:Y /* 4 */ + WIDTH-PIXELS = hCompItem:WIDTH-PIXELS /* 24 */ + HEIGHT-PIXELS = hCompItem:HEIGHT-PIXELS /* 22*/ FLAT-BUTTON = TRUE SENSITIVE = TRUE VISIBLE = TRUE Modified: trunk/prolint/rtb/custom_evnt.i =================================================================== --- trunk/prolint/rtb/custom_evnt.i 2006-03-07 21:45:04 UTC (rev 253) +++ trunk/prolint/rtb/custom_evnt.i 2006-03-07 22:19:42 UTC (rev 254) @@ -36,8 +36,11 @@ DO WHILE PROGRAM-NAME( iCountStack ) <> ?: IF INDEX( PROGRAM-NAME( iCountStack ) , "_rtb.p" ) <> 0 OR - INDEX( PROGRAM-NAME( iCountStack ) , "_rtb.r" ) <> 0 THEN - lFound_rtb = TRUE. + INDEX( PROGRAM-NAME( iCountStack ) , "_rtb.r" ) <> 0 or + INDEX( PROGRAM-NAME( iCountStack ) , "rtbstart.p" ) <> 0 OR + index( PROGRAM-NAME( iCountStack ) , "rtbstart.r" ) <> 0 + THEN + lFound_rtb = TRUE. iCountStack = iCountStack + 1. END. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2006-03-07 21:45:29
|
Revision: 253 Author: jurjen Date: 2006-03-07 13:45:04 -0800 (Tue, 07 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=253&view=rev Log Message: ----------- some files added to SubVersion that seemed to be missing, perhaps they got lost during the import from CVS Added Paths: ----------- trunk/prolint/help/rules/customrule.htxt trunk/prolint/help/standard.css trunk/prolint/settings/exteditor.cfg trunk/prolint/settings/readme.htm trunk/prolint/turbolint/turbolint.dll Property Changed: ---------------- trunk/prolint/help/ trunk/prolint/help/rules/ Property changes on: trunk/prolint/help ___________________________________________________________________ Name: svn:ignore + *.htm Property changes on: trunk/prolint/help/rules ___________________________________________________________________ Name: svn:ignore + *.htm Added: trunk/prolint/help/rules/customrule.htxt =================================================================== --- trunk/prolint/help/rules/customrule.htxt (rev 0) +++ trunk/prolint/help/rules/customrule.htxt 2006-03-07 21:45:04 UTC (rev 253) @@ -0,0 +1,5 @@ +<h1>This appears to be a CUSTOM rule</h1> + +The help generator could not find help for this rule, sorry. + + Added: trunk/prolint/help/standard.css =================================================================== --- trunk/prolint/help/standard.css (rev 0) +++ trunk/prolint/help/standard.css 2006-03-07 21:45:04 UTC (rev 253) @@ -0,0 +1,65 @@ + +BODY { +font-family: "Arial"; +font-size: 10pt; +} + +P { +font-family: "Arial"; +font-size: 10pt; +} + +TD { +font-family: "Arial"; +font-size: 10pt; +} + +H1 { +font-size: 15pt; +color: 800040; +text-align: Left; +page-break-before: Always; +} + +H2 { +color: BB0000; +font-size : 12pt; +text-align: Left; +} + +H3 { +color: BB0000; +font-size : 12pt; +text-align: Left; +} + +PRE { +font-family: "Courier New, Courier"; +} + +A:hover { +color: #ff4444; +} + +.example { +background-color : ECECEC; +border : 0; +} + +.src-comment { +color : 006600; +font-style: italic; +} +.src-char { +color : FF0000; +} +.src-prep { +color : 993333; +} +.src-keyword { +color : 000099; +} +.src-number { +color : FF0000; +} + Added: trunk/prolint/settings/exteditor.cfg =================================================================== --- trunk/prolint/settings/exteditor.cfg (rev 0) +++ trunk/prolint/settings/exteditor.cfg 2006-03-07 21:45:04 UTC (rev 253) @@ -0,0 +1,42 @@ +"C:\Program Files\Saig\Ed4W\ED32.exe" +-1 -l &2 "&1" + + +only the first two lines are used by Prolint. All other lines, +including this one, are just comments. +This file contains the shell commands used by Prolint for opening +a sourcefile in a text editor. The first line is typically the command, the +second line typically contains command-line arguments for the command. + &1 is replaced by the name of the sourcefile to open + &2 is replaced by the line number to put the cursor on + +Example configurations for various editors: copy the two lines for the +editor of your choice to the top of this file (so they are lines 1 and 2). +Remember, if a filename contains spaces it is probably required to put that +filename between quotes. + + +UltraEdit-32: +------------- +"C:\Program Files\UltraEdit\UEDIT32.EXE" +"&1/&2" + + +Ed for Windows, version 3x: +--------------------------- +c:\ed4w\ed4w.exe +-1 -l &2 "&1" + + +Ed for Windows, version 4x: +--------------------------- +"C:\Program Files\Saig\Ed4W\ED32.exe" +-1 -l &2 "&1" + + +TextPad 4.5: +------------ +"C:\Program Files\TextPad 4\TextPad.exe" +"&1"(&2) + + \ No newline at end of file Added: trunk/prolint/settings/readme.htm =================================================================== --- trunk/prolint/settings/readme.htm (rev 0) +++ trunk/prolint/settings/readme.htm 2006-03-07 21:45:04 UTC (rev 253) @@ -0,0 +1,10 @@ +<html> +<head> +<link rel="STYLESHEET" href="../help/standard.css" type="text/css"> +</head> +<body> +<h1>Settings and Profiles</h1> + +see <a href="../help/settings.htm">../help/settings.htm</a> + +</body> \ No newline at end of file Added: trunk/prolint/turbolint/turbolint.dll =================================================================== (Binary files differ) Property changes on: trunk/prolint/turbolint/turbolint.dll ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2006-03-06 23:38:17
|
Revision: 252 Author: jurjen Date: 2006-03-06 15:38:02 -0800 (Mon, 06 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=252&view=rev Log Message: ----------- new rule "nameconv" submitted by Carl Verbiest Modified Paths: -------------- trunk/prolint/rules/rules.d Added Paths: ----------- trunk/prolint/regrtest/vardef.p trunk/prolint/rules/namecheck.p trunk/prolint/rules/nameconv.i trunk/prolint/rules/nameconv.p Added: trunk/prolint/regrtest/vardef.p =================================================================== --- trunk/prolint/regrtest/vardef.p (rev 0) +++ trunk/prolint/regrtest/vardef.p 2006-03-06 23:38:02 UTC (rev 252) @@ -0,0 +1,26 @@ +/* +A grabbag of variable definitions +*/ + +def input parameter InputHandle as handle no-undo. +def param buffer bCustomer for Customer. + +def var Name like Customer.Name no-undo. + +message "Question" + view-as alert-box info buttons ok-cancel update answer as log. + +procedure proc1: +/* +Purpose : +*/ + def input parameter MyChar as char no-undo. + def var currentFocus as widget no-undo. + +end procedure. /* proc1 */ + +function func1 returns logical + (input funcparchar as char, + buffer bfCustomer for Customer, + output errmsg as char). +end function. Added: trunk/prolint/rules/namecheck.p =================================================================== --- trunk/prolint/rules/namecheck.p (rev 0) +++ trunk/prolint/rules/namecheck.p 2006-03-06 23:38:02 UTC (rev 252) @@ -0,0 +1,80 @@ +/* ----------------------------------------------------------------------------- + file : prolint/rules/namecheck.p + by : Carl Verbiest + purpose : Default logic for naming convention checks, + copy this file to prolint/custom/rules and adapt to your convention + ----------------------------------------------------------------------------- + + Copyright (C) 2005 Carl Verbiest + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + --------------------------------------------------------------------------------- */ + +{prolint/ruleparams.i} +{prolint/rules/nameconv.i} + +PROCEDURE ObjectNameCheck: + DEFINE PARAMETER BUFFER btt_Object FOR tt_Object. + + DEFINE VARIABLE lPrefix AS CHARACTER NO-UNDO. + DEFINE VARIABLE lcaseName AS CHARACTER NO-UNDO CASE-SENSITIVE. + DEFINE VARIABLE lProcName AS CHARACTER NO-UNDO. + + ASSIGN + lProcName = btt_Object.ObjScope + lCaseName = btt_Object.ObjName. + CASE btt_Object.ObjType: + WHEN "INPUT":U THEN lPrefix = "i". + WHEN "OUTPUT":U THEN lPrefix = "o". + WHEN "INPUTOUTPUT":U THEN lPrefix = "io". + OTHERWISE DO: + IF lProcName = "MAIN":U THEN + lPrefix = "g". + ELSE lPrefix = "l". + END. + END CASE. + + if keyword-all(btt_Object.ObjName) ne ? then + RUN PublishResult {&insuper} ( + input compilationunit, + input btt_Object.sourcefile, + input btt_Object.linenumber, + input substitute('&3 in &6 is a Progress keyword':T, + btt_Object.ParamType, + btt_Object.ObjType, + btt_Object.ObjName, + btt_Object.ObjDataType, + btt_Object.ObjScope, + btt_Object.ProcName, + lPrefix), + input rule_id ). + IF NOT lcaseName BEGINS lPrefix THEN + RUN PublishResult {&insuper} ( + input compilationunit, + input btt_Object.sourcefile, + input btt_Object.linenumber, + input substitute('&1 &2 &3 &4 scope &5 &6 should start with "&7"':T, + btt_Object.ParamType, + btt_Object.ObjType, + btt_Object.ObjName, + btt_Object.ObjDataType, + btt_Object.ObjScope, + btt_Object.ProcName, + lPrefix), + input rule_id ). + +END PROCEDURE. Added: trunk/prolint/rules/nameconv.i =================================================================== --- trunk/prolint/rules/nameconv.i (rev 0) +++ trunk/prolint/rules/nameconv.i 2006-03-06 23:38:02 UTC (rev 252) @@ -0,0 +1,16 @@ +{prolint/ttprocedure.i} + +/* tt_object contains all variables and parameters, defined in CompilationUnit */ +def temp-table tt_object no-undo + field sourcefile as char /* sourcefile where object was defined */ + field linenumber as inte /* linenumber in sourcefile where object was defined */ + field ProcRowid as rowid /* function|procedure where object was defined */ + field ProcName as char /* function|procedure where object was defined */ + field ParamType as char /* VARIABLE|STREAM|INPUT|INPUTOUTPUT|OUTPUT|PARAMETER */ + field objDataType as char + field objScope as char /* MAIN|LOCAL|SHARED|GLOBALSHARED */ + field objType as char /* parameter|variable */ + field objName as char /* identifier */ + field relName as char /* 2nd identifier : table-name for buffer, field-name for like */ + index idx_objname as primary objname ProcRowid + . Added: trunk/prolint/rules/nameconv.p =================================================================== --- trunk/prolint/rules/nameconv.p (rev 0) +++ trunk/prolint/rules/nameconv.p 2006-03-06 23:38:02 UTC (rev 252) @@ -0,0 +1,402 @@ +/* ----------------------------------------------------------------------------- + file : prolint/rules/nameconv.p + by : Carl Verbiest + Credits : Jurjen Dijkstra, John Green, Breck Fairley , + this rule started as a copy varusage.p + purpose : scan for all identifiers, gather scope information and + call a custom procedure to check the names against a coding convention + ----------------------------------------------------------------------------- + + Copyright (C) 2005 Carl Verbiest + + This file is part of Prolint. + + Prolint is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + Prolint is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with Prolint; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + --------------------------------------------------------------------------------- */ + +{prolint/ruleparams.i} +{prolint/rules/nameconv.i} + +def var child as inte no-undo. +def var grandchild as inte no-undo. +def var greatgrandchild as inte no-undo. +def var hCheckProc as handle no-undo. +def var checkProcName as char no-undo. +def buffer btt_procedure for tt_procedure. + +checkProcName = search("prolint/custom/rules/namecheck.p"). +if checkProcName = ? +then checkProcName = search("prolint/rules/namecheck.p"). +if checkProcName = ? +then return error. /* nothing to do */ + +/* load custom naming check and pass all parameters */ +run value(checkProcName) persistent set hCheckProc( + INPUT xreffile , + INPUT listingfile , + INPUT hLintSuper , + INPUT hparser , + INPUT hTopnode , + INPUT compilationunit, + INPUT severity , + INPUT rule_id , + INPUT pragma_number , + INPUT ignoreAB , + INPUT hpRulePersist + ). + +MAIN-BLK: +do on error undo MAIN-BLK, leave MAIN-BLK: + + assign + child = parserGetHandle() + grandchild = parserGetHandle() + greatgrandchild = parserGetHandle(). + + /* get the list of all functions and procedures */ + run ProcedureListGet in hLintSuper (output table tt_procedure). + + /* AIM: To build a complete list of tt_object (all variables and */ + /* parameters). */ + + /* STEP 1: Remove any procedures that are in a SUPER procedure, */ + /* within a HANDLE or EXTERNAL... */ + /* Collect parameters for prototypes */ + /* (IN SUPER, IN prochandle, EXTERNAL, ...). */ + /* We don't care at all about these parameters, so we will */ + /* delete the tt_objects anyway. */ + /* We only use this step because we need to set the "already*/ + /* looked at" attributes. */ + + for each tt_procedure + where tt_procedure.prototype : + + /* create a list of variables and parameters, store them in tt_object */ + run searchNode {&insuper} ( + input tt_procedure.startnode, + input "BuildList":U, + input "DEFINE":U ). + + &IF {&dlc-version}<9 &THEN + for each tt_object : + delete tt_object. + end. + &ELSE + empty temp-table tt_object. + &ENDIF + + end. + + + /* STEP 2: Build a list of all variables/parameters within this */ + /* compilation unit and its internal procedures. */ + /* First, get local vars and params in internal */ + /* procs/functions. Be sure to mark them as "already looked */ + /* at" so they are skipped when querying the Program scope. */ + + for each tt_procedure + where not tt_procedure.prototype : + + /* create a list of variables and parameters, store them in tt_object */ + run searchNode {&insuper} ( + input tt_procedure.startnode, + input "BuildList":U, + input "DEFINE":U ). + + /* if tt_procedure is a function, we must do some extra work to get parameters */ + if tt_procedure.proctype = "FUNCTION":U then + run AddFunctionParameters(input tt_procedure.startnode). + + end. + + /* Second, add the objects at the program scope. */ + /* Because we have set pragma_number attributes we are */ + /* able to skip variabless and parameters at local scopes. */ + + release tt_procedure no-error. /* we must have not available */ + run searchNode {&insuper} ( + input hTopNode, + input "BuildList":U, + input "DEFINE":U ). + + + /* Inspect the top "Program_root" scope for remaining objects. */ + /* This is very similar to the loop for a single tt_procedure, but */ + /* we must be sure to skip all vars/params which already past the */ + /* first loop. The pragma_number attribute assists us here. */ + + release tt_procedure no-error. /* we must have not available */ + + /* We are done. Release all handles as we don't need kids anymore. */ + parserReleaseHandle(child). + parserReleaseHandle(grandchild). + parserReleaseHandle(greatgrandchild). + + /* Start outputting the results */ + for each tt_object : + RUN ObjectNameCheck in hCheckProc (BUFFER tt_Object). + end. + +end. /* MAIN-BLK */ +delete procedure hCheckProc. + + +procedure BuildList : +/* purpose : recognize variable or parameter and add it to tt_object */ + +def input param theNode as inte no-undo. +def output param AbortSearch as logi no-undo initial No. +def output param SearchChildren as logi no-undo. + +def var varname as char no-undo. +def var relName as char no-undo. +def var vartype as char no-undo. +def var nodetype as char no-undo. +def var Datatype as char no-undo. +def var Scope as char no-undo. +def var ParamType as char no-undo. + + + /* set an attrib to remember we have been here before */ + parserAttrSet(theNode, pragma_number ,1). + + if available tt_procedure and tt_procedure.prototype then + return. + + assign + SearchChildren = No + nodetype = parserNodeFirstChild(theNode,child) + ParamType = "". + + do while nodetype <> "" : + + case nodetype : + when "VARIABLE":U + then assign vartype = 'VARIABLE':U. + when "INPUT":U or + when "OUTPUT":U or + when "INPUTOUTPUT":U + then assign ParamType = nodetype. + when "PARAMETER":U + then assign vartype = 'PARAMETER':U. + when "ID":U + then if varname = "":U + then varname = parserGetNodeText(child). + when "BUFFER":U or + when "TABLE":U + then datatype = nodetype. + when "RECORD_NAME":U + then if relName = "":U + then relName = parserGetNodeText(child). + when "AS":U + then do: + datatype = parserNodeFirstChild(child,grandchild). + end. + when "GLOBAL" then Scope = "GLOBALSHARED":U. + when "SHARED" then if Scope = "" then Scope = "SHARED":U. + end case. + + nodetype = parserNodeNextSibling(child,child). + end. + if Scope = "" + then Scope = if available tt_Procedure then "LOCAL":U else "MAIN". + /* add to list tt_object */ + run AddToList ( + input RelativeFileName(parserGetNodeFilename(theNode)), + input parserGetNodeLine(theNode), + input vartype, + input varname, + input relName, + input Datatype, + input Scope, + input ParamType ). + +end procedure. + +procedure BuildListFunction : +/* purpose : function variant of BuildList, paramtype already known, recognize parameter and add it to tt_object */ + +def input param ParamType as char no-undo. +def input param theNode as inte no-undo. +def output param AbortSearch as logi no-undo initial No. +def output param SearchChildren as logi no-undo. + +def var varname as char no-undo. +def var vartype as char no-undo. +def var relName as char no-undo. +def var nodetype as char no-undo. +def var Datatype as char no-undo. +def var Scope as char no-undo. + + + /* set an attrib to remember we have been here before */ + parserAttrSet(theNode, pragma_number ,1). + + if available tt_procedure and tt_procedure.prototype then + return. + + assign + SearchChildren = No + nodetype = parserNodeFirstChild(theNode,child) + . + + do while nodetype <> "" : + + case nodetype : + when "ID":U + then if varname = "":U + then varname = parserGetNodeText(child). + when "BUFFER":U or + when "TABLE":U + then datatype = nodetype. + when "RECORD_NAME":U + then if relName = "":U + then relName = parserGetNodeText(child). + when "AS":U + then do: + datatype = parserNodeFirstChild(child,grandchild). + end. + when "GLOBAL" then Scope = "GLOBALSHARED":U. + when "SHARED" then if Scope = "" then Scope = "SHARED":U. + end case. + + nodetype = parserNodeNextSibling(child,child). + end. + if Scope = "" + then Scope = if available tt_Procedure then "LOCAL":U else "MAIN". + if vartype = "" then vartype = "PARAMETER". + /* add to list tt_object */ + run AddToList ( + input RelativeFileName(parserGetNodeFilename(theNode)), + input parserGetNodeLine(theNode), + input vartype, + input varname, + input relName, + input Datatype, + input Scope, + input ParamType ). + +end procedure. + +procedure AddToList : +/* purpose: create a new record tt_object */ + +def input param pSourceFile as char no-undo. +def input param pLine as inte no-undo. +def input param pType as char no-undo. +def input param pName as char no-undo. +def input param prelName as char no-undo. +def input param pDatatype as char no-undo. +def input param pScope as char no-undo. +def input param pParamType as char no-undo. + + + create tt_object. + assign tt_object.sourcefile = pSourceFile + tt_object.linenumber = pLine + tt_object.ParamType = pParamType + tt_object.objType = pType + tt_object.objName = pName + tt_object.relName = prelName + tt_object.objDataType = pDatatype + tt_object.objScope = pScope + tt_object.ProcRowid = if available tt_procedure then rowid(tt_procedure) else ? + tt_object.ProcName = if available tt_procedure then tt_procedure.procName else compilationunit. + + +end procedure. + + +procedure AddFunctionParameters : +/* purpose: add parameters for user-defined functions to tt_object */ + +def input param thenode as inte no-undo. + +def var paramType as char no-undo. +def var paramID as inte no-undo. +def var nodetype as char no-undo. +def var lDataType as char no-undo. +def var lAbort as log no-undo. +def var lSearchChild as log no-undo. + + assign + nodetype = parserNodeFirstChild(thenode, child) + paramID = parserGetHandle(). + + /* First find the Parameter_list */ + do while nodetype <> "" and nodetype <> "Parameter_list":U: + nodetype = parserNodeNextSibling(child,child). + end. + + /* Now find each input, output, and inputoutput parameter node. + We aren't interested in buffer parameter nodes. */ + if nodetype = "Parameter_list":U then + do: /* have parameter list */ + nodetype = parserNodeFirstChild(child,child). + do while nodetype <> "": + paramType = nodetype. + /* TOdo: decide if we should ignore output and inputoutput parameters */ + if lookup(paramType, "INPUT,OUTPUT,INPUTOUTPUT,BUFFER":U) > 0 then + do: + run BuildListFunction(paramType, child, output lAbort, output lSearchChild). + /* + /* The first child is either ID or table. We only want ID. */ + if parserNodeFirstChild(child, paramID) = "ID":U then + + run AddToList ( + input RelativeFileName(parserGetNodeFilename(paramID)), + input parserGetNodeLine(paramID), + input "parameter":U, + input parserGetNodeText(paramID), + input "", /* NYI */ + input lDataType, + input "LOCAL":U, + input paramType ). + */ + + end. + nodetype = parserNodeNextSibling(child,child). + end. + end. + parserReleaseHandle(paramID). + +end procedure. + + +procedure ProcessFieldRUsage : +/* purpose : a Field_ref has a child with nodetype="ID". + This ID is an used but not necessarily accessed variable */ + +def input param theNode as inte no-undo. + + + /* set an attrib, to remember we have been here before */ + parserAttrSet(theNode, pragma_number ,1). + + /* From the tree spec: + * #(Field_ref (input)? #((FRAME|BROWSE) ID)? ID (array_subscript)? ) + */ + FIND-ID-BLK: + do: + if parserNodeFirstChild(theNode, greatgrandchild) = "ID":U then + leave FIND-ID-BLK. + if parserNodeNextSibling(greatgrandchild, greatgrandchild) = "ID":U then + leave FIND-ID-BLK. + parserNodeNextSibling(greatgrandchild, greatgrandchild). + end. /* FIND-ID-BLK */ + run AddDetectedUsage(greatgrandchild,No). + return. + +end procedure. Modified: trunk/prolint/rules/rules.d =================================================================== --- trunk/prolint/rules/rules.d 2006-03-06 23:08:11 UTC (rev 251) +++ trunk/prolint/rules/rules.d 2006-03-06 23:38:02 UTC (rev 252) @@ -28,6 +28,7 @@ "maxchar" 7 yes no no no no "string constant too long for Tranman" "Internationalization" "message" 7 yes no no no yes "use MESSAGE in debug-mode only" "Coding standard" "messagetype" 7 yes no no yes no "Identify any alert box without an alert type" "Coding standard" +"nameconv" 5 yes no no yes yes "Naming convention check" "Style" "nobrackets" 1 yes no no no no "handle:method should have brackets" "Style" "nocomment" 3 yes no no yes no "each PROCEDURE or FUNCTION must start with a comment" "Style" "noeffect" 8 yes no no no no "statement has no effect" "Bug" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ju...@us...> - 2006-03-06 23:08:17
|
Revision: 251 Author: jurjen Date: 2006-03-06 15:08:11 -0800 (Mon, 06 Mar 2006) ViewCVS: http://svn.sourceforge.net/prolint/?rev=251&view=rev Log Message: ----------- Only warn about adecomm.pl when desktop.w is not compiled Modified Paths: -------------- trunk/prolint/desktop.w Modified: trunk/prolint/desktop.w =================================================================== --- trunk/prolint/desktop.w 2006-01-10 00:42:02 UTC (rev 250) +++ trunk/prolint/desktop.w 2006-03-06 23:08:11 UTC (rev 251) @@ -650,14 +650,17 @@ &IF {&dlc-version}<>8 &THEN IF SEARCH("adecomm/adestds.i":U)=? OR SEARCH("adecomm/peditor.i":U)=? THEN DO: - MESSAGE "Sorry you will need to extract src/adecomm.pl" SKIP - "I will now show you a help file with instructions" - VIEW-AS ALERT-BOX ERROR. + /* Only give error if not compiled */ + IF SEARCH("prolint/desktop.r":U)=? THEN DO: + MESSAGE "Sorry you will need to extract src/adecomm.pl" SKIP + "I will now show you a help file with instructions" + VIEW-AS ALERT-BOX ERROR. - FILE-INFO:FILE-NAME = "prolint/help/adecomm.htm":U. - htmlfile = file-info:FULL-PATHNAME. - IF htmlfile<>? THEN - RUN prolint/openhtml.p(htmlfile). + FILE-INFO:FILE-NAME = "prolint/help/adecomm.htm":U. + htmlfile = file-info:FULL-PATHNAME. + IF htmlfile<>? THEN + RUN prolint/openhtml.p(htmlfile). + END. END. &ENDIF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: John A. G. <joh...@us...> - 2006-01-10 00:42:11
|
Update of /cvsroot/prolint/prolint/rules/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31963 Modified Files: nobrackets.i Log Message: Added some more methods that are commonly used without parens: BUFFER-CREATE,BUFFER-RELEASE,QUERY-CLOSE Index: nobrackets.i =================================================================== RCS file: /cvsroot/prolint/prolint/rules/inc/nobrackets.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nobrackets.i 31 Oct 2003 21:39:24 -0000 1.2 --- nobrackets.i 10 Jan 2006 00:42:02 -0000 1.3 *************** *** 30,33 **** DEFINE VARIABLE nobracketlist AS CHARACTER NO-UNDO ! INITIAL "QUERY-OPEN,GET-NEXT,GET-FIRST,GET-PREV,GET-LAST,CLOSE-QUERY,SELECT-ALL":U. --- 30,33 ---- DEFINE VARIABLE nobracketlist AS CHARACTER NO-UNDO ! INITIAL "QUERY-OPEN,GET-NEXT,GET-FIRST,GET-PREV,GET-LAST,CLOSE-QUERY,SELECT-ALL,BUFFER-CREATE,BUFFER-RELEASE,QUERY-CLOSE":U. |
From: John A. G. <joh...@us...> - 2006-01-04 01:55:20
|
Update of /cvsroot/prolint/prolint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11353 Modified Files: prolint.p Log Message: Added a retry to the COMPILE statement. Now tries compiling both with and without the STREAM-IO option. Reduced the number of COMPILE statements from 3 to 1, by taking advantage of a feature of the COMPILE..XREF/LISTING VALUE(...) syntax. Index: prolint.p =================================================================== RCS file: /cvsroot/prolint/prolint/prolint.p,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** prolint.p 4 May 2005 21:07:33 -0000 1.28 --- prolint.p 4 Jan 2006 01:55:09 -0000 1.29 *************** *** 51,54 **** --- 51,55 ---- DEFINE VARIABLE HasProparse AS LOGICAL NO-UNDO INITIAL YES. DEFINE VARIABLE HasJpplus AS LOGICAL NO-UNDO INITIAL NO. + DEFINE VARIABLE needCompilerStreamIO AS LOGICAL NO-UNDO INITIAL NO. DEFINE VARIABLE NeedListing AS LOGICAL NO-UNDO INITIAL NO. DEFINE VARIABLE NeedXref AS LOGICAL NO-UNDO INITIAL NO. *************** *** 742,746 **** DEFINE VARIABLE i1 AS INTEGER NO-UNDO. ! DEFINE VARIABLE cErrorMsg AS CHARACTER NO-UNDO. ASSIGN --- 743,748 ---- DEFINE VARIABLE i1 AS INTEGER NO-UNDO. ! DEFINE VARIABLE compilerLoopNum AS INTEGER NO-UNDO. ! DEFINE VARIABLE cErrorMsg AS CHARACTER NO-UNDO INITIAL "". ASSIGN *************** *** 753,797 **** - special parameters might be required, like translation params */ {prolint/publish_char.i "Prolint_Status_Action" ""compiling..."":U} ! ! IF NeedListing AND NeedXref THEN ! COMPILE VALUE(p-SourceFile) ! LISTING VALUE(listingfile) PAGE-SIZE 127 PAGE-WIDTH 255 ! XREF VALUE(xreffile) ! NO-ERROR. ! ELSE ! IF NeedListing THEN COMPILE VALUE(p-SourceFile) ! LISTING VALUE(listingfile) PAGE-SIZE 127 PAGE-WIDTH 255 NO-ERROR. - ELSE - IF NeedXref THEN - COMPILE VALUE(p-SourceFile) - XREF VALUE(xreffile) - NO-ERROR. ! IF NeedListing OR NeedXref THEN ! IF COMPILER:ERROR THEN DO: ! /* ignore error 6430 "r-code exists but SAVE was not specified" ! and error 4345 : &MESSAGE output */ ! cErrorMsg = "". ! DO i1=1 TO ERROR-STATUS:NUM-MESSAGES: ! IF ERROR-STATUS:GET-NUMBER(i1) NE 6430 THEN ! IF ERROR-STATUS:GET-NUMBER(i1) NE 4345 THEN DO: ! p-ErrorMessage = "compile failed":T. ! /* collect compiler messages for ED for Windows. ! can't publish them yet, because that would ! change the contents of ERROR-STATUS:... */ ! cErrorMsg = cErrorMsg + ERROR-STATUS:GET-MESSAGE(i1) + "~n":U. ! END. ! END. ! &IF {&pubsub} &THEN ! if cErrorMsg<>"" then ! PUBLISH "WriteToEd4Windows":U (cErrorMsg). /* just in case ED is listening */ ! &ENDIF ! IF p-ErrorMessage NE "" THEN DO: ! p-SourceFile = DYNAMIC-FUNCTION("RelativeFilename":U IN hLintSuper, p-SourceFile). ! {prolint/publish_result.i} (p-SourceFile, p-SourceFile,"0":U, p-ErrorMessage, "compiler":U, 9). ! END. ! END. /* parse sourcefile in proparse.dll */ --- 755,802 ---- - special parameters might be required, like translation params */ {prolint/publish_char.i "Prolint_Status_Action" ""compiling..."":U} ! ! IF NeedListing OR NeedXref THEN compiler-loop: DO compilerLoopNum = 1 TO 2: ! COMPILE VALUE(p-SourceFile) ! STREAM-IO = needCompilerStreamIO ! /* value of ? disables xref or listing */ ! LISTING VALUE(IF NeedListing THEN listingfile ELSE ?) ! PAGE-SIZE 127 PAGE-WIDTH 255 ! XREF VALUE(IF NeedXref THEN xreffile ELSE ?) NO-ERROR. ! ASSIGN p-ErrorMessage = "":U. ! IF COMPILER:ERROR THEN error-loop: DO i1=1 TO ERROR-STATUS:NUM-MESSAGES: ! /* ignore error 6430 "r-code exists but SAVE was not specified" ! and error 4345 : &MESSAGE output */ ! IF ERROR-STATUS:GET-NUMBER(i1) EQ 6430 OR ERROR-STATUS:GET-NUMBER(i1) EQ 4345 ! THEN NEXT error-loop. ! p-ErrorMessage = "compile failed":T. ! /* Flip the STREAM-IO flag. On the first failed compile, it ! gets flipped. On the second failed compile, we flip it again, ! so that it's back to its value before we tried this compile unit. */ ! ASSIGN needCompilerStreamIO = NOT needCompilerStreamIO. ! /* collect compiler messages for ED for Windows. ! can't publish them yet, because that would ! change the contents of ERROR-STATUS:... ! We might fail two attempts at compiling. In that case, we ! want to show the first set of compiler error messages, because ! the second compile might fail just because the STREAM-IO flag is ! set wrong, and that wouldn't be a helpful error message. */ ! IF compilerLoopNum EQ 1 THEN ! ASSIGN cErrorMsg = cErrorMsg + ERROR-STATUS:GET-MESSAGE(i1) + "~n":U. ! END. /* error-loop */ ! ! IF p-ErrorMessage EQ "":U THEN LEAVE compiler-loop. ! ! IF compilerLoopNum > 1 THEN DO: ! &IF {&pubsub} &THEN ! PUBLISH "WriteToEd4Windows":U (cErrorMsg). /* just in case ED is listening */ ! &ENDIF ! p-SourceFile = DYNAMIC-FUNCTION("RelativeFilename":U IN hLintSuper, p-SourceFile). ! {prolint/publish_result.i} (p-SourceFile, p-SourceFile,"0":U, p-ErrorMessage, "compiler":U, 9). ! END. ! ! END. /* compiler-loop */ /* parse sourcefile in proparse.dll */ |
From: Jurjen D. <ju...@us...> - 2005-12-16 00:19:05
|
Update of /cvsroot/prolint/prolint/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27430 Modified Files: adecomm.htxt Log Message: helpfile: path in prolib command fixed Index: adecomm.htxt =================================================================== RCS file: /cvsroot/prolint/prolint/help/adecomm.htxt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** adecomm.htxt 12 Apr 2004 21:55:02 -0000 1.1 --- adecomm.htxt 16 Dec 2005 00:18:54 -0000 1.2 *************** *** 15,19 **** set DLC=c:\progra~1\progress <br> ! c:\progra~1\bin\prolib ..\src\adecomm.pl -extract *.i </pre></td></tr></table> --- 15,19 ---- set DLC=c:\progra~1\progress <br> ! c:\progra~1\progress\bin\prolib ..\src\adecomm.pl -extract *.i </pre></td></tr></table> |
From: John A. G. <joh...@us...> - 2005-05-04 21:07:42
|
Update of /cvsroot/prolint/prolint In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18708 Modified Files: prolint.p Log Message: On HP-UX, the shared library file name is "libproparse.sl". Index: prolint.p =================================================================== RCS file: /cvsroot/prolint/prolint/prolint.p,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** prolint.p 18 Dec 2004 00:22:07 -0000 1.27 --- prolint.p 4 May 2005 21:07:33 -0000 1.28 *************** *** 95,99 **** Add a warning to the logfile to say proparse is required */ IF opsys="UNIX":U THEN ! hasProparse = NOT( SEARCH("proparse/libproparse.so":U)=? ). ELSE hasProparse = NOT( SEARCH("proparse/proparse.dll":U)=? ). --- 95,99 ---- Add a warning to the logfile to say proparse is required */ IF opsys="UNIX":U THEN ! hasProparse = NOT( SEARCH("proparse/libproparse.so":U)=? AND SEARCH("proparse/libproparse.sl":U)=? ). ELSE hasProparse = NOT( SEARCH("proparse/proparse.dll":U)=? ). |
From: John A. G. <joh...@us...> - 2005-04-20 17:56:39
|
Update of /cvsroot/prolint/prolinteclipse/src/testdata/simpleunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15493 Modified Files: noeffect.expect Log Message: Fix to 'expect' files - added rule name to problem messages. Index: noeffect.expect =================================================================== RCS file: /cvsroot/prolint/prolinteclipse/src/testdata/simpleunit/noeffect.expect,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** noeffect.expect 20 Apr 2005 17:26:48 -0000 1.1.1.1 --- noeffect.expect 20 Apr 2005 17:56:29 -0000 1.2 *************** *** 1,4 **** ! noeffect simpleunit/noeffect.p 23 1 Statement has no effect ! noeffect simpleunit/noeffect.p 24 12 Statement has no effect ! noeffect simpleunit/noeffect.p 27 1 Statement has no effect ! noeffect simpleunit/noeffect.p 47 15 Statement has no effect --- 1,4 ---- ! noeffect simpleunit/noeffect.p 23 1 noeffect: Statement has no effect ! noeffect simpleunit/noeffect.p 24 12 noeffect: Statement has no effect ! noeffect simpleunit/noeffect.p 27 1 noeffect: Statement has no effect ! noeffect simpleunit/noeffect.p 47 15 noeffect: Statement has no effect |
From: John A. G. <joh...@us...> - 2005-04-20 17:55:57
|
Update of /cvsroot/prolint/prolinteclipse/src/testdata/abbrevnames In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15038 Modified Files: expect.txt Log Message: Fix to 'expect' files - added rule name to problem messages. Index: expect.txt =================================================================== RCS file: /cvsroot/prolint/prolinteclipse/src/testdata/abbrevnames/expect.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** expect.txt 20 Apr 2005 17:26:48 -0000 1.1.1.1 --- expect.txt 20 Apr 2005 17:55:47 -0000 1.2 *************** *** 1,3 **** ! abbrevname abbrevnames/displaypostal.i 1 9 postal is abbreviated ! abbrevname abbrevnames/customer.p 1 12 cust is abbreviated ! abbrevname abbrevnames/billto.p 1 12 bill is abbreviated \ No newline at end of file --- 1,3 ---- ! abbrevname abbrevnames/displaypostal.i 1 9 abbrevname: postal is abbreviated ! abbrevname abbrevnames/customer.p 1 12 abbrevname: cust is abbreviated ! abbrevname abbrevnames/billto.p 1 12 abbrevname: bill is abbreviated |
From: Jurjen D. <ju...@us...> - 2005-01-25 23:02:52
|
Update of /cvsroot/prolint/prolint/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27545 Modified Files: config.htxt Log Message: oops, documentation error Index: config.htxt =================================================================== RCS file: /cvsroot/prolint/prolint/help/config.htxt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.htxt 25 Jan 2005 21:35:14 -0000 1.2 --- config.htxt 25 Jan 2005 23:02:23 -0000 1.3 *************** *** 11,21 **** That is because the validation feature is disabled by default. <p> ! To enable validation, create a directory "prolint/settings/rtb-check-in" and then copy file "prolint/rtb/prolint-rtb-check-in.ini" to "prolint/settings/rtb-check-in/default.ini". <br> The ini file contains several tuning options for the validation. <p> ! The validation will read the options in file "prolint/settings/rtb-check-in/default.ini". <br> ! If a specific workspace requires specific validation options, you can also create a specific ini-file. For example: for workspace "MAINT" you can create a file named "prolint/settings/rtb-check-in/ws-MAINT.ini" (that is "ws-" + wspace-id + ".ini"). --- 11,21 ---- That is because the validation feature is disabled by default. <p> ! To enable validation, create a directory "prolint/custom/rtb-check-in" and then copy file "prolint/rtb/prolint-rtb-check-in.ini" to "prolint/custom/rtb-check-in/default.ini". <br> The ini file contains several tuning options for the validation. <p> ! The validation will read the options in file "prolint/custom/rtb-check-in/default.ini". <br> ! If a specific workspace requires specific validation options, you can also create a specific ini-file. For example: for workspace "MAINT" you can create a file named "prolint/custom/rtb-check-in/ws-MAINT.ini" (that is "ws-" + wspace-id + ".ini"). |
From: Jurjen D. <ju...@us...> - 2005-01-25 22:30:47
|
Update of /cvsroot/prolint/prolint/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20106 Modified Files: release.ini history.htxt Log Message: getting ready for release 63 Index: release.ini =================================================================== RCS file: /cvsroot/prolint/prolint/help/release.ini,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** release.ini 12 Dec 2004 21:00:32 -0000 1.26 --- release.ini 25 Jan 2005 22:30:13 -0000 1.27 *************** *** 1,3 **** [current] ! prolint=62 ! --- 1,2 ---- [current] ! prolint=63 Index: history.htxt =================================================================== RCS file: /cvsroot/prolint/prolint/help/history.htxt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** history.htxt 12 Dec 2004 21:00:32 -0000 1.9 --- history.htxt 25 Jan 2005 22:30:14 -0000 1.10 *************** *** 10,13 **** --- 10,20 ---- + <h5>prolint release 63, 25 Januari 2005:</h5> + <ul> + <li>tuned function RelativeFilename in lintsuper.p some more.<br /> + <li>changed file location of the ini-file for Roundtable check-in validation, the new search order allows for better administration. + <li>added sources for turbolint.dll to the Open Source project + </ul> + <h5>prolint release 62, 12 December 2004:</h5> No new features but performance improvements. The overall performance improvement in my test was around 10%, but depends highly on the files you inspect, which rules you choose and how many warnings are generated. |
From: Jurjen D. <ju...@di...> - 2005-01-25 22:06:46
|
Sorry :-) Jurjen Dijkstra |
From: Jurjen D. <ju...@di...> - 2005-01-25 21:52:13
|
Just checking if the list is working at all Jurjen Dijkstra |
From: <ju...@us...> - 2003-12-15 23:18:36
|
Update of /cvsroot/prolint/prolint/help/rules In directory sc8-pr-cvs1:/tmp/cvs-serv24062/help/rules Added Files: undoretry.htxt Log Message: added new rule "undoretry" --- NEW FILE: undoretry.htxt --- <h1>"UNDO" defaults to "UNDO, RETRY"</h1> Rule "undoretry" gives this warning when it finds an UNDO statement without options like RETRY/LEAVE/UNDO/NEXT. <p> <b>the risc:</b><br> "UNDO" behaves like "UNDO, RETRY" but RETRY is almost never desired. <p> <b>How to suppress these warnings:</b><br> You should specify at least something like "UNDO, LEAVE labelname", or even "UNDO, RETRY" to confirm the default. <br> See also: <a href="../nowarn.htm">suppress warnings</a>. |
From: <ju...@us...> - 2003-12-15 23:18:36
|
Update of /cvsroot/prolint/prolint/rules In directory sc8-pr-cvs1:/tmp/cvs-serv24062/rules Modified Files: rules.d Added Files: undoretry.p Log Message: added new rule "undoretry" --- NEW FILE: undoretry.p --- /* ----------------------------------------------------------------------------- file : prolint/rules/undoretry.p purpose : Locate statement "UNDO labelname." This behaves like "UNDO, RETRY labelname" but RETRY is almost never desired. The programmer should specify at least something like "UNDO, LEAVE labelname" ----------------------------------------------------------------------------- Copyright (C) 2003 Jurjen Dijkstra This file is part of Prolint. Prolint is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. Prolint is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --------------------------------------------------------------------------------- */ {prolint/ruleparams.i} RUN searchNode {&insuper} (hTopnode, /* "Program_root" node */ "InspectNode":U, /* name of callback procedure */ "UNDO":U). /* list of nodetypes to search for */ RETURN. PROCEDURE InspectNode : /* InspectNode is where the actual rule is implemented. it is called from SearchNode */ DEFINE INPUT PARAMETER theNode AS INTEGER NO-UNDO. DEFINE OUTPUT PARAMETER AbortSearch AS LOGICAL NO-UNDO INITIAL NO. DEFINE OUTPUT PARAMETER SearchChildren AS LOGICAL NO-UNDO INITIAL YES. DEFINE VARIABLE child AS INTEGER NO-UNDO. DEFINE VARIABLE parentnode AS INTEGER NO-UNDO. DEFINE VARIABLE nodetype AS CHARACTER NO-UNDO. DEFINE VARIABLE OptionFound AS LOGICAL NO-UNDO INITIAL FALSE. ASSIGN child = parserGetHandle(). /* is this UNDO a statement or an option? */ IF parserAttrGet(theNode, "statehead":U)<>"" THEN DO: /* so UNDO is a statement. Let's see if it has an option like LEAVE, NEXT etc */ /* all you need to know is if one of the child nodes is a COMMA */ nodetype = parserNodeFirstChild(theNode,child). DO WHILE nodetype<>"" : IF nodetype="COMMA":U THEN OptionFound = TRUE. nodetype = parserNodeNextSibling(child,child). END. END. ELSE DO: /* UNDO appears to be an option to a statement. The parent should be "ON" */ parentnode = parserGetHandle(). nodetype = parserNodeParent(theNode, parentnode). IF nodetype = "ON":U THEN DO: IF "COMMA":U = parserNodeNextSibling(TheNode,child) THEN OptionFound = TRUE. END. parserReleaseHandle(parentnode). END. IF NOT OptionFound THEN RUN PublishResult {&insuper} (compilationunit, parserGetNodeFilename(theNode), parserGetNodeLine(theNode), '"UNDO" defaults to "UNDO, RETRY"':T, rule_id). /* release every proparse handle that was declared in this context */ parserReleaseHandle(child). END PROCEDURE. Index: rules.d =================================================================== RCS file: /cvsroot/prolint/prolint/rules/rules.d,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** rules.d 1 Dec 2003 22:10:28 -0000 1.20 --- rules.d 15 Dec 2003 23:18:33 -0000 1.21 *************** *** 34,38 **** --- 34,40 ---- "query" 9 yes no no no yes "Find 'DEFINE QUERY' that uses either 'GET LAST' or 'GET PREV' statements." "runargs" 8 yes no no no no "run-time arguments in RUN statement" + "runasnotfound" 5 yes no no no no "proc not found on appserver" "runname" 6 yes no no yes no "programname in RUN-statement is not Unix-compatible" + "runnotfound" 5 yes no no yes no "proc not found" "sepdbui" 8 yes no no no no "separate UI from database-access" "sequence" 9 yes no no no yes "Find all 'CURRENT-VALUE' and 'NEXT-VALUE' statements." *************** *** 44,47 **** --- 46,50 ---- "tablename" 9 yes no no yes no "locate unqualified fieldnames" "ttnoindex" 6 yes no no no yes "TT defined like base table has no custom index." + "undoretry" 5 yes no no no no """UNDO"" defaults to ""UNDO, RETRY""" "uninproc" 6 yes no no yes no "Unused Internal Procedures." "unquoted" 5 yes no no no no "find unquoted string literals" |
From: <ju...@us...> - 2003-12-15 23:18:36
|
Update of /cvsroot/prolint/prolint/regrtest In directory sc8-pr-cvs1:/tmp/cvs-serv24062/regrtest Modified Files: expect.log Added Files: undoretry.p Log Message: added new rule "undoretry" --- NEW FILE: undoretry.p --- loop1: DO WHILE TRUE ON ERROR UNDO. UNDO loop1. UNDO, RETRY loop1. UNDO, RETRY. UNDO, LEAVE. UNDO, LEAVE loop1. END. loop2: DO WHILE TRUE ON ERROR UNDO, LEAVE. UNDO loop2. UNDO, RETRY loop2. UNDO, RETRY. UNDO, LEAVE. UNDO, LEAVE loop2. END. Index: expect.log =================================================================== RCS file: /cvsroot/prolint/prolint/regrtest/expect.log,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** expect.log 14 Dec 2003 22:24:47 -0000 1.8 --- expect.log 15 Dec 2003 23:18:32 -0000 1.9 *************** *** 333,336 **** --- 333,340 ---- rule=ttnoindex; source=prolint/regrtest/noundo.i; line= 44; descr=TempTable tt_noundo5 defined like tt_noundo2 has no index defined. rule=ttnoindex; source=prolint/regrtest/sepdbui.i; line= 5; descr=TempTable tt_sepdbui defined like customer has no index defined. + rule=undoretry; source=prolint/regrtest/noundo.i; line= 44; descr="UNDO" defaults to "UNDO, RETRY" + rule=undoretry; source=prolint/regrtest/undoretry.p; line= 5; descr="UNDO" defaults to "UNDO, RETRY" + rule=undoretry; source=prolint/regrtest/undoretry.p; line= 7; descr="UNDO" defaults to "UNDO, RETRY" + rule=undoretry; source=prolint/regrtest/undoretry.p; line= 24; descr="UNDO" defaults to "UNDO, RETRY" rule=uninproc; source=prolint/regrtest/idiskeyword.p; line= 10; descr=Internal Procedure nothing is not used. rule=uninproc; source=prolint/regrtest/nocomment.i; line= 14; descr=Internal Procedure ip_nocomment_1 is not used. |
From: <ju...@us...> - 2003-12-14 22:24:50
|
Update of /cvsroot/prolint/prolint/rules In directory sc8-pr-cvs1:/tmp/cvs-serv5050/rules Added Files: runasnotfound.p runnotfound.p Log Message: added new rules "runnotfound" and "runasnotfound" --- NEW FILE: runasnotfound.p --- /* ------------------------------------------------------------------------ file : prolint/rules/runasnotfound.p by : Jurjen Dijkstra purpose : find RUN statements like "RUN dir/name.p ON SERVER" and see if the name of the external procedure can be found (trying to prevent runtime error 293) ----------------------------------------------------------------- Copyright (C) 2001,2002 Jurjen Dijkstra This file is part of Prolint. Prolint is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. Prolint is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------ */ {prolint/ruleparams.i} {prolint/ttprocedure.i} FUNCTION WithoutQuotes RETURNS CHARACTER (qstring AS CHARACTER) FORWARD. RUN searchNode {&insuper} (hTopnode, /* "Program_root" node */ "InspectNode":U, /* name of callback procedure */ "RUN":U). /* list of statements to search */ RETURN. PROCEDURE InspectNode : /* InspectNode is where the actual rule is implemented. it is called from SearchNode in ruledefs.i */ DEFINE INPUT PARAMETER theNode AS INTEGER NO-UNDO. DEFINE OUTPUT PARAMETER AbortSearch AS LOGICAL NO-UNDO INITIAL NO. DEFINE OUTPUT PARAMETER SearchChildren AS LOGICAL NO-UNDO. DEFINE VARIABLE child AS INTEGER NO-UNDO. DEFINE VARIABLE grandchild AS INTEGER NO-UNDO. DEFINE VARIABLE nodetype AS CHARACTER NO-UNDO. DEFINE VARIABLE progname AS CHARACTER NO-UNDO INITIAL "". DEFINE VARIABLE AppsHandleName AS CHARACTER NO-UNDO INITIAL "". DEFINE VARIABLE found_on AS LOGICAL NO-UNDO INITIAL NO. DEFINE VARIABLE irtb AS INTEGER NO-UNDO INITIAL 0. ASSIGN SearchChildren = FALSE /* a RUN statement can not contain other RUN statements */ child = parserGetHandle() grandchild = parserGetHandle() nodetype = parserNodeFirstChild(theNode,child). /* not every RUN node has children, for example ON "CHOOSE" PERSISTENT RUN ip IN THIS-PROCEDURE" */ IF nodetype<>"" THEN DO: CASE nodetype : WHEN "FILENAME":U THEN progname = parserGetNodeText(child). WHEN "ID":U THEN progname = parserGetNodeText(child). END CASE. IF progname<>"" THEN IF CAN-DO("',~"":U, SUBSTRING(progname,1,1)) THEN progname = WithoutQuotes(progname). /* roundtable XREF generator adds a signature to the filename. Remove it: */ irtb = INDEX (progname, "*RTB-smObj*":U). IF irtb>0 THEN DO: SUBSTRING(progname, irtb, 11) = "". progname = TRIM(progname). END. /* check for option "ON [SERVER] <AppsHandleName>" */ nodetype = parserNodeNextSibling(child,child). DO WHILE nodetype<>"" : CASE nodetype : WHEN "ON":U THEN DO: found_on = TRUE. /* we also want to know the name of the server handle.. */ nodetype = parserNodeFirstChild(child,grandchild). DO WHILE nodetype<>"":U : IF nodetype="Field_ref":U THEN AppsHandleName = GetFieldnameFromFieldref ( grandchild ). nodetype = parserNodeNextSibling(grandchild,grandchild). END. END. END CASE. nodetype = parserNodeNextSibling(child,child). END. IF found_on AND progname<>"" THEN IF SEARCH ( progname ) = ? THEN RUN PublishResult {&insuper} ( compilationunit, parserGetNodeFilename( theNode ), parserGetNodeLine( theNode ), SUBSTITUTE( "proc '&1' not found on &2":T, progname, AppsHandleName ), rule_id ). END. parserReleaseHandle(child). parserReleaseHandle(grandchild). END PROCEDURE. FUNCTION WithoutQuotes RETURNS CHARACTER (qstring AS CHARACTER) : /* purpose: remove the quotes from nodetext "test" or 'test'. */ DEFINE VARIABLE quote AS CHARACTER NO-UNDO. quote = SUBSTRING(qstring,1,1). RETURN SUBSTRING(qstring,2,R-INDEX(qstring,quote) - 2). END FUNCTION. --- NEW FILE: runnotfound.p --- /* ------------------------------------------------------------------------ file : prolint/rules/runnotfound.p by : Jurjen Dijkstra purpose : find RUN statements like "RUN dir/name.p" and see if the name of the external procedure can be found (trying to prevent runtime error 293) ----------------------------------------------------------------- Copyright (C) 2001,2002 Jurjen Dijkstra This file is part of Prolint. Prolint is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. Prolint is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with Prolint; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ------------------------------------------------------------------------ */ {prolint/ruleparams.i} {prolint/ttprocedure.i} DEFINE VARIABLE dlcdir AS CHARACTER NO-UNDO. FUNCTION WithoutQuotes RETURNS CHARACTER (qstring AS CHARACTER) FORWARD. FUNCTION IsDlcComponent RETURNS LOGICAL (progname AS CHARACTER) FORWARD. RUN ProcedureListGet IN hLintSuper (OUTPUT TABLE tt_procedure). RUN searchNode {&insuper} (hTopnode, /* "Program_root" node */ "InspectNode":U, /* name of callback procedure */ "RUN":U). /* list of statements to search */ RETURN. PROCEDURE InspectNode : /* InspectNode is where the actual rule is implemented. it is called from SearchNode in ruledefs.i */ DEFINE INPUT PARAMETER theNode AS INTEGER NO-UNDO. DEFINE OUTPUT PARAMETER AbortSearch AS LOGICAL NO-UNDO INITIAL NO. DEFINE OUTPUT PARAMETER SearchChildren AS LOGICAL NO-UNDO. DEFINE VARIABLE child AS INTEGER NO-UNDO. DEFINE VARIABLE nodetype AS CHARACTER NO-UNDO. DEFINE VARIABLE progname AS CHARACTER NO-UNDO INITIAL "". DEFINE VARIABLE found_persistent AS LOGICAL NO-UNDO INITIAL NO. DEFINE VARIABLE found_in AS LOGICAL NO-UNDO INITIAL NO. DEFINE VARIABLE found_on AS LOGICAL NO-UNDO INITIAL NO. DEFINE VARIABLE irtb AS INTEGER NO-UNDO INITIAL 0. ASSIGN SearchChildren = FALSE /* a RUN statement can not contain other RUN statements */ child = parserGetHandle() nodetype = parserNodeFirstChild(theNode,child). /* not every RUN node has children, for example ON "CHOOSE" PERSISTENT RUN ip IN THIS-PROCEDURE" */ IF nodetype<>"" THEN DO: CASE nodetype : WHEN "FILENAME":U THEN DO: progname = parserGetNodeText(child). /* Remove quotes from filename, if any. For example: RUN 'apps/tpm/itin/d-clone.w':U (chRowID, OUTPUT keyValue). Else you would get a warning about the capital U in :U */ IF CAN-DO("',~"":U, SUBSTRING(progname,1,1)) THEN progname = WithoutQuotes(progname). END. WHEN "ID":U THEN progname = parserGetNodeText(child). /* maybe an internal procedure, maybe not */ END CASE. /* roundtable XREF generator adds a signature to the filename. Remove it: */ irtb = INDEX (progname, "*RTB-smObj*":U). IF irtb>0 THEN DO: SUBSTRING(progname, irtb, 11) = "". progname = TRIM(progname). END. /* we are still not sure if it's really a filename or an internal procedure. */ /* - if the keyword "PERSISTENT" is used, it sure is an external procedure. */ /* - if the keyword "ON" is used, it is an external procedure but not in this partition. (run xyz on [server handle]) */ /* - if the keyword "IN" is used, it must be an internal procedure. except when IN is used to set event-procedure context for async appserver call, but in that case IN comes after ON */ /* - if it looks like a filename (contains dot or slash) then its probably a filename. */ /* - if it contains a dot it may be an ActiveX trigger procedure: look it up in tt_procedure */ /* - if not in tt_procedure it may still be an ip in a super procedure. False Positive! */ nodetype = parserNodeNextSibling(child,child). DO WHILE nodetype<>"" : CASE nodetype : WHEN "PERSISTENT":U THEN found_persistent = TRUE. WHEN "ON":U THEN found_on = TRUE. /* run xyz on [server ...] */ WHEN "IN":U THEN IF NOT found_on THEN found_in = TRUE. END CASE. nodetype = parserNodeNextSibling(child,child). END. IF NOT (progname="" OR found_on OR found_in) THEN IF found_persistent OR INDEX( progname, '.':U )>0 OR INDEX( progname, '/':U )>0 OR INDEX( progname, '~\':U )>0 THEN DO: FIND tt_procedure NO-LOCK WHERE tt_procedure.procname = progname AND tt_procedure.proctype = "procedure":U NO-ERROR. IF NOT AVAILABLE tt_procedure THEN IF SEARCH ( progname ) = ? THEN IF NOT IsDlcComponent(progname) THEN RUN PublishResult {&insuper} ( compilationunit, parserGetNodeFilename( theNode ), parserGetNodeLine( theNode ), SUBSTITUTE( "proc '&1' not found":T, progname ), rule_id ). END. END. parserReleaseHandle(child). END PROCEDURE. FUNCTION WithoutQuotes RETURNS CHARACTER (qstring AS CHARACTER) : /* purpose: remove the quotes from nodetext "test" or 'test'. */ DEFINE VARIABLE quote AS CHARACTER NO-UNDO. quote = SUBSTRING(qstring,1,1). RETURN SUBSTRING(qstring,2,R-INDEX(qstring,quote) - 2). END FUNCTION. FUNCTION IsDlcComponent RETURNS LOGICAL (progname AS CHARACTER) : /* purpose: check if compiled procedure is found in DLC */ DEFINE VARIABLE dlc-component AS CHARACTER NO-UNDO. DEFINE VARIABLE rprogname AS CHARACTER NO-UNDO. DEFINE VARIABLE rprogpath AS CHARACTER NO-UNDO. DEFINE VARIABLE dot AS INTEGER NO-UNDO. /* get DLC without using OS-GETENV(DLC): it may not be set, or may have a funny format */ IF dlcdir = "" THEN ASSIGN dlc-component = 'bin/prowin32.exe':U dlcdir = SEARCH (dlc-component) dlcdir = SUBSTRING(dlcdir, 1, LENGTH(dlcdir) - LENGTH(dlc-component)). /* if progname is a sourcefile, the name of its compiled r-code would be: */ dot = R-INDEX (progname, ".":U). IF dot>0 THEN rprogname = SUBSTRING(progname, 1, dot) + 'r':U. ELSE RETURN FALSE. rprogpath = SEARCH (rprogname). IF rprogpath = ? THEN RETURN FALSE. ELSE RETURN (rprogpath MATCHES (dlcdir + "*":U)). END FUNCTION. |
From: <ju...@us...> - 2003-12-14 22:24:50
|
Update of /cvsroot/prolint/prolint/help/rules In directory sc8-pr-cvs1:/tmp/cvs-serv5050/help/rules Added Files: runasnotfound.htxt runnotfound.htxt Log Message: added new rules "runnotfound" and "runasnotfound" --- NEW FILE: runasnotfound.htxt --- <h1>proc [procname] not found on server [handle]</h1> Rule "runasnotfound" gives this warning when it finds a RUN statement for an external procedure on an Appserver, while this external procedure can not be found. It tries to prevent Progress run-time error 293. <br> The rule can only work if the source for the appserver partition is available in the Propath of the Prolint session. . <p> <table class=example> <tr><td> <pre> /* Prolint will check for runs in appserver context: */ RUN subdir/filename.p ON hAppServer. /* Prolint will NOT check if subdir/filename.p exists: */ RUN subdir/filename.p. </pre></td></tr></table> <p> See also rule <a href="runnotfound.htm">runnotfound</a> to check for "RUN" statements that don't have the "ON [SERVER]" option. <p> <b>the risc:</b><br> The rule was initially designed to prevent run-time error 293. <p> <b>How to suppress these warnings:</b><br> You can put the directive {&_proparse_ prolint-nowarn(runasnotfound)} directly before the RUN statement. See also: <a href="../nowarn.htm">suppress warnings</a>. --- NEW FILE: runnotfound.htxt --- <h1>proc [procname] not found</h1> Rule "runnotfound" gives this warning when it finds a RUN statement for an external procedure, while the external procedure can not be found. It tries to prevent Progress run-time error 293. . <p> <table class=example> <tr><td> <pre> /* Prolint will check if subdir/filename.p exists: */ RUN subdir/filename.p. /* Prolint will NOT check for runs in appserver context: */ RUN subdir/filename.p ON hAppServer. </pre></td></tr></table> <p> See also rule <a href="runasnotfound.htm">runasnotfound</a> to check for "RUN ... ON SERVER ..." statements. <p> <b>the risc:</b><br> The rule was initially designed to prevent run-time error 293. <br> It turns out that the rule mostly detects 'dead code': RUN statements in conditional code that never gets executed, probably because it is obsolete. <table class=example> <tr><td> <pre> CASE menu-choice: WHEN "something obsolete" THEN RUN old/obsolete.p. </pre></td></tr></table> <p> <b>false positives:</b><br> The rule cannot follow program flow and will raise a warning in the following example, although it should not: <table class=example> <tr><td> <pre> CustomOptionsAvailable = SEARCH("custom/options.r")<>?. IF CustomOptionsAvailable THEN RUN custom/options.p. </pre></td></tr></table> <p> <b>How to suppress these warnings:</b><br> You can put the directive {&_proparse_ prolint-nowarn(runnotfound)} directly before the RUN statement. See also: <a href="../nowarn.htm">suppress warnings</a>. |
From: <ju...@us...> - 2003-12-14 22:24:50
|
Update of /cvsroot/prolint/prolint/help In directory sc8-pr-cvs1:/tmp/cvs-serv5050/help Modified Files: history.htxt Log Message: added new rules "runnotfound" and "runasnotfound" Index: history.htxt =================================================================== RCS file: /cvsroot/prolint/prolint/help/history.htxt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** history.htxt 8 Dec 2003 22:30:41 -0000 1.3 --- history.htxt 14 Dec 2003 22:24:47 -0000 1.4 *************** *** 9,12 **** --- 9,21 ---- - when running TTY, how do you change settings? --> + <h5>upcoming release:</h5> + <ul> + <li>new rule <a href="rules/runnotfound.htm">runnotfound</a>:<br> + search for statements like "RUN test.p" and warns if file "test.p" does not exist. + <li>new rule <a href="rules/runasnotfound.htm">runasnotfound</a>:<br> + search for statements like "RUN test.p ON hServer" and warns if file "test.p" does not exist. + </ul> + + <h5>prolint release 57, 8 december 2003:</h5> <ul> |
From: <ju...@us...> - 2003-12-14 22:24:50
|
Update of /cvsroot/prolint/prolint/regrtest In directory sc8-pr-cvs1:/tmp/cvs-serv5050/regrtest Modified Files: expect.log Log Message: added new rules "runnotfound" and "runasnotfound" Index: expect.log =================================================================== RCS file: /cvsroot/prolint/prolint/regrtest/expect.log,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** expect.log 8 Dec 2003 22:30:41 -0000 1.7 --- expect.log 14 Dec 2003 22:24:47 -0000 1.8 *************** *** 227,230 **** --- 227,232 ---- rule=runargs; source=prolint/regrtest/runargs.i; line= 12; descr=run-time arguments in RUN statement rule=runargs; source=prolint/regrtest/runargs.i; line= 18; descr=run-time arguments in RUN statement + rule=runasnotfound; source=prolint/regrtest/runname.i; line= 51; descr=proc 'Async.p' not found on hRunnameServer + rule=runasnotfound; source=prolint/regrtest/varusage.i; line= 42; descr=proc 'myproc.p' not found on v_varusage_8 rule=runname; source=prolint/regrtest/runname.i; line= 12; descr=progname in RUN-statement is not Unix-compatible rule=runname; source=prolint/regrtest/runname.i; line= 13; descr=progname in RUN-statement is not Unix-compatible *************** *** 242,245 **** --- 244,266 ---- rule=runname; source=prolint/regrtest/runname.i; line= 64; descr=progname in RUN-statement is not Unix-compatible rule=runname; source=prolint/regrtest/runname.i; line= 65; descr=progname in RUN-statement is not Unix-compatible + rule=runnotfound; source=prolint/regrtest/runargs.i; line= 15; descr=proc 'something.p' not found + rule=runnotfound; source=prolint/regrtest/runargs.i; line= 18; descr=proc 'something.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 11; descr=proc 'subdir/test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 12; descr=proc 'SubDir/Test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 13; descr=proc 'subdir\test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 14; descr=proc 'SubDir\Test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 20; descr=proc 'Without_dotp' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 21; descr=proc 'without_dotp' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 36; descr=proc 'SubDir\Test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 37; descr=proc 'SubDir\Test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 45; descr=proc 'SubDir\Test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 46; descr=proc 'Another\Test.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 48; descr=proc 'LastTest.p' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 58; descr=proc 'sys\vorder.w' not found + rule=runnotfound; source=prolint/regrtest/runname.i; line= 59; descr=proc 'sys\vorder.r' not found + rule=runnotfound; source=prolint/regrtest/varusage.i; line= 75; descr=proc 'myproc.p' not found + rule=runnotfound; source=prolint/regrtest/varusage.i; line= 82; descr=proc 'myproc.p' not found + rule=runnotfound; source=prolint/regrtest/varusage.i; line= 91; descr=proc 'myproc.p' not found + rule=runnotfound; source=prolint/regrtest/varusage.i; line= 102; descr=proc 'myproc.p' not found rule=sepdbui; source=prolint/regrtest/defaultname.w; line= 137; descr=Separate UI from DB-access (UI in line 364 of prolint/regrtest/defaultname.w) rule=sepdbui; source=prolint/regrtest/varusage.i; line= 37; descr=Separate UI from DB-access (UI in line 6 of prolint/regrtest/message.i) |
From: <ju...@us...> - 2003-12-08 22:30:44
|
Update of /cvsroot/prolint/prolint/help In directory sc8-pr-cvs1:/tmp/cvs-serv15572/help Modified Files: history.htxt release.ini Log Message: release 57 Index: history.htxt =================================================================== RCS file: /cvsroot/prolint/prolint/help/history.htxt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** history.htxt 1 Dec 2003 22:20:35 -0000 1.2 --- history.htxt 8 Dec 2003 22:30:41 -0000 1.3 *************** *** 9,12 **** --- 9,23 ---- - when running TTY, how do you change settings? --> + <h5>prolint release 57, 8 december 2003:</h5> + <ul> + <li>improved rule <a href="rules/sharelock.htm">sharelock</a>:<br> + added test for the PRESELECT statement.<br> + Submitted by Olivier FOUAN. + <li>improved rule <a href="rules/ifparens.htm">ifparens</a>:<br> + removed many, many false positives. + <li>improved rule <a href="rules/backslash.htm">backslash</a>:<br> + removed warning for backslash in filename of WRX binary in procedure control_load. + </ul> + <h5>prolint release 56, 1 december 2003:</h5> <ul> Index: release.ini =================================================================== RCS file: /cvsroot/prolint/prolint/help/release.ini,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** release.ini 1 Dec 2003 22:20:35 -0000 1.20 --- release.ini 8 Dec 2003 22:30:41 -0000 1.21 *************** *** 1,3 **** [current] ! prolint=56 --- 1,3 ---- [current] ! prolint=57 |
From: <ju...@us...> - 2003-12-08 22:30:44
|
Update of /cvsroot/prolint/prolint/regrtest In directory sc8-pr-cvs1:/tmp/cvs-serv15572/regrtest Modified Files: expect.log Log Message: release 57 Index: expect.log =================================================================== RCS file: /cvsroot/prolint/prolint/regrtest/expect.log,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** expect.log 1 Dec 2003 22:10:25 -0000 1.6 --- expect.log 8 Dec 2003 22:30:41 -0000 1.7 *************** *** 137,142 **** rule=ifindent2; source=prolint/regrtest/ifindentextra.i; line= 40; descr=#202: Node IF has less indent than IF on line 38. Expected to be 33, is 2. rule=ifparens; source=prolint/regrtest/ifparens.p; line= 7; descr=IF function is confusing, use parentheses ! rule=ifparens; source=prolint/regrtest/ifparens.p; line= 13; descr=IF function is confusing, use parentheses ! rule=ifparens; source=prolint/regrtest/ifparens.p; line= 17; descr=IF function is confusing, use parentheses rule=message; source=prolint/regrtest/dotcomment.i; line= 6; descr=use MESSAGE only in debug-mode rule=message; source=prolint/regrtest/dotcomment.i; line= 9; descr=use MESSAGE only in debug-mode --- 137,142 ---- rule=ifindent2; source=prolint/regrtest/ifindentextra.i; line= 40; descr=#202: Node IF has less indent than IF on line 38. Expected to be 33, is 2. rule=ifparens; source=prolint/regrtest/ifparens.p; line= 7; descr=IF function is confusing, use parentheses ! rule=ifparens; source=prolint/regrtest/ifparens.p; line= 20; descr=IF function is confusing, use parentheses ! rule=ifparens; source=prolint/regrtest/ifparens.p; line= 25; descr=IF function is confusing, use parentheses rule=message; source=prolint/regrtest/dotcomment.i; line= 6; descr=use MESSAGE only in debug-mode rule=message; source=prolint/regrtest/dotcomment.i; line= 9; descr=use MESSAGE only in debug-mode |