diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-03 22:12:02 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-03-03 22:12:02 +0000 |
commit | 3d188dd5c61aed77cae9e4eee9bdfeeba39b2030 (patch) | |
tree | f2b0c043937f25671fdcfb3e1e3affc6b476b783 /utils | |
parent | bc97760a8025514dcf7e35c2ff46720fbe5a0b61 (diff) |
Merged revisions 179807 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
I had some work to do to port these changes to trunk; the
check_expr stuff hasn't been updated here for quite some
time, it appears. I added some more tests to the check_expr2
suite. I had to play around with the makefile a bit, etc.
I added STANDALONE2 #ifdefs to ast_expr2.y so as not to
conflict structure with aelparse.
........
r179807 | murf | 2009-03-03 11:11:34 -0700 (Tue, 03 Mar 2009) | 19 lines
These changes allow AEL to better check ${} constructs within $[...], that are concatenated with text.
I modified and added rules in ast_expr2.fl to better handle
the concatenations.
I added some default routines to ast_expr2.y so the standalone would
compile. It also looks like I haven't run this thru bison since 2.1, so
it's good to get this updated.
The Makefile has comments added now for check_expr2 and check_expr to
explain what they are for, and how to run them.
The testexpr2s stuff has been removed, in favor of check_expr2.
expr2.testinput has been updated to include the two expressions
that inspired these changes (from mcnobody on #asterisk this morning)
The regression has been run and all looks well.
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179973 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Makefile | 38 | ||||
-rw-r--r-- | utils/expr2.testinput | 8 |
2 files changed, 37 insertions, 9 deletions
diff --git a/utils/Makefile b/utils/Makefile index 03ecdf634..3bf1afc79 100644 --- a/utils/Makefile +++ b/utils/Makefile @@ -16,10 +16,21 @@ ASTTOPDIR?=.. .PHONY: clean all uninstall -ALL_UTILS:=astman smsq stereorize streamplayer muted check_expr hashtest2 hashtest astcanary refcounter aelparse conf2ael +# to get check_expr, add it to the ALL_UTILS list -- this is a somewhat old checking +# program that wants an ael file for input, and will check each $[] expr for +# possible (old) problems, like spacing around operators, which dates back to +# the 1.2 days. The neat part is that it will actually evaluate the expressions. +# Users could use this to quickly check expressions in their .ael file. +# to get check_expr2, add it to the ALL_UTILS list -- this is a program that will +# read in a file containing expressions (as if they were in $[ ]), one per line. +# It will, of course signal any syntax errors. Devs (like murf) should use this whenever +# changes are made to ast_expr2.y or ast_expr2.fl (or the corresponding .c files), +# as a regression test. Others (mere mortals?) need not bother, but they are +# more than welcome to play! The regression test itself is in expr2.testinput. +ALL_UTILS:=astman smsq stereorize streamplayer muted hashtest2 hashtest astcanary refcounter aelparse conf2ael check_expr2 UTILS:=$(ALL_UTILS) -LIBS += $(BKTR_LIB) # astobj2 with devmode uses backtrace +LIBS += $(BKTR_LIB) # astobj2 with devmode uses backtrace include $(ASTTOPDIR)/Makefile.rules @@ -73,7 +84,7 @@ clean: rm -f *.o $(ALL_UTILS) check_expr rm -f .*.d rm -f *.s *.i - rm -f md5.c strcompat.c ast_expr2.c ast_expr2f.c pbx_ael.c pval.c hashtab.c + rm -f md5.c strcompat.c ast_expr2.c ast_expr2.h ast_expr2f.c pbx_ael.c pval.c hashtab.c rm -f aelparse.c aelbison.c conf2ael rm -f utils.c strings.c threadstorage.c sha1.c astobj2.c hashtest2 hashtest refcounter @@ -110,6 +121,10 @@ ast_expr2.c: $(ASTTOPDIR)/main/ast_expr2.c $(CMD_PREFIX) cp "$<" "$@" ast_expr2.o: ASTCFLAGS+=-DSTANDALONE +ast_expr2.h: $(ASTTOPDIR)/main/ast_expr2.h + $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@" + $(CMD_PREFIX) cp "$<" "$@" + ast_expr2f.c: $(ASTTOPDIR)/main/ast_expr2f.c $(ECHO_PREFIX) echo " [CP] $(subst $(ASTTOPDIR)/,,$<) -> $@" $(CMD_PREFIX) cp "$<" "$@" @@ -135,6 +150,7 @@ aelparse.c: $(ASTTOPDIR)/res/ael/ael_lex.c ael_main.o: ASTCFLAGS+=-DSTANDALONE aelparse.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res -DSTANDALONE -Wno-unused +aelparse: LIBS+=-lm aelparse: aelparse.o aelbison.o pbx_ael.o hashtab.o ael_main.o ast_expr2f.o ast_expr2.o strcompat.o pval.o extconf.o astobj2.c: $(ASTTOPDIR)/main/astobj2.c @@ -175,12 +191,16 @@ extconf.o: extconf.c conf2ael: conf2ael.o ast_expr2f.o ast_expr2.o hashtab.o aelbison.o aelparse.o pbx_ael.o pval.o extconf.o strcompat.o -testexpr2s: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h - $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2f.o - $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2.o - $(CC) -g -o testexpr2s ast_expr2f.o ast_expr2.o - rm ast_expr2.o ast_expr2f.o - ./testexpr2s expr2.testinput +check_expr2: $(ASTTOPDIR)/main/ast_expr2f.c $(ASTTOPDIR)/main/ast_expr2.c $(ASTTOPDIR)/main/ast_expr2.h + $(ECHO_PREFIX) echo " [CC] ast_expr2f.c -> ast_expr2fz.o" + $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE $(ASTTOPDIR)/main/ast_expr2f.c -o ast_expr2fz.o + $(ECHO_PREFIX) echo " [CC] ast_expr2.c -> ast_expr2z.o" + $(CC) -g -c -I$(ASTTOPDIR)/include -DSTANDALONE2 $(ASTTOPDIR)/main/ast_expr2.c -o ast_expr2z.o + $(ECHO_PREFIX) echo " [LD] ast_expr2fz.o ast_expr2z.o -> check_expr2" + $(CC) -g -o check_expr2 ast_expr2fz.o ast_expr2z.o -lm + $(ECHO_PREFIX) echo " [RM] ast_expr2fz.o ast_expr2z.o" + rm ast_expr2z.o ast_expr2fz.o + ./check_expr2 expr2.testinput smsq: smsq.o strcompat.o smsq: LIBS+=$(POPT_LIB) diff --git a/utils/expr2.testinput b/utils/expr2.testinput index 9e1532b27..8e1169be7 100644 --- a/utils/expr2.testinput +++ b/utils/expr2.testinput @@ -123,4 +123,12 @@ ACOS(12) ASIN(1) ATAN(10) SQRT(2)*SQRT(2) +ATAN(12) + TRUNC(2.4) *ASIN(14.3) *ACOS(1.2) +ATAN(.912) +TRUNC(2.4) +ASIN(0.705) +ACOS(.12) +ATAN(.912) + TRUNC(2.4) - ASIN(0.705) + ACOS(.12) MATH(3*9) +${GLOBAL(ULKOPREFIX)}9${x} +512059${x} |