2007-08-23 23:37:33 +00:00
|
|
|
/* A Bison parser, made by GNU Bison 2.1a. */
|
2006-04-24 17:41:27 +00:00
|
|
|
|
2007-08-23 23:37:33 +00:00
|
|
|
/* Skeleton parser for Yacc-like parsing with Bison,
|
|
|
|
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
2006-04-24 17:41:27 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
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., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA. */
|
|
|
|
|
2007-08-23 23:37:33 +00:00
|
|
|
/* As a special exception, when this file is copied by Bison into a
|
|
|
|
Bison output file, you may use that output file without restriction.
|
|
|
|
This special exception was added by the Free Software Foundation
|
|
|
|
in version 1.24 of Bison. */
|
2006-04-24 17:41:27 +00:00
|
|
|
|
|
|
|
/* Tokens. */
|
|
|
|
#ifndef YYTOKENTYPE
|
|
|
|
# define YYTOKENTYPE
|
|
|
|
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
|
|
|
know about them. */
|
|
|
|
enum yytokentype {
|
|
|
|
KW_CONTEXT = 258,
|
|
|
|
LC = 259,
|
|
|
|
RC = 260,
|
|
|
|
LP = 261,
|
|
|
|
RP = 262,
|
|
|
|
SEMI = 263,
|
|
|
|
EQ = 264,
|
|
|
|
COMMA = 265,
|
|
|
|
COLON = 266,
|
|
|
|
AMPER = 267,
|
|
|
|
BAR = 268,
|
|
|
|
AT = 269,
|
|
|
|
KW_MACRO = 270,
|
|
|
|
KW_GLOBALS = 271,
|
|
|
|
KW_IGNOREPAT = 272,
|
|
|
|
KW_SWITCH = 273,
|
|
|
|
KW_IF = 274,
|
|
|
|
KW_IFTIME = 275,
|
|
|
|
KW_ELSE = 276,
|
|
|
|
KW_RANDOM = 277,
|
|
|
|
KW_ABSTRACT = 278,
|
Merged revisions 87168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line
closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config,
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 17:39:39 +00:00
|
|
|
KW_EXTEND = 279,
|
|
|
|
EXTENMARK = 280,
|
|
|
|
KW_GOTO = 281,
|
|
|
|
KW_JUMP = 282,
|
|
|
|
KW_RETURN = 283,
|
|
|
|
KW_BREAK = 284,
|
|
|
|
KW_CONTINUE = 285,
|
|
|
|
KW_REGEXTEN = 286,
|
|
|
|
KW_HINT = 287,
|
|
|
|
KW_FOR = 288,
|
|
|
|
KW_WHILE = 289,
|
|
|
|
KW_CASE = 290,
|
|
|
|
KW_PATTERN = 291,
|
|
|
|
KW_DEFAULT = 292,
|
|
|
|
KW_CATCH = 293,
|
|
|
|
KW_SWITCHES = 294,
|
|
|
|
KW_ESWITCHES = 295,
|
|
|
|
KW_INCLUDES = 296,
|
|
|
|
KW_LOCAL = 297,
|
|
|
|
word = 298
|
2006-04-24 17:41:27 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
/* Tokens. */
|
|
|
|
#define KW_CONTEXT 258
|
|
|
|
#define LC 259
|
|
|
|
#define RC 260
|
|
|
|
#define LP 261
|
|
|
|
#define RP 262
|
|
|
|
#define SEMI 263
|
|
|
|
#define EQ 264
|
|
|
|
#define COMMA 265
|
|
|
|
#define COLON 266
|
|
|
|
#define AMPER 267
|
|
|
|
#define BAR 268
|
|
|
|
#define AT 269
|
|
|
|
#define KW_MACRO 270
|
|
|
|
#define KW_GLOBALS 271
|
|
|
|
#define KW_IGNOREPAT 272
|
|
|
|
#define KW_SWITCH 273
|
|
|
|
#define KW_IF 274
|
|
|
|
#define KW_IFTIME 275
|
|
|
|
#define KW_ELSE 276
|
|
|
|
#define KW_RANDOM 277
|
|
|
|
#define KW_ABSTRACT 278
|
Merged revisions 87168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line
closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config,
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 17:39:39 +00:00
|
|
|
#define KW_EXTEND 279
|
|
|
|
#define EXTENMARK 280
|
|
|
|
#define KW_GOTO 281
|
|
|
|
#define KW_JUMP 282
|
|
|
|
#define KW_RETURN 283
|
|
|
|
#define KW_BREAK 284
|
|
|
|
#define KW_CONTINUE 285
|
|
|
|
#define KW_REGEXTEN 286
|
|
|
|
#define KW_HINT 287
|
|
|
|
#define KW_FOR 288
|
|
|
|
#define KW_WHILE 289
|
|
|
|
#define KW_CASE 290
|
|
|
|
#define KW_PATTERN 291
|
|
|
|
#define KW_DEFAULT 292
|
|
|
|
#define KW_CATCH 293
|
|
|
|
#define KW_SWITCHES 294
|
|
|
|
#define KW_ESWITCHES 295
|
|
|
|
#define KW_INCLUDES 296
|
|
|
|
#define KW_LOCAL 297
|
|
|
|
#define word 298
|
2006-04-24 17:41:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-06-18 21:36:24 +00:00
|
|
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
|
|
|
typedef union YYSTYPE
|
(closes issue #6002)
Reported by: rizzo
Tested by: murf
Proposal of the changes to be made, and then an announcement of how they were accomplished:
http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html
and:
http://lists.digium.com/pipermail/asterisk-dev/2008-March/032124.html
Here is a recap, file by file, of what I have done:
pbx/pbx_config.c
pbx/pbx_ael.c
All funcs that were passed a ptr to the context list, now will ALSO be passed a hashtab ptr to the same set.
Why? because (for the time being), the dialplan is stored in both, to facilitate a quick, low-cost move to
hash-tables to speed up dialplan processing. If it was deemed necessary to pass the context LIST, well, it
is just as necessary to have the TABLE available. This is because the list/table in question might not be
the global one, but temporary ones we would use to stage the dialplan on, and then swap into the global
position when things are ready.
We now have one external function for apps to use, "ast_context_find_or_create()" instead of the pre-existing
"find" and "create", as all existing usages used both in tandem anyway.
pbx_config, and pbx_ael, will stage the reloaded dialplan into local lists and tables, and
then call merge_contexts_and_delete, which will merge (now) existing contexts and
priorities from other registrars into this local set by copying them. Then, merge_contexts_and_delete will
lock down the contexts, swap the lists and tables, and unlock (real quick), and then
destroy the old dialplan.
chan_sip.c
chan_iax.c
chan_skinny.c
All the channel drivers that would add regcontexts now use the ast_context_find_or_create now.
chan_sip also includes a small fix to get rid of warnings about removing priorities that never got entered.
apps/app_meetme.c
apps/app_dial.c
apps/app_queue.c
All the apps that added a context/exten/priority were also modified to use ast_context_find_or_create instead.
include/asterisk/pbx.h
ast_context_create() is removed. Find_or_create_ is the new method.
ast_context_find_or_create() interface gets the hashtab added.
ast_merge_contexts_and_delete() gets the local hashtab arg added.
ast_wrlock_contexts_version() is added so you can detect if someone else got a writelock between your readlocking and writelocking.
ast_hashtab_compare_contexts was made public for use in pbx_config/pbx_ael
ast_hashtab_hash_contexts was in like fashion make public.
include/asterisk/pval.h
ast_compile_ael2() interface changed to include the local hashtab table ptr.
main/features.c
For the sake of the parking context, we use ast_context_find_or_create().
main/pbx.c
I changed all the "tree" names to "table" instead. That's because the original
implementation was based on binary trees. (had a free library). Then I moved
to hashtabs. Now, the names move forward too.
refcount field added to contexts, so you can keep track of how many modules
wanted this context to exist.
Some log messages that are warnings were inflated from LOG_NOTICE to LOG_WARNING.
Added some calls to ast_verb(3,...) for debug messages
Lots of little mods to ast_context_remove_extension2, which is now excersized in ways
it was not previously; one definite bug fixed.
find_or_create was upgraded to handle both local lists/tables as well as the globals.
context_merge() was added to do the per-context merging of the old/present contexts/extens/prios into the new/proposed local list/tables
ast_merge_contexts_and_delete() was heavily modified.
ast_add_extension2() was also upgraded to handle changes.
the context_destroy() code was re-engineered to handle the new way of doing things,
by exten/prio instead of by context.
res/ael/pval.c
res/ael/ael.tab.c
res/ael/ael.tab.h
res/ael/ael.y
res/ael/ael_lex.c
res/ael/ael.flex
utils/ael_main.c
utils/extconf.c
utils/conf2ael.c
utils/Makefile
Had to change the interface to ast_compile_ael2(), to include the hashtab ptr.
This ended up involving several external apps. The main gotcha was I had to
include lock.h and hashtab.h in several places.
As a side note, I tested this stuff pretty thoroughly, I replicated the problems
originally reported by Luigi, and made triply sure that reloads worked, and everything
worked thru "stop gracefully". I found a and fixed a few bugs as I was merging into
trunk, that did not appear in my tests of bug6002.
How's this for verbose commit messages?
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07 18:57:57 +00:00
|
|
|
#line 56 "ael.y"
|
2006-06-18 21:36:24 +00:00
|
|
|
{
|
2006-04-30 12:44:54 +00:00
|
|
|
int intval; /* integer value, typically flags */
|
|
|
|
char *str; /* strings */
|
|
|
|
struct pval *pval; /* full objects */
|
2006-06-18 21:36:24 +00:00
|
|
|
}
|
2007-08-23 23:37:33 +00:00
|
|
|
/* Line 1536 of yacc.c. */
|
Merged revisions 87168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line
closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config,
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26 17:39:39 +00:00
|
|
|
#line 131 "ael.tab.h"
|
2006-06-18 21:36:24 +00:00
|
|
|
YYSTYPE;
|
2006-04-24 17:41:27 +00:00
|
|
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
|
|
|
# define YYSTYPE_IS_DECLARED 1
|
|
|
|
# define YYSTYPE_IS_TRIVIAL 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-06-18 21:36:24 +00:00
|
|
|
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
|
2006-04-24 17:41:27 +00:00
|
|
|
typedef struct YYLTYPE
|
|
|
|
{
|
|
|
|
int first_line;
|
|
|
|
int first_column;
|
|
|
|
int last_line;
|
|
|
|
int last_column;
|
|
|
|
} YYLTYPE;
|
|
|
|
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
|
|
|
|
# define YYLTYPE_IS_DECLARED 1
|
|
|
|
# define YYLTYPE_IS_TRIVIAL 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2007-08-23 23:37:33 +00:00
|
|
|
|
|
|
|
|