Steve Kann - new jitter buffer for IAX2
stevek@stevek.com
Constantine Filin - major contributions to the Asterisk Realtime Architecture
-Steve Murphy - privacy support
+Steve Murphy - privacy support, $[ ] parser upgrade, AEL2 parser upgrade
Claude Patry - bug fixes, feature enhancements, and bug marshalling
cpatry@gmail.com
-/* A Bison parser, made by GNU Bison 2.1. */
+/* A Bison parser, made by GNU Bison 2.1a. */
/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
-/* Written by Richard Stallman by simplifying the original so called
- ``semantic'' parser. */
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
/* All symbols defined below should begin with yy or YY, to avoid
infringing on user name space. This should be done even for local
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.1"
+#define YYBISON_VERSION "2.1a"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
#include <stdlib.h>
#include <string.h>
#include <locale.h>
+#include <unistd.h>
#include <ctype.h>
#if !defined(SOLARIS) && !defined(__CYGWIN__)
#include <err.h>
#define YYPARSE_PARAM parseio
#define YYLEX_PARAM ((struct parse_io *)parseio)->scanner
#define YYERROR_VERBOSE 1
+extern char extra_error_message[4095];
+extern int extra_error_message_supplied;
enum valtype {
AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string
some useful info about the error. Not as easy as it looks, but it
is possible. */
#define ast_yyerror(x) ast_yyerror(x,&yyloc,parseio)
-#define DESTROY(x) { \
-if ((x)->type == AST_EXPR_numeric_string || (x)->type == AST_EXPR_string) \
- free((x)->u.s); \
- (x)->u.s = 0; \
- free(x); \
-}
+#define DESTROY(x) {if((x)->type == AST_EXPR_numeric_string || (x)->type == AST_EXPR_string) free((x)->u.s); (x)->u.s = 0; free(x);}
/* Enabling traces. */
# define YYTOKEN_TABLE 0
#endif
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 142 "ast_expr2.y"
-typedef union YYSTYPE {
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 140 "ast_expr2.y"
+{
struct val *val;
-} YYSTYPE;
-/* Line 196 of yacc.c. */
-#line 277 "ast_expr2.c"
+}
+/* Line 198 of yacc.c. */
+#line 276 "ast_expr2.c"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
#endif
-#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
int first_line;
/* Copy the second part of user declarations. */
-#line 146 "ast_expr2.y"
+#line 144 "ast_expr2.y"
extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
-/* Line 219 of yacc.c. */
+/* Line 221 of yacc.c. */
#line 304 "ast_expr2.c"
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
#endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
#endif
-#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
#endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
#endif
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
#ifndef YY_
# if YYENABLE_NLS
# if ENABLE_NLS
# endif
#endif
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions. */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+ int i;
+#endif
+{
+ return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
# if YYSTACK_USE_ALLOCA
# ifdef __GNUC__
# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if defined (__STDC__) || defined (__cplusplus)
+# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# define YYINCLUDED_STDLIB_H
+# ifndef _STDLIB_H
+# define _STDLIB_H 1
+# endif
# endif
# endif
# endif
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+ /* Pacify GCC's `empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
# 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 */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
# endif
# else
# define YYSTACK_ALLOC YYMALLOC
# define YYSTACK_FREE YYFREE
# ifndef YYSTACK_ALLOC_MAXIMUM
-# define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
# ifdef __cplusplus
extern "C" {
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
- && (defined (__STDC__) || defined (__cplusplus)))
+# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
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)))
+# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
}
# endif
# endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-#if (! defined (yyoverflow) \
- && (! defined (__cplusplus) \
- || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \
- && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+ && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- short int yyss;
+ yytype_int16 yyss;
YYSTYPE yyvs;
YYLTYPE yyls;
};
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM)
/* Copy COUNT objects from FROM to TO. The source and destination do
not overlap. */
# ifndef YYCOPY
-# if defined (__GNUC__) && 1 < __GNUC__
+# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(To, From, Count) \
__builtin_memcpy (To, From, (Count) * sizeof (*(From)))
# else
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
- while (0)
+ while (YYID (0))
# endif
# endif
yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
yyptr += yynewbytes / sizeof (*yyptr); \
} \
- while (0)
-
-#endif
+ while (YYID (0))
-#if defined (__STDC__) || defined (__cplusplus)
- typedef signed char yysigned_char;
-#else
- typedef short int yysigned_char;
#endif
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state. */
#define YYFINAL 10
/* YYLAST -- Last index in YYTABLE. */
#define YYLAST 140
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals. */
#define YYNTOKENS 24
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 3
-/* YYNRULES -- Number of rules. */
-#define YYNRULES 22
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 23
+/* YYNRULES -- Number of states. */
#define YYNSTATES 46
/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
#if YYDEBUG
/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
YYRHS. */
-static const unsigned char yyprhs[] =
+static const yytype_uint8 yyprhs[] =
{
- 0, 0, 3, 5, 7, 11, 15, 19, 23, 27,
- 31, 35, 39, 43, 47, 51, 54, 57, 61, 65,
- 69, 73, 77
+ 0, 0, 3, 5, 6, 8, 12, 16, 20, 24,
+ 28, 32, 36, 40, 44, 48, 52, 55, 58, 62,
+ 66, 70, 74, 78
};
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS. */
+static const yytype_int8 yyrhs[] =
{
- 25, 0, -1, 26, -1, 23, -1, 21, 26, 22,
- -1, 26, 5, 26, -1, 26, 6, 26, -1, 26,
- 12, 26, -1, 26, 11, 26, -1, 26, 10, 26,
- -1, 26, 9, 26, -1, 26, 8, 26, -1, 26,
- 7, 26, -1, 26, 14, 26, -1, 26, 13, 26,
- -1, 13, 26, -1, 18, 26, -1, 26, 17, 26,
- -1, 26, 16, 26, -1, 26, 15, 26, -1, 26,
- 20, 26, -1, 26, 19, 26, -1, 26, 4, 26,
- 3, 26, -1
+ 25, 0, -1, 26, -1, -1, 23, -1, 21, 26,
+ 22, -1, 26, 5, 26, -1, 26, 6, 26, -1,
+ 26, 12, 26, -1, 26, 11, 26, -1, 26, 10,
+ 26, -1, 26, 9, 26, -1, 26, 8, 26, -1,
+ 26, 7, 26, -1, 26, 14, 26, -1, 26, 13,
+ 26, -1, 13, 26, -1, 18, 26, -1, 26, 17,
+ 26, -1, 26, 16, 26, -1, 26, 15, 26, -1,
+ 26, 20, 26, -1, 26, 19, 26, -1, 26, 4,
+ 26, 3, 26, -1
};
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
-static const unsigned char yyrline[] =
+static const yytype_uint16 yyrline[] =
{
- 0, 165, 165, 175, 176, 180, 184, 188, 192, 196,
- 200, 204, 208, 212, 216, 220, 224, 228, 232, 236,
- 240, 244, 248
+ 0, 168, 168, 176, 183, 184, 188, 192, 196, 200,
+ 204, 208, 212, 216, 220, 224, 228, 232, 236, 240,
+ 244, 248, 252, 256
};
#endif
#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
- First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
{
"$end", "error", "$undefined", "TOK_COLONCOLON", "TOK_COND", "TOK_OR",
# ifdef YYPRINT
/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
token YYLEX-NUM. */
-static const unsigned short int yytoknum[] =
+static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
# endif
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
{
- 0, 24, 25, 26, 26, 26, 26, 26, 26, 26,
+ 0, 24, 25, 25, 26, 26, 26, 26, 26, 26,
26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26
+ 26, 26, 26, 26
};
/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
{
- 0, 2, 1, 1, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 2, 2, 3, 3, 3,
- 3, 3, 5
+ 0, 2, 1, 0, 1, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 2, 2, 3, 3,
+ 3, 3, 3, 5
};
/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
STATE-NUM when YYTABLE doesn't specify something else to do. Zero
means the default is an error. */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
{
- 0, 0, 0, 0, 3, 0, 2, 15, 16, 0,
+ 3, 0, 0, 0, 4, 0, 2, 16, 17, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 4, 0, 5,
- 6, 12, 11, 10, 9, 8, 7, 14, 13, 19,
- 18, 17, 21, 20, 0, 22
+ 0, 0, 0, 0, 0, 0, 0, 5, 0, 6,
+ 7, 13, 12, 11, 10, 9, 8, 15, 14, 20,
+ 19, 18, 22, 21, 0, 23
};
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int8 yydefgoto[] =
{
-1, 5, 6
};
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
STATE-NUM. */
#define YYPACT_NINF -13
-static const yysigned_char yypact[] =
+static const yytype_int8 yypact[] =
{
109, 109, 109, 109, -13, 6, 59, 106, 106, 22,
-13, 109, 109, 109, 109, 109, 109, 109, 109, 109,
};
/* YYPGOTO[NTERM-NUM]. */
-static const yysigned_char yypgoto[] =
+static const yytype_int8 yypgoto[] =
{
-13, -13, -1
};
number is the opposite. If zero, do what YYDEFACT says.
If YYTABLE_NINF, syntax error. */
#define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
{
7, 8, 9, 22, 23, 24, 10, 25, 26, 0,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
26
};
-static const yysigned_char yycheck[] =
+static const yytype_int8 yycheck[] =
{
1, 2, 3, 15, 16, 17, 0, 19, 20, -1,
11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
{
0, 13, 18, 21, 23, 25, 26, 26, 26, 26,
0, 4, 5, 6, 7, 8, 9, 10, 11, 12,
yychar = (Token); \
yylval = (Value); \
yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK; \
+ YYPOPSTACK (1); \
goto yybackup; \
} \
else \
yyerror (YY_("syntax error: cannot back up")); \
YYERROR; \
} \
-while (0)
+while (YYID (0))
#define YYTERROR 1
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
- if (N) \
+ if (YYID (N)) \
{ \
(Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
(Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
(Current).first_column = (Current).last_column = \
YYRHSLOC (Rhs, 0).last_column; \
} \
- while (0)
+ while (YYID (0))
#endif
# if YYLTYPE_IS_TRIVIAL
# define YY_LOCATION_PRINT(File, Loc) \
fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
+ (Loc).first_line, (Loc).first_column, \
+ (Loc).last_line, (Loc).last_column)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
do { \
if (yydebug) \
YYFPRINTF Args; \
-} while (0)
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value, Location); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (YYID (0))
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yysymprint (stderr, \
- Type, Value, Location); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (0)
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep, const YYLTYPE * const yylocationp)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp)
+ FILE *yyoutput;
+ int yytype;
+ const YYSTYPE * const yyvaluep;
+ const YYLTYPE * const yylocationp;
+#endif
+{
+ if (!yyvaluep)
+ return;
+ YYUSE (yylocationp);
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+ YYUSE (yyoutput);
+# endif
+ switch (yytype)
+ {
+ default:
+ break;
+ }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, const YYSTYPE * const yyvaluep, const YYLTYPE * const yylocationp)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp)
+ FILE *yyoutput;
+ int yytype;
+ const YYSTYPE * const yyvaluep;
+ const YYLTYPE * const yylocationp;
+#endif
+{
+ if (yytype < YYNTOKENS)
+ YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ else
+ YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+ YY_LOCATION_PRINT (yyoutput, *yylocationp);
+ YYFPRINTF (yyoutput, ": ");
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp);
+ YYFPRINTF (yyoutput, ")");
+}
/*------------------------------------------------------------------.
| yy_stack_print -- Print the state stack from its BOTTOM up to its |
| TOP (included). |
`------------------------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (short int *bottom, short int *top)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
#else
static void
yy_stack_print (bottom, top)
- short int *bottom;
- short int *top;
+ yytype_int16 *bottom;
+ yytype_int16 *top;
#endif
{
YYFPRINTF (stderr, "Stack now");
- for (/* Nothing. */; bottom <= top; ++bottom)
+ for (; bottom <= top; ++bottom)
YYFPRINTF (stderr, " %d", *bottom);
YYFPRINTF (stderr, "\n");
}
do { \
if (yydebug) \
yy_stack_print ((Bottom), (Top)); \
-} while (0)
+} while (YYID (0))
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule)
#else
static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yylsp, yyrule
+ )
+ YYSTYPE *yyvsp;
+ YYLTYPE *yylsp;
int yyrule;
#endif
{
+ int yynrhs = yyr2[yyrule];
int yyi;
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, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ fprintf (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ , &(yylsp[(yyi + 1) - (yynrhs)]) );
+ fprintf (stderr, "\n");
+ }
}
# define YY_REDUCE_PRINT(Rule) \
do { \
if (yydebug) \
- yy_reduce_print (Rule); \
-} while (0)
+ yy_reduce_print (yyvsp, yylsp, Rule); \
+} while (YYID (0))
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
#if YYERROR_VERBOSE
# ifndef yystrlen
-# if defined (__GLIBC__) && defined (_STRING_H)
+# if defined __GLIBC__ && defined _STRING_H
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
-# if defined (__STDC__) || defined (__cplusplus)
yystrlen (const char *yystr)
-# else
+#else
+static YYSIZE_T
yystrlen (yystr)
- const char *yystr;
-# endif
+ const char *yystr;
+#endif
{
- const char *yys = yystr;
-
- while (*yys++ != '\0')
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
continue;
-
- return yys - yystr - 1;
+ return yylen;
}
# endif
# endif
# ifndef yystpcpy
-# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
# define yystpcpy stpcpy
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static char *
-# if defined (__STDC__) || defined (__cplusplus)
yystpcpy (char *yydest, const char *yysrc)
-# else
+#else
+static char *
yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-# endif
+ char *yydest;
+ const char *yysrc;
+#endif
{
char *yyd = yydest;
const char *yys = yysrc;
}
# endif
-#endif /* YYERROR_VERBOSE */
-
-\f
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep, yylocationp)
- FILE *yyoutput;
- int yytype;
- YYSTYPE *yyvaluep;
- YYLTYPE *yylocationp;
-#endif
+/* Copy into YYRESULT an error message about the unexpected token
+ YYCHAR while in state YYSTATE. Return the number of bytes copied,
+ including the terminating null byte. If YYRESULT is null, do not
+ copy anything; just return the number of bytes that would be
+ copied. As a special case, return 0 if an ordinary "syntax error"
+ message will do. Return YYSIZE_MAXIMUM if overflow occurs during
+ size calculation. */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
- (void) yylocationp;
+ int yyn = yypact[yystate];
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+ if (! (YYPACT_NINF < yyn && yyn < YYLAST))
+ return 0;
else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ {
+ int yytype = YYTRANSLATE (yychar);
+ YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+ YYSIZE_T yysize = yysize0;
+ YYSIZE_T yysize1;
+ int yysize_overflow = 0;
+ enum { 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;
+
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yycount = 1;
+
+ yyarg[0] = yytname[yytype];
+ yyfmt = yystpcpy (yyformat, yyunexpected);
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ 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;
+ }
- YY_LOCATION_PRINT (yyoutput, *yylocationp);
- YYFPRINTF (yyoutput, ": ");
+ yyf = YY_(yyformat);
+ yysize1 = yysize + yystrlen (yyf);
+ yysize_overflow |= (yysize1 < yysize);
+ yysize = yysize1;
-# ifdef YYPRINT
- if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
- switch (yytype)
- {
- default:
- break;
+ if (yysize_overflow)
+ return YYSIZE_MAXIMUM;
+
+ if (yyresult)
+ {
+ /* 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 = yyresult;
+ int yyi = 0;
+ while ((*yyp = *yyf) != '\0')
+ {
+ if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyf += 2;
+ }
+ else
+ {
+ yyp++;
+ yyf++;
+ }
+ }
+ }
+ return yysize;
}
- YYFPRINTF (yyoutput, ")");
}
+#endif /* YYERROR_VERBOSE */
+\f
-#endif /* ! YYDEBUG */
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp)
#else
YYLTYPE *yylocationp;
#endif
{
- /* Pacify ``unused variable'' warnings. */
- (void) yyvaluep;
- (void) yylocationp;
+ YYUSE (yyvaluep);
+ YYUSE (yylocationp);
if (!yymsg)
yymsg = "Deleting";
switch (yytype)
{
+ case 3: /* "TOK_COLONCOLON" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1250 "ast_expr2.c"
+ break;
+ case 4: /* "TOK_COND" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1255 "ast_expr2.c"
+ break;
+ case 5: /* "TOK_OR" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1260 "ast_expr2.c"
+ break;
+ case 6: /* "TOK_AND" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1265 "ast_expr2.c"
+ break;
+ case 7: /* "TOK_NE" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1270 "ast_expr2.c"
+ break;
+ case 8: /* "TOK_LE" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1275 "ast_expr2.c"
+ break;
+ case 9: /* "TOK_GE" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1280 "ast_expr2.c"
+ break;
+ case 10: /* "TOK_LT" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1285 "ast_expr2.c"
+ break;
+ case 11: /* "TOK_GT" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1290 "ast_expr2.c"
+ break;
+ case 12: /* "TOK_EQ" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1295 "ast_expr2.c"
+ break;
+ case 13: /* "TOK_MINUS" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1300 "ast_expr2.c"
+ break;
+ case 14: /* "TOK_PLUS" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1305 "ast_expr2.c"
+ break;
+ case 15: /* "TOK_MOD" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1310 "ast_expr2.c"
+ break;
+ case 16: /* "TOK_DIV" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1315 "ast_expr2.c"
+ break;
+ case 17: /* "TOK_MULT" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1320 "ast_expr2.c"
+ break;
+ case 18: /* "TOK_COMPL" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1325 "ast_expr2.c"
+ break;
+ case 19: /* "TOK_EQTILDE" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1330 "ast_expr2.c"
+ break;
+ case 20: /* "TOK_COLON" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1335 "ast_expr2.c"
+ break;
+ case 21: /* "TOK_LP" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1340 "ast_expr2.c"
+ break;
+ case 22: /* "TOK_RP" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1345 "ast_expr2.c"
+ break;
+ case 23: /* "TOKEN" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1350 "ast_expr2.c"
+ break;
+ case 26: /* "expr" */
+#line 162 "ast_expr2.y"
+ { free_value((yyvaluep->val)); };
+#line 1355 "ast_expr2.c"
+ break;
default:
- break;
+ break;
}
}
\f
/* Prevent warnings from -Wmissing-prototypes. */
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void *YYPARSE_PARAM);
-# else
+#else
int yyparse ();
-# endif
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
int yyparse (void);
#else
int yyparse ();
`----------*/
#ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+ void *YYPARSE_PARAM;
+#endif
#else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+ || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
#else
int
yyparse ()
- ;
+
#endif
#endif
{
int yyerrstatus;
/* Look-ahead token as an internal (translated) token number. */
int yytoken = 0;
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
/* Three stacks and their tools:
`yyss': related to states,
to reallocate them elsewhere. */
/* The state stack. */
- short int yyssa[YYINITDEPTH];
- short int *yyss = yyssa;
- short int *yyssp;
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss = yyssa;
+ yytype_int16 *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYLTYPE yylsa[YYINITDEPTH];
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
- /* The locations where the error started and ended. */
+ /* The locations where the error started and ended. */
YYLTYPE yyerror_range[2];
-#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
YYSIZE_T yystacksize = YYINITDEPTH;
YYSTYPE yyval;
YYLTYPE yyloc;
- /* When reducing, the number of symbols on the RHS of the reduced
- rule. */
- int yylen;
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
YYDPRINTF ((stderr, "Starting parse\n"));
`------------------------------------------------------------*/
yynewstate:
/* In all cases, when you get here, the value and location stacks
- have just been pushed. so pushing a state here evens the stacks.
- */
+ have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
yysetstate:
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
+ /* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
YYSTYPE *yyvs1 = yyvs;
- short int *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
YYLTYPE *yyls1 = yyls;
/* Each stack pointer address is followed by the size of the
yystacksize = YYMAXDEPTH;
{
- short int *yyss1 = yyss;
+ yytype_int16 *yyss1 = yyss;
union yyalloc *yyptr =
(union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
if (! yyptr)
`-----------*/
yybackup:
-/* Do appropriate processing given the current state. */
-/* Read a look-ahead token if we need one and don't already have one. */
-/* yyresume: */
+ /* Do appropriate processing given the current state. Read a
+ look-ahead token if we need one and don't already have one. */
/* First try to decide what to do without reference to look-ahead token. */
-
yyn = yypact[yystate];
if (yyn == YYPACT_NINF)
goto yydefault;
if (yyn == YYFINAL)
YYACCEPT;
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
/* Shift the look-ahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the token being shifted unless it is eof. */
+ /* Discard the shifted token unless it is eof. */
if (yychar != YYEOF)
yychar = YYEMPTY;
+ yystate = yyn;
*++yyvsp = yylval;
*++yylsp = yylloc;
-
- /* Count tokens shifted since error; after three, turn off error
- status. */
- if (yyerrstatus)
- yyerrstatus--;
-
- yystate = yyn;
goto yynewstate;
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
- /* Default location. */
- YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen);
+ /* Default location. */
+ YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
case 2:
-#line 165 "ast_expr2.y"
+#line 168 "ast_expr2.y"
{ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
- ((struct parse_io *)parseio)->val->type = (yyvsp[0].val)->type;
- if( (yyvsp[0].val)->type == AST_EXPR_integer )
- ((struct parse_io *)parseio)->val->u.i = (yyvsp[0].val)->u.i;
+ ((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type;
+ if( (yyvsp[(1) - (1)].val)->type == AST_EXPR_integer )
+ ((struct parse_io *)parseio)->val->u.i = (yyvsp[(1) - (1)].val)->u.i;
else
- ((struct parse_io *)parseio)->val->u.s = (yyvsp[0].val)->u.s;
- free((yyvsp[0].val));
+ ((struct parse_io *)parseio)->val->u.s = (yyvsp[(1) - (1)].val)->u.s;
+ free((yyvsp[(1) - (1)].val));
;}
break;
case 3:
-#line 175 "ast_expr2.y"
- { (yyval.val)= (yyvsp[0].val);;}
+#line 176 "ast_expr2.y"
+ {/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
+ ((struct parse_io *)parseio)->val->type = AST_EXPR_string;
+ ((struct parse_io *)parseio)->val->u.s = strdup("");
+ ;}
break;
case 4:
-#line 176 "ast_expr2.y"
- { (yyval.val) = (yyvsp[-1].val);
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;
- DESTROY((yyvsp[-2].val)); DESTROY((yyvsp[0].val)); ;}
+#line 183 "ast_expr2.y"
+ { (yyval.val)= (yyvsp[(1) - (1)].val);;}
break;
case 5:
-#line 180 "ast_expr2.y"
- { (yyval.val) = op_or ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 184 "ast_expr2.y"
+ { (yyval.val) = (yyvsp[(2) - (3)].val);
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;
+ DESTROY((yyvsp[(1) - (3)].val)); DESTROY((yyvsp[(3) - (3)].val)); ;}
break;
case 6:
-#line 184 "ast_expr2.y"
- { (yyval.val) = op_and ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 188 "ast_expr2.y"
+ { (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 7:
-#line 188 "ast_expr2.y"
- { (yyval.val) = op_eq ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 192 "ast_expr2.y"
+ { (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 8:
-#line 192 "ast_expr2.y"
- { (yyval.val) = op_gt ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 196 "ast_expr2.y"
+ { (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 9:
-#line 196 "ast_expr2.y"
- { (yyval.val) = op_lt ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 200 "ast_expr2.y"
+ { (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 10:
-#line 200 "ast_expr2.y"
- { (yyval.val) = op_ge ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 204 "ast_expr2.y"
+ { (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 11:
-#line 204 "ast_expr2.y"
- { (yyval.val) = op_le ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 208 "ast_expr2.y"
+ { (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 12:
-#line 208 "ast_expr2.y"
- { (yyval.val) = op_ne ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 212 "ast_expr2.y"
+ { (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 13:
-#line 212 "ast_expr2.y"
- { (yyval.val) = op_plus ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 216 "ast_expr2.y"
+ { (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 14:
-#line 216 "ast_expr2.y"
- { (yyval.val) = op_minus ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 220 "ast_expr2.y"
+ { (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 15:
-#line 220 "ast_expr2.y"
- { (yyval.val) = op_negate ((yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-1]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 224 "ast_expr2.y"
+ { (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 16:
-#line 224 "ast_expr2.y"
- { (yyval.val) = op_compl ((yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-1]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 228 "ast_expr2.y"
+ { (yyval.val) = op_negate ((yyvsp[(2) - (2)].val));
+ DESTROY((yyvsp[(1) - (2)].val));
+ (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 17:
-#line 228 "ast_expr2.y"
- { (yyval.val) = op_times ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 232 "ast_expr2.y"
+ { (yyval.val) = op_compl ((yyvsp[(2) - (2)].val));
+ DESTROY((yyvsp[(1) - (2)].val));
+ (yyloc).first_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 18:
-#line 232 "ast_expr2.y"
- { (yyval.val) = op_div ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 236 "ast_expr2.y"
+ { (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 19:
-#line 236 "ast_expr2.y"
- { (yyval.val) = op_rem ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 240 "ast_expr2.y"
+ { (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 20:
-#line 240 "ast_expr2.y"
- { (yyval.val) = op_colon ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
- (yyloc).first_line=0; (yyloc).last_line=0;;}
+#line 244 "ast_expr2.y"
+ { (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 21:
-#line 244 "ast_expr2.y"
- { (yyval.val) = op_eqtilde ((yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-2]).first_column; (yyloc).last_column = (yylsp[0]).last_column;
+#line 248 "ast_expr2.y"
+ { (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
case 22:
-#line 248 "ast_expr2.y"
- { (yyval.val) = op_cond ((yyvsp[-4].val), (yyvsp[-2].val), (yyvsp[0].val));
- DESTROY((yyvsp[-3].val));
- DESTROY((yyvsp[-1].val));
- (yyloc).first_column = (yylsp[-4]).first_column; (yyloc).last_column = (yylsp[-2]).last_column;
+#line 252 "ast_expr2.y"
+ { (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
+ DESTROY((yyvsp[(2) - (3)].val));
+ (yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
+ (yyloc).first_line=0; (yyloc).last_line=0;;}
+ break;
+
+ case 23:
+#line 256 "ast_expr2.y"
+ { (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val));
+ DESTROY((yyvsp[(2) - (5)].val));
+ DESTROY((yyvsp[(4) - (5)].val));
+ (yyloc).first_column = (yylsp[(1) - (5)]).first_column; (yyloc).last_column = (yylsp[(3) - (5)]).last_column;
(yyloc).first_line=0; (yyloc).last_line=0;;}
break;
+/* Line 1270 of yacc.c. */
+#line 1857 "ast_expr2.c"
default: break;
}
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-/* Line 1126 of yacc.c. */
-#line 1532 "ast_expr2.c"
-\f
- yyvsp -= yylen;
- yyssp -= yylen;
- yylsp -= yylen;
-
+ YYPOPSTACK (yylen);
+ yylen = 0;
YY_STACK_PRINT (yyss, yyssp);
*++yyvsp = yyval;
if (!yyerrstatus)
{
++yynerrs;
-#if YYERROR_VERBOSE
- yyn = yypact[yystate];
-
- if (YYPACT_NINF < yyn && yyn < YYLAST)
- {
- int yytype = YYTRANSLATE (yychar);
- 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;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+ yyerror (YY_("syntax error"));
+#else
+ {
+ YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+ if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+ {
+ YYSIZE_T yyalloc = 2 * yysize;
+ if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+ yyalloc = YYSTACK_ALLOC_MAXIMUM;
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+ if (yymsg)
+ yymsg_alloc = yyalloc;
+ else
{
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- 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;
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
}
+ }
- 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))
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- yyerror (yymsg);
- YYSTACK_FREE (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
+ if (0 < yysize && yysize <= yymsg_alloc)
+ {
+ (void) yysyntax_error (yymsg, yystate, yychar);
+ yyerror (yymsg);
+ }
+ else
+ {
+ yyerror (YY_("syntax error"));
+ if (yysize != 0)
goto yyexhaustedlab;
- }
- }
- else
-#endif /* YYERROR_VERBOSE */
- yyerror (YY_("syntax error"));
+ }
+ }
+#endif
}
yyerror_range[0] = yylloc;
error, discard it. */
if (yychar <= YYEOF)
- {
+ {
/* Return failure if at end of input. */
if (yychar == YYEOF)
YYABORT;
- }
+ }
else
{
- yydestruct ("Error: discarding", yytoken, &yylval, &yylloc);
+ yydestruct ("Error: discarding",
+ yytoken, &yylval, &yylloc);
yychar = YYEMPTY;
}
}
/* Pacify compilers like GCC when the user code never invokes
YYERROR and the label yyerrorlab therefore never appears in user
code. */
- if (0)
+ if (/*CONSTCOND*/ 0)
goto yyerrorlab;
yyerror_range[0] = yylsp[1-yylen];
- yylsp -= yylen;
- yyvsp -= yylen;
- yyssp -= yylen;
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
yystate = *yyssp;
goto yyerrlab1;
YYABORT;
yyerror_range[0] = *yylsp;
- yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp);
- YYPOPSTACK;
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp, yylsp);
+ YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
yyerror_range[1] = yylloc;
/* Using YYLLOC is tempting, but would change the location of
- the look-ahead. YYLOC is available though. */
- YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2);
+ the look-ahead. YYLOC is available though. */
+ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
*++yylsp = yyloc;
- /* Shift the error token. */
+ /* Shift the error token. */
YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
yystate = yyn;
if (yychar != YYEOF && yychar != YYEMPTY)
yydestruct ("Cleanup: discarding lookahead",
yytoken, &yylval, &yylloc);
+ /* Do not reclaim the symbols of the rule which action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
yystos[*yyssp], yyvsp, yylsp);
- YYPOPSTACK;
+ YYPOPSTACK (1);
}
#ifndef yyoverflow
if (yyss != yyssa)
YYSTACK_FREE (yyss);
#endif
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
return yyresult;
}
-#line 255 "ast_expr2.y"
+#line 263 "ast_expr2.y"
static struct val *
int main(int argc,char **argv) {
char s[4096];
+ char out[4096];
+ FILE *infile;
- if (ast_expr(argv[1], s, sizeof(s)))
- printf("=====%s======\n",s);
+ if( !argv[1] )
+ exit(20);
+
+ if( access(argv[1],F_OK)== 0 )
+ {
+ int ret;
+
+ infile = fopen(argv[1],"r");
+ if( !infile )
+ {
+ printf("Sorry, couldn't open %s for reading!\n", argv[1]);
+ exit(10);
+ }
+ while( fgets(s,sizeof(s),infile) )
+ {
+ if( s[strlen(s)-1] == '\n' )
+ s[strlen(s)-1] = 0;
+
+ ret = ast_expr(s, out, sizeof(out));
+ printf("Expression: %s Result: [%d] '%s'\n",
+ s, ret, out);
+ }
+ fclose(infile);
+ }
else
- printf("No result\n");
+ {
+ if (ast_expr(argv[1], s, sizeof(s)))
+ printf("=====%s======\n",s);
+ else
+ printf("No result\n");
+ }
}
#endif
struct val *r;
if (!to_integer (a)) {
- ast_log(LOG_WARNING,"non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING,"non-numeric argument\n");
if (!to_integer (b)) {
free_value(a);
free_value(b);
struct val *r;
if (!to_integer (a)) {
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
if (!to_integer (b)) {
free_value(a);
free_value(b);
return (r);
}
} else if (!to_integer(b)) {
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
free_value(b);
return (a);
}
if (!to_integer (a) ) {
free_value(a);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return make_integer(0);
}
if (!to_integer (a) || !to_integer (b)) {
free_value(a);
free_value(b);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return(make_integer(0));
}
if (!to_integer (a)) {
free_value(a);
free_value(b);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return make_integer(0);
} else if (!to_integer (b)) {
free_value(a);
free_value(b);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return make_integer(INT_MAX);
}
struct val *r;
if (!to_integer (a) || !to_integer (b)) {
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
free_value(a);
free_value(b);
return make_integer(0);
/*! \file
*
- * \brief Dialplan Expression Parser
+ * \brief Dialplan Expression Lexical Scanner
*/
#include <sys/types.h>
void ast_yyset_column(int column_no, yyscan_t yyscanner);
int ast_yyget_column(yyscan_t yyscanner);
static int curlycount = 0;
+static char *expr2_token_subst(char *mess);
%}
%option prefix="ast_yy"
\| { SET_COLUMNS; SET_STRING; return TOK_OR;}
\& { SET_COLUMNS; SET_STRING; return TOK_AND;}
\= { SET_COLUMNS; SET_STRING; return TOK_EQ;}
+\|\| { SET_COLUMNS; SET_STRING; return TOK_OR;}
+\&\& { SET_COLUMNS; SET_STRING; return TOK_AND;}
+\=\= { SET_COLUMNS; SET_STRING; return TOK_EQ;}
+\=~ { SET_COLUMNS; SET_STRING; return TOK_EQTILDE;}
\> { SET_COLUMNS; SET_STRING; return TOK_GT;}
\< { SET_COLUMNS; SET_STRING; return TOK_LT;}
\>\= { SET_COLUMNS; SET_STRING; return TOK_GE;}
\/ { SET_COLUMNS; SET_STRING; return TOK_DIV;}
\% { SET_COLUMNS; SET_STRING; return TOK_MOD;}
\? { SET_COLUMNS; SET_STRING; return TOK_COND;}
+\! { SET_COLUMNS; SET_STRING; return TOK_COMPL;}
\: { SET_COLUMNS; SET_STRING; return TOK_COLON;}
\:\: { SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;}
\( { SET_COLUMNS; SET_STRING; return TOK_LP;}
[0-9]+ { SET_COLUMNS; /* the original behavior of the expression parser was to bring in numbers as a numeric string */
SET_NUMERIC_STRING;
return TOKEN;}
-[a-zA-Z0-9,.';\\_^%$#@!]+ {SET_COLUMNS; SET_STRING; return TOKEN;}
+
+[a-zA-Z0-9,.';\\_^$#@]+ {SET_COLUMNS; SET_STRING; return TOKEN;}
<var>[^{}]*\} {curlycount--; if(curlycount < 0){ BEGIN(trail); yymore();} else { yymore();}}
<var>[^{}]*\{ {curlycount++; yymore(); }
<trail>[^-\t\r \n$():?%/+=*<>!|&]* {BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN;}
<trail>[-\t\r \n$():?%/+=*<>!|&] {char c = yytext[yyleng-1]; BEGIN(0); unput(c); SET_COLUMNS; SET_STRING; return TOKEN;}
<trail>\$\{ {curlycount = 0; BEGIN(var); yymore(); }
-<trail><<EOF>> {BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN; /* actually, if an expr is only a variable ref, this could happen a LOT */}
+<trail><<EOF>> {BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN; /*actually, if an expr is only a variable ref, this could happen a LOT */}
%%
return return_value;
}
+
+char extra_error_message[4095];
+int extra_error_message_supplied = 0;
+void ast_expr_register_extra_error_info(char *message);
+void ast_expr_clear_extra_error_info(void);
+
+void ast_expr_register_extra_error_info(char *message)
+{
+ extra_error_message_supplied=1;
+ strcpy(extra_error_message, message);
+}
+
+void ast_expr_clear_extra_error_info(void)
+{
+ extra_error_message_supplied=0;
+ extra_error_message[0] = 0;
+}
+
+static char *expr2_token_equivs1[] =
+{
+ "TOKEN",
+ "TOK_COND",
+ "TOK_COLONCOLON",
+ "TOK_OR",
+ "TOK_AND",
+ "TOK_EQ",
+ "TOK_GT",
+ "TOK_LT",
+ "TOK_GE",
+ "TOK_LE",
+ "TOK_NE",
+ "TOK_PLUS",
+ "TOK_MINUS",
+ "TOK_MULT",
+ "TOK_DIV",
+ "TOK_MOD",
+ "TOK_COMPL",
+ "TOK_COLON",
+ "TOK_EQTILDE",
+ "TOK_RP",
+ "TOK_LP"
+};
+
+static char *expr2_token_equivs2[] =
+{
+ "<token>",
+ "?",
+ "::",
+ "|",
+ "&",
+ "=",
+ ">",
+ "<",
+ ">=",
+ "<=",
+ "!=",
+ "+",
+ "-",
+ "*",
+ "/",
+ "%",
+ "!",
+ ":",
+ "=~",
+ ")",
+ "("
+};
+
+
+static char *expr2_token_subst(char *mess)
+{
+ /* calc a length, malloc, fill, and return; yyerror had better free it! */
+ int len=0,i;
+ char *p;
+ char *res, *s,*t;
+ int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
+
+ for (p=mess; *p; p++) {
+ for (i=0; i<expr2_token_equivs_entries; i++) {
+ if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
+ {
+ len+=strlen(expr2_token_equivs2[i])+2;
+ p += strlen(expr2_token_equivs1[i])-1;
+ break;
+ }
+ }
+ len++;
+ }
+ res = (char*)malloc(len+1);
+ res[0] = 0;
+ s = res;
+ for (p=mess; *p;) {
+ int found = 0;
+ for (i=0; i<expr2_token_equivs_entries; i++) {
+ if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
+ *s++ = '\'';
+ for (t=expr2_token_equivs2[i]; *t;) {
+ *s++ = *t++;
+ }
+ *s++ = '\'';
+ p += strlen(expr2_token_equivs1[i]);
+ found = 1;
+ break;
+ }
+ }
+ if( !found )
+ *s++ = *p++;
+ }
+ *s++ = 0;
+ return res;
+}
+
int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio )
{
struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
char spacebuf[8000]; /* best safe than sorry */
char spacebuf2[8000]; /* best safe than sorry */
int i=0;
+ char *s2 = expr2_token_subst((char *)s);
spacebuf[0] = 0;
for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' '; /* uh... assuming yyg is defined, then I can use the yycolumn macro,
- which is the same thing as... get this:
+ which is the same thing as... get this:
yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
I was tempted to just use yy_buf_pos in the STATE, but..., well:
a. the yy_buf_pos is the current position in the buffer, which
#ifdef STANDALONE3
/* easier to read in the standalone version */
- printf("ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n",
- s, parseio->string,spacebuf2);
+ printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
+ (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
#else
- ast_log(LOG_WARNING,"ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n",
- s, parseio->string,spacebuf2);
+ ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
+ (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
#endif
#ifndef STANDALONE
ast_log(LOG_WARNING,"If you have questions, please refer to doc/channelvariables.txt in the asterisk source.\n");
#endif
+ free(s2);
return(0);
}
-/* A Bison parser, made by GNU Bison 2.1. */
+/* A Bison parser, made by GNU Bison 2.1a. */
/* Skeleton parser for Yacc-like parsing with Bison,
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
-#line 142 "ast_expr2.y"
-typedef union YYSTYPE {
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 140 "ast_expr2.y"
+{
struct val *val;
-} YYSTYPE;
-/* Line 1447 of yacc.c. */
-#line 88 "ast_expr2.h"
+}
+/* Line 1536 of yacc.c. */
+#line 89 "ast_expr2.h"
+ YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
-#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
+#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE
{
int first_line;
#include <stdlib.h>
#include <string.h>
#include <locale.h>
+#include <unistd.h>
#include <ctype.h>
#if !defined(SOLARIS) && !defined(__CYGWIN__)
#include <err.h>
#define YYPARSE_PARAM parseio
#define YYLEX_PARAM ((struct parse_io *)parseio)->scanner
#define YYERROR_VERBOSE 1
+extern char extra_error_message[4095];
+extern int extra_error_message_supplied;
enum valtype {
AST_EXPR_integer, AST_EXPR_numeric_string, AST_EXPR_string
some useful info about the error. Not as easy as it looks, but it
is possible. */
#define ast_yyerror(x) ast_yyerror(x,&yyloc,parseio)
-#define DESTROY(x) { \
-if ((x)->type == AST_EXPR_numeric_string || (x)->type == AST_EXPR_string) \
- free((x)->u.s); \
- (x)->u.s = 0; \
- free(x); \
-}
+#define DESTROY(x) {if((x)->type == AST_EXPR_numeric_string || (x)->type == AST_EXPR_string) free((x)->u.s); (x)->u.s = 0; free(x);}
%}
%pure-parser
%token <val> TOKEN
%type <val> start expr
+
+%destructor { free_value($$); } expr TOKEN TOK_COND TOK_COLONCOLON TOK_OR TOK_AND TOK_EQ
+ TOK_GT TOK_LT TOK_GE TOK_LE TOK_NE TOK_PLUS TOK_MINUS TOK_MULT TOK_DIV TOK_MOD TOK_COMPL TOK_COLON TOK_EQTILDE
+ TOK_RP TOK_LP
+
%%
start: expr { ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
((struct parse_io *)parseio)->val->u.s = $1->u.s;
free($1);
}
+ | {/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
+ ((struct parse_io *)parseio)->val->type = AST_EXPR_string;
+ ((struct parse_io *)parseio)->val->u.s = strdup("");
+ }
+
;
expr: TOKEN { $$= $1;}
int main(int argc,char **argv) {
char s[4096];
+ char out[4096];
+ FILE *infile;
- if (ast_expr(argv[1], s, sizeof(s)))
- printf("=====%s======\n",s);
+ if( !argv[1] )
+ exit(20);
+
+ if( access(argv[1],F_OK)== 0 )
+ {
+ int ret;
+
+ infile = fopen(argv[1],"r");
+ if( !infile )
+ {
+ printf("Sorry, couldn't open %s for reading!\n", argv[1]);
+ exit(10);
+ }
+ while( fgets(s,sizeof(s),infile) )
+ {
+ if( s[strlen(s)-1] == '\n' )
+ s[strlen(s)-1] = 0;
+
+ ret = ast_expr(s, out, sizeof(out));
+ printf("Expression: %s Result: [%d] '%s'\n",
+ s, ret, out);
+ }
+ fclose(infile);
+ }
else
- printf("No result\n");
+ {
+ if (ast_expr(argv[1], s, sizeof(s)))
+ printf("=====%s======\n",s);
+ else
+ printf("No result\n");
+ }
}
#endif
struct val *r;
if (!to_integer (a)) {
- ast_log(LOG_WARNING,"non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING,"non-numeric argument\n");
if (!to_integer (b)) {
free_value(a);
free_value(b);
struct val *r;
if (!to_integer (a)) {
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
if (!to_integer (b)) {
free_value(a);
free_value(b);
return (r);
}
} else if (!to_integer(b)) {
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
free_value(b);
return (a);
}
if (!to_integer (a) ) {
free_value(a);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return make_integer(0);
}
if (!to_integer (a) || !to_integer (b)) {
free_value(a);
free_value(b);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return(make_integer(0));
}
if (!to_integer (a)) {
free_value(a);
free_value(b);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return make_integer(0);
} else if (!to_integer (b)) {
free_value(a);
free_value(b);
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
return make_integer(INT_MAX);
}
struct val *r;
if (!to_integer (a) || !to_integer (b)) {
- ast_log(LOG_WARNING, "non-numeric argument\n");
+ if( !extra_error_message_supplied )
+ ast_log(LOG_WARNING, "non-numeric argument\n");
free_value(a);
free_value(b);
return make_integer(0);
7, -11, -11, -11, -11, -11, -11, -11, -11, -11,
-11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
-11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
- -11, -11, -11, 36, -11, 36, 36, 36, -11, 36,
- -11, -11, -11, -11, 36, -11, 36, -11, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, -11, 36,
- -11, 37, -11, -11, 36, 36, 36, 36, 36, 36,
-
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, -11, 36, -11, 36, 36, -11, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, -11, -11, -11, -11, -11
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, 36, -11, -11, -11, -11, -11, -11, -11, -11,
+
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, -11, -11, -11, -11, -11, -11, -11, -11, -11,
+ -11, -11, -11, -11, -11, -11, -11, -11
},
{
- 7, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 39, 38, 38, 38, 38, 38,
-
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38
+ 7, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 38, 37, 37, 37, 37, 37,
+
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37
},
{
-13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
-13, -13, -13, -13, -13, -13, -13, -13, -13, -13,
- -13, -13, -13, 36, -13, 36, 36, 36, -13, 36,
- -13, -13, -13, -13, 36, -13, 36, -13, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, -13, 36,
- -13, -13, -13, -13, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, -13, 36, -13, 36, 36, -13, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
-
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, -13, -13, -13, -13, -13
+ -13, -13, -13, -13, -13, 39, 39, -13, -13, 39,
+ -13, -13, -13, -13, 39, -13, 39, -13, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, -13, 39,
+ -13, -13, -13, -13, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, -13, 39, -13, 39, 39, -13, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, -13, -13, -13, -13, -13
},
{
7, -14, -14, -14, -14, -14, -14, -14, -14, -14,
-14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
-14, -14, -14, -14, -14, -14, -14, -14, -14, -14,
- -14, -14, -14, 36, -14, 36, 36, 36, -14, 36,
- -14, -14, -14, -14, 36, -14, 36, -14, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, -14, 36,
- -14, -14, -14, -14, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
-
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, -14, 36, -14, 36, 36, -14, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 40, -14, -14, -14, -14
+ -14, -14, -14, -14, -14, 39, 39, -14, -14, 39,
+ -14, -14, -14, -14, 39, -14, 39, -14, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, -14, 39,
+ -14, -14, -14, -14, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, -14, 39, -14, 39, 39, -14, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 40, -14, -14, -14, -14
},
{
7, -15, -15, -15, -15, -15, -15, -15, -15, -15,
-15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
-15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
- -15, -15, -15, 36, -15, 36, 36, 36, -15, 36,
- -15, -15, -15, -15, 36, -15, 36, -15, 36, 36,
-
- 36, 36, 36, 36, 36, 36, 36, 36, -15, 36,
- -15, -15, -15, -15, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, -15, 36, -15, 36, 36, -15, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, -15, -15, -15, -15, -15
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15, -15, -15,
+ -15, -15, -15, -15, -15, -15, -15, -15
},
{
-16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
-16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
- -16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
+ -16, -16, -16, -16, -16, -16, -16, -16, 41, -16,
-16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
-16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
-16, -16, -16, -16, -16, -16, -16, -16, -16, -16,
-23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
-23, -23, -23, -23, -23, -23, -23, -23, -23, -23,
- -23, -23, -23, 36, -23, 36, 36, 36, -23, 36,
- -23, -23, -23, -23, 36, -23, 36, -23, 41, 41,
- 41, 41, 41, 41, 41, 41, 41, 41, -23, 36,
- -23, -23, -23, -23, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, -23, 36, -23, 36, 36, -23, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
-
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, -23, -23, -23, -23, -23
+ -23, -23, -23, -23, -23, 39, 39, -23, -23, 39,
+ -23, -23, -23, -23, 39, -23, 39, -23, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, -23, 39,
+ -23, -23, -23, -23, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, -23, 39, -23, 39, 39, -23, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, -23, -23, -23, -23, -23
},
{
-24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
-24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
-24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
- -24, -24, -24, -24, -24, -24, -24, -24, 42, -24,
+ -24, -24, -24, -24, -24, -24, -24, -24, 43, -24,
-24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
-24, -24, -24, -24, -24, -24, -24, -24, -24, -24,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
- -25, 43, -25, -25, -25, -25, -25, -25, -25, -25,
+ -25, 44, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-25, -25, -25, -25, -25, -25, -25, -25, -25, -25,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
+ -26, 45, -26, -26, -26, -26, -26, -26, -26, -26,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
-26, -26, -26, -26, -26, -26, -26, -26, -26, -26,
- -26, -26, -26, -26, -26, -26, -26, -26
+ -26, -26, -26, -26, -26, -26, 46, -26
},
{
-27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
-27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
-27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
- -27, 44, -27, -27, -27, -27, -27, -27, -27, -27,
+ -27, 47, -27, -27, -27, -27, -27, -27, -27, -27,
-27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
-27, -27, -27, -27, -27, -27, -27, -27, -27, -27,
-29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
-29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
-29, -29, -29, -29, -29, -29, -29, -29, -29, -29,
- -29, -29, -29, -29, -29, -29, -29, -29
+ -29, -29, -29, -29, 48, -29, -29, -29
},
{
- 7, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 46, 45, 47, 45, 45
+ 7, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 50, 49, 51, 49, 49
},
{
},
{
- 7, 48, 48, 48, 48, 48, 48, 48, 48, -33,
-
- -33, 48, 48, -33, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, -33, -33, 48, 48, -33, -33, -33, 48,
- -33, -33, -33, -33, 48, -33, 48, -33, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, -33, 48,
- -33, -33, -33, -33, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
-
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, -33, 48, 48, 48
+ 7, 52, 52, 52, 52, 52, 52, 52, 52, -33,
+
+ -33, 52, 52, -33, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, -33, -33, 52, 52, -33, -33, -33, 52,
+ -33, -33, -33, -33, 52, -33, 52, -33, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, -33, 52,
+ -33, -33, -33, -33, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, -33, 52, 52, 52
},
{
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
-35, -35, -35, -35, -35, -35, -35, -35, -35, -35,
- -35, -35, -35, 49, -35, -35, -35, -35
+ -35, -35, -35, 53, -35, -35, -35, -35
},
{
-36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
-36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
- -36, -36, -36, 36, -36, 36, 36, 36, -36, 36,
- -36, -36, -36, -36, 36, -36, 36, -36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, -36, 36,
- -36, -36, -36, -36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, -36, 36, -36, 36, 36, -36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
-
- 36, 36, 36, -36, -36, -36, -36, -36
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+ -36, -36, -36, -36, -36, -36, -36, -36, -36, -36,
+
+ -36, -36, -36, -36, -36, -36, -36, -36
},
{
- 7, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
-
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37, -37, -37,
- -37, -37, -37, -37, -37, -37, -37, -37
+ 7, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 38, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
+ 37, 37, 37, 37, 37, 37, 37, 37
},
{
- 7, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 39, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
-
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
- 38, 38, 38, 38, 38, 38, 38, 38
+ 7, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38, -38, -38,
+ -38, -38, -38, -38, -38, -38, -38, -38
},
{
-39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
-39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39, -39, -39,
- -39, -39, -39, -39, -39, -39, -39, -39
+ -39, -39, -39, -39, -39, 39, 39, -39, -39, 39,
+ -39, -39, -39, -39, 39, -39, 39, -39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, -39, 39,
+ -39, -39, -39, -39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, -39, 39, -39, 39, 39, -39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, -39, -39, -39, -39, -39
},
7, -41, -41, -41, -41, -41, -41, -41, -41, -41,
-41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
-41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
- -41, -41, -41, 36, -41, 36, 36, 36, -41, 36,
- -41, -41, -41, -41, 36, -41, 36, -41, 41, 41,
- 41, 41, 41, 41, 41, 41, 41, 41, -41, 36,
- -41, -41, -41, -41, 36, 36, 36, 36, 36, 36,
-
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, -41, 36, -41, 36, 36, -41, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
- 36, 36, 36, -41, -41, -41, -41, -41
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41, -41, -41,
+ -41, -41, -41, -41, -41, -41, -41, -41
},
{
7, -42, -42, -42, -42, -42, -42, -42, -42, -42,
-42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
-42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
-
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42, -42, -42,
- -42, -42, -42, -42, -42, -42, -42, -42
+ -42, -42, -42, -42, -42, 39, 39, -42, -42, 39,
+
+ -42, -42, -42, -42, 39, -42, 39, -42, 42, 42,
+ 42, 42, 42, 42, 42, 42, 42, 42, -42, 39,
+ -42, -42, -42, -42, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, -42, 39, -42, 39, 39, -42, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, 39, 39, 39, 39, 39, 39, 39,
+ 39, 39, 39, -42, -42, -42, -42, -42
},
{
},
{
- 7, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
-
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 46, 45, 47, 45, 45
+ 7, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45, -45, -45,
+ -45, -45, -45, -45, -45, -45, -45, -45
},
{
},
{
- 7, 48, 48, 48, 48, 48, 48, 48, 48, -48,
- -48, 48, 48, -48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, -48, -48, 48, 48, -48, -48, -48, 48,
- -48, -48, -48, -48, 48, -48, 48, -48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, -48, 48,
-
- -48, -48, -48, -48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
- 48, 48, 48, 48, -48, 48, 48, 48
+ 7, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48, -48, -48,
+ -48, -48, -48, -48, -48, -48, -48, -48
},
{
- 7, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
-
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49, -49, -49,
- -49, -49, -49, -49, -49, -49, -49, -49
+ 7, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 49, 49, 49, 49, 49, 49, 49,
+ 49, 49, 49, 50, 49, 51, 49, 49
+
+ },
+ {
+ 7, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50, -50, -50,
+ -50, -50, -50, -50, -50, -50, -50, -50
+ },
+
+ {
+ 7, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51, -51, -51,
+ -51, -51, -51, -51, -51, -51, -51, -51
+ },
+
+ {
+ 7, 52, 52, 52, 52, 52, 52, 52, 52, -52,
+ -52, 52, 52, -52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, -52, -52, 52, 52, -52, -52, -52, 52,
+
+ -52, -52, -52, -52, 52, -52, 52, -52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, -52, 52,
+ -52, -52, -52, -52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
+ 52, 52, 52, 52, -52, 52, 52, 52
+ },
+
+ {
+ 7, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+
+ -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
+ -53, -53, -53, -53, -53, -53, -53, -53
},
} ;
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 30
-#define YY_END_OF_BUFFER 31
+#define YY_NUM_RULES 35
+#define YY_END_OF_BUFFER 36
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[50] =
+static yyconst flex_int16_t yy_accept[54] =
{ 0,
- 0, 0, 0, 0, 27, 27, 31, 30, 20, 22,
- 24, 30, 24, 24, 13, 2, 17, 18, 11, 9,
- 10, 12, 23, 15, 5, 3, 4, 14, 1, 30,
- 26, 25, 27, 28, 28, 24, 8, 0, 21, 19,
- 23, 16, 7, 6, 0, 26, 25, 27, 29
+ 0, 0, 0, 0, 32, 32, 36, 35, 25, 27,
+ 19, 35, 29, 29, 17, 2, 22, 23, 15, 13,
+ 14, 16, 28, 20, 9, 3, 8, 18, 1, 35,
+ 31, 30, 32, 33, 33, 12, 0, 26, 29, 24,
+ 5, 28, 21, 11, 6, 7, 10, 4, 0, 31,
+ 30, 32, 34
} ;
-static yyconst yy_state_type yy_NUL_trans[50] =
+static yyconst yy_state_type yy_NUL_trans[54] =
{ 0,
8, 8, 30, 30, 33, 33, 0, 0, 0, 0,
- 0, 38, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,
- 0, 0, 48, 0, 0, 0, 0, 38, 0, 0,
- 0, 0, 0, 0, 45, 0, 0, 48, 0
+ 0, 37, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 49,
+ 0, 0, 52, 0, 0, 0, 37, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 49, 0,
+ 0, 52, 0
} ;
/* The intent behind this definition is that it'll catch
#define YY_RESTORE_YY_MORE_OFFSET
#line 1 "ast_expr2.fl"
#line 2 "ast_expr2.fl"
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 1999 - 2006, Digium, Inc.
+ *
+ * Mark Spencer <markster@digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
/*! \file
*
- * \brief Dialplan Expression Parser
+ * \brief Dialplan Expression Lexical Scanner
*/
#include <sys/types.h>
void ast_yyset_column(int column_no, yyscan_t yyscanner);
int ast_yyget_column(yyscan_t yyscanner);
static int curlycount = 0;
+static char *expr2_token_subst(char *mess);
-#line 1304 "ast_expr2f.c"
+#line 1394 "ast_expr2f.c"
#define INITIAL 0
#define var 1
register int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 64 "ast_expr2.fl"
+#line 83 "ast_expr2.fl"
-#line 1524 "ast_expr2f.c"
+#line 1614 "ast_expr2f.c"
yylval = yylval_param;
case 1:
YY_RULE_SETUP
-#line 66 "ast_expr2.fl"
+#line 85 "ast_expr2.fl"
{ SET_COLUMNS; SET_STRING; return TOK_OR;}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 67 "ast_expr2.fl"
+#line 86 "ast_expr2.fl"
{ SET_COLUMNS; SET_STRING; return TOK_AND;}
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 68 "ast_expr2.fl"
+#line 87 "ast_expr2.fl"
{ SET_COLUMNS; SET_STRING; return TOK_EQ;}
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 69 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_GT;}
+#line 88 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_OR;}
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 70 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_LT;}
+#line 89 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_AND;}
YY_BREAK
case 6:
YY_RULE_SETUP
-#line 71 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_GE;}
+#line 90 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_EQ;}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 72 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_LE;}
+#line 91 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_EQTILDE;}
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 73 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_NE;}
+#line 92 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_GT;}
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 74 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_PLUS;}
+#line 93 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_LT;}
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 75 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_MINUS;}
+#line 94 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_GE;}
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 76 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_MULT;}
+#line 95 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_LE;}
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 77 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_DIV;}
+#line 96 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_NE;}
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 78 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_MOD;}
+#line 97 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_PLUS;}
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 79 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_COND;}
+#line 98 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_MINUS;}
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 80 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_COLON;}
+#line 99 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_MULT;}
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 81 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;}
+#line 100 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_DIV;}
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 82 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_LP;}
+#line 101 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_MOD;}
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 83 "ast_expr2.fl"
-{ SET_COLUMNS; SET_STRING; return TOK_RP;}
+#line 102 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_COND;}
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 84 "ast_expr2.fl"
+#line 103 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_COMPL;}
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+#line 104 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_COLON;}
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+#line 105 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_COLONCOLON;}
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+#line 106 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_LP;}
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+#line 107 "ast_expr2.fl"
+{ SET_COLUMNS; SET_STRING; return TOK_RP;}
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+#line 108 "ast_expr2.fl"
{/* gather the contents of ${} expressions, with trailing stuff, into a single TOKEN. They are much more complex now than they used to be */
curlycount = 0; BEGIN(var); yymore();}
YY_BREAK
-case 20:
+case 25:
YY_RULE_SETUP
-#line 87 "ast_expr2.fl"
+#line 111 "ast_expr2.fl"
{}
YY_BREAK
-case 21:
-/* rule 21 can match eol */
+case 26:
+/* rule 26 can match eol */
YY_RULE_SETUP
-#line 88 "ast_expr2.fl"
+#line 112 "ast_expr2.fl"
{SET_COLUMNS; SET_STRING; return TOKEN;}
YY_BREAK
-case 22:
-/* rule 22 can match eol */
+case 27:
+/* rule 27 can match eol */
YY_RULE_SETUP
-#line 90 "ast_expr2.fl"
+#line 114 "ast_expr2.fl"
{/* what to do with eol */}
YY_BREAK
-case 23:
+case 28:
YY_RULE_SETUP
-#line 91 "ast_expr2.fl"
+#line 115 "ast_expr2.fl"
{ SET_COLUMNS; /* the original behavior of the expression parser was to bring in numbers as a numeric string */
SET_NUMERIC_STRING;
return TOKEN;}
YY_BREAK
-case 24:
+case 29:
YY_RULE_SETUP
-#line 94 "ast_expr2.fl"
+#line 119 "ast_expr2.fl"
{SET_COLUMNS; SET_STRING; return TOKEN;}
YY_BREAK
-case 25:
-/* rule 25 can match eol */
+case 30:
+/* rule 30 can match eol */
YY_RULE_SETUP
-#line 96 "ast_expr2.fl"
+#line 121 "ast_expr2.fl"
{curlycount--; if(curlycount < 0){ BEGIN(trail); yymore();} else { yymore();}}
YY_BREAK
-case 26:
-/* rule 26 can match eol */
+case 31:
+/* rule 31 can match eol */
YY_RULE_SETUP
-#line 97 "ast_expr2.fl"
+#line 122 "ast_expr2.fl"
{curlycount++; yymore(); }
YY_BREAK
-case 27:
+case 32:
YY_RULE_SETUP
-#line 98 "ast_expr2.fl"
+#line 123 "ast_expr2.fl"
{BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN;}
YY_BREAK
-case 28:
-/* rule 28 can match eol */
+case 33:
+/* rule 33 can match eol */
YY_RULE_SETUP
-#line 99 "ast_expr2.fl"
+#line 124 "ast_expr2.fl"
{char c = yytext[yyleng-1]; BEGIN(0); unput(c); SET_COLUMNS; SET_STRING; return TOKEN;}
YY_BREAK
-case 29:
+case 34:
YY_RULE_SETUP
-#line 100 "ast_expr2.fl"
+#line 125 "ast_expr2.fl"
{curlycount = 0; BEGIN(var); yymore(); }
YY_BREAK
case YY_STATE_EOF(trail):
-#line 101 "ast_expr2.fl"
-{BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN; /* actually, if an expr is only a variable ref, this could happen a LOT */}
+#line 126 "ast_expr2.fl"
+{BEGIN(0); SET_COLUMNS; SET_STRING; return TOKEN; /*actually, if an expr is only a variable ref, this could happen a LOT */}
YY_BREAK
-case 30:
+case 35:
YY_RULE_SETUP
-#line 103 "ast_expr2.fl"
+#line 128 "ast_expr2.fl"
ECHO;
YY_BREAK
-#line 1767 "ast_expr2f.c"
+#line 1882 "ast_expr2f.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(var):
yyterminate();
#undef YY_DECL_IS_OURS
#undef YY_DECL
#endif
-#line 103 "ast_expr2.fl"
+#line 128 "ast_expr2.fl"
return return_value;
}
+
+char extra_error_message[4095];
+int extra_error_message_supplied = 0;
+void ast_expr_register_extra_error_info(char *message);
+void ast_expr_clear_extra_error_info(void);
+
+void ast_expr_register_extra_error_info(char *message)
+{
+ extra_error_message_supplied=1;
+ strcpy(extra_error_message, message);
+}
+
+void ast_expr_clear_extra_error_info(void)
+{
+ extra_error_message_supplied=0;
+ extra_error_message[0] = 0;
+}
+
+static char *expr2_token_equivs1[] =
+{
+ "TOKEN",
+ "TOK_COND",
+ "TOK_COLONCOLON",
+ "TOK_OR",
+ "TOK_AND",
+ "TOK_EQ",
+ "TOK_GT",
+ "TOK_LT",
+ "TOK_GE",
+ "TOK_LE",
+ "TOK_NE",
+ "TOK_PLUS",
+ "TOK_MINUS",
+ "TOK_MULT",
+ "TOK_DIV",
+ "TOK_MOD",
+ "TOK_COMPL",
+ "TOK_COLON",
+ "TOK_EQTILDE",
+ "TOK_RP",
+ "TOK_LP"
+};
+
+static char *expr2_token_equivs2[] =
+{
+ "<token>",
+ "?",
+ "::",
+ "|",
+ "&",
+ "=",
+ ">",
+ "<",
+ ">=",
+ "<=",
+ "!=",
+ "+",
+ "-",
+ "*",
+ "/",
+ "%",
+ "!",
+ ":",
+ "=~",
+ ")",
+ "("
+};
+
+
+static char *expr2_token_subst(char *mess)
+{
+ /* calc a length, malloc, fill, and return; yyerror had better free it! */
+ int len=0,i;
+ char *p;
+ char *res, *s,*t;
+ int expr2_token_equivs_entries = sizeof(expr2_token_equivs1)/sizeof(char*);
+
+ for (p=mess; *p; p++) {
+ for (i=0; i<expr2_token_equivs_entries; i++) {
+ if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 )
+ {
+ len+=strlen(expr2_token_equivs2[i])+2;
+ p += strlen(expr2_token_equivs1[i])-1;
+ break;
+ }
+ }
+ len++;
+ }
+ res = (char*)malloc(len+1);
+ res[0] = 0;
+ s = res;
+ for (p=mess; *p;) {
+ int found = 0;
+ for (i=0; i<expr2_token_equivs_entries; i++) {
+ if ( strncmp(p,expr2_token_equivs1[i],strlen(expr2_token_equivs1[i])) == 0 ) {
+ *s++ = '\'';
+ for (t=expr2_token_equivs2[i]; *t;) {
+ *s++ = *t++;
+ }
+ *s++ = '\'';
+ p += strlen(expr2_token_equivs1[i]);
+ found = 1;
+ break;
+ }
+ }
+ if( !found )
+ *s++ = *p++;
+ }
+ *s++ = 0;
+ return res;
+}
+
int ast_yyerror (const char *s, yyltype *loc, struct parse_io *parseio )
{
struct yyguts_t * yyg = (struct yyguts_t*)(parseio->scanner);
char spacebuf[8000]; /* best safe than sorry */
char spacebuf2[8000]; /* best safe than sorry */
int i=0;
+ char *s2 = expr2_token_subst((char *)s);
spacebuf[0] = 0;
for(i=0;i< (int)(yytext - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf);i++) spacebuf2[i] = ' '; /* uh... assuming yyg is defined, then I can use the yycolumn macro,
- which is the same thing as... get this:
+ which is the same thing as... get this:
yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]->yy_bs_column
I was tempted to just use yy_buf_pos in the STATE, but..., well:
a. the yy_buf_pos is the current position in the buffer, which
#ifdef STANDALONE3
/* easier to read in the standalone version */
- printf("ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n",
- s, parseio->string,spacebuf2);
+ printf("ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
+ (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
#else
- ast_log(LOG_WARNING,"ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n",
- s, parseio->string,spacebuf2);
+ ast_log(LOG_WARNING,"ast_yyerror(): %s syntax error: %s; Input:\n%s\n%s\n",
+ (extra_error_message_supplied?extra_error_message:""), s2, parseio->string,spacebuf2);
#endif
#ifndef STANDALONE
ast_log(LOG_WARNING,"If you have questions, please refer to doc/channelvariables.txt in the asterisk source.\n");
#endif
+ free(s2);
return(0);
}
//
// Example AEL config file
//
+//
+// Static extension configuration file, used by
+// the pbx_config module. This is where you configure all your
+// inbound and outbound calls in Asterisk.
+//
+// This configuration file is reloaded
+// - With the "extensions reload" command in the CLI
+// - With the "reload" command (that reloads everything) in the CLI
+
+// The "Globals" category contains global variables that can be referenced
+// in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental
+// variables,
+// ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
+//
+
+globals {
+ CONSOLE="Console/dsp"; // Console interface for demo
+ //CONSOLE=Zap/1
+ //CONSOLE=Phone/phone0
+ IAXINFO=guest; // IAXtel username/password
+ //IAXINFO="myuser:mypass";
+ TRUNK="Zap/g2"; // Trunk interface
+ //
+ // Note the 'g2' in the TRUNK variable above. It specifies which group (defined
+ // in zapata.conf) to dial, i.e. group 2, and how to choose a channel to use in
+ // the specified group. The four possible options are:
+ //
+ // g: select the lowest-numbered non-busy Zap channel
+ // (aka. ascending sequential hunt group).
+ // G: select the highest-numbered non-busy Zap channel
+ // (aka. descending sequential hunt group).
+ // r: use a round-robin search, starting at the next highest channel than last
+ // time (aka. ascending rotary hunt group).
+ // R: use a round-robin search, starting at the next lowest channel than last
+ // time (aka. descending rotary hunt group).
+ //
+ TRUNKMSD=1; // MSD digits to strip (usually 1 or 0)
+ //TRUNK=IAX2/user:pass@provider
+};
+
+//
+// Any category other than "General" and "Globals" represent
+// extension contexts, which are collections of extensions.
+//
+// Extension names may be numbers, letters, or combinations
+// thereof. If an extension name is prefixed by a '_'
+// character, it is interpreted as a pattern rather than a
+// literal. In patterns, some characters have special meanings:
+//
+// X - any digit from 0-9
+// Z - any digit from 1-9
+// N - any digit from 2-9
+// [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
+// . - wildcard, matches anything remaining (e.g. _9011. matches
+// anything starting with 9011 excluding 9011 itself)
+// ! - wildcard, causes the matching process to complete as soon as
+// it can unambiguously determine that no other matches are possible
+//
+// For example the extension _NXXXXXX would match normal 7 digit dialings,
+// while _1NXXNXXXXXX would represent an area code plus phone number
+// preceeded by a one.
+//
+// Each step of an extension is ordered by priority, which must
+// always start with 1 to be considered a valid extension. The priority
+// "next" or "n" means the previous priority plus one, regardless of whether
+// the previous priority was associated with the current extension or not.
+// The priority "same" or "s" means the same as the previously specified
+// priority, again regardless of whether the previous entry was for the
+// same extension. Priorities may be immediately followed by a plus sign
+// and another integer to add that amount (most useful with 's' or 'n').
+// Priorities may then also have an alias, or label, in
+// parenthesis after their name which can be used in goto situations
+//
+// Contexts contain several lines, one for each step of each
+// extension, which can take one of two forms as listed below,
+// with the first form being preferred. One may include another
+// context in the current one as well, optionally with a
+// date and time. Included contexts are included in the order
+// they are listed.
+//
+//context name {
+// exten-name => {
+// application(arg1,arg2,...);
+//
+// Timing list for includes is
+//
+// <time range>|<days of week>|<days of month>|<months>
+//
+// includes {
+// daytime|9:00-17:00|mon-fri|*|*;
+// };
+//
+// ignorepat can be used to instruct drivers to not cancel dialtone upon
+// receipt of a particular pattern. The most commonly used example is
+// of course '9' like this:
+//
+// ignorepat => 9;
+//
+// so that dialtone remains even after dialing a 9.
+//};
+
+
+//
+// Sample entries for extensions.conf
+//
+//
+context dundi-e164-canonical {
+ //
+ // List canonical entries here
+ //
+ // 12564286000 => &std-exten(6000,IAX2/foo);
+ // _125642860XX => Dial(IAX2/otherbox/${EXTEN:7});
+};
+
+context dundi-e164-customers {
+ //
+ // If you are an ITSP or Reseller, list your customers here.
+ //
+ //_12564286000 => Dial(SIP/customer1);
+ //_12564286001 => Dial(IAX2/customer2);
+};
+
+context dundi-e164-via-pstn {
+ //
+ // If you are freely delivering calls to the PSTN, list them here
+ //
+ //_1256428XXXX => Dial(Zap/g2/${EXTEN:7}); // Expose all of 256-428
+ //_1256325XXXX => Dial(Zap/g2/${EXTEN:7}); // Ditto for 256-325
+};
+
+context dundi-e164-local {
+ //
+ // Context to put your dundi IAX2 or SIP user in for
+ // full access
+ //
+ includes {
+ dundi-e164-canonical;
+ dundi-e164-customers;
+ dundi-e164-via-pstn;
+ };
+};
+
+context dundi-e164-switch {
+ //
+ // Just a wrapper for the switch
+ //
+
+ switches {
+ DUNDi/e164;
+ };
+};
+
+context dundi-e164-lookup {
+ //
+ // Locally to lookup, try looking for a local E.164 solution
+ // then try DUNDi if we don't have one.
+ //
+ includes {
+ dundi-e164-local;
+ dundi-e164-switch;
+ };
+ //
+};
+
+//
+// DUNDi can also be implemented as a Macro instead of using
+// the Local channel driver.
+//
+macro dundi-e164(exten) {
+//
+// ARG1 is the extension to Dial
+//
+ goto ${exten}|1;
+};
+
+//
+// Here are the entries you need to participate in the IAXTEL
+// call routing system. Most IAXTEL numbers begin with 1-700, but
+// there are exceptions. For more information, and to sign
+// up, please go to www.gnophone.com or www.iaxtel.com
+//
+context iaxtel700 {
+ _91700XXXXXXX => Dial(IAX2/${IAXINFO}@iaxtel.com/${EXTEN:1}@iaxtel);
+};
+
+//
+// The SWITCH statement permits a server to share the dialplain with
+// another server. Use with care: Reciprocal switch statements are not
+// allowed (e.g. both A -> B and B -> A), and the switched server needs
+// to be on-line or else dialing can be severly delayed.
+//
+context iaxprovider {
+ switches {
+ // IAX2/user:[key]@myserver/mycontext;
+ };
+};
+
+context trunkint {
+ //
+ // International long distance through trunk
+ //
+ includes {
+ dundi-e164-lookup;
+ };
+ _9011. => {
+ &dundi-e164(${EXTEN:4});
+ Dial(${TRUNK}/${EXTEN:${TRUNKMSD}});
+ };
+};
+
+context trunkld {
+ //
+ // Long distance context accessed through trunk
+ //
+ includes {
+ dundi-e164-lookup;
+ };
+ _91NXXNXXXXXX => {
+ &dundi-e164(${EXTEN:1});
+ Dial(${TRUNK}/${EXTEN:${TRUNKMSD}});
+ };
+};
+
+context trunklocal {
+ //
+ // Local seven-digit dialing accessed through trunk interface
+ //
+ _9NXXXXXX => {
+ Dial(${TRUNK}/${EXTEN:${TRUNKMSD}});
+ };
+};
+
+context trunktollfree {
+ //
+ // Long distance context accessed through trunk interface
+ //
+
+ _91800NXXXXXX => Dial(${TRUNK}/${EXTEN:${TRUNKMSD}});
+ _91888NXXXXXX => Dial(${TRUNK}/${EXTEN:${TRUNKMSD}});
+ _91877NXXXXXX => Dial(${TRUNK}/${EXTEN:${TRUNKMSD}});
+ _91866NXXXXXX => Dial(${TRUNK}/${EXTEN:${TRUNKMSD}});
+};
+
+context international {
+ //
+ // Master context for international long distance
+ //
+ ignorepat => 9;
+ includes {
+ longdistance;
+ trunkint;
+ };
+};
+
+context longdistance {
+ //
+ // Master context for long distance
+ //
+ ignorepat => 9;
+ includes {
+ local;
+ trunkld;
+ };
+};
+
+context local {
+ //
+ // Master context for local, toll-free, and iaxtel calls only
+ //
+ ignorepat => 9;
+ includes {
+ default;
+ parkedcalls;
+ trunklocal;
+ iaxtel700;
+ trunktollfree;
+ iaxprovider;
+ };
+};
+
+//
+// You can use an alternative switch type as well, to resolve
+// extensions that are not known here, for example with remote
+// IAX switching you transparently get access to the remote
+// Asterisk PBX
+//
+// switch => IAX2/user:password@bigserver/local
+//
+// An "lswitch" is like a switch but is literal, in that
+// variable substitution is not performed at load time
+// but is passed to the switch directly (presumably to
+// be substituted in the switch routine itself)
+//
+// lswitch => Loopback/12${EXTEN}@othercontext
+//
+// An "eswitch" is like a switch but the evaluation of
+// variable substitution is performed at runtime before
+// being passed to the switch routine.
+//
+// eswitch => IAX2/context@${CURSERVER}
+
macro std-exten-ael( ext , dev ) {
Dial(${dev}/${ext},20);
s => {
Wait(1);
Answer();
- TIMEOUT(digit)=5;
- TIMEOUT(response)=10;
+ Set(TIMEOUT(digit)=5);
+ Set(TIMEOUT(response)=10);
restart:
Background(demo-congrats);
instructions:
goto s|instructions;
};
3 => {
- LANGUAGE()=fr;
+ Set(LANGUAGE()=fr);
goto s|restart;
};
+ 1000 => {
+ goto default|s|1;
+ };
500 => {
Playback(demo-abouttotry);
- Dial(IAX2/guest@misery.digium.com);
+ Dial(IAX2/guest@misery.digium.com/s@default);
Playback(demo-nogo);
goto s|instructions;
};
goto s|instructions;
};
_1234 => &std-exten-ael(${EXTEN}, "IAX2");
+ 8500 => {
+ VoicemailMain();
+ goto s|instructions;
+ };
# => {
Playback(demo-thanks);
Hangup();
};
- t => jump #;
+ t => goto #|1;
i => Playback(invalid);
};
+context default {
+
+// By default we include the demo. In a production system, you
+// probably don't want to have the demo there.
+
+ includes {
+ ael-demo;
+ };
+//
+// Extensions like the two below can be used for FWD, Nikotel, sipgate etc.
+// Note that you must have a [sipprovider] section in sip.conf whereas
+// the otherprovider.net example does not require such a peer definition
+//
+//_41X. => Dial(SIP/${EXTEN:2}@sipprovider,,r);
+//_42X. => Dial(SIP/user:passwd@${EXTEN:2}@otherprovider.net,30,rT);
+
+// Real extensions would go here. Generally you want real extensions to be
+// 4 or 5 digits long (although there is no such requirement) and start with a
+// single digit that is fairly large (like 6 or 7) so that you have plenty of
+// room to overlap extensions and menu options without conflict. You can alias
+// them with names, too, and use global variables
+
+// 6245 => {
+// hint(SIP/Grandstream1&SIP/Xlite1,Joe Schmoe); // Channel hints for presence
+// Dial(SIP/Grandstream1,20,rt); // permit transfer
+// Dial(${HINT}/5245},20,rtT); // Use hint as listed
+// switch(${DIALSTATUS}) {
+// case BUSY:
+// Voicemail(b6245);
+// return;
+// default:
+// Voicemail(u6245);
+// return;
+// };
+// };
+
+// 6361 => Dial(IAX2/JaneDoe,,rm); // ring without time limit
+// 6389 => Dial(MGCP/aaln/1@192.168.0.14);
+// 6394 => Dial(Local/6275/n); // this will dial ${MARK}
+
+// 6275 => &ael-stdexten(6275,${MARK}); // assuming ${MARK} is something like Zap/2
+// mark => goto 6275|1; // alias mark to 6275
+// 6536 => &ael-stdexten(6236,${WIL}); // Ditto for wil
+// wil => goto 6236|1;
+//
+// Some other handy things are an extension for checking voicemail via
+// voicemailmain
+//
+// 8500 => {
+// VoicemailMain();
+// Hangup();
+// };
+//
+// Or a conference room (you'll need to edit meetme.conf to enable this room)
+//
+// 8600 => Meetme(1234);
+//
+// Or playing an announcement to the called party, as soon it answers
+//
+// 8700 => Dial(${MARK},30,A(/path/to/my/announcemsg))
+//
+// For more information on applications, just type "show applications" at your
+// friendly Asterisk CLI prompt.
+//
+// 'show application <command>' will show details of how you
+// use that particular application in this file, the dial plan.
+//
+};
-The Asterisk Extension Language
-===================================
+The Asterisk Extension Language - v 2
+=====================================
-Over time, people have been pushing to add features to extensions.conf to make
-it more like a programming language. AEL is intended to provide an actual
-programming language that can be used to write an Asterisk dialplan.
+AEL is a specialized language intended purely for
+describing Asterisk dial plans.
-Getting Started
+The current version was written by Steve Murphy, and is a rewrite of
+the original version.
+
+AEL is considered an EXPERIMENTAL Version. (yet is being
+used in the field with success)
+
+This new version further extends AEL, and
+provides more flexible syntax, better error messages, and some missing
+functionality.
+
+AEL is really the merger of 4 different 'languages', or syntaxes:
+
+ * The first and most obvious is the AEL syntax itselft. A BNF is
+ provided near the end of this document.
+
+ * The second syntax is the Expression Syntax, which is normally
+ handled by Asterisk extension engine, as expressions enclosed in
+ $[...]. The right hand side of assignments are wrapped in $[ ... ]
+ by AEL, and so are the if and while expressions, among others.
+
+ * The third syntax is the Variable Reference Syntax, the stuff
+ enclosed in ${..} curly braces. It's a bit more involved than just
+ putting a variable name in there. You can include one of dozens of
+ 'functions', and their arguments, and there are even some string
+ manipulation notation in there.
+
+ * The last syntax that underlies AEL, and is not used
+ directly in AEL, is the Extension Language Syntax. The
+ extension language is what you see in extensions.conf, and AEL
+ compiles the higher level AEL language into extensions and
+ priorities, and passes them via function calls into
+ Asterisk. Embedded in this language is the Application/AGI
+ commands, of which one application call per step, or priority
+ can be made. You can think of this as a "macro assembler"
+ language, that AEL2 will compile into.
+
+
+Any programmer of AEL should be familiar with it's syntax, of course,
+as well as the Expression syntax, and the Variable syntax.
+
+**************************
+* Asterisk in a Nutshell *
+**************************
+
+Asterisk acts as a server. Devices involved in telephony, like Zapata
+cards, or Voip phones, all indicate some context that should be
+activated in their behalf. See the config file formats for IAX, SIP,
+zapata.conf, etc. They all help describe a device, and they all
+specify a context to activate when somebody picks up a phone, or a
+call comes in from the phone company, or a voip phone, etc.
+
+Contexts
+--------
+
+Contexts are a grouping of extensions.
+
+Contexts can also include other contexts. Think of it as a sort of
+merge operation at runtime, whereby the included context's extensions
+are added to the contexts making the inclusion.
+
+Extensions and priorities
-------------------------
+
+A Context contains zero or more Extensions. There are several
+predefined extensions. The "s" extension is the "start" extension, and
+when a device activates a context the "s" extension is the one that is
+going to be run. Other extensions are the timeout "t" extension, the
+invalid response, or "i" extension, and there's a "fax" extension. For
+instance, a normal call will activate the "s" extension, but an
+incoming FAX call will come into the "fax" extension, if it
+exists. (BTW, asterisk can tell it's a fax call by the little "beep"
+that the calling fax machine emits every so many seconds.).
+
+Extensions contain several priorities, which are individual
+instructions to perform. Some are as simple as setting a variable to a
+value. Others are as complex as initiating the Voicemail application,
+for instance. Priorities are executed in order.
+
+When the 's" extension completes, asterisk waits until the timeout for
+a response. If the response matches an extension's pattern in the
+context, then control is transferred to that extension. Usually the
+responses are tones emitted when a user presses a button on their
+phone. For instance, a context associated with a desk phone might not
+have any "s" extension. It just plays a dialtone until someone starts
+hitting numbers on the keypad, gather the number, find a matching
+extension, and begin executing it. That extension might Dial out over
+a connected telephone line for the user, and then connect the two
+lines together.
+
+The extensions can also contain "goto" or "jump" commands to skip to
+extensions in other contexts. Conditionals provide the ability to
+react to different stimiuli, and there you have it.
+
+Macros
+------
+
+Think of a macro as a combination of a context with one nameless
+extension, and a subroutine. It has arguments like a subroutine
+might. A macro call can be made within an extension, and the
+individual statements there are executed until it ends. At this point,
+execution returns to the next statement after the macro call. Macros
+can call other macros. And they work just like function calls.
+
+Applications
+------------
+
+Application calls, like "Dial()", or "Hangup()", or "Answer()", are
+available for users to use to accomplish the work of the
+dialplan. There are over 145 of them at the moment this was written,
+and the list grows as new needs and wants are uncovered. Some
+applications do fairly simple things, some provide amazingly complex
+services.
+
+Hopefully, the above objects will allow you do anything you need to in
+the Asterisk environment!
+
+
+*******************
+* Getting Started *
+*******************
+
The AEL parser (pbx_ael.so) is completely separate from the module
-that parses extensions.conf (pbx_config.so). To use AEL, the only thing that
-has to be done is the module pbx_ael.so must be loaded by Asterisk. This will
-be done automatically if using 'autoload=yes' in /etc/asterisk/modules.conf.
-When the module is loaded, it will look for 'extensions.ael' in /etc/asterisk/.
-Both extensions.conf and extensions.ael can be used in conjunction with each
-other if that is what is desired. Some users may want to keep extensions.conf
-for the features that are configured in the 'general' section of
-extensions.conf.
+that parses extensions.conf (pbx_config.so). To use AEL, the only
+thing that has to be done is the module pbx_ael.so must be loaded by
+Asterisk. This will be done automatically if using 'autoload=yes' in
+/etc/asterisk/modules.conf. When the module is loaded, it will look
+for 'extensions.ael' in /etc/asterisk/. extensions.conf and
+extensions.ael can be used in conjunction with
+each other if that is what is desired. Some users may want to keep
+extensions.conf for the features that are configured in the 'general'
+section of extensions.conf.
+------------------------------
+- Reloading extensions.ael -
+------------------------------
-Reloading extensions.ael
--------------------------
-To reload extensions.ael, the following command can be issued at the CLI.
+To reload extensions.ael, the following command can be issued at the
+CLI:
- *CLI> reload pbx_ael.so
+ *CLI> ael reload
-Contexts
+
+*************
+* Debugging *
+*************
+
+Right at this moment, the following commands are available, but do
+nothing:
+
+Enable AEL contexts debug
+ *CLI> ael debug contexts
+
+Enable AEL macros debug
+ *CLI> ael debug macros
+
+Enable AEL read debug
+ *CLI> ael debug read
+
+Enable AEL tokens debug
+ *CLI> ael debug tokens
+
+Disable AEL debug messages
+ *CLI> ael no debug
+
+If things are going wrong in your dialplan, you can use the following
+facilities to debug your file:
+
+1. The messages log in /var/log/asterisk. (from the checks done at load time).
+2. the "show dialplan" command in asterisk
+3. the standalone executable, "aelparse" built in the utils/ dir in the source.
+
+
+*****************************
+* About "aelparse" *
+*****************************
+
+You can also use the "aelparse" program to check your extensions.ael
+file before feeding it to asterisk. Wouldn't it be nice to eliminate
+most errors before giving the file to asterisk?
+
+aelparse is compiled in the utils directory of the asterisk release.
+It isn't installed anywhere (yet). You can copy it to your favorite
+spot in your PATH.
+
+aelparse has two optional arguments:
+
+-d - Override the normal location of the config file dir, (usually
+ /etc/asterisk), and use the current directory instead as the
+ config file dir. Aelparse will then expect to find the file
+ "./extensions.ael" in the current directory, and any included
+ files in the current directory as well.
+
+-n - don't show all the function calls to set priorities and contexts
+ within asterisk. It will just show the errors and warnings from
+ the parsing and semantic checking phases.
+
+
+******************************
+* General Notes about Syntax *
+******************************
+
+Note that the syntax and style are now a little more free-form. The
+opening '{' (curly-braces) do not have to be on the same line as the
+keyword that precedes them. Statements can be split across lines, as
+long as tokens are not broken by doing so. More than one statement can
+be included on a single line. Whatever you think is best!
+
+You can just as easily say,
+
+if(${x}=1) { NoOp(hello!); goto s|3; } else { NoOp(Goodbye!); goto s|12; }
+
+as you can say:
+
+if(${x}=1)
+{
+ NoOp(hello!);
+ goto s|3;
+}
+else
+{
+ NoOp(Goodbye!);
+ goto s|12;
+}
+
+or:
+
+if(${x}=1) {
+ NoOp(hello!);
+ goto s|3;
+} else {
+ NoOp(Goodbye!);
+ goto s|12;
+}
+
+or:
+
+if (${x}=1) {
+ NoOp(hello!); goto s|3;
+} else {
+ NoOp(Goodbye!); goto s|12;
+}
+
+or even:
+
+if
+(${x}=1)
+{
+NoOp(hello!);
+goto s|3;
+}
+else
+{
+NoOp(Goodbye!);
+goto s|12;
+}
+
+
+************
+* Keywords *
+************
+
+The AEL keywords are case-sensitive. If an application name and a
+keyword overlap, there is probably good reason, and you should
+consider replacing the application call with an AEL statement. If you
+do not wish to do so, you can still use the application, by using a
+capitalized letter somewhere in its name. In the Asterisk extension
+language, application names are NOT case-sensitive.
+
+The following are keywords in the AEL2 language:
+
+ * abstract
+ * context
+ * macro
+ * globals
+ * ignorepat
+ * switch
+ * if
+ * ifTime
+ * else
+ * random
+ * goto
+ * jump
+ * return
+ * break
+ * continue
+ * regexten
+ * hint
+ * for
+ * while
+ * case
+ * pattern
+ * default NOTE: the "default" keyword can be used as a context name,
+ for those who would like to do so.
+ * catch
+ * switches
+ * eswitches
+ * includes
+
+
+
+
+
+Procedural Interface and Internals
+==================================
+
+AEL first parses the extensions.ael file into a memory structure representing the file.
+The entire file is represented by a tree of "pval" structures linked together.
+
+This tree is then handed to the semantic check routine.
+
+Then the tree is handed to the compiler.
+
+After that, it is freed from memory.
+
+A program could be written that could build a tree of pval structures, and
+a pretty printing function is provided, that would dump the data to a file,
+or the tree could be handed to the compiler to merge the data into the
+asterisk dialplan. The modularity of the design offers several opportunities
+for developers to simplify apps to generate dialplan data.
+
+
+
+=========================
+ AEL version 2 BNF
+=========================
+
+
+
+(hopefully, something close to bnf).
+
+First, some basic objects
+
+------------------------
+
+<word> a lexical token consisting of characters matching this pattern: [-a-zA-Z0-9"_/.\<\>\*\+!$#\[\]][-a-zA-Z0-9"_/.!\*\+\<\>\{\}$#\[\]]*
+
+<word3-list> a concatenation of up to 3 <word>s.
+
+<collected-word> all characters encountered until the character that follows the <collected-word> in the grammar.
+
-------------------------
-Contexts in AEL represent a set of extensions in the same way that they do
-in extensions.conf.
+
+<file> :== <objects>
+
+<objects> :== <object>
+ | <objects> <object>
+
+
+<object> :== <context>
+ | <macro>
+ | <globals>
+ | ';'
+
+
+<context> :== 'context' <word> '{' <elements> '}'
+ | 'context' <word> '{' '}'
+ | 'context' 'default' '{' <elements> '}'
+ | 'context' 'default' '{' '}'
+ | 'abstract' 'context' <word> '{' <elements> '}'
+ | 'abstract' 'context' <word> '{' '}'
+ | 'abstract' 'context' 'default' '{' <elements> '}'
+ | 'abstract' 'context' 'default' '{' '}'
+
+
+<macro> :== 'macro' <word> '(' <arglist> ')' '{' <macro_statements> '}'
+ | 'macro' <word> '(' <arglist> ')' '{' '}'
+ | 'macro' <word> '(' ')' '{' <macro_statements> '}'
+ | 'macro' <word> '(' ')' '{' '}'
+
+
+<globals> :== 'globals' '{' <global_statements> '}'
+ | 'globals' '{' '}'
+
+
+<global_statements> :== <global_statement>
+ | <global_statements> <global_statement>
+
+
+<global_statement> :== <word> '=' <collected-word> ';'
+
+
+<arglist> :== <word>
+ | <arglist> ',' <word>
+
+
+<elements> :== <element>
+ | <elements> <element>
+
+
+<element> :== <extension>
+ | <includes>
+ | <switches>
+ | <eswitches>
+ | <ignorepat>
+ | <word> '=' <collected-word> ';'
+ | ';'
+
+
+<ignorepat> :== 'ignorepat' '=>' <word> ';'
+
+
+<extension> :== <word> '=>' <statement>
+ | 'regexten' <word> '=>' <statement>
+ | 'hint' '(' <word3-list> ')' <word> '=>' <statement>
+ | 'regexten' 'hint' '(' <word3-list> ')' <word> '=>' <statement>
+
+
+<statements> :== <statement>
+ | <statements> <statement>
+
+<if_head> :== 'if' '(' <collected-word> ')'
+
+<random_head> :== 'random' '(' <collected-word> ')'
+
+<ifTime_head> :== 'ifTime' '(' <word3-list> ':' <word3-list> ':' <word3-list> '|' <word3-list> '|' <word3-list> '|' <word3-list> ')'
+ | 'ifTime' '(' <word> '|' <word3-list> '|' <word3-list> '|' <word3-list> ')'
+
+
+<word3-list> :== <word>
+ | <word> <word>
+ | <word> <word> <word>
+
+<switch_head> :== 'switch' '(' <collected-word> ')' '{'
+
+
+<statement> :== '{' <statements> '}'
+ | <word> '=' <collected-word> ';'
+ | 'goto' <target> ';'
+ | 'jump' <jumptarget> ';'
+ | <word> ':'
+ | 'for' '(' <collected-word> ';' <collected-word> ';' <collected-word> ')' <statement>
+ | 'while' '(' <collected-word> ')' <statement>
+ | <switch_head> '}'
+ | <switch_head> <case_statements> '}'
+ | '&' macro_call ';'
+ | <application_call> ';'
+ | <application_call> '=' <collected-word> ';'
+ | 'break' ';'
+ | 'return' ';'
+ | 'continue' ';'
+ | <random_head> <statement>
+ | <random_head> <statement> 'else' <statement>
+ | <if_head> <statement>
+ | <if_head> <statement> 'else' <statement>
+ | <ifTime_head> <statement>
+ | <ifTime_head> <statement> 'else' <statement>
+ | ';'
+
+<target> :== <word>
+ | <word> '|' <word>
+ | <word> '|' <word> '|' <word>
+ | 'default' '|' <word> '|' <word>
+ | <word> ',' <word>
+ | <word> ',' <word> ',' <word>
+ | 'default' ',' <word> ',' <word>
+
+<jumptarget> :== <word>
+ | <word> ',' <word>
+ | <word> ',' <word> '@' <word>
+ | <word> '@' <word>
+ | <word> ',' <word> '@' 'default'
+ | <word> '@' 'default'
+
+<macro_call> :== <word> '(' <eval_arglist> ')'
+ | <word> '(' ')'
+
+<application_call_head> :== <word> '('
+
+<application_call> :== <application_call_head> <eval_arglist> ')'
+ | <application_call_head> ')'
+
+<eval_arglist> :== <collected-word>
+ | <eval_arglist> ',' <collected-word>
+ | /* nothing */
+ | <eval_arglist> ',' /* nothing */
+
+<case_statements> :== <case_statement>
+ | <case_statements> <case_statement>
+
+
+<case_statement> :== 'case' <word> ':' <statements>
+ | 'default' ':' <statements>
+ | 'pattern' <word> ':' <statements>
+ | 'case' <word> ':'
+ | 'default' ':'
+ | 'pattern' <word> ':'
+
+<macro_statements> :== <macro_statement>
+ | <macro_statements> <macro_statement>
+
+<macro_statement> :== <statement>
+ | 'catch' <word> '{' <statements> '}'
+
+<switches> :== 'switches' '{' <switchlist> '}'
+ | 'switches' '{' '}'
+
+<eswitches> :== 'eswitches' '{' <switchlist> '}'
+ | 'eswitches' '{' '}'
+
+<switchlist> :== <word> ';'
+ | <switchlist> <word> ';'
+
+<includeslist> :== <includedname> ';'
+ | <includedname> '|' <word3-list> ':' <word3-list> ':' <word3-list> '|' <word3-list> '|' <word3-list> '|' <word3-list> ';'
+ | <includedname> '|' <word> '|' <word3-list> '|' <word3-list> '|' <word3-list> ';'
+ | <includeslist> <includedname> ';'
+ | <includeslist> <includedname> '|' <word3-list> ':' <word3-list> ':' <word3-list> '|' <word3-list> '|' <word3-list> '|' <word3-list> ';'
+ | <includeslist> <includedname> '|' <word> '|' <word3-list> '|' <word3-list> '|' <word3-list> ';'
+
+<includedname> :== <word>
+ | 'default'
+
+<includes> :== 'includes' '{' <includeslist> '}'
+ | 'includes' '{' '}'
+
+
+**************************
+* AEL Example USAGE *****
+**************************
+
+Comments
+========
+
+Comments begin with // and end with the end of the line.
+
+Comments are removed by the lexical scanner, and will not be
+recognized in places where it is busy gathering expressions to wrap in
+$[] , or inside application call argument lists. The safest place to put
+comments is after terminating semicolons, or on otherwise empty lines.
+
+
+Context
+=======
+
+Contexts in AEL represent a set of extensions in the same way that
+they do in extensions.conf.
+
context default {
-};
+}
+
+
+A context can be declared to be "abstract", in which case, this
+declaration expresses the intent of the writer, that this context will
+only be included by another context, and not "stand on its own". The
+current effect of this keyword is to prevent "goto " statements from
+being checked.
+
+
+abstract context longdist {
+ _1NXXNXXXXXX => NoOp(generic long distance dialing actions in the US);
+}
+
Extensions
--------------------------
-To specify an extension in a context, the following syntax is used. If more
-than one application is be called in an extension, they can be listed in order
-inside of a block.
+==========
+
+To specify an extension in a context, the following syntax is used. If
+more than one application is be called in an extension, they can be
+listed in order inside of a block.
+
context default {
- 1234 => Playback(tt-monkeys);
- 8000 => {
- NoOp(one);
- NoOp(two);
- NoOp(three);
- };
- _5XXX => NoOp(it's a pattern!);
-};
+ 1234 => Playback(tt-monkeys);
+ 8000 => {
+ NoOp(one);
+ NoOp(two);
+ NoOp(three);
+ };
+ _5XXX => NoOp(it's a pattern!);
+}
+
+
+Two optional items have been added to the AEL syntax, that allow the
+specification of hints, and a keyword, regexten, that will force the
+numbering of priorities to start at 2.
+
+
+context default {
+
+ regexten _5XXX => NoOp(it's a pattern!);
+}
+
+
+
+context default {
+
+ hint(Sip/1) _5XXX => NoOp(it's a pattern!);
+}
+
+
+
+context default {
+
+ regexten hint(Sip/1) _5XXX => NoOp(it's a pattern!);
+}
+
+
+The regexten must come before the hint if they are both present.
+
Includes
--------------------------
-Contexts can be included in other contexts. All included contexts are listed
-within a single block.
+========
+
+Contexts can be included in other contexts. All included contexts are
+listed within a single block.
+
context default {
- includes {
- local;
- longdistance;
- international;
- };
-};
+ includes {
+ local;
+ longdistance;
+ international;
+ }
+}
+
+
+Time-limited inclusions can be specified, as in extensions.conf
+format, with the fields described in the wiki page Asterisk cmd
+GotoIfTime.
+
+
+context default {
+ includes {
+ local;
+ longdistance|16:00-23:59|mon-fri|*|*;
+ international;
+ }
+}
+
+
+#include
+========
+
+You can include other files with the #include "filepath" construct.
+
+
+ #include "/etc/asterisk/testfor.ael"
+
+
+An interesting property of the #include, is that you can use it almost
+anywhere in the .ael file. It is possible to include the contents of
+a file in a macro, context, or even extension. The #include does not
+have to occur at the beginning of a line. Included files can include
+other files, up to 50 levels deep. If the path provided in quotes is a
+relative path, the parser looks in the config file directory for the
+file (usually /etc/asterisk).
+
Dialplan Switches
--------------------------
-Switches are listed in their own block within a context.
+=================
+
+Switches are listed in their own block within a context. For clues as
+to what these are used for, see Asterisk - dual servers, and Asterisk
+config extensions.conf.
+
context default {
- switches {
- DUNDi/e164;
- IAX2/box5;
- };
- eswitches {
- IAX2/context@${CURSERVER};
- };
-};
+ switches {
+ DUNDi/e164;
+ IAX2/box5;
+ };
+ eswitches {
+ IAX2/context@${CURSERVER};
+ }
+}
+
Ignorepat
--------------------------
-ignorepat can be used to instruct channel drivers to not cancel dialtone upon
-receipt of a particular pattern. The most commonly used example is '9'.
+=========
+
+ignorepat can be used to instruct channel drivers to not cancel
+dialtone upon receipt of a particular pattern. The most commonly used
+example is '9'.
+
context outgoing {
- ignorepat => 9;
-};
+ ignorepat => 9;
+}
+
+
Variables
--------------------------
-Variables in Asterisk do not have a type, so to define a variable, it just has
-to be specified with a value.
+=========
+
+Variables in Asterisk do not have a type, so to define a variable, it
+just has to be specified with a value.
Global variables are set in their own block.
+
globals {
- CONSOLE=Console/dsp;
- TRUNK=Zap/g2;
-};
+ CONSOLE=Console/dsp;
+ TRUNK=Zap/g2;
+}
+
+
Variables can be set within extensions as well.
+
context foo {
- 555 => {
- x=5;
- y=blah;
- NoOp(x is ${x} and y is ${y} !);
- };
-};
+ 555 => {
+ x=5;
+ y=blah;
+ divexample=10/2
+ NoOp(x is ${x} and y is ${y} !);
+ }
+}
+
+
+NOTE: AEL wraps the right hand side of an assignment with $[ ] to allow
+expressions to be used If this is unwanted, you can protect the right hand
+side from being wrapped by using the Set() application.
+Read the README.variables about the requirements and behavior
+of $[ ] expressions.
+
+NOTE: These things are wrapped up in a $[ ] expression: The while() test;
+the if() test; the middle expression in the for( x; y; z) statement
+(the y expression); Assignments - the right hand side, so a = b -> Set(a=$[b])
Writing to a dialplan function is treated the same as writing to a variable.
+
context blah {
- s => {
- CALLERID(name)=ChickenMan;
- NoOp(My name is ${CALLERID(name)} !);
- };
-};
+ s => {
+ CALLERID(name)=ChickenMan;
+ NoOp(My name is ${CALLERID(name)} !);
+ }
+}
+
Loops
--------------------------
+=====
+
AEL has implementations of 'for' and 'while' loops.
+
context loops {
- 1 => {
- for (x=0; ${x} < 3; x=${x} + 1) {
- Verbose(x is ${x} !);
- };
- };
- 2 => {
- y=10;
- while (${y} >= 0) {
- Verbose(y is ${y} !);
- y=${y}-1;
- };
- };
-};
+ 1 => {
+ for (x=0; ${x} < 3; x=${x} + 1) {
+ Verbose(x is ${x} !);
+ }
+ }
+ 2 => {
+ y=10;
+ while (${y} >= 0) {
+ Verbose(y is ${y} !);
+ y=${y}-1;
+ }
+ }
+}
+
+
+NOTE: The conditional expression (the "${y} >= 0" above) is wrapped in
+ $[ ] so it can be evaluated. NOTE: The for loop test expression
+ (the "${x} < 3" above) is wrapped in $[ ] so it can be evaluated.
+
Conditionals
--------------------------
-AEL supports if and switch statements. Note that if you have an else
-clause, you MUST place braces around the non-else portion of the if
-statement.
+============
+
+AEL supports if and switch statements, like AEL, but adds ifTime, and
+random. Unlike the original AEL, though, you do NOT need to put curly
+braces around a single statement in the "true" branch of an if(), the
+random(), or an ifTime() statement. The if(), ifTime(), and random()
+statements allow optional else clause.
+
context conditional {
- _8XXX => {
- Dial(SIP/${EXTEN});
- if (${DIALSTATUS} = "BUSY") {
- Voicemail(${EXTEN}|b);
- } else
- Voicemail(${EXTEN}|u);
- };
- _777X => {
- switch (${EXTEN}) {
- case 7771:
- NoOp(You called 7771!);
- break;
- case 7772:
- NoOp(You called 7772!);
- break;
- case 7773:
- NoOp(You called 7773!);
- // fall through
- default:
- NoOp(In the default clause!);
- };
- };
-};
-
-
-goto and labels
--------------------------
+ _8XXX => {
+ Dial(SIP/${EXTEN});
+ if ("${DIALSTATUS}" = "BUSY")
+ {
+ NoOp(yessir);
+ Voicemail(${EXTEN}|b);
+ }
+ else
+ Voicemail(${EXTEN}|u);
+ ifTime (14:00-25:00|sat-sun|*|*)
+ Voicemail(${EXTEN}|b);
+ else
+ {
+ Voicemail(${EXTEN}|u);
+ NoOp(hi, there!);
+ }
+ random(51) NoOp(This should appear 51% of the time);
+
+ random( 60 )
+ {
+ NoOp( This should appear 60% of the time );
+ }
+ else
+ {
+ random(75)
+ {
+ NoOp( This should appear 30% of the time! );
+ }
+ else
+ {
+ NoOp( This should appear 10% of the time! );
+ }
+ }
+ }
+ _777X => {
+ switch (${EXTEN}) {
+ case 7771:
+ NoOp(You called 7771!);
+ break;
+ case 7772:
+ NoOp(You called 7772!);
+ break;
+ case 7773:
+ NoOp(You called 7773!);
+ // fall thru-
+ pattern 777[4-9]:
+ NoOp(You called 777 something!);
+ default:
+ NoOp(In the default clause!);
+ }
+ }
+}
+
+
+NOTE: The conditional expression in if() statements (the
+ "${DIALSTATUS}" = "BUSY" above) is wrapped by the compiler in
+ $[] for evaluation.
+
+NOTE: Neither the switch nor case values are wrapped in $[ ]; they can
+ be constants, or ${var} type references only.
+
+NOTE: AEL generates each case as a separate extension. case clauses
+ with no terminating 'break', or 'goto', have a goto inserted, to
+ the next clause, which creates a 'fall thru' effect.
+
+NOTE: AEL introduces the ifTime keyword/statement, which works just
+ like the if() statement, but the expression is a time value,
+ exactly like that used by the application GotoIfTime(). See
+ Asterisk cmd GotoIfTime
+
+NOTE: The pattern statement makes sure the new extension that is
+ created has an '_' preceding it to make sure asterisk recognizes
+ the extension name as a pattern.
+
+NOTE: Every character enclosed by the switch expression's parenthesis
+ are included verbatim in the labels generated. So watch out for
+ spaces!
+
+NOTE: NEW: Previous to version 0.13, the random statement used the
+ "Random()" application, which has been deprecated. It now uses
+ the RAND() function instead, in the GotoIf application.
+
+
+Break, Continue, and Return
+===========================
+
+
+Three keywords, break, continue, and return, are included in the
+syntax to provide flow of control to loops, and switches.
+
+The break can be used in switches and loops, to jump to the end of the
+loop or switch.
+
+The continue can be used in loops (while and for) to immediately jump
+to the end of the loop. In the case of a for loop, the increment and
+test will then be performed. In the case of the while loop, the
+continue will jump to the test at the top of the loop.
+
+The return keyword will cause an immediate jump to the end of the
+context, or macro, and can be used anywhere.
+
+
+
+goto, jump, and labels
+======================
+
This is an example of how to do a goto in AEL.
+
+context gotoexample {
+ s => {
+begin:
+ NoOp(Infinite Loop! yay!);
+ Wait(1);
+ goto begin; // go to label in same extension
+ }
+ 3 => {
+ goto s|begin; // go to label in different extension
+ }
+ 4 => {
+ goto gotoexample|s|begin; // overkill go to label in same context
+ }
+}
+
+context gotoexample2 {
+ s => {
+ end:
+ goto gotoexample|s|begin; // go to label in different context
+ }
+}
+
+You can use the special label of "1" in the goto and jump
+statements. It means the "first" statement in the extension. I would
+not advise trying to use numeric labels other than "1" in goto's or
+jumps, nor would I advise declaring a "1" label anywhere! As a matter
+of fact, it would be bad form to declare a numeric label, and it might
+confllict with the priority numbers used internally by asterisk.
+
+The syntax of the jump statement is: jump
+extension[,priority][@context] If priority is absent, it defaults to
+"1". If context is not present, it is assumed to be the same as that
+which contains the "jump".
+
+
context gotoexample {
- s => {
+ s => {
begin:
- NoOp(Infinite Loop! yay!);
- Wait(1);
- goto begin;
- };
-};
+ NoOp(Infinite Loop! yay!);
+ Wait(1);
+ jump s; // go to first extension in same extension
+ }
+ 3 => {
+ jump s,begin; // go to label in different extension
+ }
+ 4 => {
+ jump s,begin@gotoexample; // overkill go to label in same context
+ }
+}
+
+context gotoexample2 {
+ s => {
+ end:
+ jump s@gotoexample; // go to label in different context
+ }
+}
+
+NOTE: goto labels follow the same requirements as the Goto()
+ application, except the last value has to be a label. If the
+ label does not exist, you will have run-time errors. If the
+ label exists, but in a different extension, you have to specify
+ both the extension name and label in the goto, as in: goto s|z;
+ if the label is in a different context, you specify
+ context|extension|label. There is a note about using goto's in a
+ switch statement below...
+
+NOTE AEL introduces the special label "1", which is the beginning
+ context number for most extensions.
+
+NOTE: A NEW addition to AEL: you can now use ',' instead of '|' to
+ separate the items in the target address. You can't have a mix,
+ though, of '|' and ',' in the target. It's either one, or the other.
+
+
Macros
--------------------------
-A macro is defined in its own block like this. The arguments to the macro are
-specified with the name of the macro. They are then reffered to by that same
-name. A catch block can be specified to catch special extensions.
+======
+
+A macro is defined in its own block like this. The arguments to the
+macro are specified with the name of the macro. They are then referred
+to by that same name. A catch block can be specified to catch special
+extensions.
+
macro std-exten( ext , dev ) {
- Dial(${dev}/${ext},20);
- switch(${DIALSTATUS) {
- case BUSY:
- Voicemail(b${ext});
- break;
- default:
- Voicemail(u${ext});
- };
- catch a {
- VoiceMailMain(${ext});
- return;
- };
-};
-
-A macro is then called by preceeding the macro name with an ampersand.
+ Dial(${dev}/${ext},20);
+ switch(${DIALSTATUS) {
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+
+ }
+ catch a {
+ VoiceMailMain(${ext});
+ return;
+ }
+}
+
+
+A macro is then called by preceeding the macro name with an
+ampersand. Empty arguments can be passed simply with nothing between
+comments(0.11).
+
context example {
- _5XXX => &std-exten(${EXTEN}, "IAX2");
-};
+ _5XXX => &std-exten(${EXTEN}, "IAX2");
+ _6XXX => &std-exten(, "IAX2");
+ _7XXX => &std-exten(${EXTEN},);
+ _8XXX => &std-exten(,);
+}
+
Examples
-------------------------
+========
+
context demo {
- s => {
- Wait(1);
- Answer();
- TIMEOUT(digit)=5;
- TIMEOUT(response)=10;
+ s => {
+ Wait(1);
+ Answer();
+ TIMEOUT(digit)=5;
+ TIMEOUT(response)=10;
restart:
- Background(demo-congrats);
+ Background(demo-congrats);
instructions:
- for (x=0; ${x} < 3; x=${x} + 1) {
- Background(demo-instruct);
- WaitExten();
- };
- };
- 2 => {
- Background(demo-moreinfo);
- goto s|instructions;
- };
- 3 => {
- LANGUAGE()=fr;
- goto s|restart;
- };
- 500 => {
- Playback(demo-abouttotry);
- Dial(IAX2/guest@misery.digium.com);
- Playback(demo-nogo);
- goto s|instructions;
- };
- 600 => {
- Playback(demo-echotest);
- Echo();
- Playback(demo-echodone);
- goto s|instructions;
- };
- # => {
+ for (x=0; ${x} < 3; x=${x} + 1) {
+ Background(demo-instruct);
+ WaitExten();
+ }
+ }
+ 2 => {
+ Background(demo-moreinfo);
+ goto s|instructions;
+ }
+ 3 => {
+ LANGUAGE()=fr;
+ goto s|restart;
+ }
+
+ 500 => {
+ Playback(demo-abouttotry);
+ Dial(IAX2/guest@misery.digium.com);
+ Playback(demo-nogo);
+ goto s|instructions;
+ }
+ 600 => {
+ Playback(demo-echotest);
+ Echo();
+ Playback(demo-echodone);
+ goto s|instructions;
+ }
+ # => {
hangup:
- Playback(demo-thanks);
- Hangup();
- };
- t => goto #|hangup;
- i => Playback(invalid);
-};
+ Playback(demo-thanks);
+ Hangup();
+ }
+ t => goto #|hangup;
+ i => Playback(invalid);
+}
-Syntax Note
-------------------------
-Please note that all opening {'s are on the same line as the keyword. For
-the time being, that syntax is mandatory. We are looking at ways to allow
-other syntax in the future for flexibility, but for now, that is the way
-you must write AEL clauses.
+Semantic Checks
+===============
+
+
+AEL, after parsing, but before compiling, traverses the dialplan
+tree, and makes several checks:
+
+ * Macro calls to non-existent macros.
+ * Macro calls to contexts.
+ * Macro calls with argument count not matching the definition.
+ * application call to macro. (missing the '&')
+ * application calls to "GotoIf", "GotoIfTime", "while",
+ "endwhile", "Random", and "execIf", will generate a message to
+ consider converting the call to AEL goto, while, etc. constructs.
+ * goto a label in an empty extension.
+ * goto a non-existent label, either a within-extension,
+ within-context, or in a different context, or in any included
+ contexts. Will even check "sister" context references.
+ * All the checks done on the time values in the dial plan, are
+ done on the time values in the ifTime() and includes times:
+ o the time range has to have two times separated by a dash;
+ o the times have to be in range of 0 to 24 hours.
+ o The weekdays have to match the internal list, if they are provided;
+ o the day of the month, if provided, must be in range of 1 to 31;
+ o the month name or names have to match those in the internal list.
+ * (0.5) If an expression is wrapped in $[ ... ], and the compiler
+ will wrap it again, a warning is issued.
+ * (0.5) If an expression had operators (you know,
+ +,-,*,/,%,!,etc), but no ${ } variables, a warning is
+ issued. Maybe someone forgot to wrap a variable name?
+ * (0.12) check for duplicate context names.
+ * (0.12) check for abstract contexts that are not included by any context.
+ * (0.13) Issue a warning if a label is a numeric value.
+
+There are a subset of checks that have been removed until the proposed
+AAL (Asterisk Argument Language) is developed and incorporated into Asterisk.
+These checks will be:
+
+ * (if the application argument analyzer is working: the presence
+ of the 'j' option is reported as error.
+ * if options are specified, that are not available in an
+ application.
+ * if you specify too many arguments to an application.
+ * a required argument is not present in an application call.
+ * Switch-case using "known" variables that applications set, that
+ does not cover all the possible values. (a "default" case will
+ solve this problem. Each "unhandled" value is listed.
+ * a Switch construct is used, which is uses a known variable, and
+ the application that would set that variable is not called in
+ the same extension. This is a warning only...
+ * Calls to applications not in the "applist" database (installed
+ in /var/lib/asterisk/applist" on most systems).
+ * In an assignment statement, if the assignment is to a function,
+ the function name used is checked to see if it one of the
+ currently known functions. A warning is issued if it is not.
+
+
+
+Differences with the original version of AEL
+============================================
+
+ 1. The $[...] expressions have been enhanced to inlcude the ==, ||,
+ and && operators. These operators are exactly equivalent to the
+ =, |, and & operators, respectively. Why? So the C, Java, C++
+ hackers feel at home here.
+ 2. It is more free-form. The newline character means very little,
+ and is pulled out of the white-space only for line numbers in
+ error messages.
+ 3. It generates more error messages -- by this I mean that any
+ difference between the input and the grammar are reported, by
+ file, line number, and column.
+ 4. It checks the contents of $[ ] expressions (or what will end up
+ being $[ ] expressions!) for syntax errors. It also does
+ matching paren/bracket counts.
+ 5. It runs several semantic checks after the parsing is over, but
+ before the compiling begins, see the list above.
+ 6. It handles #include "filepath" directives. -- ALMOST
+ anywhere, in fact. You could easily include a file in a context,
+ in an extension, or at the root level. Files can be included in
+ files that are included in files, down to 50 levels of hierarchy...
+ 7. Local Goto's inside Switch statements automatically have the
+ extension of the location of the switch statement appended to them.
+ 8. A pretty printer function is available within pbx_ael.so.
+ 9. In the utils directory, two standalone programs are supplied for
+ debugging AEL files. One is called "aelparse", and it reads in
+ the /etc/asterisk/extensions.ael file, and shows the results of
+ syntax and semantic checking on stdout, and also shows the
+ results of compilation to stdout. The other is "aelparse1",
+ which uses the original ael compiler to do the same work,
+ reading in "/etc/asterisk/extensions.ael", using the original
+ 'pbx_ael.so' instead.
+ 10. AEL supports the "jump" statement, and the "pattern" statement
+ in switch constructs. Hopefully these will be documented in the
+ AEL README.
+ 11. Added the "return" keyword, which will jump to the end of an
+ extension/Macro.
+ 12. Added the ifTime (<time range>|<days of week>|<days of
+ month>|<months> ) {} [else {}] construct, which executes much
+ like an if () statement, but the decision is based on the
+ current time, and the time spec provided in the ifTime. See the
+ example above. (Note: all the other time-dependent Applications
+ can be used via ifTime)
+ 13. Added the optional time spec to the contexts in the includes
+ construct. See examples above.
+ 14. You don't have to wrap a single "true" statement in curly
+ braces, as in the orignal AEL. An "else" is attached to the
+ closest if. As usual, be careful about nested if statements!
+ When in doubt, use curlies!
+ 15. Added the syntax [regexten] [hint(channel)] to preceed an
+ extension declaration. See examples above, under
+ "Extension". The regexten keyword will cause the priorities in
+ the extension to begin with 2 instead of 1. The hint keyword
+ will cause its arguments to be inserted in the extension under
+ the hint priority. They are both optional, of course, but the
+ order is fixed at the moment-- the regexten must come before the
+ hint, if they are both present.
+ 16. Empty case/default/pattern statements will "fall thru" as
+ expected. (0.6)
+ 17. A trailing label in an extension, will automatically have a
+ NoOp() added, to make sure the label exists in the extension on
+ Asterisk. (0.6)
+ 18. (0.9) the semicolon is no longer required after a closing brace!
+ (i.e. "];" ===> "}". You can have them there if you like, but
+ they are not necessary. Someday they may be rejected as a syntax
+ error, maybe.
+ 19. (0.9) the // comments are not recognized and removed in the
+ spots where expressions are gathered, nor in application call
+ arguments. You may have to move a comment if you get errors in
+ existing files.
+ 20. (0.10) the random statement has been added. Syntax: random (
+ <expr> ) <lucky-statement> [ else <unlucky-statement> ]. The
+ probability of the lucky-statement getting executed is <expr>,
+ which should evaluate to an integer between 0 and 100. If the
+ <lucky-statement> isn't so lucky this time around, then the
+ <unlucky-statement> gets executed, if it is present.
+
+
+
+Hints and Bugs
+==============
+
+ * The safest way to check for a null strings is to say $[ "${x}" =
+ "" ] The old way would do as shell scripts often do, and append
+ something on both sides, like this: $[ ${x}foo = foo ]. The
+ trouble with the old way, is that, if x contains any spaces, then
+ problems occur, usually syntax errors. It is better practice and
+ safer wrap all such tests with double quotes! Also, there are now
+ some functions that can be used in a variable referenece,
+ ISNULL(), and LEN(), that can be used to test for an empty string:
+ ${ISNULL(${x})} or $[ ${LEN(${x}) = 0 ].
+
+ * Assignment vs. Set(). Keep in mind that setting a variable to
+ value can be done two different ways. If you choose say 'x=y;',
+ keep in mind that AEL will wrap the right-hand-side with
+ $[]. So, when compiled into extension language format, the end
+ result will be 'Set(x=$[y])'. If you don't want this effect,
+ then say "Set(x=y);" instead.
+
+
+The Full Power of AEL
+==============================
+
+A newcomer to Asterisk will look at the above constructs and
+descriptions, and ask, "Where's the string manipulation functions?",
+"Where's all the cool operators that other languages have to offer?",
+etc.
+
+The answer is that the rich capabilities of Asterisk are made
+available through AEL, via:
+
+ * Applications: See Asterisk - documentation of application
+ commands
+
+ * Functions: Functions were implemented inside ${ .. } variable
+ references, and supply many useful capabilities.
+
+ * Expressions: An expression evaluation engine handles items
+ wrapped inside $[...]. This includes some string manipulation
+ facilities, arithmetic expressions, etc.
+
+ * Application Gateway Interface: Asterisk can fork external
+ processes that communicate via pipe. AGI applications can be
+ written in any language. Very powerful applications can be added
+ this way.
+
+ * Variables: Channels of communication have variables associated
+ with them, and asterisk provides some global variables. These can be
+ manipulated and/or consulted by the above mechanisms.
--- /dev/null
+#if !defined(SOLARIS) && !defined(__CYGWIN__)
+#include <err.h>
+#else
+#define quad_t int64_t
+#endif
+
+#ifdef LONG_LONG_MIN
+#define QUAD_MIN LONG_LONG_MIN
+#endif
+#ifdef LONG_LONG_MAX
+#define QUAD_MAX LONG_LONG_MAX
+#endif
+
+# if ! defined(QUAD_MIN)
+# define QUAD_MIN (-0x7fffffffffffffffLL-1)
+# endif
+# if ! defined(QUAD_MAX)
+# define QUAD_MAX (0x7fffffffffffffffLL)
+# endif
+
+
+typedef enum
+{
+ PV_WORD, /* an ident, string, name, label, etc. A user-supplied string. */
+ PV_MACRO,
+ PV_CONTEXT,
+ PV_MACRO_CALL,
+ PV_APPLICATION_CALL,
+ PV_CASE,
+ PV_PATTERN,
+ PV_DEFAULT,
+ PV_CATCH,
+ PV_SWITCHES,
+ PV_ESWITCHES,
+ PV_INCLUDES,
+ PV_STATEMENTBLOCK,
+ PV_VARDEC, /* you know, var=val; */
+ PV_GOTO,
+ PV_LABEL,
+ PV_FOR,
+ PV_WHILE,
+ PV_BREAK,
+ PV_RETURN,
+ PV_CONTINUE,
+ PV_IF,
+ PV_IFTIME,
+ PV_RANDOM,
+ PV_SWITCH,
+ PV_EXTENSION,
+ PV_IGNOREPAT,
+ PV_GLOBALS,
+
+} pvaltype;
+
+/* why this horrible mess? It's always been a tradeoff-- tons of structs,
+ each storing it's specific lists of goodies, or a 'simple' single struct,
+ with lots of fields, that catches all uses at once. Either you have a long
+ list of struct names and subnames, or you have a long list of field names,
+ and where/how they are used. I'm going with a single struct, using unions
+ to reduce storage. Some simple generalizations, and a long list of types,
+ and a book about what is used with what types.... Sorry!
+*/
+
+struct pval
+{
+ pvaltype type;
+ int startline;
+ int endline;
+ int startcol;
+ int endcol;
+ char *filename;
+
+ union
+ {
+ char *str; /* wow, used almost everywhere! */
+ struct pval *list; /* used in SWITCHES, ESWITCHES, INCLUDES, STATEMENTBLOCK, GOTO */
+ struct pval *statements;/* used in EXTENSION */
+ char *for_init; /* used in FOR */
+ } u1;
+ struct pval *u1_last; /* to build in-order lists -- looks like we only need one */
+
+ union
+ {
+ struct pval *arglist; /* used in macro_call, application_call, MACRO def, also attached to PWORD, the 4 timevals for includes */
+ struct pval *statements; /* used in case, default, catch, while's statement, CONTEXT elements, GLOBALS */
+ char *val; /* used in VARDEC */
+ char *for_test; /* used in FOR */
+
+ } u2;
+
+ union
+ {
+ char *for_inc; /* used in FOR */
+ struct pval *else_statements; /* used in IF */
+ struct pval *macro_statements; /* used in MACRO */
+ int abstract; /* used for context */
+ char *hints; /* used in EXTENSION */
+ } u3;
+
+ union
+ {
+ struct pval *for_statements; /* used in PV_FOR */
+ int regexten; /* used in EXTENSION */
+ } u4;
+
+
+ struct pval *next; /* the pval at the end of this ptr will ALWAYS be of the same type as this one!
+ EXCEPT for objects of the different types, that are in the same list, like contexts & macros, etc */
+
+
+} ;
+
+
+typedef struct pval pval;
+
+pval *npval(pvaltype type, int first_line, int last_line, int first_column, int last_column);
+void linku1(pval *head, pval *tail);
+void print_pval_list(FILE *f, pval *item, int depth);
+void print_pval(FILE *f, pval *item, int depth);
+void ael2_semantic_check(pval *item, int *errs, int *warns, int *notes);
+struct pval *find_label_in_current_context(char *exten, char *label);
+struct pval *find_label_in_current_extension(char *label);
+int count_labels_in_current_context(char *label);
+struct pval *find_label_in_current_db(char *context, char *exten, char *label);
+struct pval *ael2_parse(char *fname, int *errs);
+void destroy_pval(pval *item);
+void ael2_print(char *fname, pval *tree);
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* for passing info into and out of yyparse */
+struct parse_io
+{
+ struct pval *pval; /* yyparse will set this to point to the parse tree */
+ yyscan_t scanner; /* yylex needs a scanner. Set it up, and pass it in */
+ int syntax_error_count; /* the count of syntax errors encountered */
+};
+
+/* for CODE GENERATION */
+
+typedef enum { AEL_APPCALL, AEL_CONTROL1, AEL_FOR_CONTROL, AEL_IF_CONTROL, AEL_IFTIME_CONTROL, AEL_RAND_CONTROL, AEL_LABEL, AEL_RETURN } ael_priority_type;
+
+
+struct ael_priority
+{
+ int priority_num;
+ ael_priority_type type;
+
+ char *app;
+ char *appargs;
+
+ struct pval *origin;
+ struct ael_extension *exten;
+
+ struct ael_priority *goto_true;
+ struct ael_priority *goto_false;
+ struct ael_priority *next;
+};
+
+struct ael_extension
+{
+ char *name;
+ char *hints;
+ int regexten;
+
+ struct ael_priority *plist;
+ struct ael_priority *plist_last;
+ struct ael_extension *next_exten;
+
+ struct ael_priority *loop_break; /* set by latest loop for breaks */
+ struct ael_priority *loop_continue; /* set by lastest loop for continuing */
+ struct ael_priority *return_target;
+ int return_needed;
+};
+
+
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57.
+# Generated by GNU Autoconf 2.59.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
# Be sure to have absolute paths.
for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+ localstatedir libdir includedir oldincludedir infodir mandir
do
eval ac_val=$`echo $ac_var`
case $ac_val in
# Try the directory containing this script, then its parent.
ac_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$0" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
cd $ac_dir
# Check for guested configure; otherwise get Cygnus style configure.
echo
$SHELL $ac_srcdir/configure --help=recursive
elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
+ test -f $ac_srcdir/configure.in; then
echo
$ac_configure --help
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi
- cd $ac_popdir
+ cd "$ac_popdir"
done
fi
if $ac_init_version; then
cat <<\_ACEOF
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
fi
ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
# Get rid of the leading space.
case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
*ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
;;
*)
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
}
for ac_var in $ac_subst_files
do
eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
+ rm -f core *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
# value.
ac_cache_corrupted=false
for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val="\$ac_cv_env_${ac_var}_value"
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output" >&5
-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
(eval $ac_link_default) 2>&5
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
+ ;;
conftest.$ac_ext )
- # This is the source file.
- ;;
+ # This is the source file.
+ ;;
[ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
- break;;
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
* )
- break;;
+ break;;
esac
done
else
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
- break;;
+ export ac_cv_exeext
+ break;;
* ) break;;
esac
done
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_compiler_gnu=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_prog_cc_g=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
va_end (v);
return s;
}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext
+rm -f conftest.err conftest.$ac_objext
done
rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
+ '' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdlib.h>
$ac_declaration
+#include <stdlib.h>
int
main ()
{
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
continue
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_compiler_gnu=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
fi
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
ac_cv_prog_cxx_g=no
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
fi
fi
for ac_declaration in \
- ''\
- '#include <stdlib.h>' \
+ '' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
'void exit (int);'
do
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <stdlib.h>
$ac_declaration
+#include <stdlib.h>
int
main ()
{
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
continue
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+ (eval $ac_compile) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
+ { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
sed 's/^/| /' conftest.$ac_ext >&5
fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
rm -f conftest*
if test -n "$ac_declaration"; then
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
case $as_dir/ in
./ | .// | /cC/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
done
;;
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
+
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
+
+#undef $ac_func
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
+
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
+
+#undef $ac_func
+
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+ (eval $ac_link) 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
+ { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
eval "$as_ac_var=no"
fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
esac;
} |
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
s/:*\$(srcdir):*/:/;
s/:*\${srcdir}:*/:/;
s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
+s/^\([^=]*=[ ]*\):*/\1/;
s/:*$//;
-s/^[^=]*=[ ]*$//;
+s/^[^=]*=[ ]*$//;
}'
fi
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
# 2. Add them.
ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
set -o posix
fi
+DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
$as_unset $as_var
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
+ test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
# IFS
cat >&5 <<_CSEOF
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.57. Invocation command line was
+generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ instantiate the configuration header FILE
Configuration files:
$config_files
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.57,
+configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
-Free Software Foundation, Inc.
+Copyright (C) 2003 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
srcdir=$srcdir
(echo ':t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
fi
ac_sed_frag=`expr $ac_sed_frag + 1`
ac_beg=$ac_end
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
# Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
-# absolute.
-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
-ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
case $INSTALL in
*) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input="$ac_file. "
fi
configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
+ sed 's,.*/,,'` by configure."
# First look for the input files in the build tree, otherwise in the
# src tree.
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
# NAME is the cpp macro being defined and VALUE is the value it is being given.
#
# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
ac_dC=' '
ac_dD=',;t'
# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
ac_uB='$,\1#\2define\3'
ac_uC=' '
ac_uD=',;t'
# Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
*:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
* ) ac_file_in=$ac_file.in ;;
esac
case $f in
-) echo $tmp/stdin ;;
[\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- echo $f;;
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
*) # Relative
- if test -f "$f"; then
- # Build tree
- echo $f
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo $srcdir/$f
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
echo "$as_me: error: cannot find input file: $f" >&2;}
{ (exit 1); exit 1; }; }
- fi;;
+ fi;;
esac
done` || { (exit 1); exit 1; }
# Remove the trailing spaces.
- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
_ACEOF
s,[\\$`],\\&,g
t clear
: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
t end
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
: end
_ACEOF
# If some macros were called several times there might be several times
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
cat >>conftest.undefs <<\_ACEOF
-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
_ACEOF
# Break up conftest.defines because some shells have a limit on the size
# of here documents, and old seds have small limits too (100 cmds).
echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
echo ' :' >>$CONFIG_STATUS
rm -f conftest.tail
# Write a limited-size here document to $tmp/defines.sed.
echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
# Speed up: don't consider the non `#define' lines.
- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
# Work around the forget-to-reset-the-flag bug.
echo 't clr' >>$CONFIG_STATUS
echo ': clr' >>$CONFIG_STATUS
# Write a limited-size here document to $tmp/undefs.sed.
echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
# Speed up: don't consider the non `#undef'
- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
# Work around the forget-to-reset-the-flag bug.
echo 't clr' >>$CONFIG_STATUS
echo ': clr' >>$CONFIG_STATUS
else
ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
as_dirs="$as_dir $as_dirs"
as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
/^X\(\/\/\)[^/].*/{ s//\1/; q; }
pbx_dundi.o: pbx_dundi.c
$(CC) -c -o $@ $(CFLAGS) $(Z_INCLUDE) $<
+pbx_ael.o: ael/aelflex.o ael/aelbison.o ../include/asterisk/ael_structs.h
+
+pbx_ael.so: pbx_ael.o ael/aelbison.o ael/aelflex.o
+ $(CC) $(SOLINK) -o $@ pbx_ael.o ael/aelbison.o ael/aelflex.o
+
+ael/aelflex.o: ael/ael_lex.c ../include/asterisk/ael_structs.h ael/ael.tab.h
+ $(CC) $(CFLAGS) -c -o ael/aelflex.o ael/ael_lex.c
+
+ael/aelbison.o: ael/ael.tab.c ael/ael.tab.h ../include/asterisk/ael_structs.h
+ $(CC) $(CFLAGS) -c -o ael/aelbison.o ael/ael.tab.c
+
+ael/ael_lex.c: ael/ael.flex
+ (cd ael; flex ael.flex)
+
+ael/ael.tab.c ael/ael.tab.h: ael/ael.y
+ (cd ael; bison -v -d ael.y)
+
%.moc : %.h
$(MOC) $< -o $@
--- /dev/null
+
+macro testdial(number, timeout) {
+ Dial(IAX2/vpconnect-t02/${number},${timeout},${OG_DIAL_FLAGS});
+ switch (${DIALSTATUS}) {
+ case CHANUNAVAIL:
+ goto dial-trunk2;
+ break;
+ default:
+ NoOp(t02 Unavailable - ${DIALSTATUS});
+ return;
+ }
+
+dial-trunk2:
+ Dial(IAX2/vpconnect-t01/${number},${timeout},${OG_DIAL_FLAGS});
+
+}
+
+macro exten-gen(name,pword)
+{
+ if( ${DB_EXISTS(org/${GroupID}/${name}/secret)} = 0 )
+ goto other|nomatch|begin;
+ if( ${DB(org/${GroupID}/${name}/secret)}foo != ${pword}foo )
+ goto other|nomatch|begin;
+
+};
+
+context what {
+ who =>
+ {
+ random(51) NoOp(This should appear 51% of the time);
+
+ random( 60 )
+ {
+ NoOp( This should appear 60% of the time );
+ }
+ else
+ {
+ random(75)
+ {
+ NoOp( This should appear 30% of the time! );
+ }
+ else
+ {
+ NoOp( This should appear 10% of the time! );
+ }
+ }
+ }
+}
+
+context other {
+ nomatch => {
+ begin:
+ NoOp(Hello!);
+ switch(${DIALSTATUS})
+ {
+ case BUSY:
+ NoOp(wow);
+ case TORTURE:
+ NoOp(woow);
+ };
+ NoOp(woohoo);
+ };
+};
+
+context testloop {
+ includes {
+ other|16:00-23:59|m0n-fri|*|*;
+ };
+
+ 1 => {
+ for (x=0; ${x} < 3; x=${x} + 1) {
+ Verbose(x is ${x} !);
+ if( ${x} = 1 )
+ continue;
+ if( ${x} = 2 )
+ break;
+ };
+ ifTime(14:00-25:00|sat-sun|*|*) {
+ BackGround(Hello);
+ } else
+ BackGround(Sorry);
+ NoOp(This is a totally useless NOOP);
+ };
+ 2 => {
+ y=10;
+ while (${y} >= 0) {
+ Verbose(y is ${y} !);
+ if( ${y} = 1 )
+ continue;
+ if( ${y} = 2 )
+ break;
+ if( ${y} = 3 )
+ return;
+ y=${y}-1;
+ };
+ };
+ regexten hint(nasty/Thingy) 3 => {
+ for (x=0; ${x} < 3; x=${x} + 1)
+ {
+ Verbose(x is ${x} !);
+ if( ${x} = 4 )
+ break;
+ if( ${x} = 5 )
+ continue;
+ if( ${x} = 6 )
+ return;
+
+ y=10;
+ while (${y} >= 0)
+ {
+ Verbose(y is ${y} !);
+ if( ${y} = 4 )
+ break;
+ if( ${y} = 5 )
+ continue;
+ if( ${y} = 6 )
+ return;
+ y=${y}-1;
+ };
+ };
+ };
+ 4 => {
+ y=10;
+ while (${y} >= 0)
+ {
+ Verbose(y is ${y} !);
+ if( ${y} = 4 )
+ break;
+ if( ${y} = 5 )
+ continue;
+ if( ${y} = 6 )
+ return;
+ for (x=0; ${x} < 3; x=${x} + 1)
+ {
+ Verbose(x is ${x} !);
+ if( ${x} = 4 )
+ break;
+ if( ${x} = 5 )
+ continue;
+ if( ${x} = 6 )
+ return;
+ for (z=0; ${z} < 17; z=${z} + 1)
+ {
+ Verbose(z is ${z} !);
+ Verbose(z is ${z} !);
+ if( ${z} = 4 )
+ break;
+ if( ${z} = 5 )
+ continue;
+ if( ${z} = 6 )
+ return;
+ Verbose(z is ${z} !);
+ Verbose(z is ${z} !);
+ };
+
+ };
+ y=${y}-1;
+ };
+ };
+ 5 => {
+ &exten-gen(axel,brain);
+ };
+};
--- /dev/null
+// this is a quick test to see how many of the apps we can spot j options in
+// include this in a macro or extension
+// at this moment, there are 18 apps that accept the j option.
+
+ AddQueueMember(zork,iface,20,j);
+ ADSIProg(sfile);
+ AgentCallbackLogin(agent,s,30@cont);
+ AgentLogin(agent,s);
+ AgentMonitorOutgoing(dcn);
+ AGI(whatever);
+ AlarmReceiver();
+ Answer(2);
+ AppendCDRUserField(value);
+ Authenticate(pword,adjmr);
+ BackGround(filename,snm,eng);
+ BackgroundDetect(filename,20,2,10);
+ Busy(10);
+ ChangeMonitor(fnamebase);
+ ChanIsAvail(Zap/5,sj);
+ ChanSpy(prefix,bg()qrv);
+ Congestion(5);
+ ControlPlayback(filename,10,6,4,0,5,7,j);
+ DateTime(unixtime,tz,fmt);
+ DBdel(fam/key);
+ DBdeltree(fam);
+ DeadAGI(command);
+ Dial(zap/1,45,A()CdD()fgG()hHjL()m()M()nNoprS()tTwW);
+ Dictate(basedir);
+ Directory(cont,dcont,f);
+ DISA(68986869876,context);
+ DumpChan(verblev);
+ DUNDiLookup(90709780978,context,bj);
+ EAGI(command);
+ Echo();
+ EndWhile();
+ Exec(appname,args);
+ ExecIf(expr,app,data);
+ ExecIfTime(*,*,*,*,appname);
+ ExternalIVR(command,arg1);
+ Festival(text);
+ Flash();
+ ForkCDR(v);
+ GetCPEID();
+ Gosub(cont,exten,priority);
+ GosubIf(cond?label);
+ Goto(cont,exten,prior);
+ GotoIf(cond?t:f);
+ GotoIfTime(*,*,*,*?cont,ext,prior);
+ Hangup();
+ HasNewVoicemail(vmbox,var,j);
+ HasVoicemail(vmbox,var,j);
+ IAX2Provision(template);
+ ICES(xmlconfig);
+ ImportVar(nevar@chann,var);
+ Log(NOTICE,message);
+ LookupBlacklist(j);
+ LookupCIDName();
+ Macro(macro,arg1);
+ MacroExit();
+ MacroIf(expr?etc);
+ MailboxExists(mbox@cont,j);
+ Math(v,2+2);
+ MeetMe(5555,aAbcdDeimMpPqrstTovwxX);
+ MeetMeAdmin(5555,e,user);
+ MeetMeCount(5555,var);
+ Milliwatt();
+ MixMonitor(filename,abv()V()W(),command);
+ Monitor(file.fmt,base,mb);
+ MP3Player(location);
+ MusicOnHold(class);
+ NBScat();
+ NoCDR();
+ NoOp(ignored);
+ Page(Zap/1,dq);
+ Park(exten);
+ ParkAndAnnounce(template,5,238,retcont);
+ ParkedCall(exten);
+ PauseQueueMember(queue,zap,j);
+ Pickup(ext@cont);
+ Playback(file,j);
+ PlayTones(arg);
+ PrivacyManager(3,4,j);
+ Progress();
+ Queue(queuename,dhHnrtTwW,http://www.where.what,over,5);
+ Random(30,cont,ext,pri);
+ Read(var,fname,10,skip,2,5);
+ ReadFile(var=file,10);
+ RealTime(fam,2,val,prefix);
+ RealTimeUpdate(fam,2,val,2,newval);
+ Record(file,2,10,anqst);
+ RemoveQueueMember(queuename,iface,j);
+ ResetCDR(wav);
+ RetryDial(annound,4,2);
+ Return();
+ Ringing();
+ RxFAX(fname,caller);
+ SayAlpha(string);
+ SayDigits(string);
+ SayNumber(digits);
+ SayPhonetic(string);
+ SayUnixTime(unixtime,tz,fmt);
+ SendDTMF(digits,10);
+ SendImage(filename);
+ SendText(text,j);
+ SendURL(URL);
+ Set(a=b);
+ SetAMAFlags();
+ SetCallerID(clid,a);
+ SetCallerPres(allowed_passed_screen);
+ SetCDRUserField(value);
+ SetGlobalVar(var=val);
+ SetMusicOnHold(class);
+ SetTransferCapability(SPEECH);
+ SIPAddHeader(header);
+ SIPDtmfMode(inband,info,rfc);
+ SIPGetHeader(var@headername);
+ SMS(name);
+ SoftHangup(zap/1,a);
+ StackPop();
+ StartMusicOnHold(class);
+ StopMonitor();
+ StopMusicOnHold();
+ StopPlayTones();
+ System(command);
+ TestClient(testid);
+ TestServer();
+ Transfer(zap/1,j);
+ TrySystem(command);
+ TxFAX(filename,caller,debug);
+ UnpauseQueueMember(queuename,iface,j);
+ UserEvent(eventanme,body);
+ Verbose(5,message);
+ VMAuthenticate(mailbox@cont,s);
+ VoiceMail(mailbox@cont,bg()suj);
+ VoiceMailMain(mailbox@cont,pg()s);
+ Wait(2);
+ WaitExten(3,m());
+ WaitForRing(2);
+ WaitForSilence(2,y);
+ WaitMusicOnHold(2);
+ While(expr);
+ Zapateller(answer,5);
+ ZapBarge(channel);
+ ZapRAS(arg);
+ ZapScan(group);
+ ZapSendKeypadFacility();
--- /dev/null
+context test1
+{
+ s =>
+ {
+ #include "apptest.ael2";
+ }
+}
+
--- /dev/null
+globals
+{
+ static=yes;
+ writeprotect=yes;
+ CONSOLE=Console/dsp; // Console interface for demo
+ IAXINFO=murf:tlhfckoct; // IAXtel username/password
+ FWDNUMBER=544788 ; // your calling number
+ FWDCIDNAME="Joe-Worker"; // your caller id
+ FWDPASSWORD=zingledoodle ; // your password
+ FWDRINGS=Zap/6 ; // the phone to ring
+ FWDVMBOX=1 ; // the VM box for this user
+}
+
+macro std-exten( ext , dev )
+{
+ Dial(${dev}/${ext},20);
+ switch(${DIALSTATUS})
+ {
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ case ANSWER:
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+ catch a {
+ VoiceMailMain(${ext});
+ }
+}
+
+macro std-priv-exten_1( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_2( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_3( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_4( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_5( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_6( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_7( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_8( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_9( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_10( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_11( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_12( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_13( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_14( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_15( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_16( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_17( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_18( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ break;
+ default:
+ Voicemail(u${ext});
+ }
+}
+
+
+macro std-priv-exten_19( dev, ext , timeout, opts, torcont, dontcont )
+{
+ Dial(${dev},${timeout},${opts});
+ NoOp(${DIALSTATUS} was chosen);
+ switch(${DIALSTATUS})
+ {
+ case TORTURE:
+ goto ${torcont}|s|begin;
+ break;
+ case DONTCALL:
+ goto ${dontcont}|s|begin;
+ break;
+ case BUSY:
+ Voicemail(b${ext});
+ break;
+ case ANSWER:
+ break;
+ case NOANSWER:
+ Voicemail(u${ext});
+ &n