aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/ael/ael_lex.c
AgeCommit message (Collapse)AuthorFilesLines
2010-01-24Only rebuild bison and flex source files on demand, if bison and flex are ↵tilghman1-7/+6
detected by the configure script. Changed after discussion on the -dev list about possible unnecessary build failures, due to checkouts/untars causing these special source files to possibly be newer than their resulting C files. This should additionally ensure that nobody need learn about extra Makefile arguments to ensure the proper files get rebuilt when changes are made to these special source files. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@242520 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-10(closes issue #14022)murf1-422/+427
Reported by: wetwired Tested by: murf I checked, and I added a mod to the trunk version of Asterisk that would make it 8-bit transparent on 27 Nov 2007, but I made no such updates to 1.4. My best guess is that 1.4 was released, and it was not appropriate to commit an enhancement. But I'm going to add the same fixes to 1.4 now, for the following reasons: 1. wetwired is correct; 1.4 is **mostly** 8-bit transparent now. This is because the lexical token forming rules use . in most 'word' state continuances. It's just the beginning of a 'word' that is picky. 2. Accepting 8-bit chars in some places and not others leads to bug reports like this. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162671 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09In discussion with seanbright on #asterisk-dev, I have added a default ↵murf1-84/+96
rule, and an option to suppress the default rule from being generated in the flex output, for the sake of those OS's where they didn't tweak flex's ECHO macro, and the compiler doesn't like it. The regressions are OK with this. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162264 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09Previous fix used ast_malloc and ast_copy_string and messed up the ↵murf1-50/+63
standalone stuff. Fixed. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162136 f38db490-d61c-443f-a65b-d21fe96a405b
2008-12-09(closes issue #14019)murf1-39/+49
Reported by: ckjohnsonme Patches: 14019.diff uploaded by murf (license 17) Tested by: ckjohnsonme, murf This crash was the result of a few small errors that would combine in 64-bit land to result in a crash. 32-bit land might have seen these combine to mysteriously drop the args to an application call, in certain circumstances. Also, in trying to find this bug, I spotted a situation in the flex input, where, in passing back a 'word' to the parser, it would allocate a buffer larger than necessary. I changed the usage in such situations, so that strdup was not used, but rather, an ast_malloc, followed by ast_copy_string. I removed a field from the pval struct, in u2, that was never getting used, and set in one spot in the code. I believe it was an artifact of a previous fix to make switch cases work invisibly with extens. And, for goto's I removed a '!' from before a strcmp, that has been there since the initial merging of AEL2, that might prevent the proper target of a goto from being found. This was pretty harmless on its own, as it would just louse up a consistency check for users. Many thanks to ckjohnsonme for providing a simplified and complete set of information about the bug, that helped considerably in finding and fixing the problem. Now, to get aelparse up and running again in trunk, and out of its "horribly broken" state, so I can run the regression suite! git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@162013 f38db490-d61c-443f-a65b-d21fe96a405b
2008-11-01fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings ↵kpfleming1-100/+153
being passed to printf()-like functions and ignored results from read()/write() and friends git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@153337 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-27improve header inclusion process in a few small ways:kpfleming1-0/+2
- it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled - simplify the usage of some of these headers in the AEL-related stuff in the utils directory git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@144924 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-04(closes issue #13357)murf1-425/+673
Reported by: pj Tested by: murf (closes issue #13416) Reported by: yarns Tested by: murf If you find this message overly verbose, relax, it's probably not meant for you. This message is meant for probably only two people in the whole world: me, or the poor schnook that has to maintain this code because I'm either dead or unavailable at the moment. This fix solves two reports, both having to do with embedding a function call in a ${} construct. It was tricky because the funccall syntax has parenthesis () in it. And up till now, the 'word' token in the flex stuff didn't allow that, because it would tend to steal the LP and RP tokens. To be truthful, the "word" token was the trickiest, most unstable thing in the whole lexer. I was lucky it made this long without complaints. I had to choose every character in the pattern with extreme care, and I knew that someday I'd have to revisit it. Well, the day has come. So, my brilliant idea (and I'm being modest), was to use the surrounding ${} construct to make a state machine and capture everything in it, no matter what it contains. But, I have to now treat the word token like I did with comments, in that I turn the whole thing into a state-machine sort of spec, with new contexts "curlystate", "wordstate", and "brackstate". Wait a minute, "brackstate"? Yes, well, it didn't take very many regression tests to point out if I do this for ${} constructs, I also have to do it with the $[] constructs, too. I had to create a separate pcbstack2 and pcbstack3 because these constructs can occur inside macro argument lists, and when we have two state machines operating on the same structures we'd get problems otherwise. I guess I could have stopped at pcbstack2 and had the brackstate stuff share it, but it doesn't hurt to be safe. So, the pcbpush and pcbpop routines also now have versions for "2" and "3". I had to add the {KEYWORD} construct to the initial pattern for "word", because previously word would match stuff like "default7", because it was a longer match than the keyword "default". But, not any more, because the word pattern only matches only one or two characters now, and it will always lose. So, I made it the winner again by making an optional match on any of the keywords before it's normal pattern. I added another regression test to make sure we don't lose this in future edits, and had to fix just one regression, where it no longer reports a 'cascaded' error, which I guess is a plus. I've given some thought as to whether to apply these fixes to 1.4 and the 1.6.x releases, vs trunk; I decided to put it in 1.4 because one of the bug reports was against 1.4; and it is unexpected that AEL cannot handle this situation. It actually reduced the amount of useless "cascade" error messages that appeared in the regressions (by one line, ehhem). There is a possible side-effect in that it does now do more careful checking of what's in those ${} constructs, as far as matching parens, and brackets are concerned. Some users may find a an insidious problem and correct it this way. This should be exceedingly rare, I hope. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@141094 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18(closes issue #11903)murf1-12/+14
Reported by: atis Many thanks to atis for spotting this problem and reporting it. The fix was to straighten out how items are placed on and removed from the file stack. Regressions as well as the provided test case helped to straighten out all code paths. valgrind was used to make sure all memory allocated was freed. Sorry for not solving this earlier. I got distracted. Added the ntest23 regression test, which is mainly a copy of ntest22, but with a few juicy errors thrown in, to replicate the kind of error that atis spotted. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@109309 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-10Applied the same fixes for ael.flex as was done in 97849 for ast_expr2.fl; ↵murf1-134/+141
overrode the normally generate yyfree func with our own version that checks the pointer for non-null before passing to free(). Also takes care of a little problem with 2.5.33 and the use of the __STDC_VERSION__ macro. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@97889 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-26closes issue #11086 where a user complains that references to following ↵murf1-343/+350
contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config, git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@87168 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-29This issue sort of closes 10786; All config files support #include with ↵murf1-126/+213
globbing (you know, *,[chars],?,{list,list},etc), so I've updated the AEL system to support this also. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@84133 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-26A fix for the flex input files, DONT_COMPILE, and STANDALONE_AELmurf1-5/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59206 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-26Have ast_copy_string magically appear in the aelparse binary! DONT_OPTIMIZE ↵file1-0/+4
should now work once again. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59200 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-02This is a slight modification to Josh's edits for #8579; both files edited ↵murf1-1/+1
were the produced by flex; so the source files need to be changed instead, and the generated files regenerated. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49237 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-28removed <err.h> as in trunk from the ael stuff. Also, threw in a minor fix ↵murf1-14/+8
to frame.c to avoid build-killing compiler warnings. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49020 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-27ast_copy_string is not available when LOW_MEMORY is used and things are ↵file1-1/+1
being built in the utils directory, so we need to resort to the old method of strncpy. (issue #8579 reported by mottano) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49009 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-31This commit is a basic AEL enhancement: c-style commentsmurf1-402/+391
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41527 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-06OK, here is everything I changed to fix 7474:murf1-194/+360
1. ael/ael.flex -- the "fix" is here. In short, I modified the pattern for the chars that break args, to exclude those chars that would normally break args if they are preceded by a backslash. I did this to 3 patterns where really, this kind of exclusion should be placed. 2. ael_lex.c is an updated output from lex. 3. the ael-test stuff -- instituted a regression test for this condition. as ael_ntest9. The "n" in the name means that instead of just getting the syntax/semantic errors and high-level output from aelparse, we also want the compilation results to be in the comparison file. (remove the -n option). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@37255 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-18merge changes from team/murf/AEL-trunk-fixesonlyrussell1-73/+61
- fix callerid matching for extensions - fix nested switch statements - fix compilation with bison 2.1a or higher (issue #7309) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@34665 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-10don't use ast_copy_string when building for an external toolrussell1-5/+9
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33423 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-09various minor portability fixes (mostly from tholo for OpenBSD)kpfleming1-70/+67
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33350 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-1/+4
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-01more simplificationsrizzo1-79/+66
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23807 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-01always trim the trailing ';'rizzo1-8/+6
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23806 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-01comment usage of contextsrizzo1-17/+38
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23805 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-30put back some simplifications, this time really testedrizzo1-24/+17
(ael_lex.c manually deleted, runtest passed) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23782 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-30more commentsrizzo1-19/+18
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23557 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-30comment some coderizzo1-3/+13
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23550 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-28simplify handling of line numbersrizzo1-89/+72
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23153 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-28fix last known bug in computing columb numbers in error messagesrizzo1-65/+69
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23152 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-28fix a bug in computing line numbersrizzo1-4/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23151 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-28- fix miscalculation in column numbers when multiple tabsrizzo1-2/+2
or empty lines are involved; - change linku1() to return the head of the list (unused at the moment); - ignore the source line number in runtests as they change with the source and cause mismatches in the comparison with the reference output. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23130 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27fix destructor for pval objects (thanks to Steve Murphy);rizzo1-93/+112
rearrange initial part of ael.flex for flexibility. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23011 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27document variable and options used.rizzo1-63/+93
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22988 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27slightly restructure a block to reduce nesting,rizzo1-51/+51
mark some missing error checks git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22957 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27remove some commented-out coderizzo1-22/+12
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22901 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27finish packing yylloc into macrosrizzo1-108/+91
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22900 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27add some comments to the coderizzo1-66/+71
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22869 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27more dup removalrizzo1-255/+194
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22844 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27more duplicate removalrizzo1-259/+214
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22843 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27remove duplicated coderizzo1-292/+254
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22842 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27staticize c_prevword()rizzo1-3/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22820 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27move similar blocks close to each other to make similaritiesrizzo1-81/+81
more evident git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22727 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27normalize and simplify the code for keeping track of line and column number.rizzo1-173/+96
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22726 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27define some flex constants for character sets.rizzo1-86/+139
partly fix indentation and normalize code layout. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22725 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-27uncomment some functions in the flex code that were actuallyrizzo1-10/+13
used in the bison code - detected by making aelparse compile again. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22702 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-26use \t to indicate a tab, and fix indentation forrizzo1-3/+3
the whitespace-handling rules git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22680 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-26remove common blocks of code with a macro (waiting for a betterrizzo1-113/+116
solution). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22679 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-26staticize some variablesrizzo1-5/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22678 f38db490-d61c-443f-a65b-d21fe96a405b