Qucs-core  0.0.18
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Macros | Functions | Variables
parse_spice.y File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "check_spice.h"

Go to the source code of this file.

Macros

#define YYERROR_VERBOSE   42
 
#define YYDEBUG   1
 
#define YYMAXDEPTH   1000000
 

Functions

int spice_checker (void)
 
int spice_parse (void)
 
int spice_error (const char *)
 
int spice_lex (void)
 
int spice_lex_destroy (void)
 
void spice_destroy (void)
 
void spice_add_last_hint (struct value_t *, int)
 
void spice_set_last_hint (struct value_t *, int)
 
struct value_tnetlist_append_values (struct value_t *, struct value_t *)
 
struct definition_tspice_checker_intern (struct definition_t *)
 
static __END_DECLS char * spice_toupper (char *str)
 
static struct definition_tspice_create_device (char *instance)
 
static struct definition_tspice_create_action (char *type, char *instance)
 
static struct value_tspice_create_str_value (char *value, int hint)
 
static struct value_tspice_create_val_value (char *value, int hint)
 
static struct value_tspice_create_par_value (char *key, char *value)
 
static void spice_append_str_value (struct definition_t *def, char *value, int hint)
 
static struct value_tspice_append_str_values (struct value_t *values, char *value, int hint)
 
static void spice_append_val_value (struct definition_t *def, char *value, int hint)
 
static struct value_tspice_append_val_values (struct value_t *values, char *value, int hint)
 
 spice_append_str_value ($$, $2, HINT_NODE)
 
 spice_append_val_value ($$, $4, HINT_NUMBER)
 
 spice_append_str_value ($$, $5, HINT_NAME)
 
 spice_add_last_hint ($2, HINT_MSTOP)
 
int spice_error (const char *error)
 

Variables

name prefix
 
InputList __pad0__
 
InputLine __pad1__
 
 definition_root = $1
 
 DefinitionLine
 
DefinitionLine __pad2__
 
 values = netlist_append_values ($$->values, $5)
 
RLC_Device Node Node Value
MODEL_Ident PairList 
Eol
 
TC_Value_1 __pad3__
 
TC_Value_2 __pad4__ = spice_create_par_value ($1, $2)
 
IC_Condition_1 __pad5__ = spice_append_val_values ($$, $3, HINT_NUMBER)
 
IC_Condition_2 __pad6__ = spice_append_val_values ($$, $2, HINT_NUMBER)
 
IC_Condition_3 __pad7__ = spice_append_val_values ($$, $3, HINT_NUMBER)
 
IC_Condition_4 __pad8__ = spice_append_val_values ($$, $4, HINT_NUMBER)
 
Output_Range __pad9__ = spice_append_val_values ($$, $5, HINT_NUMBER)
 
VOLTAGE_Output __pad10__ = spice_append_val_values ($$, $2, HINT_NUMBER)
 
VoltFunc Node
 
IV_Reference __pad11__ = spice_append_str_values ($$, $3, HINT_NODE | HINT_MSTOP)
 
CURRENT_Output __pad12__
 
 BranchFunc
 
 OpFunc
 
PLOT_List __pad13__ = spice_append_str_values ($$, $1, HINT_NAME | HINT_MSTOP)
 
VOLTAGE_Output PLOT_List
 
SWITCH_State __pad14__ = netlist_append_values ($$, $3)
 
 ON_Special
 
 OFF_Special
 
PRINT_List __pad15__
 
OPTIONS_List __pad16__
 
Options OPTIONS_List
 
MODEL_List __pad17__ = netlist_append_values ($$, $3)
 
ModelProps MODEL_List
 
NODESET_List __pad18__ = netlist_append_values ($$, $3)
 
VoltFunc Node Value NODESET_List
 
DEVICE_List_1 __pad19__ = netlist_append_values ($$, $4)
 
TEMP_Special Value DEVICE_List_1
 
DEVICE_List_2 __pad20__
 
TEMP_Special Value DEVICE_List_2
 
DEVICE_List_3 __pad21__ = netlist_append_values ($$, $3)
 
TEMP_Special Value DEVICE_List_3
 
MODEL_Ident __pad22__
 
DC_List __pad23__
 
Value __pad24__ = spice_append_val_values ($$, $4, HINT_NUMBER | HINT_MSTOP)
 
Node __pad25__
 
FH_Node __pad26__
 
PairList __pad27__
 
Identifier Value PairList
 
 next = $3
 
ValueList __pad28__
 
Value ValueList
 
NodeValueList __pad29__
 
Node NodeValueList
 
NodeList __pad30__
 
Node NodeList
 
VSourceList __pad31__
 
V_Source VSourceList
 
Expr __pad32__
 
Expr HINT_NAME HINT_MSTART
 
ExprList __pad33__
 
Expr ExprList
 
Subcircuit __pad34__
 
BeginSub __pad35__ = NULL
 
SubBody __pad36__
 
SubBodyLine SubBody
 
SubCkt_Ident __pad37__
 
EndSub __pad38__
 
SubBodyLine __pad39__
 
 Subcircuit
 

Macro Definition Documentation

#define YYDEBUG   1

Definition at line 42 of file parse_spice.y.

#define YYERROR_VERBOSE   42

Definition at line 41 of file parse_spice.y.

#define YYMAXDEPTH   1000000

Definition at line 43 of file parse_spice.y.

Function Documentation

struct value_t* netlist_append_values ( struct value_t ,
struct value_t  
)

Definition at line 231 of file check_spice.cpp.

void spice_add_last_hint ( struct value_t ,
int   
)

Definition at line 3047 of file check_spice.cpp.

spice_add_last_hint (   $2,
HINT_MSTOP   
)
static void spice_append_str_value ( struct definition_t def,
char *  value,
int  hint 
)
static

Definition at line 102 of file parse_spice.y.

spice_append_str_value (   $$,
  $2,
HINT_NODE   
)
spice_append_str_value (   $$,
  $5,
HINT_NAME   
)
static struct value_t* spice_append_str_values ( struct value_t values,
char *  value,
int  hint 
)
static

Definition at line 109 of file parse_spice.y.

static void spice_append_val_value ( struct definition_t def,
char *  value,
int  hint 
)
static

Definition at line 116 of file parse_spice.y.

spice_append_val_value (   $$,
  $4,
HINT_NUMBER   
)
static struct value_t* spice_append_val_values ( struct value_t values,
char *  value,
int  hint 
)
static

Definition at line 123 of file parse_spice.y.

int spice_checker ( void  )

Definition at line 3071 of file check_spice.cpp.

struct definition_t* spice_checker_intern ( struct definition_t )

Definition at line 3061 of file check_spice.cpp.

static struct definition_t* spice_create_action ( char *  type,
char *  instance 
)
static

Definition at line 67 of file parse_spice.y.

static struct definition_t* spice_create_device ( char *  instance)
static

Definition at line 56 of file parse_spice.y.

static struct value_t* spice_create_par_value ( char *  key,
char *  value 
)
static

Definition at line 95 of file parse_spice.y.

static struct value_t* spice_create_str_value ( char *  value,
int  hint 
)
static

Definition at line 78 of file parse_spice.y.

static struct value_t* spice_create_val_value ( char *  value,
int  hint 
)
static

Definition at line 86 of file parse_spice.y.

void spice_destroy ( void  )

Definition at line 1194 of file check_spice.cpp.

int spice_error ( const char *  )

Definition at line 958 of file parse_spice.y.

int spice_error ( const char *  error)

Definition at line 958 of file parse_spice.y.

int spice_lex ( void  )
int spice_lex_destroy ( void  )
int spice_parse ( void  )
void spice_set_last_hint ( struct value_t ,
int   
)

Definition at line 3054 of file check_spice.cpp.

static __END_DECLS char* spice_toupper ( char *  str)
static

Definition at line 48 of file parse_spice.y.

Variable Documentation

InputList __pad0__

Definition at line 198 of file parse_spice.y.

VOLTAGE_Output __pad10__ = spice_append_val_values ($$, $2, HINT_NUMBER)

Definition at line 658 of file parse_spice.y.

IV_Reference __pad11__ = spice_append_str_values ($$, $3, HINT_NODE | HINT_MSTOP)

Definition at line 680 of file parse_spice.y.

CURRENT_Output __pad12__

Definition at line 690 of file parse_spice.y.

Definition at line 704 of file parse_spice.y.

SWITCH_State __pad14__ = netlist_append_values ($$, $3)

Definition at line 721 of file parse_spice.y.

PRINT_List __pad15__

Definition at line 732 of file parse_spice.y.

OPTIONS_List __pad16__

Definition at line 741 of file parse_spice.y.

MODEL_List __pad17__ = netlist_append_values ($$, $3)

Definition at line 750 of file parse_spice.y.

NODESET_List __pad18__ = netlist_append_values ($$, $3)

Definition at line 761 of file parse_spice.y.

DEVICE_List_1 __pad19__ = netlist_append_values ($$, $4)

Definition at line 771 of file parse_spice.y.

InputLine __pad1__

Definition at line 203 of file parse_spice.y.

DEVICE_List_2 __pad20__

Definition at line 791 of file parse_spice.y.

DEVICE_List_3 __pad21__ = netlist_append_values ($$, $3)

Definition at line 811 of file parse_spice.y.

MODEL_Ident __pad22__

Definition at line 835 of file parse_spice.y.

DC_List __pad23__

Definition at line 842 of file parse_spice.y.

Value __pad24__ = spice_append_val_values ($$, $4, HINT_NUMBER | HINT_MSTOP)

Definition at line 846 of file parse_spice.y.

Node __pad25__

Definition at line 852 of file parse_spice.y.

FH_Node __pad26__

Definition at line 854 of file parse_spice.y.

PairList __pad27__

Definition at line 856 of file parse_spice.y.

ValueList __pad28__

Definition at line 861 of file parse_spice.y.

NodeValueList __pad29__

Definition at line 868 of file parse_spice.y.

DefinitionLine __pad2__

Definition at line 219 of file parse_spice.y.

NodeList __pad30__

Definition at line 879 of file parse_spice.y.

VSourceList __pad31__

Definition at line 886 of file parse_spice.y.

Expr __pad32__

Definition at line 893 of file parse_spice.y.

ExprList __pad33__

Definition at line 901 of file parse_spice.y.

Subcircuit __pad34__

Definition at line 907 of file parse_spice.y.

BeginSub __pad35__ = NULL

Definition at line 913 of file parse_spice.y.

SubBody __pad36__

Definition at line 922 of file parse_spice.y.

SubCkt_Ident __pad37__

Definition at line 936 of file parse_spice.y.

EndSub __pad38__

Definition at line 940 of file parse_spice.y.

SubBodyLine __pad39__

Definition at line 941 of file parse_spice.y.

TC_Value_1 __pad3__

Definition at line 604 of file parse_spice.y.

TC_Value_2 __pad4__ = spice_create_par_value ($1, $2)

Definition at line 605 of file parse_spice.y.

IC_Condition_1 __pad5__ = spice_append_val_values ($$, $3, HINT_NUMBER)

Definition at line 613 of file parse_spice.y.

IC_Condition_2 __pad6__ = spice_append_val_values ($$, $2, HINT_NUMBER)

Definition at line 621 of file parse_spice.y.

IC_Condition_3 __pad7__ = spice_append_val_values ($$, $3, HINT_NUMBER)

Definition at line 630 of file parse_spice.y.

IC_Condition_4 __pad8__ = spice_append_val_values ($$, $4, HINT_NUMBER)

Definition at line 639 of file parse_spice.y.

Output_Range __pad9__ = spice_append_val_values ($$, $5, HINT_NUMBER)

Definition at line 650 of file parse_spice.y.

