[Asterisk-cvs] asterisk ast_expr2.c, NONE, 1.1 ast_expr2.h, NONE, 1.1 ast_expr2f.c, NONE, 1.1 .cvsignore, 1.16, 1.17 Makefile, 1.193, 1.194

kpfleming kpfleming
Fri Aug 26 15:20:18 CDT 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv8416

Modified Files:
	.cvsignore Makefile 
Added Files:
	ast_expr2.c ast_expr2.h ast_expr2f.c 
Log Message:
switch to 'new' expression parser, remove support for old parser
provide parser files in source tree, so flex/bison are not need to build
update Makefile to use simpler techniques to build parser
update README to remove references to old vs. new parsers
remove version comparison tool used for flex/bison programs


--- NEW FILE: ast_expr2.c ---
/* A Bison parser, made by GNU Bison 1.875d.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 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
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */
[...2308 lines suppressed...]

		} else {
			v = make_integer ((quad_t)(rm[0].rm_eo - rm[0].rm_so));
		}
	} else {
		if (rp.re_nsub == 0) {
			v = make_integer ((quad_t)0);
		} else {
			v = make_str ("");
		}
	}

	/* free arguments and pattern buffer */
	free_value (a);
	free_value (b);
	regfree (&rp);

	return v;
}


--- NEW FILE: ast_expr2.h ---
/* A Bison parser, made by GNU Bison 1.875d.  */

/* Skeleton parser for Yacc-like parsing with Bison,
   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 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
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

/* 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
# define YYTOKENTYPE
   /* Put the tokens into the symbol table, so that GDB and other debuggers
      know about them.  */
   enum yytokentype {
     TOK_COLONCOLON = 258,
     TOK_COND = 259,
     TOK_OR = 260,
     TOK_AND = 261,
     TOK_NE = 262,
     TOK_LE = 263,
     TOK_GE = 264,
     TOK_LT = 265,
     TOK_GT = 266,
     TOK_EQ = 267,
     TOK_MINUS = 268,
     TOK_PLUS = 269,
     TOK_MOD = 270,
     TOK_DIV = 271,
     TOK_MULT = 272,
     TOK_COMPL = 273,
     TOK_EQTILDE = 274,
     TOK_COLON = 275,
     TOK_LP = 276,
     TOK_RP = 277,
     TOKEN = 278
   };
#endif
#define TOK_COLONCOLON 258
#define TOK_COND 259
#define TOK_OR 260
#define TOK_AND 261
#define TOK_NE 262
#define TOK_LE 263
#define TOK_GE 264
#define TOK_LT 265
#define TOK_GT 266
#define TOK_EQ 267
#define TOK_MINUS 268
#define TOK_PLUS 269
#define TOK_MOD 270
#define TOK_DIV 271
#define TOK_MULT 272
#define TOK_COMPL 273
#define TOK_EQTILDE 274
#define TOK_COLON 275
#define TOK_LP 276
#define TOK_RP 277
#define TOKEN 278




#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 137 "ast_expr2.y"
typedef union YYSTYPE {
	struct val *val;
} YYSTYPE;
/* Line 1285 of yacc.c.  */
#line 87 "ast_expr2.h"
# 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)
typedef struct YYLTYPE
{
  int first_line;
  int first_column;
  int last_line;
  int last_column;
} YYLTYPE;
# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
# define YYLTYPE_IS_DECLARED 1
# define YYLTYPE_IS_TRIVIAL 1
#endif





--- NEW FILE: ast_expr2f.c ---
#line 2 "ast_expr2f.c"

#line 4 "ast_expr2f.c"

#define  YY_INT_ALIGNED short int

/* A lexical scanner generated by flex */

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 31
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif

/* First, we deal with  platform-specific or compiler-specific issues. */

/* begin standard C headers. */
[...2124 lines suppressed...]
															ast_yy_scan_string func, it creates a single buffer the size of
															string, so the two would be the same... 
													so, in the end, the yycolumn macro is available, shorter, therefore easier. */
	spacebuf2[i++]='^';
	spacebuf2[i]= 0;

#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);
#else
	ast_log(LOG_WARNING,"ast_yyerror(): syntax error: %s; Input:\n%s\n%s\n",  
			s, parseio->string,spacebuf2);
#endif
#ifndef STANDALONE
	ast_log(LOG_WARNING,"If you have questions, please refer to doc/README.variables in the asterisk source.\n");
#endif
	return(0);
}


Index: .cvsignore
===================================================================
RCS file: /usr/cvsroot/asterisk/.cvsignore,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- .cvsignore	20 Jun 2005 17:26:07 -0000	1.16
+++ .cvsignore	26 Aug 2005 19:21:57 -0000	1.17
@@ -1,12 +1,6 @@
 asterisk
 defaults.h
-ast_expr.c
-ast_expr.h
-ast_expr.output
-ast_expr2.c
-ast_expr2.h
 ast_expr2.output
-ast_expr2f.c
 .version
 .depend
 .applied

Index: Makefile
===================================================================
RCS file: /usr/cvsroot/asterisk/Makefile,v
retrieving revision 1.193
retrieving revision 1.194
diff -u -d -r1.193 -r1.194
--- Makefile	23 Aug 2005 15:08:55 -0000	1.193
+++ Makefile	26 Aug 2005 19:21:57 -0000	1.194
@@ -204,11 +204,6 @@
 M4=/usr/local/bin/m4
 endif
 
