Changeset: 353 fdbozzo - 06/07/2014 15:14:42:

This commit is contained in:
fdbozzo
2014-07-06 15:15:41 +02:00
5 changed files with 177 additions and 30 deletions

View File

@@ -90,6 +90,7 @@
* 14/06/2014 FDBOZZO v1.19.24 Arreglo bug vcx/scx: Un campo de tabla llamado "text" que comienza la l<>nea puede confundirse con la estructura TEXT/ENDTEXT y reconocer mal el resto del c<>digo
* 16/06/2014 FDBOZZO v1.19.25 Mejora: Agregado soporte de configuraciones (CFG) por directorio que, si existen, se usan en lugar del principal (Mario Peschke)
* 17/06/2014 FDBOZZO v1.19.25 Mejora: Si durante la generaci<63>n de binarios o de textos se producen errores, mostrar un mensaje avisando de ello (Pedro Guti<74>rrez M.)
* 06/07/2014 FDBOZZO v1.19.26 Mejora: Cuando se convierten binarios a texto, los CHR(0) pasan tambi<62>n, pudiendo provocar falsa detecci<63>n como binario. Se agrega opci<63>n para quitar los NULLs. (Matt Slay)
* 27/06/2014 FDBOZZO v1.19.26 Mejora: Si el campo memo "methods" de los vcx/scx contiene asteriscos fuera de lugar (que no deber<65>a), FoxBin2Prg lo procesa igualmente. (Daniel S<>nchez)
* 06/07/2014 FDBOZZO v1.19.26 Bug Fix cfg: ExtraBackupLevel no se tiene en cuenta cuando se usa multi-configuraci<63>n
* </HISTORIAL DE CAMBIOS Y NOTAS IMPORTANTES>
@@ -126,6 +127,7 @@
* 13/06/2014 Mario Peschke REPORTE BUG vcx/scx v1.19.23: Los campos de tabla con nombre "text" a veces provocan corrupci<63>n del binario generado (Arreglado en v1.19.24)
* 16/06/2014 Mario Peschke MEJORA v1.19.24: Agregado soporte de configuraciones (CFG) por directorio que, si existen, se usan en lugar del CFG principal (Agregado en v1.19.25)
* 17/06/2014 Pedro Guti<74>rrez M. MEJORA v1.19.24: Si durante la generaci<63>n de binarios o de textos se producen errores, mostrar un mensaje avisando de ello (Agregado en v1.19.25)
* 02/07/2014 Matt Slay MEJORA v1.19.25: Se filtran algunos CHR(0) de los binarios al tx2, provocando que a veces no sea reconocido como texto. Deber<65>an poderse quitar los NULLs (Arreglado en v1.19.26)
* 27/06/2014 Daniel S<>nchez MEJORA v1.19.25: Si el campo memo "methods" de los vcx/scx contiene asteriscos fuera de lugar (que no deber<65>a), FoxBin2Prg falla. Deber<65>a poder procesarlo igual.
* </TESTEO Y REPORTE DE BUGS (AGRADECIMIENTOS)>
*
@@ -280,6 +282,7 @@ LPARAMETERS tc_InputFile, tcType, tcTextName, tlGenText, tcDontShowErrors, tcDeb
#DEFINE C_TAB CHR(9)
#DEFINE C_CR CHR(13)
#DEFINE C_LF CHR(10)
#DEFINE C_NULL_CHAR CHR(0)
#DEFINE CR_LF C_CR + C_LF
#DEFINE C_MPROPHEADER REPLICATE( CHR(1), 517 )
*-- Fin / End
@@ -447,6 +450,7 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
+ [<memberdata name="lfilemode" display="lFileMode"/>] ;
+ [<memberdata name="l_cfg_cachedaccess" display="l_CFG_CachedAccess"/>] ;
+ [<memberdata name="l_allowmulticonfig" display="l_AllowMultiConfig"/>] ;
+ [<memberdata name="l_dropnullcharsfromcode" display="l_DropNullCharsFromCode"/>] ;
+ [<memberdata name="l_clearuniqueid" display="l_ClearUniqueID"/>] ;
+ [<memberdata name="l_configevaluated" display="l_ConfigEvaluated"/>] ;
+ [<memberdata name="l_debug" display="l_Debug"/>] ;
@@ -517,6 +521,7 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
l_ShowErrors = .T.
l_ShowProgress = .T.
l_AllowMultiConfig = .T.
l_DropNullCharsFromCode = .T.
l_Recompile = .T.
l_NoTimestamps = .T.
l_ClearUniqueID = .T.
@@ -1148,21 +1153,28 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
lcValue = ALLTRIM( SUBSTR( laConfig(I), 15 ) )
IF NOT INLIST( TRANSFORM(tcClearUniqueID), '0', '1' ) AND INLIST( lcValue, '0', '1' ) THEN
tcClearUniqueID = lcValue
.writeLog( JUSTFNAME(lcConfigFile) + ' > ClearUniqueID: ' + TRANSFORM(ALLTRIM( SUBSTR( laConfig(I), 15 )) ) )
.writeLog( JUSTFNAME(lcConfigFile) + ' > ClearUniqueID: ' + TRANSFORM(lcValue) )
ENDIF
CASE LEFT( laConfig(I), 20 ) == LOWER('OptimizeByFilestamp:')
lcValue = ALLTRIM( SUBSTR( laConfig(I), 21 ) )
IF NOT INLIST( TRANSFORM(tcOptimizeByFilestamp), '0', '1' ) AND INLIST( lcValue, '0', '1' ) THEN
tcOptimizeByFilestamp = lcValue
.writeLog( JUSTFNAME(lcConfigFile) + ' > OptimizeByFilestamp: ' + TRANSFORM(ALLTRIM( SUBSTR( laConfig(I), 21 )) ) )
.writeLog( JUSTFNAME(lcConfigFile) + ' > OptimizeByFilestamp: ' + TRANSFORM(lcValue) )
ENDIF
CASE LEFT( laConfig(I), 17 ) == LOWER('AllowMultiConfig:')
lcValue = ALLTRIM( SUBSTR( laConfig(I), 18 ) )
IF INLIST( lcValue, '0', '1' ) THEN
.l_AllowMultiConfig = ( TRANSFORM(lcValue) == '1' )
.writeLog( JUSTFNAME(lcConfigFile) + ' > AllowMultiConfig: ' + TRANSFORM(ALLTRIM( SUBSTR( laConfig(I), 18 )) ) )
.writeLog( JUSTFNAME(lcConfigFile) + ' > AllowMultiConfig: ' + TRANSFORM(lcValue) )
ENDIF
CASE LEFT( laConfig(I), 22 ) == LOWER('DropNullCharsFromCode:')
lcValue = ALLTRIM( SUBSTR( laConfig(I), 23 ) )
IF INLIST( lcValue, '0', '1' ) THEN
.l_DropNullCharsFromCode = ( TRANSFORM(lcValue) == '1' )
.writeLog( JUSTFNAME(lcConfigFile) + ' > DropNullCharsFromCode: ' + TRANSFORM(lcValue) )
ENDIF
CASE LEFT( laConfig(I), 23 ) == LOWER('PJX_Conversion_Support:')
@@ -1256,14 +1268,15 @@ DEFINE CLASS c_foxbin2prg AS CUSTOM
ENDIF
.writeLog( '---' )
.writeLog( '> l_ShowProgress: ' + TRANSFORM(.l_ShowProgress) )
.writeLog( '> l_ShowErrors: ' + TRANSFORM(.l_ShowErrors) )
.writeLog( '> l_Recompile: ' + TRANSFORM(.l_Recompile) + ' (' + EVL(tcRecompile,'') + ')' )
.writeLog( '> l_NoTimestamps: ' + TRANSFORM(.l_NoTimestamps) )
.writeLog( '> l_ClearUniqueID: ' + TRANSFORM(.l_ClearUniqueID) )
.writeLog( '> l_Debug: ' + TRANSFORM(.l_Debug) )
.writeLog( '> n_ExtraBackupLevels: ' + TRANSFORM(.n_ExtraBackupLevels) )
.writeLog( '> l_OptimizeByFilestamp: ' + TRANSFORM(.l_OptimizeByFilestamp) )
.writeLog( '> l_ShowProgress: ' + TRANSFORM(.l_ShowProgress) )
.writeLog( '> l_ShowErrors: ' + TRANSFORM(.l_ShowErrors) )
.writeLog( '> l_Recompile: ' + TRANSFORM(.l_Recompile) + ' (' + EVL(tcRecompile,'') + ')' )
.writeLog( '> l_NoTimestamps: ' + TRANSFORM(.l_NoTimestamps) )
.writeLog( '> l_ClearUniqueID: ' + TRANSFORM(.l_ClearUniqueID) )
.writeLog( '> l_Debug: ' + TRANSFORM(.l_Debug) )
.writeLog( '> n_ExtraBackupLevels: ' + TRANSFORM(.n_ExtraBackupLevels) )
.writeLog( '> l_OptimizeByFilestamp: ' + TRANSFORM(.l_OptimizeByFilestamp) )
.writeLog( '> l_DropNullCharsFromCode: ' + TRANSFORM(.l_DropNullCharsFromCode) )
lo_CFG = NULL
RELEASE lo_CFG
@@ -8124,16 +8137,20 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*******************************************************************************************************************
PROCEDURE get_ADD_OBJECT_METHODS
LPARAMETERS toRegObj, toRegClass, tcMethods, taMethods, taCode, tnMethodCount ;
, taPropsAndComments, tnPropsAndComments_Count, taProtected, tnProtected_Count
, taPropsAndComments, tnPropsAndComments_Count, taProtected, tnProtected_Count ;
, toFoxBin2Prg
EXTERNAL ARRAY taPropsAndComments, taProtected
#IF .F.
LOCAL toFoxBin2Prg AS c_foxbin2prg OF 'FOXBIN2PRG.PRG'
#ENDIF
TRY
LOCAL lcMethodName
WITH THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG'
.SortMethod( toRegObj.METHODS, @taMethods, @taCode, '', @tnMethodCount ;
, @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count )
, @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count, @toFoxBin2Prg )
*-- Ubico los m<>todos protegidos y les cambio la definici<63>n.
*-- Los m<>todos se deben generar con la ruta completa, porque si no es imposible saber a que objeto corresponden,
@@ -8515,11 +8532,14 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*******************************************************************************************************************
PROCEDURE SortMethod
LPARAMETERS tcMethod, taMethods, taCode, tcSorted, tnMethodCount, taPropsAndComments, tnPropsAndComments_Count ;
, taProtected, tnProtected_Count
, taProtected, tnProtected_Count, toFoxBin2Prg
*-- 29/10/2013 Fernando D. Bozzo
*-- Se tiene en cuenta la posibilidad de que haya un PROC/ENDPROC dentro de un TEXT/ENDTEXT
*-- cuando es usado en un generador de c<>digo o similar.
EXTERNAL ARRAY taMethods, taCode, taPropsAndComments, taProtected
#IF .F.
LOCAL toFoxBin2Prg AS c_foxbin2prg OF 'FOXBIN2PRG.PRG'
#ENDIF
*-- ESTRUCTURA DE LOS ARRAYS CREADOS:
*-- taMethods[1,3]
@@ -8543,6 +8563,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
DIMENSION laLine(1), taMethods(1,3)
STORE '' TO laLine, taMethods, taCode
STORE 0 TO tnMethodCount, lnTextNodes
lnLineCount = ALINES(laLine, m.tcMethod) && NO aplicar nung<6E>n formato ni limpieza, que es el C<>DIGO FUENTE
*-- Delete beginning empty lines before first "PROCEDURE", that is the first not empty line.
@@ -8576,6 +8597,10 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*-- Analyze and count line methods, get method names and consolidate block code
FOR I = 1 TO lnLineCount
IF toFoxBin2Prg.l_DropNullCharsFromCode
laLine(I) = CHRTRAN( laLine(I), C_NULL_CHAR, '' )
ENDIF
lnLine_Len = LEN( laLine(I) )
DO CASE
@@ -8790,7 +8815,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
*******************************************************************************************************************
PROCEDURE write_ALL_OBJECT_METHODS
LPARAMETERS tcMethods, taPropsAndComments, tnPropsAndComments_Count, taProtected, tnProtected_Count
LPARAMETERS tcMethods, taPropsAndComments, tnPropsAndComments_Count, taProtected, tnProtected_Count, toFoxBin2Prg
*-- Finalmente, todos los m<>todos los ordeno y escribo juntos
LOCAL laMethods(1), laCode(1), lnMethodCount, I, lcMethods
@@ -8801,7 +8826,7 @@ DEFINE CLASS c_conversor_bin_a_prg AS c_conversor_base
WITH THIS AS c_conversor_bin_a_prg OF 'FOXBIN2PRG.PRG'
.SortMethod( @tcMethods, @laMethods, @laCode, '', @lnMethodCount ;
, @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count )
, @taPropsAndComments, tnPropsAndComments_Count, @taProtected, tnProtected_Count, @toFoxBin2Prg )
FOR I = 1 TO lnMethodCount
*-- Genero los m<>todos indentados
@@ -9863,7 +9888,7 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg
DIMENSION laMethods(1,3)
laMethods = ''
.SortMethod( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ;
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count )
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
.write_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments )
@@ -9891,10 +9916,11 @@ DEFINE CLASS c_conversor_vcx_a_prg AS c_conversor_bin_a_prg
ENDIF
.get_ADD_OBJECT_METHODS( @loRegObj, @loRegClass, @lcMethods, @laMethods, @laCode, @lnMethodCount ;
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count )
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
ENDSCAN
.write_ALL_OBJECT_METHODS( @lcMethods, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count )
.write_ALL_OBJECT_METHODS( @lcMethods, @laPropsAndComments, lnPropsAndComments_Count, @laProtected ;
, lnProtected_Count, @toFoxBin2Prg )
GOTO RECORD (lnRecno)
ENDSCAN
@@ -10100,7 +10126,7 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg
DIMENSION laMethods(1,3)
laMethods = ''
.SortMethod( loRegClass.METHODS, @laMethods, @laCode, '', @lnMethodCount ;
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count )
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
.write_CLASS_METHODS( @lnMethodCount, @laMethods, @laCode, @laProtected, @laPropsAndComments )
@@ -10130,10 +10156,11 @@ DEFINE CLASS c_conversor_scx_a_prg AS c_conversor_bin_a_prg
ENDIF
.get_ADD_OBJECT_METHODS( @loRegObj, @loRegClass, @lcMethods, @laMethods, @laCode, @lnMethodCount ;
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count )
, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count, @toFoxBin2Prg )
ENDSCAN
.write_ALL_OBJECT_METHODS( @lcMethods, @laPropsAndComments, lnPropsAndComments_Count, @laProtected, lnProtected_Count )
.write_ALL_OBJECT_METHODS( @lcMethods, @laPropsAndComments, lnPropsAndComments_Count, @laProtected ;
, lnProtected_Count, @toFoxBin2Prg )
GOTO RECORD (lnRecno)
ENDSCAN