My Project  UNKNOWN_GIT_VERSION
libparse.h
Go to the documentation of this file.
1 #ifndef LIBPARSE_H
2 #define LIBPARSE_H
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT: lib parsing
8 */
10 typedef enum { LOAD_LIB, GET_INFO } lp_modes;
11 
12 #ifdef STANDALONE_PARSER
13 
14 
15 #define idhdl void*
16 #define leftv void*
17 #define package void*
18 #define BOOLEAN int
19 
21 // LANG_TOP : Toplevel package only
22 // LANG_SINGULAR:
23 // LANG_C :
24 //
25 
26 class proc_singular
27 {
28 public:
29  long proc_start; // position where proc is starting
30  long def_end; // position where proc header is ending
31  long help_start; // position where help is starting
32  long help_end; // position where help is starting
33  long body_start; // position where proc-body is starting
34  long body_end; // position where proc-body is ending
35  long example_start; // position where example is starting
36  long proc_end; // position where proc is ending
37  int proc_lineno;
38  int body_lineno;
39  int example_lineno;
40  char *body;
41  long help_chksum;
42 };
43 
44 struct proc_object
45 {
46 //public:
47  BOOLEAN (*function)(leftv res, leftv v);
48 };
49 union uprocinfodata
50 {
51 public:
52  proc_singular s; // data of Singular-procedure
53  struct proc_object o; // pointer to binary-function
54 };
55 
56 typedef union uprocinfodata procinfodata;
57 
58 class procinfo;
59 typedef procinfo * procinfov;
60 
61 class procinfo
62 {
63 public:
64  char *libname;
65  char *procname;
66  package pack;
68  short ref;
69  char is_static; // if set, proc not accessible for user
70  char trace_flag;
71  procinfodata data;
72 };
73 #endif
74 
76  const char *procname, int line, long pos, BOOLEAN pstatic=FALSE);
77 
78 int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style,
79  idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB);
80 
81 void reinit_yylp();
82 
83 extern char * text_buffer;
84 
85 # define YYLP_ERR_NONE 0
86 # define YYLP_DEF_BR2 1
87 # define YYLP_BODY_BR2 2
88 # define YYLP_BODY_BR3 3
89 # define YYLP_BODY_TMBR2 4
90 # define YYLP_BODY_TMBR3 5
91 # define YYLP_EX_BR2 6
92 # define YYLP_EX_BR3 7
93 # define YYLP_BAD_CHAR 8
94 # define YYLP_MISSQUOT 9
95 # define YYLP_MISS_BR1 10
96 # define YYLP_MISS_BR2 11
97 # define YYLP_MISS_BR3 12
98 
99 # ifdef STANDALONE_PARSER
100 #define myfopen fopen
101 #define myfread fread
102 # endif
103 
104 #endif /* LIBPARSE_H */
105 
106 
FALSE
#define FALSE
Definition: auxiliary.h:94
proc_singular::body
char * body
Definition: subexpr.h:36
lp_modes
lp_modes
Definition: libparse.h:10
procinfo::language
language_defs language
Definition: subexpr.h:59
procinfo::ref
short ref
Definition: subexpr.h:60
procinfov
procinfo * procinfov
Definition: structs.h:63
uprocinfodata
Definition: subexpr.h:46
procinfo::trace_flag
char trace_flag
Definition: subexpr.h:62
LANG_TOP
@ LANG_TOP
Definition: subexpr.h:24
LANG_SINGULAR
@ LANG_SINGULAR
Definition: subexpr.h:24
OLD_LIBSTYLE
@ OLD_LIBSTYLE
Definition: libparse.h:11
LANG_MAX
@ LANG_MAX
Definition: subexpr.h:24
iiInitSingularProcinfo
procinfo * iiInitSingularProcinfo(procinfo *pi, const char *libname, const char *procname, int line, long pos, BOOLEAN pstatic=FALSE)
proc_singular
Definition: subexpr.h:24
proc_singular::example_start
long example_start
Definition: subexpr.h:33
yylplex
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
procinfo
Definition: subexpr.h:54
sleftv
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
proc_singular::def_end
long def_end
Definition: subexpr.h:28
NEW_LIBSTYLE
@ NEW_LIBSTYLE
Definition: libparse.h:11
proc_singular::body_lineno
int body_lineno
Definition: subexpr.h:34
pi
#define pi
Definition: libparse.cc:1143
proc_singular::help_start
long help_start
Definition: subexpr.h:29
procinfo::libname
char * libname
Definition: subexpr.h:56
res
CanonicalForm res
Definition: facAbsFact.cc:64
text_buffer
char * text_buffer
Definition: libparse.cc:1097
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
procinfo::procname
char * procname
Definition: subexpr.h:57
LANG_C
@ LANG_C
Definition: subexpr.h:24
proc_singular::help_chksum
long help_chksum
Definition: subexpr.h:37
proc_object
Definition: subexpr.h:40
LANG_NONE
@ LANG_NONE
Definition: subexpr.h:24
uprocinfodata::o
struct proc_object o
Definition: subexpr.h:49
proc_singular::proc_end
long proc_end
Definition: subexpr.h:27
idrec
Definition: idrec.h:35
procinfo::data
procinfodata data
Definition: subexpr.h:63
LANG_MIX
@ LANG_MIX
Definition: subexpr.h:24
proc_singular::help_end
long help_end
Definition: subexpr.h:30
lib_style_types
lib_style_types
Definition: libparse.h:9
proc_singular::example_lineno
int example_lineno
Definition: subexpr.h:35
language_defs
language_defs
Definition: subexpr.h:22
LOAD_LIB
@ LOAD_LIB
Definition: libparse.h:10
proc_singular::body_end
long body_end
Definition: subexpr.h:32
procinfo::is_static
char is_static
Definition: subexpr.h:61
GET_INFO
@ GET_INFO
Definition: libparse.h:10
reinit_yylp
void reinit_yylp()
Definition: libparse.cc:3374
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
uprocinfodata::s
proc_singular s
Definition: subexpr.h:48
proc_singular::proc_start
long proc_start
Definition: subexpr.h:26
proc_singular::body_start
long body_start
Definition: subexpr.h:31