Skip to content

Commit

Permalink
2024-12-13 09:06 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
Browse files Browse the repository at this point in the history
  * src/compiler/harbour.y
  * src/macro/macro.y
    * replaced depreciated bison macro %pure-parser with %define api.pure

  * src/compiler/complex.c
  * src/macro/macrolex.c
  * src/compiler/harbour.y
  * src/macro/macro.y
    * replaced depreciated bison macro %name-prefix with %define api.prefix

  ; Warning: now Bison 2.6 or newer is required to regenerate Harbour grammar
             files. If someone wants/needs to work with older bison versions
             then it's enough to restore depreciated macros, Harbour compiler
             and macros lexers will work with both versions.

  * src/compiler/harbour.yyc
  * src/compiler/harbour.yyh
  * src/macro/macro.yyc
  * src/macro/macro.yyh
    * regenerated with Bison 3.02 (the same as before)
    * re-added HB_SYMBOL_UNUSED( yynerrs ) to pacify some compilers warnings
  • Loading branch information
druzus committed Dec 13, 2024
1 parent 68af17b commit 1b57427
Show file tree
Hide file tree
Showing 9 changed files with 1,194 additions and 1,128 deletions.
23 changes: 23 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */

2024-12-13 09:06 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/compiler/harbour.y
* src/macro/macro.y
* replaced depreciated bison macro %pure-parser with %define api.pure

* src/compiler/complex.c
* src/macro/macrolex.c
* src/compiler/harbour.y
* src/macro/macro.y
* replaced depreciated bison macro %name-prefix with %define api.prefix

; Warning: now Bison 2.6 or newer is required to regenerate Harbour grammar
files. If someone wants/needs to work with older bison versions
then it's enough to restore depreciated macros, Harbour compiler
and macros lexers will work with both versions.

* src/compiler/harbour.yyc
* src/compiler/harbour.yyh
* src/macro/macro.yyc
* src/macro/macro.yyh
* regenerated with Bison 3.02 (the same as before)
* re-added HB_SYMBOL_UNUSED( yynerrs ) to pacify some compilers warnings

2024-12-12 21:30 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/compiler/genc.c
! fixed detection of C function written in C inside
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/complex.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
#include "hbdate.h"
#include "harboury.h"

#ifdef HB_COMP_YYSTYPE_IS_DECLARED
# define YYSTYPE HB_COMP_YYSTYPE
#endif

#define HB_PP_LEX_SELF(t) ( HB_PP_TOKEN_TYPE((t)->type) == HB_PP_TOKEN_SEND && \
(t)->pNext && (t)->pNext->spaces == 0 && \
HB_PP_TOKEN_TYPE((t)->pNext->type) == HB_PP_TOKEN_SEND )
Expand Down
5 changes: 3 additions & 2 deletions src/compiler/harbour.y
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
%pure-parser
%define api.pure
%parse-param { PHB_COMP pComp }
%lex-param { PHB_COMP pComp }
%name-prefix "hb_comp_yy"
%define api.prefix {hb_comp_yy}

%{
/*
* Compiler YACC rules and actions
Expand Down
1,877 changes: 943 additions & 934 deletions src/compiler/harbour.yyc

Large diffs are not rendered by default.

34 changes: 21 additions & 13 deletions src/compiler/harbour.yyh
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,25 @@
#ifndef YY_HB_COMP_YY_HARBOURY_H_INCLUDED
# define YY_HB_COMP_YY_HARBOURY_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#ifndef HB_COMP_YYDEBUG
# if defined YYDEBUG
#if YYDEBUG
# define HB_COMP_YYDEBUG 1
# else
# define HB_COMP_YYDEBUG 0
# endif
# else /* ! defined YYDEBUG */
# define HB_COMP_YYDEBUG 0
# endif /* ! defined YYDEBUG */
#endif /* ! defined HB_COMP_YYDEBUG */
#if HB_COMP_YYDEBUG
extern int hb_comp_yydebug;
#endif

/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
#ifndef HB_COMP_YYTOKENTYPE
# define HB_COMP_YYTOKENTYPE
enum hb_comp_yytokentype
{
FUNCTION = 258,
PROCEDURE = 259,
Expand Down Expand Up @@ -159,11 +167,11 @@ extern int hb_comp_yydebug;
#endif

/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE YYSTYPE;
union YYSTYPE
#if ! defined HB_COMP_YYSTYPE && ! defined HB_COMP_YYSTYPE_IS_DECLARED
typedef union HB_COMP_YYSTYPE HB_COMP_YYSTYPE;
union HB_COMP_YYSTYPE
{
#line 125 "harbour.y" /* yacc.c:1909 */
#line 126 "harbour.y" /* yacc.c:1909 */

const char * string; /* to hold a string returned by lex */
int iNumber; /* to hold a temporary integer number */
Expand Down Expand Up @@ -202,10 +210,10 @@ union YYSTYPE
} asCodeblock;
PHB_VARTYPE asVarType;

#line 206 "harboury.h" /* yacc.c:1909 */
#line 214 "harboury.h" /* yacc.c:1909 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
# define HB_COMP_YYSTYPE_IS_TRIVIAL 1
# define HB_COMP_YYSTYPE_IS_DECLARED 1
#endif


Expand Down
4 changes: 2 additions & 2 deletions src/macro/macro.y
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%pure-parser
%define api.pure
%parse-param { PHB_MACRO pMacro }
%lex-param { PHB_MACRO pMacro }
%name-prefix "hb_macro_yy"
%define api.prefix {hb_macro_yy}

%{
/*
Expand Down
Loading

0 comments on commit 1b57427

Please sign in to comment.