]> git.draconx.ca Git - cdecl99.git/commitdiff
Add cdecl__ prefix to flex/bison functions.
authorNick Bowler <nbowler@draconx.ca>
Tue, 19 Jul 2011 23:13:23 +0000 (19:13 -0400)
committerNick Bowler <nbowler@draconx.ca>
Tue, 19 Jul 2011 23:13:29 +0000 (19:13 -0400)
Now all global symbols are prefixed.

src/parse-decl.c
src/parse.y
src/scan.l

index 5002f593fc66422400d8d34571b2bd9857a48242..3ffb1029ae181b596da102f367130f5f84bd83c4 100644 (file)
@@ -391,14 +391,14 @@ struct cdecl *cdecl_parse_decl(const char *declstr)
        struct cdecl *decl;
        int rc;
 
-       rc = yylex_init(&scanner);
+       rc = cdecl__yylex_init(&scanner);
        if (rc != 0)
                return NULL;
 
-       state = yy_scan_string(declstr, scanner);
-       rc = yyparse(scanner, &decl);
-       yy_delete_buffer(state, scanner);
-       yylex_destroy(scanner);
+       state = cdecl__yy_scan_string(declstr, scanner);
+       rc = cdecl__yyparse(scanner, &decl);
+       cdecl__yy_delete_buffer(state, scanner);
+       cdecl__yylex_destroy(scanner);
 
        if (rc != 0)
                return NULL;
@@ -437,14 +437,14 @@ struct cdecl *cdecl_parse_english(const char *english)
        struct cdecl *decl;
        int rc;
 
-       rc = yylex_init_extra(true, &scanner);
+       rc = cdecl__yylex_init_extra(true, &scanner);
        if (rc != 0)
                return NULL;
 
-       state = yy_scan_string(english, scanner);
-       rc = yyparse(scanner, &decl);
-       yy_delete_buffer(state, scanner);
-       yylex_destroy(scanner);
+       state = cdecl__yy_scan_string(english, scanner);
+       rc = cdecl__yyparse(scanner, &decl);
+       cdecl__yy_delete_buffer(state, scanner);
+       cdecl__yylex_destroy(scanner);
 
        if (rc != 0)
                return NULL;
index 32ee5a7d1efdbd608413964a8302594321c9c418..1cda21f14d7c39328518345667a31d705c019cfc 100644 (file)
@@ -18,6 +18,7 @@
  */
 }
 
+%name-prefix "cdecl__yy"
 %parse-param {yyscan_t scanner}
 %parse-param {struct cdecl **out}
 %lex-param {yyscan_t scanner}
@@ -54,8 +55,8 @@
 }
 
 %code provides {
-void yyerror(YYLTYPE *, void *, struct cdecl **, const char *);
-int yyparse(void *scanner, struct cdecl **out);
+void cdecl__yyerror(YYLTYPE *, void *, struct cdecl **, const char *);
+int cdecl__yyparse(void *scanner, struct cdecl **out);
 }
 
 %union {
index bb6564b7d214be4c82b12d89885959cf9afae147..e59b0aae85bc73bd121a051d008e0422aa672136 100644 (file)
 
 %option noyywrap bison-locations reentrant
 %option extra-type="_Bool"
+%option prefix="cdecl__yy"
 
 %{
 #define lex_error(msg) do { \
-       yyerror(yylloc, NULL, NULL, (msg)); \
+       cdecl__yyerror(yylloc, NULL, NULL, (msg)); \
        return T_LEX_ERROR; \
 } while(0)