Browse Source

polish bison/flex makefile rules

pre-master-46
rlar 11 years ago
parent
commit
1c6efd9481
  1. 13
      src/frontend/Makefile.am
  2. 17
      src/frontend/parse-bison-y.h
  3. 74
      src/frontend/parse-bison.y
  4. 41
      src/frontend/parse.c
  5. 12
      src/spicelib/parser/Makefile.am
  6. 16
      src/spicelib/parser/inpptree-parser-y.h
  7. 84
      src/spicelib/parser/inpptree-parser.y
  8. 23
      src/spicelib/parser/inpptree.c
  9. 33
      src/xspice/cmpp/Makefile.am

13
src/frontend/Makefile.am

@ -2,9 +2,7 @@
SUBDIRS = plotting help parser wdisp numparam trannoise SUBDIRS = plotting help parser wdisp numparam trannoise
DIST_SUBDIRS = plotting help parser wdisp numparam trannoise DIST_SUBDIRS = plotting help parser wdisp numparam trannoise
EXTRA_DIST = testcommands.c parse-bison.y
## For Windows with Visual Studio
EXTRA_DIST += parse-bison.c parse-bison.h
EXTRA_DIST = testcommands.c
noinst_LTLIBRARIES = libfte.la noinst_LTLIBRARIES = libfte.la
@ -150,6 +148,8 @@ libfte_la_SOURCES = \
outitf.h \ outitf.h \
parse.c \ parse.c \
parse.h \ parse.h \
parse-bison.y \
parse-bison-y.h \
points.c \ points.c \
points.h \ points.h \
postcoms.c \ postcoms.c \
@ -194,10 +194,9 @@ libfte_la_SOURCES = \
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include @X_CFLAGS@ AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include @X_CFLAGS@
AM_CFLAGS = $(STATIC) AM_CFLAGS = $(STATIC)
AM_YFLAGS = -d
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
parse-bison.c parse-bison.h : parse-bison.y
bison $(srcdir)/parse-bison.y
$(srcdir)/parse.c : parse-bison.c
parse-bison.c : parse-bison.y
$(am__skipyacc) $(YACCCOMPILE) -o $@ $<

17
src/frontend/parse-bison-y.h

@ -0,0 +1,17 @@
struct PPltype {
const char *start, *stop;
};
extern int PPlex(YYSTYPE *lvalp, struct PPltype *llocp, char **line);
extern int PPdebug;
extern struct pnode *PP_mkunode(int op, struct pnode *arg);
extern struct pnode *PP_mkfnode(const char *func, struct pnode *arg);
extern struct pnode *PP_mknnode(double number);
extern struct pnode *PP_mkbnode(int opnum, struct pnode *arg1, struct pnode *arg2);
extern struct pnode *PP_mksnode(const char *string);
#if defined (_MSC_VER)
# define __func__ __FUNCTION__ /* __func__ is C99, but MSC can't */
#endif

74
src/frontend/parse-bison.y

