Skip to content
Snippets Groups Projects
Commit 83e28341 authored by Steve Murphy's avatar Steve Murphy
Browse files

an unreported crash I debugged, looked like it was backing up way too far...

an unreported crash I debugged, looked like it was backing up way too far after hitting the syntax error. An inspection of the code revealed that error tokens in lists were not rearranged when the rules were rearranged as part of a code neatening-up process. By moving the error tokens to where they should be, I also reduced the number of shift/reduce conflicts to 3 instead of 8. This introduces subtle differences in error messages, so the regressions had to be updated.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent cf83d1ff
No related branches found
No related tags found
No related merge requests found
......@@ -8,32 +8,23 @@
LOG: lev:2 file:pbx_ael.c line:1680 func: pbx_load_module Starting AEL load process.
LOG: lev:2 file:pbx_ael.c line:1687 func: pbx_load_module AEL load process: calculated config file name './extensions.ael'.
LOG: lev:2 file:pbx_ael.c line:1695 func: pbx_load_module AEL load process: parsed config file name './extensions.ael'.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 1-4: The macro endsess does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 6-9: The macro nullchk does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 11-26: The macro endcall does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 13-13: A default case was automatically added to the switch.
LOG: lev:3 file:extconf.c line:3959 func: add_pri Unable to register extension '_', priority 1 in 'test6', already in use
LOG: lev:3 file:extconf.c line:3959 func: add_pri Unable to register extension '_X.', priority 1 in 'test6', already in use
=== Loading extensions.conf ===
Context: test6
Context: test5
Context: macro-funcA
Context: macro-funcB
Context: macro-funcC
=========
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 28-44: The macro endcall2 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 36-36: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 46-68: The macro endcall3 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 48-48: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 60-60: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 70-96: The macro endcall4 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 72-72: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 84-84: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 87-87: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 98-131: The macro endcall5 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 106-106: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 119-119: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2280 func: check_switch_expr Warning: file ./extensions.ael, line 122-122: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 1-4: The macro endsess does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 6-9: The macro nullchk does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 11-26: The macro endcall does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 13-13: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 28-44: The macro endcall2 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 36-36: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 46-68: The macro endcall3 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 48-48: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 60-60: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 70-96: The macro endcall4 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 72-72: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 84-84: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 87-87: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 98-131: The macro endcall5 does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 106-106: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 119-119: A default case was automatically added to the switch.
LOG: lev:3 file:pval.c line:2281 func: check_switch_expr Warning: file ./extensions.ael, line 122-122: A default case was automatically added to the switch.
LOG: lev:2 file:pbx_ael.c line:1698 func: pbx_load_module AEL load process: checked config file name './extensions.ael'.
Executed ast_context_create(conts, name=endsess, registrar=pbx_ael);
Executed ast_context_create(conts, name=nullchk, registrar=pbx_ael);
......@@ -168,4 +159,4 @@ Executed ast_merge_contexts_and_delete();
LOG: lev:2 file:pbx_ael.c line:1703 func: pbx_load_module AEL load process: merged config file name './extensions.ael'.
Executed ast_walk_contexts();
LOG: lev:2 file:pbx_ael.c line:1706 func: pbx_load_module AEL load process: verified config file name './extensions.ael'.
LOG: lev:4 file:ael2_parse line:521 func: main 7 contexts, 27 extensions, 121 priorities
LOG: lev:4 file:ael2_parse line:523 func: main 7 contexts, 27 extensions, 121 priorities
......@@ -6,19 +6,20 @@ LOG: lev:2 file:pbx_ael.c line:1680 func: pbx_load_module Starting AEL load pr
LOG: lev:2 file:pbx_ael.c line:1687 func: pbx_load_module AEL load process: calculated config file name './extensions.ael'.
LOG: lev:4 file:ael.flex line:277 func: ael_yylex File=./extensions.ael, line=165, column=49: Mismatched '}' in expression!
LOG: lev:4 file:ael.y line:764 func: ael_yyerror ==== File: ./extensions.ael, Line 165, Cols: 51-51: Error: syntax error, unexpected '=', expecting ')'
LOG: lev:4 file:ael.y line:764 func: ael_yyerror ==== File: ./extensions.ael, Line 169, Cols: 24-24: Error: syntax error, unexpected '&'
LOG: lev:4 file:ael.flex line:277 func: ael_yylex File=./extensions.ael, line=174, column=49: Mismatched '}' in expression!
LOG: lev:4 file:ael.y line:764 func: ael_yyerror ==== File: ./extensions.ael, Line 174, Cols: 51-51: Error: syntax error, unexpected '=', expecting ')'
LOG: lev:4 file:ael.flex line:277 func: ael_yylex File=./extensions.ael, line=222, column=41: Mismatched '}' in expression!
LOG: lev:4 file:ael.y line:764 func: ael_yyerror ==== File: ./extensions.ael, Line 222, Cols: 43-43: Error: syntax error, unexpected '=', expecting ')'
LOG: lev:4 file:ael.y line:764 func: ael_yyerror ==== File: ./extensions.ael, Line 226, Cols: 16-16: Error: syntax error, unexpected '&'
LOG: lev:4 file:ael.y line:764 func: ael_yyerror ==== File: ./extensions.ael, Line 291, Cols: 21-28: Error: syntax error, unexpected word, expecting '(' or ';' or '=' or ':'
LOG: lev:4 file:ael.y line:764 func: ael_yyerror ==== File: ./extensions.ael, Line 291, Cols: 32-32: Error: syntax error, unexpected '|', expecting '(' or ';' or '=' or ':'
LOG: lev:2 file:pbx_ael.c line:1695 func: pbx_load_module AEL load process: parsed config file name './extensions.ael'.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 116-125: The macro dialout does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 129-168: The macro stdexten does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 184-191: The macro uvm does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 193-200: The macro bvm does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 202-207: The macro checkdnd does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 209-216: The macro checkcf does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 218-225: The macro checkcfb does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 688-694: The macro check-psd-exists does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 116-125: The macro dialout does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 129-182: The macro stdexten does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 184-191: The macro uvm does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 193-200: The macro bvm does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 202-207: The macro checkdnd does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 209-216: The macro checkcf does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 218-230: The macro checkcfb does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 688-694: The macro check-psd-exists does not end with a return; I will insert one.
LOG: lev:4 file:pbx_ael.c line:1708 func: pbx_load_module Sorry, but 5 syntax errors and 0 semantic errors were detected. It doesn't make sense to compile.
LOG: lev:4 file:ael2_parse line:521 func: main 0 contexts, 0 extensions, 0 priorities
LOG: lev:4 file:ael2_parse line:523 func: main 0 contexts, 0 extensions, 0 priorities
......@@ -5,25 +5,16 @@
LOG: lev:2 file:pbx_ael.c line:1680 func: pbx_load_module Starting AEL load process.
LOG: lev:2 file:pbx_ael.c line:1687 func: pbx_load_module AEL load process: calculated config file name './extensions.ael'.
LOG: lev:2 file:pbx_ael.c line:1695 func: pbx_load_module AEL load process: parsed config file name './extensions.ael'.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 22-42: The macro stdexten does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 44-49: The macro announce_minutes does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 59-89: The macro checkanddial does not end with a return; I will insert one.
LOG: lev:3 file:extconf.c line:3959 func: add_pri Unable to register extension '_', priority 1 in 'test6', already in use
LOG: lev:3 file:extconf.c line:3959 func: add_pri Unable to register extension '_X.', priority 1 in 'test6', already in use
=== Loading extensions.conf ===
Context: test6
Context: test5
Context: macro-funcA
Context: macro-funcB
Context: macro-funcC
=========
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 91-100: The macro trunkdial does not end with a return; I will insert one.
LOG: lev:4 file:pval.c line:2464 func: check_pval_item Error: file ./extensions.ael, line 98-98: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 102-112: The macro checklocal does not end with a return; I will insert one.
LOG: lev:4 file:pval.c line:2464 func: check_pval_item Error: file ./extensions.ael, line 107-107: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:3 file:pval.c line:668 func: check_macro_returns Warning: file ./extensions.ael, line 114-119: The macro autodial does not end with a return; I will insert one.
LOG: lev:4 file:pval.c line:2464 func: check_pval_item Error: file ./extensions.ael, line 284-284: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:4 file:pval.c line:2464 func: check_pval_item Error: file ./extensions.ael, line 287-287: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:3 file:pval.c line:2422 func: check_pval_item Warning: file ./extensions.ael, line 452-452: macro call to non-existent std-exten-ael! (Not even in the extensions.conf stuff!)
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 22-42: The macro stdexten does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 44-49: The macro announce_minutes does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 59-89: The macro checkanddial does not end with a return; I will insert one.
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 91-100: The macro trunkdial does not end with a return; I will insert one.
LOG: lev:4 file:pval.c line:2465 func: check_pval_item Error: file ./extensions.ael, line 98-98: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 102-112: The macro checklocal does not end with a return; I will insert one.
LOG: lev:4 file:pval.c line:2465 func: check_pval_item Error: file ./extensions.ael, line 107-107: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:3 file:pval.c line:669 func: check_macro_returns Warning: file ./extensions.ael, line 114-119: The macro autodial does not end with a return; I will insert one.
LOG: lev:4 file:pval.c line:2465 func: check_pval_item Error: file ./extensions.ael, line 284-284: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:4 file:pval.c line:2465 func: check_pval_item Error: file ./extensions.ael, line 287-287: The macro call to checkanddial has 5 arguments, but the macro definition has 7 arguments
LOG: lev:3 file:pval.c line:2423 func: check_pval_item Warning: file ./extensions.ael, line 452-452: macro call to non-existent std-exten-ael! (Not even in the extensions.conf stuff!)
LOG: lev:4 file:pbx_ael.c line:1708 func: pbx_load_module Sorry, but 0 syntax errors and 4 semantic errors were detected. It doesn't make sense to compile.
LOG: lev:4 file:ael2_parse line:521 func: main 0 contexts, 0 extensions, 0 priorities
LOG: lev:4 file:ael2_parse line:523 func: main 0 contexts, 0 extensions, 0 priorities
This diff is collapsed.
/* 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
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
/* Skeleton parser for Yacc-like parsing with Bison,
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
......@@ -20,18 +18,10 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
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. */
/* As a special exception, when this file is copied by Bison into a
Bison output file, you may use that output file without restriction.
This special exception was added by the Free Software Foundation
in version 1.24 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
......@@ -134,8 +124,8 @@ typedef union YYSTYPE
char *str; /* strings */
struct pval *pval; /* full objects */
}
/* Line 1489 of yacc.c. */
#line 139 "ael.tab.h"
/* Line 1536 of yacc.c. */
#line 129 "ael.tab.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
......@@ -158,3 +148,5 @@ typedef struct YYLTYPE
#endif
......@@ -154,7 +154,7 @@ static pval *update_last(pval *, YYLTYPE *);
/* there will be two shift/reduce conflicts, they involve the if statement, where a single statement occurs not wrapped in curlies in the "true" section
the default action to shift will attach the else to the preceeding if. */
%expect 8
%expect 3
%error-verbose
/*
......@@ -234,7 +234,7 @@ globals : KW_GLOBALS LC global_statements RC {
global_statements : { $$ = NULL; }
| assignment global_statements {$$ = linku1($1, $2); }
| global_statements error {$$=$1;}
| error global_statements {$$=$2;}
;
assignment : word EQ { reset_semicount(parseio->scanner); } word SEMI {
......@@ -258,7 +258,7 @@ arglist : /* empty */ { $$ = NULL; }
elements : {$$=0;}
| element elements { $$ = linku1($1, $2); }
| elements error { $$=$1;}
| error elements { $$=$2;}
;
element : extension {$$=$1;}
......@@ -303,7 +303,7 @@ extension : word EXTENMARK statement {
/* list of statements in a block or after a case label - can be empty */
statements : /* empty */ { $$ = NULL; }
| statement statements { $$ = linku1($1, $2); }
| statements error {$$=$1;}
| error statements {$$=$2;}
;
/* hh:mm-hh:mm, due to the way the parser works we do not
......@@ -478,7 +478,7 @@ statement : LC statements RC {
opt_else : KW_ELSE statement { $$ = $2; }
| { $$ = NULL ; }
target : goto_word { $$ = nword($1, &@1); }
| goto_word BAR goto_word {
$$ = nword($1, &@1);
......@@ -607,7 +607,7 @@ switchlist : /* empty */ { $$ = NULL; }
| word SEMI switchlist { $$ = linku1(nword($1, &@1), $3); }
| word AT word SEMI switchlist { char *x; asprintf(&x,"%s@%s", $1,$3); free($1); free($3);
$$ = linku1(nword(x, &@1), $5);}
| switchlist error {$$=$1;}
| error switchlist {$$=$2;}
;
included_entry : context_name { $$ = nword($1, &@1); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment