diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 33f0975de5..c14b32a69a 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -7,6 +7,14 @@ For example: 2002-12-01 23:12 UTC+0100 Foo Bar */ + * Updated version numbers to Alpha 39 release + * Tagged Repository With BUILD39 + +2002-03-08 07:30 UTC-0300 Luiz Rafael Culik + * utils/hbmake/hbmake.prg + * Minor fix for Library names on linux section + +2002-03-07 14:50 UTC+0300 Alexander Kresin * source/rtl/dbsdf.prg * bug fixed, reported by Mikhail Malyh * doc/en/compiler.txt diff --git a/harbour/doc/en/compiler.txt b/harbour/doc/en/compiler.txt index 74bd760ed6..8a69a91b8c 100644 --- a/harbour/doc/en/compiler.txt +++ b/harbour/doc/en/compiler.txt @@ -2,227 +2,233 @@ * $Id$ */ +/* + * Las siguientes partes son derechos adquiridos de sus autores individuales. + * www - http://www.harbour-project.org + * + * Copyright 2000 Alejandro de Gárate + * Documentación en Español de: Opciones del Compilador + * + * Vea doc/license.txt por los términos de la licencia. + * + */ + + /* $DOC$ * $FUNCNAME$ - * Compiler Options + * Opciones del Compilador * $CATEGORY$ - * Document + * Documentación * $ONELINER$ - * Compiler Options + * Opciones del Compilador * $DESCRIPTION$ * - * Invoking the Harbour compiler: - * ============================== + * Invocando al compilador Harbour: + * =============================== * - * harbour [options] - * or - * harbour [options] + * harbour [opciones] + * or + * harbour [opciones] * or - * harbour [options] [options] + * harbour [opciones] [opciones] * - * The command line options have to be separated by at least one space. - * The option can start with either '/' character or '-' character. * - * The Harbour command line options: - * ================================= + * Las opciones de la línea de comandos debe ser separada, al menos por + * un espacio en blanco. + * Las opciones pueden comenzar con el carácter '/' ó '-', * - * /a automatic memvar declaration - * ================= - - * This causes all variables declared by PARAMETER, PRIVATE or PUBLIC - * statements to be automatically declared as MEMVAR variables. + * Opciones de la línea de comandos de: + * ==================================== * - * /b debug info - * ================= - - * The compiler generates all information required for debugging + * /a Declaración Automática de memvar + * ----------------- + * Esto causa que todas las variables declaradas por las sentencias + * PARAMETER, PRIVATE ó PUBLIC sean automáticamente declaradas como + * variables MEMVAR. + * + * /b Información de depuración (Bug) + * ----------------- + * El compilador genera toda la información requerida para depuración * * /d[=] #define - * ================= + * ----------------- * - * /es[] set exit severity - * ================= + * /es[] establece la Severidad de la salida (Exit Severity) + * ----------------- * - * /es or /es0 - all warnings are ignored and exit code returned by - * the compiler (accessed by DOS ERRORLEVEL command) - * is equal to 0 if there are no errors in compiled - * source file. + * /es or /es0 - Todas las advertencias son ignoradas y el código de + * salida retornado por el compilador (accedido por el + * comando de DOS ERRORLEVEL) es igual a cero si no + * hay errores en el archivo fuente compilado. + * /es1 - Cualquier advertencia genera un código de salida + * distinto de cero, pero la salida es aún creada. + * /es2 - Cualquier advertencia es tratada como error y ningún + * archivo de salida es creado. El código de salida es + * establecido a un valor distinto de cero. * - * /es1 - any warnings generate a non-zero exit code, but - * output is still created. + * /g Generación del tipo de archivo de salida + * ----------------- * - * /es2 - all warnings are treated as errors and no output - * file is created. The exit code is set to a non-zero - * value. - * /i add #include file search path - * ================= + * /gc tipo de salida: fuente de lenguaje C (.c) (defecto) + * /gf tipo de salida: Windows/DOS OBJ32 (.obj) + * /gh tipo de salida: Objeto Portable de Harbour (.hrb) + * /gj tipo de salida: fuente de Java (.java) + * /gp tipo de salida: fuente de Pascal (.pas) + * /gr tipo de salida: recursos de Windows (.rc) * - * /k enable compatibility mode - * ================= + * /i agrega la ruta de búsqueda de archivos #Include + * ----------------- * - * /kc clear all flags (strict Clipper compatibility) + * /l suprime la información del número de Línea + * ----------------- + * El compilador no genera el número de línea del código fuente + * en el archivo de salida. La función PROCLINE() retornará cero + * para los módulos compilados usando esta opción. * - * /kh Harbour extensions (default) + * /m compilar el Módulo actual solamente + * ----------------- * - * /ki HB_INLINE support enabled (default) + * /n sin procedimiento de inicio implícito + * ----------------- + * El compilador no crea un procedimiento con el mismo nombre + * que el del archivo compilado. Esto significa que algunas + * declaraciones puestas antes de la primera sentencia de + * PROCEDURE ó FUNCTION tienen el alcance del archivo y pueden ser + * accedidas/usadas en todas las funciones/procedimientos definidos + * en el archivo fuente compilado. Todas las sentencias ejecutables + * puestas al principio del archivo y antes de la primera sentencia + * de PROCEDURE ó FUNCTION son ignoradas. * - * /kr use runtime settings for the macro compiler + * /o unidad de disco y/o ruta para el archivo de salida + * ----------------- * - * /kx other xbase dialects extensions (default) + * /p genera un archivo de salida Pre-procesada (.ppo) + * ----------------- + * El compilador solamente crea el archivo que contiene el + * resultado del archivo fuente pre-procesado. * - * /k? invoke help information + * /q Quieto + * ----------------- + * El compilador no imprime ningún mensaje durante la compilación + * (excepto la información del copyright). * - * /l suppress line number information - * ================= + * /q0 que permanezca realmente Quieto y no muestre ni + * siquiera la información del copyright. * - * The compiler does not generate the source code line numbers in - * the output file. The PROCLINE() function will return 0 for - * modules compiled using this option. + * /r[] solicita al linker Revisar por (ó ninguna) + * ----------------- + * Actualmente no soportado en Harbour. * - * /m compile current module only - * ================= + * /s solo chequeo de Sintaxis. + * ----------------- + * El compilador chequea la sintaxis solamente. Ningún archivo de + * salida es generado. * - * /n no implicit starting procedure - * ================= + * /t ruta para la creación de un archivo Temporario + * ----------------- + * Actualmente no usado en harbour (El compilador de harbour no + * crea ningún archivo temporal) * - * The compiler does not create a procedure with the same name as - * the compiled file. This means that any declarations placed - * before the first PROCEDURE or FUNCTION statement have file- - * wide scope and can be accessed/used in all functions/procedures - * defined in the compiled source file. All executable statements - * placed at the beginning of the file and before the first - * PROCEDURE/FUNCTION statement are ignored. + * /u[] Usar la definición de comando establecido en el + * (ó ninguno) + * ----------------- + * Aún no soportado. * - * /o output file drive and/or path - * ================= + * /v las Variables son asumidas como M-> + * ----------------- + * Todas las variables sin declarar ó unaliased son asumidas como + * variables MEMVAR (variables privadas ó públicas). si este switch + * no es usado entones el alcance de estas variables es chequeado + * en tiempo de ejecución. * - * /p generate pre-processed output (.ppo) file - * ================= + * /w[] Establece el número de nivel de las advertencias + * (Warnings) (0..4, por defecto es 1) + * ----------------- * - * The compiler only creates the file that contains the result of - * pre-processing the source file. + * /w0 - sin advertencias + * /w or /w1 - advertencias compatibles con Clipper + * /w2 - algunas advertencias útiles ausentes en Clipper + * /w3 - advertencias generadas para extensiones al lenguaje + * hechas en Harbour. También habilita el chequeo de + * sintaxis fuertemente tipeada pero sólo advierte + * contra los tipos declarados, o los tipos que pueden + * ser calculados en tiempo de compilación. + * /w4 - habilita advertencias acerca de operaciones que son + * sospechosas, lo cual significa que si se mezclan tipos + * sin declarar ó tipos que no pueden ser calculados + * en tiempo de compilación, junto con los tipos ya + * declarados, una advertencia será generada. * - * /q quiet - * ================= + * /x[] establece el símbolo del prefijo agregado al nombre + * de función (para archivo.c solamente) + * ----------------- + * Establece el símbolo del prefijo agregado al nombre de función + * de inicio (en la salida de lenguaje C, actualmente). Esta función + * es generada automáticamente para cada módulo de PRG compilado. + * Este prefijo adicional puede ser usado para suprimir problemas + * con símbolos duplicados durante el enlazado de una aplicación + * (linking) con alguna librería de terceros. * - * The compiler does not print any messages during compiling - * (except the copyright info). + * /y seguimiento de la actividad de Lex & Yacc + * ----------------- + * El compilador Harbour usa las utilidades FLEX y YACC para analizar + * el código fuente y generar el archivo de salida requerido. + * Esta opción sigue la actividad de esas utilidades. * - * /q0 be really quiet and don't display even the copyright info + * /z suprime el cortocircuito lógico (.and. y .or.) + * ----------------- * - * /r[] request linker to search (or none) - * ================= - * - * Currently not supported in Harbour. - * - * /s syntax check only - * ================= - * - * The compiler checks the syntax only. No output file is generated. - * - * /t path for temp file creation - * ================= - * - * Currently not used in Harbour (the Harbour compiler does not - * create any temporary files). - * - * /u[] use command definition set in (or none) - * ================= - * - * /v variables are assumed M-> - * ================= - * - * All undeclared or unaliased variables are assumed MEMVAR - * variables (private or public variables). If this switch is not - * used then the scope of such variables is checked at runtime. - * - * /w[] set warning level number (0..4, default 1) - * ================= - * - * /w0 - no warnings - * - * /w or /w1 - Clipper compatible warnings - * - * /w2 - some useful warnings missed in Clipper - * - * /w3 - warnings generated for Harbour language extensions - * and also enables strong type checking but only - * warns against declared types, or types which may be - * calculated at compile time - * - * /w4 - Enables warning about suspicious operations, which - * means if you mix undeclared types, or types which - * can not be calculated at compile time,together with - * declared types, a warning will be generated. - * - * /x[] set symbol init function name prefix (for .c only) - * ================= - * - * Sets the prefix added to the generated symbol init function name - * (in C output currently). This function is generated - * automatically for every PRG module compiled. This additional - * prefix can be used to suppress problems with duplicated symbols - * during linking an application with some third party libraries. - * - * /y trace lex & yacc activity - * ================= - * - * The Harbour compiler uses the FLEX and YACC utilities to parse - * the source code and to generate the required output file. This - * option traces the activity of these utilities. - * - * /z suppress logical shortcutting (.and. & .or.) - * ================= - * - * /10 restrict symbol length to 10 characters - * ================= - * - * All variable and function names are cut to maximum 10 characters. - * - * Compilation in batch mode. - * ========================== - * - * @ compile list of modules in - * ================= - * - * Not supported yet. - * - * Known incompatibilities between harbour and clipper compilers - * ============================================================= - * - * NOTE: - * - * If you want a 100% compatible runtime libraries then - * you have to define HARBOUR_STRICT_CLIPPER_COMPATIBILITY. This - * option should be defined in the file include/hbsetup.h (in fact this - * option is placed in a comment by default - you need to remove the - * /* */ characters only). This change has to be done before invoking - * the make utility. + * /10 restringe la longitud de símbolos a 10 caracteres. + * ----------------- + * Todos los nombres de variables y de funciones son cortados a un + * máximo de 10 caracteres. * * - * Handling of undeclared variables + * Compilación en modo lote (batch). * ================================ * - * When a value is assigned to an undeclared variable and the '-v' - * command line option is not used, then the Clipper compiler assumes - * that the variable is a PRIVATE or a PUBLIC variable and generates - * POPM (pop memvar) opcode. + * @ compila la lista de módulos en el + * ----------------- + * No soportado aún. * - * When the value of an undeclared variable is accessed and the '-v' - * command line option is not used, the Clipper compiler generates PUSHV - * (push variable) opcode that determines the type of variable at runtime. - * If a field with the requested name exists in the current workarea then - * its value is used. If there is no field then a PRIVATE or a PUBLIC - * variable is used (if exists). * - * The Harbour compiler generates an opcode to determine the type of - * variable at runtime (POPVARIABLE or PUSHVARIABLE) in both cases - * (assignment and access). * - * The difference can be checked by the following code: + * Conocidas incompatibilidades entre compiladores harbour y clipper + * ================================================================= * + * NOTE: + * Si desea librerías de compilación y ejecución 100 % compatibles, + * entonces Ud. debe definir: HARBOUR_STRICT_CLIPPER_COMPATIBILITY. + * Esta opción debe ser definida en el archvivo ../include/hbsetup.h + * (en efecto esta opción es puesta en un comentario por defecto - Ud. + * necesita remover los caracteres /* */ solamente. Este cambio debe ser + * realizado antes de invocar la utilidad make. + * + * + * Manejo de variables sin declarar + * -------------------------------- + * Cuando un valor es asignado a una variable no declarada y la opción + * -v de la línea de comandos no es usada, entonces el compilador + * Clipper asume que la variable es una variable PRIVATE ó PUBLIC y + * genera un opcode POPM (pop memvar). + * + * Cuando el valor de una variable no declarada es accedido y la opción + * -v de la línea de comandos no es usada, el compilador Harbour genera + * un opcode PUSHV (push variable) para determinar el tipo de variable + * en tiempo de ejecución + + * Si un campo con el nombre requerido existe en el area de trabajo + * actual, entonces este valor es usado. Si no existe el campo, entones + * una variable PRIVATE ó PUBLIC es usada (si existe). + * + * El compilador Harbour genera un opcode para determinar el tipo de + * variable en tiempo de ejecución (POPVARIABLE or PUSHVARIABLE) en + * ambos casos (asignación y acceso). + * + * La diferencia puede ser chequeada por el siguiente código: + * - * PROCEDURE MAIN() + * PROCEDURE MAIN() * PRIVATE myname * * DBCREATE( "TEST", { { "MYNAME", "C", 10, 0} } ) @@ -245,61 +251,62 @@ * * RETURN * - * - * Passing an undeclared variable by the reference - * =============================================== * - * The Clipper compiler uses the special opcode PUSHP to pass a - * reference to an undeclared variable ( '@' operator ). The type of - * passed variable is checked at runtime (field or memvar). However, - * field variables cannot be passed by reference. This means that - * Clipper checks the memvar variable only and doesn't look for a field. - * This is the reason why the Harbour compiler uses the usual - * PUSHMEMVARREF opcode in such cases. Notice that the runtime behavior - * is the same in Clipper and in Harbour - only the generated opcodes - * are different. + * Pasando por refeerencia una variable no declarada + * ------------------------------------------------- + * El compilador Harbour usa un opcode especial PUSHP para pasar una + * referencia a una variable no declarada ( el operador '@' ). El tipo + * de la variable pasada es chequeada en tiempo de ejecución (field or + * memvar). Sin embargo las variables de campo no pueden ser pasadas por + * referencia. Esto significa que Clipper chequea sólo la variable memvar + * y no mira por una de campo. + * Esta es la razón por la cual el compilador Harbour usa el opcode + * habitual PUSHMEMVARREF en estos casos. Nótese que el comportamiento + * en tiempo de ejecución es el mismo en Clipper y en Harbour - sólo los + * opcodes generados son diferentes. * * - * Handling of object messages - * =========================== + * Manejo de mensajes a objetos + * ---------------------------- * - * The HARBOUR_STRICT_CLIPPER_COMPATIBILITY setting determines - * the way chained send messages are handled. + * El seteo de HARBOUR_STRICT_CLIPPER_COMPATIBILITY determina + * la forma en que el envío encadenado de mensajes es manejado * - * For example, the following code: + * Por ejemplo, el siguiente código: * - * a:b( COUNT() ):c += 1 + * a:b( COUNT() ):c += 1 * - * will be handled as: + * será manejado como: * - * a:b( COUNT() ):c := a:b( COUNT() ):c + 1 + * a:b( COUNT() ):c := a:b( COUNT() ):c + 1 + * en modo de compatibilidad estricta y * - * in strict Clipper compatibility mode and + * temp := a:b( COUNT() ), temp:c += 1 + * en modo no-estricto. * - * temp := a:b( COUNT() ), temp:c += 1 + * En la práctica, Clipper llamará a la función COUNT() dos veces: + * La primera vez antes de la adición y la segunda después de la + * adición. + * En Harbour, COUNT() será llamada sólo una vez, antes de la adición. * - * in non-strict mode. + * El método Harbour (no-estricto) es: + * 1) Más rápido + * 2) Garantiza que la misma variable de instancia del mismo + * objeto será cambiada. * - * In practice, Clipper will call the COUNT() function two times: - * the first time before addition and the second one after addition. - * In Harbour, COUNT() will be called only once, before addition. + * (Ver también: ../source/compiler/expropt.c) * - * The Harbour (non-strict) method is: - * 1) faster - * 2) it guarantees that the same instance variable of the same object - * will be changed * - * (See also: source/compiler/expropt.c) + * Inicialización variables estáticas + * ---------------------------------- * - * Initialization of static variables - * ================================== - * - * There is a difference in the initialization of static - * variables that are initialized with a codeblock that refers to - * a local variable. For example: + * Hay una diferencia en la inicialización de las variables estáticas + * que son inicializadas con un bloque de código que refiere a una + * variable local. Por ejemplo: * * PROCEDURE TEST() + * * LOCAL MyLocalVar * STATIC MyStaticVar := {|| MyLocalVar } * @@ -309,22 +316,24 @@ * RETURN * - * The above code compiles fine in Clipper, but it generates a - * runtime error Error/BASE 1132 Bound error: array access - * Called form (b)STATICS$(0) + * El código de arriba compila bien en Clipper, pero éste genera un + * error de ejecución: + * Error/BASE 1132 Bound error: array access + * Called from (b)STATICS$(0) * - * In Harbour this code generates a compile time error: - * Error E0009 Illegal variable (b) initializer: 'MyLocalVar' + * En Harbour este código genera un error en tiempo de compilación: + * Error E0009 Illegal variable (b) initializer: 'MyLocalVar' * - * Both Clipper and Harbour are handling all local variables used in a - * codeblock in a special way: they are detached from the local stack - * of function/procedure where they are declared. This allows access to - * these variables after the exit from a function/procedure. However, - * all static variables are initialized in a separate procedure - * ('STATICS$' in Clipper and '(_INITSTATICS)' in Harbour) before the - * main procedure and before all INIT procedures. The local variables - * don't exist on the eval stack when static variables are initialized, - * so they cannot be detached. + * Ambos Clipper y Harbour estan manejando todas las variables locales + * usadas en una forma especial: ellas son separadas de la pila (stack) + * local de la función / procedimiento donde ellas son declaradas. + * Esto permite acceder a estas variables despues de la salida de una + * función / procedimiento. Sin embargo todas las variables estáticas + * son inicializadas en un procedimiento separado ('STATICS$' en Clipper + * y '(_INITSTATICS)' en Harbour) antes del procedimiento principal y + * antes de todos los procedimientos INIT. Las variables locales no + * existen en la pila de evaluación (eval stack) donde las variables + * estáticas son inicializadas, así ellas no pueden ser separadas. * * $END$ */ diff --git a/harbour/make_b32.bat b/harbour/make_b32.bat index c708ae1bf0..de0396dc42 100644 --- a/harbour/make_b32.bat +++ b/harbour/make_b32.bat @@ -16,6 +16,7 @@ if "%1" == "CLEAN" goto CLEAN :BUILD + SET BISON_SIMPLE=source\compiler\harbour.simple make -fmakefile.bc %1 %2 %3 > make_b32.log if errorlevel 1 goto BUILD_ERR diff --git a/harbour/source/vm/runner.c b/harbour/source/vm/runner.c index 0a37dde340..ec4bfb0bc8 100644 --- a/harbour/source/vm/runner.c +++ b/harbour/source/vm/runner.c @@ -273,7 +273,7 @@ HB_FUNC( __HRBDOFU ) for( i = 0; i < argc-1; i++ ) /* Push other params */ hb_vmPush( hb_param( i + 2, HB_IT_ANY ) ); - hb_vmSend( argc-1 ); /* Run function */ + hb_vmDo( argc-1 ); /* Run function */ } else hb_errRT_BASE( EG_ARG, 9999, NULL, "__HRBDOFU", 0 ); @@ -442,7 +442,7 @@ void hb_hrbDo( PHRB_BODY pHrbBody, int argc, char * argv[] ) for( i = 0; i < argc; i++ ) /* Push other cmdline params*/ hb_vmPushString( argv[i],strlen(argv[i]) ); - hb_vmSend( argc ); /* Run init function */ + hb_vmDo( argc ); /* Run init function */ } } @@ -453,7 +453,7 @@ void hb_hrbDo( PHRB_BODY pHrbBody, int argc, char * argv[] ) hb_vmPushNil(); for( i = 0; i < ( hb_pcount() - 1 ); i++ ) hb_vmPush( hb_param( i + 2, HB_IT_ANY ) ); /* Push other cmdline params*/ - hb_vmSend( hb_pcount() - 1 ); /* Run the thing !!! */ + hb_vmDo( hb_pcount() - 1 ); /* Run the thing !!! */ pRetVal = hb_itemNew( NULL ); hb_itemCopy( pRetVal, &hb_stack.Return ); @@ -465,7 +465,7 @@ void hb_hrbDo( PHRB_BODY pHrbBody, int argc, char * argv[] ) { hb_vmPushSymbol( pHrbBody->pSymRead + ul ); hb_vmPushNil(); - hb_vmSend( 0 ); /* Run exit function */ + hb_vmDo( 0 ); /* Run exit function */ pHrbBody->pSymRead[ ul ].cScope = pHrbBody->pSymRead[ ul ].cScope & ( ~HB_FS_EXIT ); /* Exit function cannot be handled by main in hvm.c */