@ -1,17 +1,21 @@
%{ %{
/* /*
* (compile (concat "bison " (file-relative-name buffer-file-name)))
* (compile (concat "bison -ydo parse-bison.c " (file-relative-name buffer-file-name)))
*/ */
#include "ngspice/ngspice.h"
#include "ngspice/fteparse.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
struct PPltype {
const char *start, *stop;
};
# define YYLTYPE struct PPltype # define YYLTYPE struct PPltype
#include "parse.h"
#include "parse-bison.h"
#include "parse-bison-y.h"
# define YYLLOC_DEFAULT(Current, Rhs, N) \ # define YYLLOC_DEFAULT(Current, Rhs, N) \
do \ do \
if (N) { \ if (N) { \
@ -22,22 +26,10 @@
} \ } \
while (0) while (0)
#include "parse-bison.h"
extern int PPlex (YYSTYPE *lvalp, struct PPltype *llocp, char **line);
extern int PPdebug;
static void PPerror (YYLTYPE *locp, char **line, struct pnode **retval, char const *); static void PPerror (YYLTYPE *locp, char **line, struct pnode **retval, char const *);
#if defined (_MSC_VER)
# define __func__ __FUNCTION__ /* __func__ is C99, but MSC can't */
#endif
%} %}
%name-prefix="PP" %name-prefix="PP"
%output="parse-bison.c"
%defines %defines
%locations %locations
@ -130,42 +122,42 @@ one_exp:
; ;
exp: exp:
TOK_NUM { $$ = mknnode($1); }
| TOK_STR { $$ = mksnode($1); txfree((void*)$1); }
TOK_NUM { $$ = PP_mknnode($1); }
| TOK_STR { $$ = PP_mksnode($1); txfree((void*)$1); }
| exp ',' exp { $$ = mkbnode(PT_OP_COMMA, $1, $3); }
| exp '+' exp { $$ = mkbnode(PT_OP_PLUS, $1, $3); }
| exp '-' exp { $$ = mkbnode(PT_OP_MINUS, $1, $3); }
| exp '*' exp { $$ = mkbnode(PT_OP_TIMES, $1, $3); }
| exp '%' exp { $$ = mkbnode(PT_OP_MOD, $1, $3); }
| exp '/' exp { $$ = mkbnode(PT_OP_DIVIDE, $1, $3); }
| exp '^' exp { $$ = mkbnode(PT_OP_POWER, $1, $3); }
| exp ',' exp { $$ = PP_mkbnode(PT_OP_COMMA, $1, $3); }
| exp '+' exp { $$ = PP_mkbnode(PT_OP_PLUS, $1, $3); }
| exp '-' exp { $$ = PP_mkbnode(PT_OP_MINUS, $1, $3); }
| exp '*' exp { $$ = PP_mkbnode(PT_OP_TIMES, $1, $3); }
| exp '%' exp { $$ = PP_mkbnode(PT_OP_MOD, $1, $3); }
| exp '/' exp { $$ = PP_mkbnode(PT_OP_DIVIDE, $1, $3); }
| exp '^' exp { $$ = PP_mkbnode(PT_OP_POWER, $1, $3); }
| '(' exp ')' { $$ = $2; } | '(' exp ')' { $$ = $2; }
| '-' exp %prec NEG { $$ = mkunode(PT_OP_UMINUS, $2); }
| '~' exp { $$ = mkunode(PT_OP_NOT, $2); }
| '-' exp %prec NEG { $$ = PP_mkunode(PT_OP_UMINUS, $2); }
| '~' exp { $$ = PP_mkunode(PT_OP_NOT, $2); }
| TOK_STR '(' exp ')' { $$ = mkfnode($1, $3);
| TOK_STR '(' exp ')' { $$ = PP_mkfnode($1, $3);
txfree((void*)$1); txfree((void*)$1);
if(!$$) if(!$$)
YYABORT; YYABORT;
} }
| exp '=' exp { $$ = mkbnode(PT_OP_EQ, $1, $3); }
| exp TOK_NE exp { $$ = mkbnode(PT_OP_NE, $1, $3); }
| exp '>' exp { $$ = mkbnode(PT_OP_GT, $1, $3); }
| exp '<' exp { $$ = mkbnode(PT_OP_LT, $1, $3); }
| exp TOK_GE exp { $$ = mkbnode(PT_OP_GE, $1, $3); }
| exp TOK_LE exp { $$ = mkbnode(PT_OP_LE, $1, $3); }
| exp '=' exp { $$ = PP_mkbnode(PT_OP_EQ, $1, $3); }
| exp TOK_NE exp { $$ = PP_mkbnode(PT_OP_NE, $1, $3); }
| exp '>' exp { $$ = PP_mkbnode(PT_OP_GT, $1, $3); }
| exp '<' exp { $$ = PP_mkbnode(PT_OP_LT, $1, $3); }
| exp TOK_GE exp { $$ = PP_mkbnode(PT_OP_GE, $1, $3); }
| exp TOK_LE exp { $$ = PP_mkbnode(PT_OP_LE, $1, $3); }
| exp '&' exp { $$ = mkbnode(PT_OP_AND, $1, $3); }
| exp '|' exp { $$ = mkbnode(PT_OP_OR, $1, $3); }
| exp '&' exp { $$ = PP_mkbnode(PT_OP_AND, $1, $3); }
| exp '|' exp { $$ = PP_mkbnode(PT_OP_OR, $1, $3); }
| exp '[' exp ']' { $$ = mkbnode(PT_OP_INDX, $1, $3); }
| exp '[' '[' exp ']' ']' { $$ = mkbnode(PT_OP_RANGE, $1, $4); }
| exp '?' exp ':' exp { $$ = mkbnode(PT_OP_TERNARY,$1,
mkbnode(PT_OP_COMMA,$3,$5)); }
| exp '[' exp ']' { $$ = PP_mkbnode(PT_OP_INDX, $1, $3); }
| exp '[' '[' exp ']' ']' { $$ = PP_mkbnode(PT_OP_RANGE, $1, $4); }
| exp '?' exp ':' exp { $$ = PP_mkbnode(PT_OP_TERNARY,$1,
PP_mkbnode(PT_OP_COMMA,$3,$5)); }
; ;
%% %%

