Jspice3
Main Page
Data Structures
Files
File List
Globals
fteparse.h
Go to the documentation of this file.
1
/**********
2
Copyright 1990 Regents of the University of California. All rights reserved.
3
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
4
**********/
5
6
/*
7
* Stuff for parsing -- used by the parser and in ft_evaluate().
8
*/
9
10
#ifndef FTEPARSE
11
#define FTEPARSE
12
13
14
#include "
ftedata.h
"
15
16
struct
pnode
{
17
char
*
pn_name
;
/* If non-NULL, the name. */
18
struct
dvec
*
pn_value
;
/* Non-NULL in a terminal node. */
19
struct
func
*
pn_func
;
/* Non-NULL is a function. */
20
struct
op
*
pn_op
;
/* Operation if the above two NULL. */
21
struct
pnode
*
pn_left
;
/* Left branch or function argument. */
22
struct
pnode
*
pn_right
;
/* Right branch. */
23
struct
pnode
*
pn_next
;
/* For expression lists. */
24
} ;
25
26
/* Operations. These should really be considered functions. */
27
28
struct
op
{
29
int
op_num
;
/* From parser #defines. */
30
char
*
op_name
;
/* Printing name. */
31
char
op_arity
;
/* One or two. */
32
struct
dvec
*(*op_func)();
/* The function to do the work. */
33
} ;
34
35
/* The functions that are available. */
36
37
struct
func
{
38
char
*
fu_name
;
/* The print name of the function. */
39
char
*(*fu_func)();
/* The function. */
40
} ;
41
42
/* User-definable functions. The idea of ud_name is that the args are
43
* kept in strings after the name, all seperated by '\0's. There
44
* will be ud_arity of them.
45
*/
46
47
struct
udfunc
{
48
char
*
ud_name
;
/* The name. */
49
int
ud_arity
;
/* The arity of the function. */
50
struct
pnode
*
ud_text
;
/* The definition. */
51
struct
udfunc
*
ud_next
;
/* Link pointer. */
52
} ;
53
54
#define MAXARITY 32
55
56
/* Parser elements. */
57
58
struct
element
{
59
int
e_token
;
/* One of the below. */
60
int
e_type
;
/* If the token is VALUE. */
61
union
{
62
char
*
un_string
;
63
double
un_double
;
64
struct
pnode
*
un_pnode
;
65
} e_un;
66
#define e_string e_un.un_string
67
#define e_double e_un.un_double
68
#define e_indices e_un.un_indices
69
#define e_pnode e_un.un_pnode
70
};
71
72
/* See the table in parse.c */
73
74
#define END 0
75
#define PLUS 1
76
#define MINUS 2
77
#define TIMES 3
78
#define MOD 4
79
#define DIVIDE 5
80
#define POWER 6
81
#define UMINUS 7
82
#define LPAREN 8
83
#define RPAREN 9
84
#define COMMA 10
85
#define VALUE 11
86
#define EQ 12
87
#define GT 13
88
#define LT 14
89
#define GE 15
90
#define LE 16
91
#define NE 17
92
#define AND 18
93
#define OR 19
94
#define NOT 20
95
#define INDX 21
96
#define RANGE 22
97
98
#define NUM 1
99
#define STRING 2
100
#define PNODE 3
101
102
#endif
/* FTEPARSE */
element::e_token
int e_token
Definition:
fteparse.h:59
pnode::pn_func
struct func * pn_func
Definition:
fteparse.h:19
element::un_string
char * un_string
Definition:
fteparse.h:62
func::fu_name
char * fu_name
Definition:
fteparse.h:38
element::un_double
double un_double
Definition:
fteparse.h:63
pnode::pn_name
char * pn_name
Definition:
fteparse.h:17
element
Definition:
fteparse.h:58
udfunc::ud_text
struct pnode * ud_text
Definition:
fteparse.h:50
op::op_num
int op_num
Definition:
fteparse.h:29
pnode::pn_next
struct pnode * pn_next
Definition:
fteparse.h:23
ftedata.h
pnode::pn_op
struct op * pn_op
Definition:
fteparse.h:20
dvec
Definition:
ftedata.h:24
op
Definition:
fteparse.h:28
func
Definition:
fteparse.h:37
pnode::pn_value
struct dvec * pn_value
Definition:
fteparse.h:18
op::op_name
char * op_name
Definition:
fteparse.h:30
udfunc::ud_next
struct udfunc * ud_next
Definition:
fteparse.h:51
element::un_pnode
struct pnode * un_pnode
Definition:
fteparse.h:64
udfunc::ud_name
char * ud_name
Definition:
fteparse.h:48
op::op_arity
char op_arity
Definition:
fteparse.h:31
udfunc::ud_arity
int ud_arity
Definition:
fteparse.h:49
pnode::pn_right
struct pnode * pn_right
Definition:
fteparse.h:22
pnode::pn_left
struct pnode * pn_left
Definition:
fteparse.h:21
udfunc
Definition:
fteparse.h:47
element::e_type
int e_type
Definition:
fteparse.h:60
pnode
Definition:
fteparse.h:16
src
include
fteparse.h
Generated by
1.8.11