-# if doing a recursive make, don't double-up CFLAGS
-ifeq ($(MAKECMDGOALS),ast_expr.a)
-CFLAGS=
-endif
-
 INCLUDE=-Iinclude -I../include
 CFLAGS+=-pipe  -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations $(DEBUG) $(INCLUDE) -D_REENTRANT -D_GNU_SOURCE #-DMAKE_VALGRIND_HAPPY
 CFLAGS+=$(OPTIMIZE)
@@ -296,7 +291,7 @@
 	dsp.o chanvars.o indications.o autoservice.o db.o privacy.o \
 	astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
 	utils.o config_old.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
-	netsock.o slinfactory.o
+	netsock.o slinfactory.o ast_expr2.o ast_expr2f.o
 ifeq (${OSARCH},Darwin)
 OBJS+=poll.o dlfcn.o
 ASTLINK=-Wl,-dynamic
@@ -357,59 +352,13 @@
 include .tags-depend
 endif
 
-.PHONY: ast_expr
-
-build_tools/vercomp: build_tools/vercomp.c
-	$(HOST_CC) -o $@ $<
-
-ast_expr: build_tools/vercomp
-	$(MAKE) ast_expr.a
-
-ifeq ($(MAKECMDGOALS),ast_expr.a)
-FLEXVER_GT_2_5_31=$(shell build_tools/vercomp flex \>= 2.5.31)
-BISONVER_GE_1_85=$(shell build_tools/vercomp bison \>= 1.85 )
-endif
-
-ifeq ($(FLEXVER_GT_2_5_31),true)
-FLEXOBJS=ast_expr2.o ast_expr2f.o
-else
-FLEXOBJS=ast_expr.o
-endif
-
-ast_expr.o:: ast_expr.c
-	@echo "================================================================================="
-	@echo "NOTE: Using older version of expression parser. To use the newer version,"
-	@echo "NOTE: upgrade to flex 2.5.31 or higher, which can be found at"
-	@echo "NOTE: http://sourceforge.net/project/showfiles.php?group_id=72099"
-	@echo "================================================================================="
-
-ast_expr.o:: ast_expr.c
-
-ifeq ($(BISONVER_GE_1_85),false)
-.y.c:
-	@echo "================================================================================="
-	@echo "NOTE: You may have trouble if you do not have bison-1.85 or higher installed!"
-	@echo "NOTE: You can pick up a copy at: http://ftp.gnu.org or its mirrors"
-	@echo "NOTE: You have:"
-	@bison --version
-	@echo "================================================================================"
-	bison -v -d --name-prefix=ast_yy $< -o $@
-else
-.y.c:
-	bison -v -d --name-prefix=ast_yy $< -o $@
-endif
+ast_expr2.c: FORCE
+	bison -d --name-prefix=ast_yy ast_expr2.y -o ast_expr2.c
 
-ast_expr2f.c: ast_expr2.fl
+ast_expr2f.c: FORCE
 	flex ast_expr2.fl
 
-ast_expr.a: $(FLEXOBJS)
-	@rm -f $@
-	ar r $@ $(FLEXOBJS)
-	ranlib $@
-
-testexpr2 :
-	flex ast_expr2.fl
-	bison -v -d --name-prefix=ast_yy -o ast_expr2.c ast_expr2.y
+testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
 	gcc -g -c -DSTANDALONE ast_expr2f.c
 	gcc -g -c -DSTANDALONE ast_expr2.c
 	gcc -g -o testexpr2 ast_expr2f.o ast_expr2.o
@@ -443,7 +392,6 @@
 	fi
 	rm -f $@.tmp
 
-
 include/asterisk/build.h:
 	build_tools/make_build_h > $@.tmp
 	if cmp -s $@.tmp $@ ; then echo ; else \
@@ -471,8 +419,8 @@
 		exit 1; \
 	fi
 
-asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS) ast_expr
-	$(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) ast_expr.a $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
+asterisk: editline/libedit.a db1-ast/libdb1.a stdtime/libtime.a $(OBJS)
+	$(CC) $(DEBUG) -o asterisk $(ASTLINK) $(OBJS) $(LIBEDIT) db1-ast/libdb1.a stdtime/libtime.a $(LIBS)
 
 muted: muted.o
 	$(CC) $(AUDIO_LIBS) -o muted muted.o
@@ -486,9 +434,6 @@
 	rm -f defaults.h
 	rm -f include/asterisk/build.h
 	rm -f include/asterisk/version.h
-	rm -f ast_expr.c ast_expr.h ast_expr.output
-	rm -f ast_expr2.c ast_expr2f.c ast_expr2.h ast_expr2.output
-	rm -f ast_expr.a build_tools/vercomp
 	rm -f .version
 	rm -f .tags-depend .tags-sources tags TAGS
 	@if [ -f editline/Makefile ]; then $(MAKE) -C editline distclean ; fi
@@ -814,8 +759,7 @@
 	for x in $(SUBDIRS); do $(MAKE) -C $$x depend || exit 1 ; done
 
 .depend: include/asterisk/version.h
-	build_tools/mkdep ${CFLAGS} $(filter-out ast_expr.c,$(wildcard *.c))
-	build_tools/mkdep -a -d ${CFLAGS} ast_expr.c
+	build_tools/mkdep ${CFLAGS} $(wildcard *.c)
 
 .tags-depend:
 	@echo -n ".tags-depend: " > $@




More information about the svn-commits mailing list