mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
Terry found this problem with running the expr2 parser on OSX. Make the #defines come out the same between the parser & lexer.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@98953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
177
main/ast_expr2.c
177
main/ast_expr2.c
@@ -135,9 +135,19 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "asterisk.h"
|
#include "asterisk.h"
|
||||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||||
|
#ifdef STANDALONE
|
||||||
|
#ifndef __USE_ISOC99
|
||||||
|
#define __USE_ISOC99 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __USE_ISOC99
|
||||||
#define FP___PRINTF "%.18Lg"
|
#define FP___PRINTF "%.18Lg"
|
||||||
#define FP___TYPE long double
|
#define FP___TYPE long double
|
||||||
|
#else
|
||||||
|
#define FP___PRINTF "%.16g"
|
||||||
|
#define FP___TYPE double
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COSL
|
#ifdef HAVE_COSL
|
||||||
#define FUNC_COS cosl
|
#define FUNC_COS cosl
|
||||||
@@ -460,13 +470,13 @@ int ast_yyerror(const char *,YYLTYPE *, struct parse_io *);
|
|||||||
|
|
||||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||||
typedef union YYSTYPE
|
typedef union YYSTYPE
|
||||||
#line 331 "ast_expr2.y"
|
#line 341 "ast_expr2.y"
|
||||||
{
|
{
|
||||||
struct val *val;
|
struct val *val;
|
||||||
struct expr_node *arglist;
|
struct expr_node *arglist;
|
||||||
}
|
}
|
||||||
/* Line 198 of yacc.c. */
|
/* Line 198 of yacc.c. */
|
||||||
#line 470 "ast_expr2.c"
|
#line 480 "ast_expr2.c"
|
||||||
YYSTYPE;
|
YYSTYPE;
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
@@ -488,13 +498,13 @@ typedef struct YYLTYPE
|
|||||||
|
|
||||||
|
|
||||||
/* Copy the second part of user declarations. */
|
/* Copy the second part of user declarations. */
|
||||||
#line 336 "ast_expr2.y"
|
#line 346 "ast_expr2.y"
|
||||||
|
|
||||||
extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
|
extern int ast_yylex __P((YYSTYPE *, YYLTYPE *, yyscan_t));
|
||||||
|
|
||||||
|
|
||||||
/* Line 221 of yacc.c. */
|
/* Line 221 of yacc.c. */
|
||||||
#line 498 "ast_expr2.c"
|
#line 508 "ast_expr2.c"
|
||||||
|
|
||||||
#ifdef short
|
#ifdef short
|
||||||
# undef short
|
# undef short
|
||||||
@@ -788,9 +798,9 @@ static const yytype_int8 yyrhs[] =
|
|||||||
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
|
||||||
static const yytype_uint16 yyrline[] =
|
static const yytype_uint16 yyrline[] =
|
||||||
{
|
{
|
||||||
0, 362, 362, 370, 377, 378, 387, 393, 394, 398,
|
0, 372, 372, 380, 387, 388, 397, 403, 404, 408,
|
||||||
402, 406, 410, 414, 418, 422, 426, 430, 434, 438,
|
412, 416, 420, 424, 428, 432, 436, 440, 444, 448,
|
||||||
442, 446, 450, 454, 458, 462, 466
|
452, 456, 460, 464, 468, 472, 476
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1444,115 +1454,115 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp)
|
|||||||
switch (yytype)
|
switch (yytype)
|
||||||
{
|
{
|
||||||
case 4: /* "TOK_COLONCOLON" */
|
case 4: /* "TOK_COLONCOLON" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
|
||||||
#line 1450 "ast_expr2.c"
|
|
||||||
break;
|
|
||||||
case 5: /* "TOK_COND" */
|
|
||||||
#line 356 "ast_expr2.y"
|
|
||||||
{ free_value((yyvaluep->val)); };
|
|
||||||
#line 1455 "ast_expr2.c"
|
|
||||||
break;
|
|
||||||
case 6: /* "TOK_OR" */
|
|
||||||
#line 356 "ast_expr2.y"
|
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1460 "ast_expr2.c"
|
#line 1460 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 7: /* "TOK_AND" */
|
case 5: /* "TOK_COND" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1465 "ast_expr2.c"
|
#line 1465 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 8: /* "TOK_NE" */
|
case 6: /* "TOK_OR" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1470 "ast_expr2.c"
|
#line 1470 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 9: /* "TOK_LE" */
|
case 7: /* "TOK_AND" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1475 "ast_expr2.c"
|
#line 1475 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 10: /* "TOK_GE" */
|
case 8: /* "TOK_NE" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1480 "ast_expr2.c"
|
#line 1480 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 11: /* "TOK_LT" */
|
case 9: /* "TOK_LE" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1485 "ast_expr2.c"
|
#line 1485 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 12: /* "TOK_GT" */
|
case 10: /* "TOK_GE" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1490 "ast_expr2.c"
|
#line 1490 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 13: /* "TOK_EQ" */
|
case 11: /* "TOK_LT" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1495 "ast_expr2.c"
|
#line 1495 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 14: /* "TOK_MINUS" */
|
case 12: /* "TOK_GT" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1500 "ast_expr2.c"
|
#line 1500 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 15: /* "TOK_PLUS" */
|
case 13: /* "TOK_EQ" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1505 "ast_expr2.c"
|
#line 1505 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 16: /* "TOK_MOD" */
|
case 14: /* "TOK_MINUS" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1510 "ast_expr2.c"
|
#line 1510 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 17: /* "TOK_DIV" */
|
case 15: /* "TOK_PLUS" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1515 "ast_expr2.c"
|
#line 1515 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 18: /* "TOK_MULT" */
|
case 16: /* "TOK_MOD" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1520 "ast_expr2.c"
|
#line 1520 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 19: /* "TOK_COMPL" */
|
case 17: /* "TOK_DIV" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1525 "ast_expr2.c"
|
#line 1525 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 20: /* "TOK_EQTILDE" */
|
case 18: /* "TOK_MULT" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1530 "ast_expr2.c"
|
#line 1530 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 21: /* "TOK_COLON" */
|
case 19: /* "TOK_COMPL" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1535 "ast_expr2.c"
|
#line 1535 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 22: /* "TOK_LP" */
|
case 20: /* "TOK_EQTILDE" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1540 "ast_expr2.c"
|
#line 1540 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 23: /* "TOK_RP" */
|
case 21: /* "TOK_COLON" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1545 "ast_expr2.c"
|
#line 1545 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 24: /* "TOKEN" */
|
case 22: /* "TOK_LP" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1550 "ast_expr2.c"
|
#line 1550 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
case 28: /* "expr" */
|
case 23: /* "TOK_RP" */
|
||||||
#line 356 "ast_expr2.y"
|
#line 366 "ast_expr2.y"
|
||||||
{ free_value((yyvaluep->val)); };
|
{ free_value((yyvaluep->val)); };
|
||||||
#line 1555 "ast_expr2.c"
|
#line 1555 "ast_expr2.c"
|
||||||
break;
|
break;
|
||||||
|
case 24: /* "TOKEN" */
|
||||||
|
#line 366 "ast_expr2.y"
|
||||||
|
{ free_value((yyvaluep->val)); };
|
||||||
|
#line 1560 "ast_expr2.c"
|
||||||
|
break;
|
||||||
|
case 28: /* "expr" */
|
||||||
|
#line 366 "ast_expr2.y"
|
||||||
|
{ free_value((yyvaluep->val)); };
|
||||||
|
#line 1565 "ast_expr2.c"
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -1874,7 +1884,7 @@ yyreduce:
|
|||||||
switch (yyn)
|
switch (yyn)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
#line 362 "ast_expr2.y"
|
#line 372 "ast_expr2.y"
|
||||||
{ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
|
{ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),1);
|
||||||
((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type;
|
((struct parse_io *)parseio)->val->type = (yyvsp[(1) - (1)].val)->type;
|
||||||
if( (yyvsp[(1) - (1)].val)->type == AST_EXPR_number )
|
if( (yyvsp[(1) - (1)].val)->type == AST_EXPR_number )
|
||||||
@@ -1886,7 +1896,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
#line 370 "ast_expr2.y"
|
#line 380 "ast_expr2.y"
|
||||||
{/* nothing */ ((struct parse_io *)parseio)->val = (struct val *)calloc(sizeof(struct val),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->type = AST_EXPR_string;
|
||||||
((struct parse_io *)parseio)->val->u.s = strdup("");
|
((struct parse_io *)parseio)->val->u.s = strdup("");
|
||||||
@@ -1894,12 +1904,12 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
#line 377 "ast_expr2.y"
|
#line 387 "ast_expr2.y"
|
||||||
{ (yyval.arglist) = alloc_expr_node(AST_EXPR_NODE_VAL); (yyval.arglist)->val = (yyvsp[(1) - (1)].val);;}
|
{ (yyval.arglist) = alloc_expr_node(AST_EXPR_NODE_VAL); (yyval.arglist)->val = (yyvsp[(1) - (1)].val);;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
#line 378 "ast_expr2.y"
|
#line 388 "ast_expr2.y"
|
||||||
{struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
|
{struct expr_node *x = alloc_expr_node(AST_EXPR_NODE_VAL);
|
||||||
struct expr_node *t;
|
struct expr_node *t;
|
||||||
DESTROY((yyvsp[(2) - (3)].val));
|
DESTROY((yyvsp[(2) - (3)].val));
|
||||||
@@ -1909,7 +1919,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
#line 387 "ast_expr2.y"
|
#line 397 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_func((yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].arglist), ((struct parse_io *)parseio)->chan);
|
{ (yyval.val) = op_func((yyvsp[(1) - (4)].val),(yyvsp[(3) - (4)].arglist), ((struct parse_io *)parseio)->chan);
|
||||||
DESTROY((yyvsp[(2) - (4)].val));
|
DESTROY((yyvsp[(2) - (4)].val));
|
||||||
DESTROY((yyvsp[(4) - (4)].val));
|
DESTROY((yyvsp[(4) - (4)].val));
|
||||||
@@ -1919,12 +1929,12 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
#line 393 "ast_expr2.y"
|
#line 403 "ast_expr2.y"
|
||||||
{(yyval.val) = (yyvsp[(1) - (1)].val);;}
|
{(yyval.val) = (yyvsp[(1) - (1)].val);;}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
#line 394 "ast_expr2.y"
|
#line 404 "ast_expr2.y"
|
||||||
{ (yyval.val) = (yyvsp[(2) - (3)].val);
|
{ (yyval.val) = (yyvsp[(2) - (3)].val);
|
||||||
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
(yyloc).first_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
(yyloc).first_line=0; (yyloc).last_line=0;
|
(yyloc).first_line=0; (yyloc).last_line=0;
|
||||||
@@ -1932,7 +1942,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 9:
|
case 9:
|
||||||
#line 398 "ast_expr2.y"
|
#line 408 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_or ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1940,7 +1950,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 10:
|
case 10:
|
||||||
#line 402 "ast_expr2.y"
|
#line 412 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_and ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1948,7 +1958,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 11:
|
case 11:
|
||||||
#line 406 "ast_expr2.y"
|
#line 416 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_eq ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1956,7 +1966,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 12:
|
case 12:
|
||||||
#line 410 "ast_expr2.y"
|
#line 420 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_gt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1964,7 +1974,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 13:
|
case 13:
|
||||||
#line 414 "ast_expr2.y"
|
#line 424 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_lt ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1972,7 +1982,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 14:
|
case 14:
|
||||||
#line 418 "ast_expr2.y"
|
#line 428 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_ge ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1980,7 +1990,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 15:
|
case 15:
|
||||||
#line 422 "ast_expr2.y"
|
#line 432 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_le ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1988,7 +1998,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
#line 426 "ast_expr2.y"
|
#line 436 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_ne ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -1996,7 +2006,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 17:
|
case 17:
|
||||||
#line 430 "ast_expr2.y"
|
#line 440 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_plus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -2004,7 +2014,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 18:
|
case 18:
|
||||||
#line 434 "ast_expr2.y"
|
#line 444 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_minus ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -2012,7 +2022,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 19:
|
case 19:
|
||||||
#line 438 "ast_expr2.y"
|
#line 448 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_negate ((yyvsp[(2) - (2)].val));
|
{ (yyval.val) = op_negate ((yyvsp[(2) - (2)].val));
|
||||||
DESTROY((yyvsp[(1) - (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_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
|
||||||
@@ -2020,7 +2030,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 20:
|
case 20:
|
||||||
#line 442 "ast_expr2.y"
|
#line 452 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_compl ((yyvsp[(2) - (2)].val));
|
{ (yyval.val) = op_compl ((yyvsp[(2) - (2)].val));
|
||||||
DESTROY((yyvsp[(1) - (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_column = (yylsp[(1) - (2)]).first_column; (yyloc).last_column = (yylsp[(2) - (2)]).last_column;
|
||||||
@@ -2028,7 +2038,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 21:
|
case 21:
|
||||||
#line 446 "ast_expr2.y"
|
#line 456 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_times ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -2036,7 +2046,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 22:
|
case 22:
|
||||||
#line 450 "ast_expr2.y"
|
#line 460 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_div ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -2044,7 +2054,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 23:
|
case 23:
|
||||||
#line 454 "ast_expr2.y"
|
#line 464 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_rem ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -2052,7 +2062,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 24:
|
case 24:
|
||||||
#line 458 "ast_expr2.y"
|
#line 468 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_colon ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -2060,7 +2070,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 25:
|
case 25:
|
||||||
#line 462 "ast_expr2.y"
|
#line 472 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
{ (yyval.val) = op_eqtilde ((yyvsp[(1) - (3)].val), (yyvsp[(3) - (3)].val));
|
||||||
DESTROY((yyvsp[(2) - (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_column = (yylsp[(1) - (3)]).first_column; (yyloc).last_column = (yylsp[(3) - (3)]).last_column;
|
||||||
@@ -2068,7 +2078,7 @@ yyreduce:
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 26:
|
case 26:
|
||||||
#line 466 "ast_expr2.y"
|
#line 476 "ast_expr2.y"
|
||||||
{ (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val));
|
{ (yyval.val) = op_cond ((yyvsp[(1) - (5)].val), (yyvsp[(3) - (5)].val), (yyvsp[(5) - (5)].val));
|
||||||
DESTROY((yyvsp[(2) - (5)].val));
|
DESTROY((yyvsp[(2) - (5)].val));
|
||||||
DESTROY((yyvsp[(4) - (5)].val));
|
DESTROY((yyvsp[(4) - (5)].val));
|
||||||
@@ -2078,7 +2088,7 @@ yyreduce:
|
|||||||
|
|
||||||
|
|
||||||
/* Line 1270 of yacc.c. */
|
/* Line 1270 of yacc.c. */
|
||||||
#line 2082 "ast_expr2.c"
|
#line 2092 "ast_expr2.c"
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
|
||||||
@@ -2297,7 +2307,7 @@ yyreturn:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#line 473 "ast_expr2.y"
|
#line 483 "ast_expr2.y"
|
||||||
|
|
||||||
|
|
||||||
static struct expr_node *alloc_expr_node(enum node_type nt)
|
static struct expr_node *alloc_expr_node(enum node_type nt)
|
||||||
@@ -3436,4 +3446,3 @@ op_eqtilde (struct val *a, struct val *b)
|
|||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,9 +1,7 @@
|
|||||||
/* A Bison parser, made by GNU Bison 2.3. */
|
/* A Bison parser, made by GNU Bison 2.1a. */
|
||||||
|
|
||||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
/* Skeleton parser for Yacc-like parsing with Bison,
|
||||||
|
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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
|
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
|
it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,18 +18,10 @@
|
|||||||
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
Boston, MA 02110-1301, USA. */
|
Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* As a special exception, you may create a larger work that contains
|
/* As a special exception, when this file is copied by Bison into a
|
||||||
part or all of the Bison parser skeleton and distribute that work
|
Bison output file, you may use that output file without restriction.
|
||||||
under terms of your choice, so long as that work isn't itself a
|
This special exception was added by the Free Software Foundation
|
||||||
parser generator using the skeleton or a modified version thereof
|
in version 1.24 of Bison. */
|
||||||
as a parser skeleton. Alternatively, if you modify or redistribute
|
|
||||||
the parser skeleton itself, you may (at your option) remove this
|
|
||||||
special exception, which will cause the skeleton and the resulting
|
|
||||||
Bison output files to be licensed under the GNU General Public
|
|
||||||
License without this special exception.
|
|
||||||
|
|
||||||
This special exception was added by the Free Software Foundation in
|
|
||||||
version 2.2 of Bison. */
|
|
||||||
|
|
||||||
/* Tokens. */
|
/* Tokens. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
@@ -92,13 +82,13 @@
|
|||||||
|
|
||||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||||
typedef union YYSTYPE
|
typedef union YYSTYPE
|
||||||
#line 330 "../main/ast_expr2.y"
|
#line 341 "ast_expr2.y"
|
||||||
{
|
{
|
||||||
struct val *val;
|
struct val *val;
|
||||||
struct expr_node *arglist;
|
struct expr_node *arglist;
|
||||||
}
|
}
|
||||||
/* Line 1489 of yacc.c. */
|
/* Line 1536 of yacc.c. */
|
||||||
#line 102 "../main/ast_expr2.h"
|
#line 92 "ast_expr2.h"
|
||||||
YYSTYPE;
|
YYSTYPE;
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
@@ -121,3 +111,5 @@ typedef struct YYLTYPE
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -16,9 +16,19 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "asterisk.h"
|
#include "asterisk.h"
|
||||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||||
|
#ifdef STANDALONE
|
||||||
|
#ifndef __USE_ISOC99
|
||||||
|
#define __USE_ISOC99 1
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __USE_ISOC99
|
||||||
#define FP___PRINTF "%.18Lg"
|
#define FP___PRINTF "%.18Lg"
|
||||||
#define FP___TYPE long double
|
#define FP___TYPE long double
|
||||||
|
#else
|
||||||
|
#define FP___PRINTF "%.16g"
|
||||||
|
#define FP___TYPE double
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_COSL
|
#ifdef HAVE_COSL
|
||||||
#define FUNC_COS cosl
|
#define FUNC_COS cosl
|
||||||
|
Reference in New Issue
Block a user