From f30d118e0435601e5b7c1fe4052f49a44e222a35 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Fri, 24 Feb 2006 22:03:13 -0600 Subject: [PATCH] Started moving ASScript into mooutils --- Makefile.am | 1 + build/.empty | 0 .../plugins/activestrings/Makefile.incl | 43 -- .../plugins/activestrings/as-plugin-script.h | 4 +- moo/mooedit/plugins/activestrings/as-plugin.c | 2 +- moo/mooutils/mooscript/Makefile.incl | 36 ++ .../mooscript/mooscript-context.c} | 2 +- .../mooscript/mooscript-context.h} | 10 +- .../mooscript/mooscript-func.c} | 2 +- .../mooscript/mooscript-func.h} | 10 +- .../mooscript/mooscript-node.c} | 6 +- .../mooscript/mooscript-node.h} | 10 +- .../mooscript/mooscript-parser.c} | 4 +- .../mooscript/mooscript-parser.h} | 12 +- .../mooscript/mooscript-value.c} | 4 +- .../mooscript/mooscript-value.h} | 8 +- .../mooscript/mooscript-yacc.c} | 448 +++++++++++------- .../mooscript/mooscript-yacc.h} | 15 +- .../mooscript/mooscript-yacc.y} | 4 +- 19 files changed, 372 insertions(+), 249 deletions(-) create mode 100644 build/.empty delete mode 100644 moo/mooedit/plugins/activestrings/Makefile.incl create mode 100644 moo/mooutils/mooscript/Makefile.incl rename moo/{mooedit/plugins/activestrings/as-script-context.c => mooutils/mooscript/mooscript-context.c} (99%) rename moo/{mooedit/plugins/activestrings/as-script-context.h => mooutils/mooscript/mooscript-context.h} (96%) rename moo/{mooedit/plugins/activestrings/as-script-func.c => mooutils/mooscript/mooscript-func.c} (99%) rename moo/{mooedit/plugins/activestrings/as-script-func.h => mooutils/mooscript/mooscript-func.h} (96%) rename moo/{mooedit/plugins/activestrings/as-script-node.c => mooutils/mooscript/mooscript-node.c} (99%) rename moo/{mooedit/plugins/activestrings/as-script-node.h => mooutils/mooscript/mooscript-node.h} (98%) rename moo/{mooedit/plugins/activestrings/as-script-parser.c => mooutils/mooscript/mooscript-parser.c} (99%) rename moo/{mooedit/plugins/activestrings/as-script-parser.h => mooutils/mooscript/mooscript-parser.h} (94%) rename moo/{mooedit/plugins/activestrings/as-script-value.c => mooutils/mooscript/mooscript-value.c} (99%) rename moo/{mooedit/plugins/activestrings/as-script-value.h => mooutils/mooscript/mooscript-value.h} (95%) rename moo/{mooedit/plugins/activestrings/as-script-yacc.c => mooutils/mooscript/mooscript-yacc.c} (80%) rename moo/{mooedit/plugins/activestrings/as-script-yacc.h => mooutils/mooscript/mooscript-yacc.h} (82%) rename moo/{mooedit/plugins/activestrings/as-script-yacc.y => mooutils/mooscript/mooscript-yacc.y} (98%) diff --git a/Makefile.am b/Makefile.am index dac16f07..0100f394 100644 --- a/Makefile.am +++ b/Makefile.am @@ -43,6 +43,7 @@ include moo/Makefile.incl include moo/mooutils/Makefile.incl include moo/mooutils/glade/Makefile.incl include moo/mooutils/moofileview/Makefile.incl +include moo/mooutils/mooscript/Makefile.incl include moo/mooutils/newgtk/Makefile.incl include moo/mooutils/pcre/Makefile.incl include moo/mooutils/pixmaps/Makefile.incl diff --git a/build/.empty b/build/.empty new file mode 100644 index 00000000..e69de29b diff --git a/moo/mooedit/plugins/activestrings/Makefile.incl b/moo/mooedit/plugins/activestrings/Makefile.incl deleted file mode 100644 index 0d4d9796..00000000 --- a/moo/mooedit/plugins/activestrings/Makefile.incl +++ /dev/null @@ -1,43 +0,0 @@ -# -# moo/mooedit/plugins/activestrings/Makefile.incl -# - -astrings = $(mooedit_plugins)/activestrings -astrings_srcdir = $(srcdir)/$(astrings) - -astrings_extra_dist = \ - $(astrings)/as-script-yacc.y - -$(astrings)/as-script-yacc.c: $(astrings)/as-script-yacc.y - bison -d -o $(astrings_srcdir)/as-script-yacc.c $(astrings_srcdir)/as-script-yacc.y -$(astrings)/as-script-yacc.h: $(astrings)/as-script-yacc.y - bison -d -o $(astrings_srcdir)/as-script-yacc.c $(astrings_srcdir)/as-script-yacc.y - -astrings_sources = \ - $(astrings)/as-plugin.c \ - $(astrings)/as-plugin-script.c \ - $(astrings)/as-plugin-script.h \ - $(astrings)/as-plugin-xml.c \ - $(astrings)/as-plugin-xml.h \ - $(astrings)/as-script-context.c \ - $(astrings)/as-script-context.h \ - $(astrings)/as-script-func.c \ - $(astrings)/as-script-func.h \ - $(astrings)/as-script-node.c \ - $(astrings)/as-script-node.h \ - $(astrings)/as-script-parser.c \ - $(astrings)/as-script-parser.h \ - $(astrings)/as-script-value.c \ - $(astrings)/as-script-value.h \ - $(astrings)/as-script-yacc.c \ - $(astrings)/as-script-yacc.h - -astrings_built_sources = \ - $(astrings)/as-script-yacc.c \ - $(astrings)/as-script-yacc.h - -if MOO_BUILD_EDIT -moo_sources += $(astrings_sources) -moo_built_sources += $(astrings_built_sources) -moo_extra_dist += $(astrings_extra_dist) -endif diff --git a/moo/mooedit/plugins/activestrings/as-plugin-script.h b/moo/mooedit/plugins/activestrings/as-plugin-script.h index 9df7c413..f6bfa410 100644 --- a/moo/mooedit/plugins/activestrings/as-plugin-script.h +++ b/moo/mooedit/plugins/activestrings/as-plugin-script.h @@ -15,8 +15,8 @@ #ifndef __AS_PLUGIN_SCRIPT_H__ #define __AS_PLUGIN_SCRIPT_H__ -#include "as-script-context.h" -#include "as-script-node.h" +#include "mooutils/mooscript/mooscript-context.h" +#include "mooutils/mooscript/mooscript-node.h" #include "mooedit/mooedit.h" G_BEGIN_DECLS diff --git a/moo/mooedit/plugins/activestrings/as-plugin.c b/moo/mooedit/plugins/activestrings/as-plugin.c index 7df65285..c1c951b2 100644 --- a/moo/mooedit/plugins/activestrings/as-plugin.c +++ b/moo/mooedit/plugins/activestrings/as-plugin.c @@ -25,7 +25,7 @@ #include "mooutils/eggregex.h" #include "as-plugin-script.h" #include "as-plugin-xml.h" -#include "as-script-parser.h" +#include "mooutils/mooscript/mooscript-parser.h" #include #define AS_PLUGIN_ID "ActiveStrings" diff --git a/moo/mooutils/mooscript/Makefile.incl b/moo/mooutils/mooscript/Makefile.incl new file mode 100644 index 00000000..bd4a4e74 --- /dev/null +++ b/moo/mooutils/mooscript/Makefile.incl @@ -0,0 +1,36 @@ +# +# moo/mooutils/mooscript/Makefile.incl +# + +mooscript = $(mooutils)/mooscript +mooscript_srcdir = $(srcdir)/$(mooscript) + +mooscript_extra_dist = \ + $(mooscript)/mooscript-yacc.y + +$(mooscript)/mooscript-yacc.c: $(mooscript)/mooscript-yacc.y + bison -d -o $(mooscript_srcdir)/mooscript-yacc.c $(mooscript_srcdir)/mooscript-yacc.y +$(mooscript)/mooscript-yacc.h: $(mooscript)/mooscript-yacc.y + bison -d -o $(mooscript_srcdir)/mooscript-yacc.c $(mooscript_srcdir)/mooscript-yacc.y + +mooscript_sources = \ + $(mooscript)/mooscript-context.c \ + $(mooscript)/mooscript-context.h \ + $(mooscript)/mooscript-func.c \ + $(mooscript)/mooscript-func.h \ + $(mooscript)/mooscript-node.c \ + $(mooscript)/mooscript-node.h \ + $(mooscript)/mooscript-parser.c \ + $(mooscript)/mooscript-parser.h \ + $(mooscript)/mooscript-value.c \ + $(mooscript)/mooscript-value.h \ + $(mooscript)/mooscript-yacc.c \ + $(mooscript)/mooscript-yacc.h + +mooscript_built_sources = \ + $(mooscript)/mooscript-yacc.c \ + $(mooscript)/mooscript-yacc.h + +moo_sources += $(mooscript_sources) +moo_built_sources += $(mooscript_built_sources) +moo_extra_dist += $(mooscript_extra_dist) diff --git a/moo/mooedit/plugins/activestrings/as-script-context.c b/moo/mooutils/mooscript/mooscript-context.c similarity index 99% rename from moo/mooedit/plugins/activestrings/as-script-context.c rename to moo/mooutils/mooscript/mooscript-context.c index ea11300f..3f5e8541 100644 --- a/moo/mooedit/plugins/activestrings/as-script-context.c +++ b/moo/mooutils/mooscript/mooscript-context.c @@ -12,7 +12,7 @@ * See COPYING file that comes with this distribution. */ -#include "as-script-context.h" +#include "mooscript-context.h" #include #define N_POS_VARS 20 diff --git a/moo/mooedit/plugins/activestrings/as-script-context.h b/moo/mooutils/mooscript/mooscript-context.h similarity index 96% rename from moo/mooedit/plugins/activestrings/as-script-context.h rename to moo/mooutils/mooscript/mooscript-context.h index b77c5381..81acd791 100644 --- a/moo/mooedit/plugins/activestrings/as-script-context.h +++ b/moo/mooutils/mooscript/mooscript-context.h @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8 -*- * - * as-script-context.h + * mooscript-context.h * * Copyright (C) 2004-2006 by Yevgen Muntyan * @@ -12,10 +12,10 @@ * See COPYING file that comes with this distribution. */ -#ifndef __AS_SCRIPT_CONTEXT_H__ -#define __AS_SCRIPT_CONTEXT_H__ +#ifndef __MOO_SCRIPT_CONTEXT_H__ +#define __MOO_SCRIPT_CONTEXT_H__ -#include "as-script-func.h" +#include "mooscript-func.h" G_BEGIN_DECLS @@ -111,4 +111,4 @@ void as_context_clear_error (ASContext *ctx); G_END_DECLS -#endif /* __AS_SCRIPT_CONTEXT_H__ */ +#endif /* __MOO_SCRIPT_CONTEXT_H__ */ diff --git a/moo/mooedit/plugins/activestrings/as-script-func.c b/moo/mooutils/mooscript/mooscript-func.c similarity index 99% rename from moo/mooedit/plugins/activestrings/as-script-func.c rename to moo/mooutils/mooscript/mooscript-func.c index 945c2549..0fd96312 100644 --- a/moo/mooedit/plugins/activestrings/as-script-func.c +++ b/moo/mooutils/mooscript/mooscript-func.c @@ -12,7 +12,7 @@ * See COPYING file that comes with this distribution. */ -#include "as-script-func.h" +#include "mooscript-func.h" ASValue * diff --git a/moo/mooedit/plugins/activestrings/as-script-func.h b/moo/mooutils/mooscript/mooscript-func.h similarity index 96% rename from moo/mooedit/plugins/activestrings/as-script-func.h rename to moo/mooutils/mooscript/mooscript-func.h index 53c7eddf..55778ce0 100644 --- a/moo/mooedit/plugins/activestrings/as-script-func.h +++ b/moo/mooutils/mooscript/mooscript-func.h @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8 -*- * - * as-script-func.h + * mooscript-func.h * * Copyright (C) 2004-2006 by Yevgen Muntyan * @@ -12,10 +12,10 @@ * See COPYING file that comes with this distribution. */ -#ifndef __AS_SCRIPT_FUNC_H__ -#define __AS_SCRIPT_FUNC_H__ +#ifndef __MOO_SCRIPT_FUNC_H__ +#define __MOO_SCRIPT_FUNC_H__ -#include "as-script-value.h" +#include "mooscript-value.h" G_BEGIN_DECLS @@ -98,4 +98,4 @@ ASFunc *as_cfunc_new_3 (ASCFunc_3 cfunc); G_END_DECLS -#endif /* __AS_SCRIPT_FUNC_H__ */ +#endif /* __MOO_SCRIPT_FUNC_H__ */ diff --git a/moo/mooedit/plugins/activestrings/as-script-node.c b/moo/mooutils/mooscript/mooscript-node.c similarity index 99% rename from moo/mooedit/plugins/activestrings/as-script-node.c rename to moo/mooutils/mooscript/mooscript-node.c index 0783bc4e..47e7498d 100644 --- a/moo/mooedit/plugins/activestrings/as-script-node.c +++ b/moo/mooutils/mooscript/mooscript-node.c @@ -12,9 +12,9 @@ * See COPYING file that comes with this distribution. */ -#include "as-script-node.h" -#include "as-script-func.h" -#include "as-script-context.h" +#include "mooscript-node.h" +#include "mooscript-func.h" +#include "mooscript-context.h" #include diff --git a/moo/mooedit/plugins/activestrings/as-script-node.h b/moo/mooutils/mooscript/mooscript-node.h similarity index 98% rename from moo/mooedit/plugins/activestrings/as-script-node.h rename to moo/mooutils/mooscript/mooscript-node.h index 76c7e5c9..0e9f2ce8 100644 --- a/moo/mooedit/plugins/activestrings/as-script-node.h +++ b/moo/mooutils/mooscript/mooscript-node.h @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8 -*- * - * as-script-node.h + * mooscript-node.h * * Copyright (C) 2004-2006 by Yevgen Muntyan * @@ -12,10 +12,10 @@ * See COPYING file that comes with this distribution. */ -#ifndef __AS_SCRIPT_NODE_H__ -#define __AS_SCRIPT_NODE_H__ +#ifndef __MOO_SCRIPT_NODE_H__ +#define __MOO_SCRIPT_NODE_H__ -#include "as-script-func.h" +#include "mooscript-func.h" G_BEGIN_DECLS @@ -263,4 +263,4 @@ ASNodeVar *as_node_var_new_named (const char *name); G_END_DECLS -#endif /* __AS_SCRIPT_NODE_H__ */ +#endif /* __MOO_SCRIPT_NODE_H__ */ diff --git a/moo/mooedit/plugins/activestrings/as-script-parser.c b/moo/mooutils/mooscript/mooscript-parser.c similarity index 99% rename from moo/mooedit/plugins/activestrings/as-script-parser.c rename to moo/mooutils/mooscript/mooscript-parser.c index 77ebd715..b102c719 100644 --- a/moo/mooedit/plugins/activestrings/as-script-parser.c +++ b/moo/mooutils/mooscript/mooscript-parser.c @@ -12,8 +12,8 @@ * See COPYING file that comes with this distribution. */ -#include "as-script-parser.h" -#include "as-script-yacc.h" +#include "mooscript-parser.h" +#include "mooscript-yacc.h" #include diff --git a/moo/mooedit/plugins/activestrings/as-script-parser.h b/moo/mooutils/mooscript/mooscript-parser.h similarity index 94% rename from moo/mooedit/plugins/activestrings/as-script-parser.h rename to moo/mooutils/mooscript/mooscript-parser.h index a0556ff7..f45f8d66 100644 --- a/moo/mooedit/plugins/activestrings/as-script-parser.h +++ b/moo/mooutils/mooscript/mooscript-parser.h @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8 -*- * - * as-script-parser.h + * mooscript-parser.h * * Copyright (C) 2004-2006 by Yevgen Muntyan * @@ -12,12 +12,12 @@ * See COPYING file that comes with this distribution. */ -#ifndef __AS_SCRIPT_PARSER_H__ -#define __AS_SCRIPT_PARSER_H__ +#ifndef __MOO_SCRIPT_PARSER_H__ +#define __MOO_SCRIPT_PARSER_H__ #include -#include "as-script-node.h" -#include "as-script-context.h" +#include "mooscript-node.h" +#include "mooscript-context.h" G_BEGIN_DECLS @@ -76,4 +76,4 @@ ASNode *_as_parser_node_var_named (ASParser *parser, G_END_DECLS -#endif /* __AS_SCRIPT_PARSER_H__ */ +#endif /* __MOO_SCRIPT_PARSER_H__ */ diff --git a/moo/mooedit/plugins/activestrings/as-script-value.c b/moo/mooutils/mooscript/mooscript-value.c similarity index 99% rename from moo/mooedit/plugins/activestrings/as-script-value.c rename to moo/mooutils/mooscript/mooscript-value.c index 6dabbda5..9f3968e1 100644 --- a/moo/mooedit/plugins/activestrings/as-script-value.c +++ b/moo/mooutils/mooscript/mooscript-value.c @@ -12,8 +12,8 @@ * See COPYING file that comes with this distribution. */ -#include "as-script-value.h" -#include "as-script-context.h" +#include "mooscript-value.h" +#include "mooscript-context.h" #include diff --git a/moo/mooedit/plugins/activestrings/as-script-value.h b/moo/mooutils/mooscript/mooscript-value.h similarity index 95% rename from moo/mooedit/plugins/activestrings/as-script-value.h rename to moo/mooutils/mooscript/mooscript-value.h index 5d984cf0..a0f6e01e 100644 --- a/moo/mooedit/plugins/activestrings/as-script-value.h +++ b/moo/mooutils/mooscript/mooscript-value.h @@ -1,6 +1,6 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4; coding: utf-8 -*- * - * as-script-value.h + * mooscript-value.h * * Copyright (C) 2004-2006 by Yevgen Muntyan * @@ -12,8 +12,8 @@ * See COPYING file that comes with this distribution. */ -#ifndef __AS_SCRIPT_VALUE_H__ -#define __AS_SCRIPT_VALUE_H__ +#ifndef __MOO_SCRIPT_VALUE_H__ +#define __MOO_SCRIPT_VALUE_H__ #include @@ -108,4 +108,4 @@ int as_value_cmp (ASValue *a, G_END_DECLS -#endif /* __AS_SCRIPT_VALUE_H__ */ +#endif /* __MOO_SCRIPT_VALUE_H__ */ diff --git a/moo/mooedit/plugins/activestrings/as-script-yacc.c b/moo/mooutils/mooscript/mooscript-yacc.c similarity index 80% rename from moo/mooedit/plugins/activestrings/as-script-yacc.c rename to moo/mooutils/mooscript/mooscript-yacc.c index 5a2d9d5c..020d4bbb 100644 --- a/moo/mooedit/plugins/activestrings/as-script-yacc.c +++ b/moo/mooutils/mooscript/mooscript-yacc.c @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.0. */ +/* A Bison parser, made by GNU Bison 2.1. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -36,6 +36,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.1" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -81,6 +84,7 @@ UMINUS = 275 }; #endif +/* Tokens. */ #define IDENTIFIER 258 #define LITERAL 259 #define VARIABLE 260 @@ -104,10 +108,10 @@ /* Copy the first part of user declarations. */ -#line 1 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 1 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" -#include "as-script-parser.h" -#include "as-script-yacc.h" +#include "mooscript-parser.h" +#include "mooscript-yacc.h" #define NODE_LIST_ADD(list, node) _as_parser_node_list_add (parser, AS_NODE_LIST (list), node) #define NODE_COMMAND(id, node) _as_parser_node_command (parser, id, AS_NODE_LIST (node)) @@ -139,15 +143,20 @@ # define YYERROR_VERBOSE 0 #endif +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 24 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 24 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" typedef union YYSTYPE { int ival; const char *str; ASNode *node; } YYSTYPE; -/* Line 190 of yacc.c. */ -#line 151 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.c" +/* Line 196 of yacc.c. */ +#line 160 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.c" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 @@ -158,18 +167,37 @@ typedef union YYSTYPE { /* Copy the second part of user declarations. */ -/* Line 213 of yacc.c. */ -#line 163 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.c" +/* Line 219 of yacc.c. */ +#line 172 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.c" + +#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) +# define YYSIZE_T __SIZE_TYPE__ +#endif +#if ! defined (YYSIZE_T) && defined (size_t) +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus)) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +#endif +#if ! defined (YYSIZE_T) +# define YYSIZE_T unsigned int +#endif + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif #if ! defined (yyoverflow) || YYERROR_VERBOSE -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif - /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA @@ -178,6 +206,10 @@ typedef union YYSTYPE { # define YYSTACK_ALLOC __builtin_alloca # else # define YYSTACK_ALLOC alloca +# if defined (__STDC__) || defined (__cplusplus) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYINCLUDED_STDLIB_H +# endif # endif # endif # endif @@ -185,13 +217,39 @@ typedef union YYSTYPE { # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */ # endif +# else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1) +# endif +# ifdef __cplusplus +extern "C" { +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \ + && (defined (__STDC__) || defined (__cplusplus))) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifdef __cplusplus +} +# endif # endif #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ @@ -226,7 +284,7 @@ union yyalloc # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ @@ -276,7 +334,7 @@ union yyalloc #define YYUNDEFTOK 2 #define YYMAXUTOK 275 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ @@ -359,8 +417,8 @@ static const unsigned char yyrline[] = }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { @@ -551,22 +609,6 @@ static const unsigned char yystos[] = 44 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -596,8 +638,8 @@ do \ goto yybackup; \ } \ else \ - { \ - yyerror (parser, "syntax error: cannot back up");\ + { \ + yyerror (parser, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) @@ -676,7 +718,7 @@ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ + yysymprint (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ @@ -724,13 +766,13 @@ yy_reduce_print (yyrule) #endif { int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ", yyrule - 1, yylno); /* Print the symbols being reduced, and their result. */ for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]); + YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]); } # define YY_REDUCE_PRINT(Rule) \ @@ -759,7 +801,7 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH @@ -783,7 +825,7 @@ yystrlen (yystr) const char *yystr; # endif { - register const char *yys = yystr; + const char *yys = yystr; while (*yys++ != '\0') continue; @@ -808,8 +850,8 @@ yystpcpy (yydest, yysrc) const char *yysrc; # endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -819,7 +861,55 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + size_t yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +#endif /* YYERROR_VERBOSE */ @@ -944,8 +1034,8 @@ yyparse (parser) #endif { - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; @@ -963,12 +1053,12 @@ yyparse (parser) /* The state stack. */ short int yyssa[YYINITDEPTH]; short int *yyss = yyssa; - register short int *yyssp; + short int *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; @@ -1000,9 +1090,6 @@ yyparse (parser) yyssp = yyss; yyvsp = yyvs; - - yyvsp[0] = yylval; - goto yysetstate; /*------------------------------------------------------------. @@ -1035,7 +1122,7 @@ yyparse (parser) data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1046,11 +1133,11 @@ yyparse (parser) } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; @@ -1060,7 +1147,7 @@ yyparse (parser) union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1189,215 +1276,216 @@ yyreduce: switch (yyn) { case 2: -#line 60 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 60 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { SET_TOP_NODE ((yyvsp[0].node)); ;} break; case 3: -#line 62 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 62 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_LIST_ADD (NULL, (yyvsp[-1].node)); ;} break; case 4: -#line 63 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 63 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_LIST_ADD ((yyvsp[-2].node), (yyvsp[-1].node)); ;} break; case 5: -#line 67 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 67 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = (yyvsp[-1].node); ;} break; case 12: -#line 76 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 76 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NULL; ;} break; case 14: -#line 80 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 80 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NULL; ;} break; case 17: -#line 83 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 83 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_LIST_ADD ((yyvsp[-1].node), (yyvsp[0].node)); ;} break; case 18: -#line 86 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 86 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_COMMAND ((yyvsp[-1].str), (yyvsp[0].node)); ;} break; case 19: -#line 89 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 89 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NULL; ;} break; case 20: -#line 90 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 90 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_LIST_ADD ((yyvsp[-1].node), (yyvsp[0].node)); ;} break; case 21: -#line 93 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 93 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_IF_ELSE ((yyvsp[-2].node), (yyvsp[0].node), NULL); ;} break; case 22: -#line 95 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 95 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_IF_ELSE ((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 23: -#line 98 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 98 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_IF_ELSE ((yyvsp[-4].node), (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 24: -#line 101 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 101 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_REPEAT ((yyvsp[-1].node), (yyvsp[0].node)); ;} break; case 25: -#line 102 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 102 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_WHILE ((yyvsp[-1].node), (yyvsp[0].node)); ;} break; case 26: -#line 106 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 106 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_ASSIGNMENT ((yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 28: -#line 110 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 110 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_PLUS, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 29: -#line 111 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 111 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_MINUS, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 30: -#line 112 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 112 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_DIV, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 31: -#line 113 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 113 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_MULT, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 32: -#line 115 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 115 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_AND, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 33: -#line 116 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 116 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_OR, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 34: -#line 118 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 118 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_EQ, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 35: -#line 119 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 119 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_NEQ, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 36: -#line 120 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 120 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_LT, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 37: -#line 121 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 121 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_GT, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 38: -#line 122 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 122 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_LE, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 39: -#line 123 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 123 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_GE, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 40: -#line 127 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 127 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_NUMBER ((yyvsp[0].ival)); ;} break; case 41: -#line 128 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 128 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_STRING ((yyvsp[0].str)); ;} break; case 43: -#line 130 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 130 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = (yyvsp[-1].node); ;} break; case 44: -#line 131 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 131 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_VALUE_LIST ((yyvsp[-1].node)); ;} break; case 45: -#line 132 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 132 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = BINARY_OP (AS_OP_FORMAT, (yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 46: -#line 133 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 133 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = UNARY_OP (AS_OP_LEN, (yyvsp[0].node)); ;} break; case 47: -#line 134 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 134 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = UNARY_OP (AS_OP_NOT, (yyvsp[0].node)); ;} break; case 48: -#line 135 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 135 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = UNARY_OP (AS_OP_UMINUS, (yyvsp[0].node)); ;} break; case 49: -#line 138 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 138 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NULL; ;} break; case 50: -#line 139 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 139 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_LIST_ADD (NULL, (yyvsp[0].node)); ;} break; case 51: -#line 140 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 140 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = NODE_LIST_ADD ((yyvsp[-2].node), (yyvsp[0].node)); ;} break; case 52: -#line 143 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 143 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = VAR_POSITIONAL ((yyvsp[0].ival)); ;} break; case 53: -#line 144 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 144 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" { (yyval.node) = VAR_NAMED ((yyvsp[0].str)); ;} break; + default: break; } -/* Line 1037 of yacc.c. */ -#line 1401 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.c" +/* Line 1126 of yacc.c. */ +#line 1489 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.c" yyvsp -= yylen; yyssp -= yylen; @@ -1436,12 +1524,36 @@ yyerrlab: if (YYPACT_NINF < yyn && yyn < YYLAST) { - YYSIZE_T yysize = 0; int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + char *yymsg = 0; +# define YYERROR_VERBOSE_ARGS_MAXIMUM 5 + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; +#if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +#endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; @@ -1449,48 +1561,68 @@ yyerrlab: /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); - yyprefix = ", expecting "; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { - yysize = 0; + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; break; } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - if (yycount < 5) + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= yysize1 < yysize; + yysize = yysize1; + + if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM) + yymsg = (char *) YYSTACK_ALLOC (yysize); + if (yymsg) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yymsg; + int yyi = 0; + while ((*yyp = *yyf)) { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; - } + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } } yyerror (parser, yymsg); YYSTACK_FREE (yymsg); } else - yyerror (parser, "syntax error; also virtual memory exhausted"); + { + yyerror (parser, YY_("syntax error")); + goto yyexhaustedlab; + } } else #endif /* YYERROR_VERBOSE */ - yyerror (parser, "syntax error"); + yyerror (parser, YY_("syntax error")); } @@ -1502,18 +1634,9 @@ yyerrlab: if (yychar <= YYEOF) { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ + /* Return failure if at end of input. */ if (yychar == YYEOF) - for (;;) - { - - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - yydestruct ("Error: popping", - yystos[*yyssp], yyvsp); - } + YYABORT; } else { @@ -1532,12 +1655,11 @@ yyerrlab: `---------------------------------------------------*/ yyerrorlab: -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ if (0) goto yyerrorlab; -#endif yyvsp -= yylen; yyssp -= yylen; @@ -1600,23 +1722,29 @@ yyacceptlab: | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: - yydestruct ("Error: discarding lookahead", - yytoken, &yylval); - yychar = YYEMPTY; yyresult = 1; goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror (parser, "parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (parser, YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK; + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); @@ -1625,6 +1753,6 @@ yyreturn: } -#line 147 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 147 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" diff --git a/moo/mooedit/plugins/activestrings/as-script-yacc.h b/moo/mooutils/mooscript/mooscript-yacc.h similarity index 82% rename from moo/mooedit/plugins/activestrings/as-script-yacc.h rename to moo/mooutils/mooscript/mooscript-yacc.h index 1fc7be3e..d54ad3de 100644 --- a/moo/mooedit/plugins/activestrings/as-script-yacc.h +++ b/moo/mooutils/mooscript/mooscript-yacc.h @@ -1,7 +1,7 @@ -/* A Bison parser, made by GNU Bison 2.0. */ +/* A Bison parser, made by GNU Bison 2.1. */ /* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /* As a special exception, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. @@ -49,6 +49,7 @@ UMINUS = 275 }; #endif +/* Tokens. */ #define IDENTIFIER 258 #define LITERAL 259 #define VARIABLE 260 @@ -72,14 +73,14 @@ #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) -#line 24 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.y" +#line 24 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.y" typedef union YYSTYPE { int ival; const char *str; ASNode *node; } YYSTYPE; -/* Line 1318 of yacc.c. */ -#line 83 "/home/muntyan/Projects/moo-svn/moo/mooedit/plugins/activestrings/as-script-yacc.h" +/* Line 1447 of yacc.c. */ +#line 84 "/home/muntyan/projects/moo/moo/mooutils/mooscript/mooscript-yacc.h" # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 diff --git a/moo/mooedit/plugins/activestrings/as-script-yacc.y b/moo/mooutils/mooscript/mooscript-yacc.y similarity index 98% rename from moo/mooedit/plugins/activestrings/as-script-yacc.y rename to moo/mooutils/mooscript/mooscript-yacc.y index 90535754..bd89c890 100644 --- a/moo/mooedit/plugins/activestrings/as-script-yacc.y +++ b/moo/mooutils/mooscript/mooscript-yacc.y @@ -1,6 +1,6 @@ %{ -#include "as-script-parser.h" -#include "as-script-yacc.h" +#include "mooscript-parser.h" +#include "mooscript-yacc.h" #define NODE_LIST_ADD(list, node) _as_parser_node_list_add (parser, AS_NODE_LIST (list), node) #define NODE_COMMAND(id, node) _as_parser_node_command (parser, id, AS_NODE_LIST (node))