Jspice3
acprse.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1987 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include "ftedefs.h"
10 #include "inpdefs.h"
11 #include "inpmacs.h"
12 #include "misc.h"
13 
14 
15 /* ARGSUSED */
16 int
17 ACparse(ckt,tab,which,currentp,line,task,gnode)
18 
19 /*
20  .ac {DEC OCT LIN} NP FSTART FSTOP [ dc SRC1NAME Vstart1 [Vstop1 [Vinc1]]
21  [SRC2NAME Vstart2 [Vstop2 [Vinc2]]] ]
22 */
23 GENERIC *ckt;
24 INPtables *tab;
25 int which;
26 GENERIC *currentp;
27 char **line;
28 GENERIC *task;
29 GENERIC *gnode;
30 {
31  GENERIC *foo; /* pointer to analysis */
32  int error; /* error code temporary */
33  char *token; /* a token from the line */
34  card *current = (card *)currentp;
35 
36  IFC(newAnalysis,(ckt,which,"acan",&foo,task))
37  GCA(ParseAC,(ckt,line,current,which,foo,tab))
38  if (**line) {
39  INPgetTok(line, &token, 1);
40  strtolower(token);
41  if (!strcmp(token,"dc")) {
42  txfree(token);
43  GCA(ParseDC,(ckt,line,current,which,foo,tab,1))
44  if (**line)
45  GCA(ParseDC,(ckt,line,current,which,foo,tab,2))
46  }
47  else {
48  LITERR("Syntax error: 'dc' expected.")
49  }
50  }
51 
52  return (0);
53 }
54 
55 
56 int
57 ParseAC(ckt,line,current,which,aptr,tab)
58 
59 GENERIC *ckt;
60 char **line;
61 card *current;
62 int which;
63 GENERIC *aptr;
64 INPtables *tab;
65 {
66  char *steptype; /* ac analysis, type of stepping function */
67  IFvalue ptemp; /* a value structure to package stuff into */
68  IFvalue *parm; /* a pointer to a value struct for function returns */
69  int error; /* error code temporary */
70 
71  INPgetTok(line,&steptype,1); /* get DEC, OCT, or LIN */
72  strtolower(steptype);
73  ptemp.iValue = 1;
74  GCA(INPapName,(ckt,which,aptr,steptype,&ptemp))
75  txfree(steptype);
76 
77  parm = INPgetValue(ckt,line,IF_INTEGER,tab); /* number of points */
78  GCA(INPapName,(ckt,which,aptr,"numsteps",parm))
79 
80  parm = INPgetValue(ckt,line,IF_REAL,tab); /* fstart */
81  GCA(INPapName,(ckt,which,aptr,"start",parm))
82 
83  parm = INPgetValue(ckt,line,IF_REAL,tab); /* fstop */
84  GCA(INPapName,(ckt,which,aptr,"stop",parm))
85 
86  return (0);
87 }
int ParseAC(GENERIC *ckt, char **line, card *current, int which, GENERIC *aptr, INPtables *tab)
Definition: acprse.c:57
IFvalue * INPgetValue()
int ACparse(GENERIC *ckt, INPtables *tab, int which, GENERIC *currentp, char **line, GENERIC *task, GENERIC *gnode)
Definition: acprse.c:17
Definition: inpdefs.h:62
Definition: subckt.c:51
int iValue
Definition: ifsim.h:232
#define LITERR(text)
Definition: inpmacs.h:35
Definition: fteinp.h:14
void txfree()
void strtolower()
#define GCA(func, args)
Definition: inpmacs.h:27
#define IF_INTEGER
Definition: ifsim.h:107
#define IFC(func, args)
Definition: inpmacs.h:19
int ParseDC()
#define IF_REAL
Definition: ifsim.h:108
int INPapName()
char GENERIC
Definition: ifsim.h:27
int INPgetTok()