BranchFunc
Initial value:
{
$$ = NULL

Definition at line 694 of file parse_spice.y.

definition_root = $1

Definition at line 204 of file parse_spice.y.

DefinitionLine
Initial value:
{
if ($1) {
$1->next = definition_root;
}
}
| Eol { }
definition_root
Definition: parse_spice.y:204
RLC_Device Node Node Value MODEL_Ident PairList Eol
Definition: parse_spice.y:225

Definition at line 206 of file parse_spice.y.

IC_Condition_1 DEVICE_List_1
Initial value:
{
$$ = spice_create_par_value ($1, $2)
static struct value_t * spice_create_par_value(char *key, char *value)
Definition: parse_spice.y:95

Definition at line 776 of file parse_spice.y.

MOS_Special Value DEVICE_List_2
Initial value:
{
$$ = spice_create_par_value ($1, $2)
static struct value_t * spice_create_par_value(char *key, char *value)
Definition: parse_spice.y:95

Definition at line 794 of file parse_spice.y.

IC_Condition_3 DEVICE_List_3
Initial value:
{
$$ = spice_create_par_value ($1, $2)
static struct value_t * spice_create_par_value(char *key, char *value)
Definition: parse_spice.y:95

Definition at line 816 of file parse_spice.y.

VarListBegin Eol VarList VarListEnd Eol
Initial value:
{
static struct definition_t * spice_create_device(char *instance)
Definition: parse_spice.y:56

Definition at line 225 of file parse_spice.y.

Expr ExprList
Initial value:
{
$$ = netlist_append_values ($1, $2)
struct value_t * netlist_append_values(struct value_t *v1, struct value_t *v2)

Definition at line 904 of file parse_spice.y.

Expr HINT_NAME HINT_MSTART

Definition at line 893 of file parse_spice.y.

Identifier Value MODEL_List
Initial value:
{
static struct value_t * spice_create_str_value(char *value, int hint)
Definition: parse_spice.y:78
#define HINT_NAME

Definition at line 755 of file parse_spice.y.

next = $3

Definition at line 859 of file parse_spice.y.

VoltFunc Node Node
Initial value:
{
$$ = NULL

Definition at line 669 of file parse_spice.y.

Node NodeList
Initial value:
{
static struct value_t * spice_create_str_value(char *value, int hint)
Definition: parse_spice.y:78
#define HINT_NODE

Definition at line 882 of file parse_spice.y.

VoltFunc Node Value NODESET_List
Initial value:
{
$$ = NULL

Definition at line 766 of file parse_spice.y.

Floats NodeValueList
Initial value:
{
static struct value_t * spice_create_str_value(char *value, int hint)
Definition: parse_spice.y:78
#define HINT_NODE

Definition at line 871 of file parse_spice.y.

OFF_Special
Initial value:
{
static struct value_t * spice_create_str_value(char *value, int hint)
Definition: parse_spice.y:78
#define HINT_NAME

Definition at line 729 of file parse_spice.y.

ON_Special
Initial value:
{
static struct value_t * spice_create_str_value(char *value, int hint)
Definition: parse_spice.y:78
#define HINT_NAME

Definition at line 726 of file parse_spice.y.

OpFunc
Initial value:
{
$$ = NULL

Definition at line 700 of file parse_spice.y.

Identifier Value OPTIONS_List
Initial value:
{
static struct value_t * spice_create_str_value(char *value, int hint)
Definition: parse_spice.y:78
#define HINT_NAME

Definition at line 744 of file parse_spice.y.

Assign NoneValue PairList
Initial value:
{
$$ = spice_create_par_value ($1, $2)
static struct value_t * spice_create_par_value(char *key, char *value)
Definition: parse_spice.y:95

Definition at line 857 of file parse_spice.y.

CURRENT_Output PLOT_List
Initial value:
{
$$ = netlist_append_values ($1, $2)
struct value_t * netlist_append_values(struct value_t *v1, struct value_t *v2)

Definition at line 709 of file parse_spice.y.

name prefix

Definition at line 131 of file parse_spice.y.

SubBodyLine SubBody
Initial value:
{
if ($1) {
$1->next = $2;
$$ = $1;
}
else {
$$ = $2;
}
}

Definition at line 925 of file parse_spice.y.

Subcircuit
Initial value:
{ }
| Eol {
$$ = NULL;
}
RLC_Device Node Node Value MODEL_Ident PairList Eol
Definition: parse_spice.y:225

Definition at line 950 of file parse_spice.y.

Value ValueList
Initial value:
{
static struct value_t * spice_create_val_value(char *value, int hint)
Definition: parse_spice.y:86
#define HINT_NUMBER

Definition at line 864 of file parse_spice.y.

BeginSub values = netlist_append_values ($$->values, $5)

Definition at line 223 of file parse_spice.y.

V_Source VSourceList
Initial value:
{
static struct value_t * spice_create_str_value(char *value, int hint)
Definition: parse_spice.y:78
#define HINT_NAME

Definition at line 889 of file parse_spice.y.