41
src/frontend/parse.c

@ -16,16 +16,13 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "evaluate.h" #include "evaluate.h"
#include "parse.h" #include "parse.h"
#include "parse-bison.h"
#include "parse-bison-y.h"
static bool checkvalid(struct pnode *pn); static bool checkvalid(struct pnode *pn);
static struct pnode *mkbnode(int opnum, struct pnode *arg1, struct pnode *arg2);
static struct pnode *mkunode(int op, struct pnode *arg);
static struct pnode *mkfnode(const char *func, struct pnode *arg);
static struct pnode *mknnode(double number);
static struct pnode *mksnode(const char *string);
#include "parse-bison.c"
extern int PPparse(char **, struct pnode **);
void db_print_pnode_tree(struct pnode *p, char *print); void db_print_pnode_tree(struct pnode *p, char *print);
@ -199,8 +196,8 @@ struct func func_not = { "not", cx_not };
/* Binary operator node. */ /* Binary operator node. */
static struct pnode *
mkbnode(int opnum, struct pnode *arg1, struct pnode *arg2)
struct pnode *
PP_mkbnode(int opnum, struct pnode *arg1, struct pnode *arg2)
{ {
struct op *o; struct op *o;
struct pnode *p; struct pnode *p;
@ -210,7 +207,7 @@ mkbnode(int opnum, struct pnode *arg1, struct pnode *arg2)
break; break;
if (!o->op_name) if (!o->op_name)
fprintf(cp_err, "mkbnode: Internal Error: no such op num %d\n",
fprintf(cp_err, "PP_mkbnode: Internal Error: no such op num %d\n",
opnum); opnum);
p = alloc(struct pnode); p = alloc(struct pnode);
@ -232,8 +229,8 @@ mkbnode(int opnum, struct pnode *arg1, struct pnode *arg2)
/* Unary operator node. */ /* Unary operator node. */
static struct pnode *
mkunode(int op, struct pnode *arg)
struct pnode *
PP_mkunode(int op, struct pnode *arg)
{ {
struct pnode *p; struct pnode *p;
struct op *o; struct op *o;
@ -244,7 +241,7 @@ mkunode(int op, struct pnode *arg)
break; break;
if (!o->op_name) if (!o->op_name)
fprintf(cp_err, "mkunode: Internal Error: no such op num %d\n",
fprintf(cp_err, "PP_mkunode: Internal Error: no such op num %d\n",
op); op);
p->pn_op = o; p->pn_op = o;
@ -270,8 +267,8 @@ mkunode(int op, struct pnode *arg)
* defined to be. * defined to be.
*/ */
static struct pnode *
mkfnode(const char *func, struct pnode *arg)
struct pnode *
PP_mkfnode(const char *func, struct pnode *arg)
{ {
struct func *f; struct func *f;
struct pnode *p, *q; struct pnode *p, *q;
@ -304,7 +301,7 @@ mkfnode(const char *func, struct pnode *arg)
return (NULL); return (NULL);
} }
/* (void) strcpy(buf, d->v_name); XXX */ /* (void) strcpy(buf, d->v_name); XXX */
return (mksnode(buf));
return (PP_mksnode(buf));
} else if (f->fu_name == NULL) { } else if (f->fu_name == NULL) {
fprintf(cp_err, "Error: no function as %s with that arity.\n", fprintf(cp_err, "Error: no function as %s with that arity.\n",
func); func);
@ -313,8 +310,8 @@ mkfnode(const char *func, struct pnode *arg)
} }
if (!f->fu_func && arg->pn_op && arg->pn_op->op_num == PT_OP_COMMA) { if (!f->fu_func && arg->pn_op && arg->pn_op->op_num == PT_OP_COMMA) {
p = mkbnode(PT_OP_MINUS, mkfnode(func, arg->pn_left),
mkfnode(func, arg->pn_right));
p = PP_mkbnode(PT_OP_MINUS, PP_mkfnode(func, arg->pn_left),
PP_mkfnode(func, arg->pn_right));
tfree(arg); tfree(arg);
return p; return p;
} }
@ -336,8 +333,8 @@ mkfnode(const char *func, struct pnode *arg)
/* Number node. */ /* Number node. */
static struct pnode *
mknnode(double number)
struct pnode *
PP_mknnode(double number)
{ {
struct pnode *p; struct pnode *p;
struct dvec *v; struct dvec *v;
@ -353,7 +350,7 @@ mknnode(double number)
p->pn_left = p->pn_right = NULL; p->pn_left = p->pn_right = NULL;
p->pn_next = NULL; p->pn_next = NULL;
/* We don't use printnum because it screws up mkfnode above. We have
/* We don't use printnum because it screws up PP_mkfnode above. We have
* to be careful to deal properly with node numbers that are quite * to be careful to deal properly with node numbers that are quite
* large... * large...
*/ */
@ -374,8 +371,8 @@ mknnode(double number)
/* String node. */ /* String node. */
static struct pnode *
mksnode(const char *string)
struct pnode *
PP_mksnode(const char *string)
{ {
struct dvec *v, *nv, *vs, *newv = NULL, *end = NULL; struct dvec *v, *nv, *vs, *newv = NULL, *end = NULL;
struct pnode *p; struct pnode *p;

12
src/spicelib/parser/Makefile.am

@ -1,9 +1,5 @@
## Process this file with automake to produce Makefile.in ## Process this file with automake to produce Makefile.in
EXTRA_DIST = inpptree-parser.y
## For Windows with Visual Studio
EXTRA_DIST += inpptree-parser.c inpptree-parser.h
noinst_LTLIBRARIES = libinp.la noinst_LTLIBRARIES = libinp.la
libinp_la_SOURCES = \ libinp_la_SOURCES = \
@ -63,17 +59,19 @@ libinp_la_SOURCES = \
inppas3.h \ inppas3.h \
inppname.c \ inppname.c \
inpptree.c \ inpptree.c \
inpptree-parser.y \
inpptree-parser-y.h \
inpsymt.c \ inpsymt.c \
inptyplk.c \ inptyplk.c \
ptfuncs.c \ ptfuncs.c \
sperror.c \ sperror.c \
inpxx.h inpxx.h
$(srcdir)/inpptree.c : inpptree-parser.c
inpptree-parser.c inpptree-parser.h : inpptree-parser.y
bison $(srcdir)/inpptree-parser.y
inpptree-parser.c : inpptree-parser.y
$(am__skipyacc) $(YACCCOMPILE) -o $@ $<
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -I$(top_srcdir)/src/frontend AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include -I$(top_srcdir)/src/frontend
AM_CFLAGS = $(STATIC) AM_CFLAGS = $(STATIC)
AM_YFLAGS = -d
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in

16
src/spicelib/parser/inpptree-parser-y.h

@ -0,0 +1,16 @@
struct PTltype {
char *start, *stop;
};
extern int PTlex(YYSTYPE *lvalp, struct PTltype *llocp, char **line);
extern int PTdebug;
extern INPparseNode *PT_mkbnode(const char *opstr, INPparseNode *arg1, INPparseNode *arg2);
extern INPparseNode *PT_mkfnode(const char *fname, INPparseNode *arg);
extern INPparseNode *PT_mknnode(double number);
extern INPparseNode *PT_mksnode(const char *string, void *ckt);
#if defined (_MSC_VER)
# define __func__ __FUNCTION__ /* __func__ is C99, but MSC can't */
#endif

84
src/spicelib/parser/inpptree-parser.y

@ -1,17 +1,20 @@
%{ %{
/* /*
* (compile (concat "bison " (file-relative-name buffer-file-name)))
* (compile (concat "bison -ydo inpptree-parser.c " (file-relative-name buffer-file-name)))
*/ */
#include "ngspice/ngspice.h"
#include "ngspice/inpptree.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
struct PTltype {
char *start, *stop;
};
# define YYLTYPE struct PTltype # define YYLTYPE struct PTltype
#include "inpptree-parser.h"
#include "inpptree-parser-y.h"
# define YYLLOC_DEFAULT(Current, Rhs, N) \ # define YYLLOC_DEFAULT(Current, Rhs, N) \
do \ do \
if (N) { \ if (N) { \
@ -22,23 +25,10 @@
} \ } \
while (0) while (0)
#include "inpptree-parser.h"
extern int PTlex (YYSTYPE *lvalp, struct PTltype *llocp, char **line);
extern int PTdebug;
static void PTerror (YYLTYPE *locp, char **line, struct INPparseNode **retval, void *ckt, char const *); static void PTerror (YYLTYPE *locp, char **line, struct INPparseNode **retval, void *ckt, char const *);
#if defined (_MSC_VER)
# define __func__ __FUNCTION__ /* __func__ is C99, but MSC can't */
#endif
%} %}
%name-prefix="PT" %name-prefix="PT"
%output="inpptree-parser.c"
%defines %defines
@ -93,53 +83,53 @@ expression: exp
exp: exp:
TOK_NUM { $$ = mknnode($1); }
| TOK_STR { $$ = mksnode($1, ckt); txfree((void*)$1); }
TOK_NUM { $$ = PT_mknnode($1); }
| TOK_STR { $$ = PT_mksnode($1, ckt); txfree((void*)$1); }
| exp '+' exp { $$ = mkbnode("+", $1, $3); }
| exp '-' exp { $$ = mkbnode("-", $1, $3); }
| exp '*' exp { $$ = mkbnode("*", $1, $3); }
| exp '/' exp { $$ = mkbnode("/", $1, $3); }
| exp '^' exp { $$ = mkbnode("^", $1, $3); }
| exp '+' exp { $$ = PT_mkbnode("+", $1, $3); }
| exp '-' exp { $$ = PT_mkbnode("-", $1, $3); }
| exp '*' exp { $$ = PT_mkbnode("*", $1, $3); }
| exp '/' exp { $$ = PT_mkbnode("/", $1, $3); }
| exp '^' exp { $$ = PT_mkbnode("^", $1, $3); }
| '(' exp ')' { $$ = $2; } | '(' exp ')' { $$ = $2; }
| '-' exp %prec NEG { $$ = mkfnode("-",$2); }
| '-' exp %prec NEG { $$ = PT_mkfnode("-",$2); }
| TOK_STR '(' nonempty_arglist ')' { $$ = mkfnode($1, $3);
| TOK_STR '(' nonempty_arglist ')' { $$ = PT_mkfnode($1, $3);
if (!$$) if (!$$)
YYERROR; YYERROR;
txfree((void*)$1); } txfree((void*)$1); }
| TOK_pnode | TOK_pnode
| exp '?' exp ':' exp { $$ = mkfnode("ternary_fcn",
mkbnode(",",
mkbnode(",", $1, $3),
| exp '?' exp ':' exp { $$ = PT_mkfnode("ternary_fcn",
PT_mkbnode(",",
PT_mkbnode(",", $1, $3),
$5)); } $5)); }
| exp TOK_EQ exp { $$ = mkfnode("eq0", mkbnode("-",$1,$3)); }
| exp TOK_NE exp { $$ = mkfnode("ne0", mkbnode("-",$1,$3)); }
| exp TOK_GT exp { $$ = mkfnode("gt0", mkbnode("-",$1,$3)); }
| exp TOK_LT exp { $$ = mkfnode("lt0", mkbnode("-",$1,$3)); }
| exp TOK_GE exp { $$ = mkfnode("ge0", mkbnode("-",$1,$3)); }
| exp TOK_LE exp { $$ = mkfnode("le0", mkbnode("-",$1,$3)); }
| exp TOK_OR exp { $$ = mkfnode("ne0",
mkbnode("+",
mkfnode("ne0", $1),
mkfnode("ne0", $3))); }
| exp TOK_AND exp { $$ = mkfnode("eq0",
mkbnode("+",
mkfnode("eq0", $1),
mkfnode("eq0", $3))); }
| '!' exp { $$ = mkfnode("eq0", $2); }
| exp TOK_EQ exp { $$ = PT_mkfnode("eq0", PT_mkbnode("-",$1,$3)); }
| exp TOK_NE exp { $$ = PT_mkfnode("ne0", PT_mkbnode("-",$1,$3)); }
| exp TOK_GT exp { $$ = PT_mkfnode("gt0", PT_mkbnode("-",$1,$3)); }
| exp TOK_LT exp { $$ = PT_mkfnode("lt0", PT_mkbnode("-",$1,$3)); }
| exp TOK_GE exp { $$ = PT_mkfnode("ge0", PT_mkbnode("-",$1,$3)); }
| exp TOK_LE exp { $$ = PT_mkfnode("le0", PT_mkbnode("-",$1,$3)); }
| exp TOK_OR exp { $$ = PT_mkfnode("ne0",
PT_mkbnode("+",
PT_mkfnode("ne0", $1),
PT_mkfnode("ne0", $3))); }
| exp TOK_AND exp { $$ = PT_mkfnode("eq0",
PT_mkbnode("+",
PT_mkfnode("eq0", $1),
PT_mkfnode("eq0", $3))); }
| '!' exp { $$ = PT_mkfnode("eq0", $2); }
; ;
nonempty_arglist: nonempty_arglist:
exp exp
| nonempty_arglist ',' exp { $$ = mkbnode(",", $1, $3); }
| nonempty_arglist ',' exp { $$ = PT_mkbnode(",", $1, $3); }
%% %%

23
src/spicelib/parser/inpptree.c

@ -11,20 +11,19 @@ Author: 1987 Wayne A. Christopher, U. C. Berkeley CAD Group
#include "ngspice/inpptree.h" #include "ngspice/inpptree.h"
#include "inpxx.h" #include "inpxx.h"
#include "inpptree-parser.h"
#include "inpptree-parser-y.h"
int PTparse(char **line, INPparseNode **p, CKTcircuit *ckt);
static INPparseNode *mkcon(double value); static INPparseNode *mkcon(double value);
static INPparseNode *mkb(int type, INPparseNode * left, static INPparseNode *mkb(int type, INPparseNode * left,
INPparseNode * right); INPparseNode * right);
static INPparseNode *mkf(int type, INPparseNode * arg); static INPparseNode *mkf(int type, INPparseNode * arg);
static int PTcheck(INPparseNode * p); static int PTcheck(INPparseNode * p);
static INPparseNode *mkbnode(const char *opstr, INPparseNode * arg1,
INPparseNode * arg2);
static INPparseNode *mkfnode(const char *fname, INPparseNode * arg);
static INPparseNode *mkvnode(char *name); static INPparseNode *mkvnode(char *name);
static INPparseNode *mkinode(char *name); static INPparseNode *mkinode(char *name);
static INPparseNode *mknnode(double number);
static INPparseNode *mksnode(const char *string, void *ckt);
static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum); static INPparseNode *PTdifferentiate(INPparseNode * p, int varnum);
static void free_tree(INPparseNode *); static void free_tree(INPparseNode *);
@ -96,18 +95,12 @@ mkfirst(INPparseNode *fst, INPparseNode *snd)
} }
#include "inpptree-parser.c"
static IFvalue *values = NULL; static IFvalue *values = NULL;
static int *types; static int *types;
static int numvalues; static int numvalues;
static CKTcircuit *circuit; static CKTcircuit *circuit;
static INPtables *tables; static INPtables *tables;
#if defined (_MSC_VER)
# define __func__ __FUNCTION__ /* __func__ is C99, but MSC can't */
#endif
extern IFsimulator *ft_sim; /* XXX */ extern IFsimulator *ft_sim; /* XXX */
/* Some tables that the parser uses. */ /* Some tables that the parser uses. */
@ -885,7 +878,7 @@ static int PTcheck(INPparseNode * p)
/* Binop node. */ /* Binop node. */
static INPparseNode *mkbnode(const char *opstr, INPparseNode * arg1,
INPparseNode *PT_mkbnode(const char *opstr, INPparseNode * arg1,
INPparseNode * arg2) INPparseNode * arg2)
{ {
INPparseNode *p; INPparseNode *p;
@ -1002,7 +995,7 @@ static INPparseNode *prepare_PTF_PWL(INPparseNode *p)
} }
static INPparseNode *mkfnode(const char *fname, INPparseNode * arg)
INPparseNode *PT_mkfnode(const char *fname, INPparseNode * arg)
{ {
int i; int i;
INPparseNode *p; INPparseNode *p;
@ -1122,7 +1115,7 @@ static INPparseNode *mkinode(char *name)
/* Number node. */ /* Number node. */
static INPparseNode *mknnode(double number)
INPparseNode *PT_mknnode(double number)
{ {
struct INPparseNode *p; struct INPparseNode *p;
@ -1138,7 +1131,7 @@ static INPparseNode *mknnode(double number)
/* String node. */ /* String node. */
static INPparseNode *mksnode(const char *string, void *ckt)
INPparseNode *PT_mksnode(const char *string, void *ckt)
{ {
int i, j; int i, j;
char buf[128]; char buf[128];

33
src/xspice/cmpp/Makefile.am

@ -1,30 +1,29 @@
## Process this file with automake to produce Makefile.in ## Process this file with automake to produce Makefile.in
BUILT_SOURCES = ifs_lex.c ifs_yacc.c ifs_yacc.h mod_lex.c mod_yacc.c mod_yacc.h
BUILT_SOURCES = ifs_yacc.h mod_yacc.h
EXTRA_DIST = ifs_lex.l mod_lex.l ifs_yacc.h mod_yacc.h .gitignore
EXTRA_DIST = .gitignore
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
LEX = flex
BISON = bison
bin_PROGRAMS = cmpp bin_PROGRAMS = cmpp
cmpp_SOURCES = cmpp.h main.c pp_ifs.c pp_lst.c pp_mod.c read_ifs.c util.c \
writ_ifs.c ifs_yacc_y.h ifs_yacc.y ifs_lex.c mod_yacc_y.h mod_yacc.y \
mod_lex.c
AM_CPPFLAGS = -I. -I$(srcdir)
AM_YFLAGS = -d
cmpp_SOURCES = main.c cmpp.h \
pp_ifs.c pp_lst.c pp_mod.c read_ifs.c writ_ifs.c util.c \
ifs_lex.l ifs_yacc.y ifs_yacc_y.h \
mod_lex.l mod_yacc.y mod_yacc_y.h
mod_lex.o : mod_yacc.h
mod_lex.c : mod_lex.l mod_lex.c : mod_lex.l
$(LEX) -o$@ $<
$(am__skiplex) $(LEXCOMPILE) -o $@ $<
ifs_lex.o : ifs_yacc.h
ifs_lex.c : ifs_lex.l
$(LEX) -o$@ $<
mod_yacc.c : mod_yacc.y
$(am__skipyacc) $(YACCCOMPILE) -o $@ $<
ifs_yacc.c ifs_yacc.h : ifs_yacc.y
$(BISON) $(BISONFLAGS) -d -o ifs_yacc.c $<
ifs_lex.c : ifs_lex.l
$(am__skiplex) $(LEXCOMPILE) -o $@ $<
mod_yacc.c mod_yacc.h : mod_yacc.y
$(BISON) $(BISONFLAGS) -d -o mod_yacc.c $<
ifs_yacc.c : ifs_yacc.y
$(am__skipyacc) $(YACCCOMPILE) -o $@ $<
Loading…
Cancel
Save