Loading...
Searching...
No Matches
libparse.h
Go to the documentation of this file.
#ifndef LIBPARSE_H
#define LIBPARSE_H
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/*
* ABSTRACT: lib parsing
*/
typedef enum { OLD_LIBSTYLE, NEW_LIBSTYLE } lib_style_types;
typedef enum { LOAD_LIB, GET_INFO } lp_modes;
#ifdef STANDALONE_PARSER
#define idhdl void*
#define leftv void*
#define package void*
#define BOOLEAN int
typedef enum { LANG_NONE, LANG_TOP, LANG_SINGULAR, LANG_C, LANG_MIX, LANG_MAX} language_defs;
// LANG_TOP : Toplevel package only
// LANG_SINGULAR:
// LANG_C :
//
class proc_singular
{
public:
long proc_start; // position where proc is starting
long def_end; // position where proc header is ending
long help_start; // position where help is starting
long help_end; // position where help is starting
long body_start; // position where proc-body is starting
long body_end; // position where proc-body is ending
long example_start; // position where example is starting
long proc_end; // position where proc is ending
int proc_lineno;
int body_lineno;
int example_lineno;
char *body;
long help_chksum;
};
struct proc_object
{
//public:
BOOLEAN (*function)(leftv res, leftv v);
};
union uprocinfodata
{
public:
proc_singular s; // data of Singular-procedure
struct proc_object o; // pointer to binary-function
};
typedef union uprocinfodata procinfodata;
class procinfo;
typedef procinfo * procinfov;
class procinfo
{
public:
char *libname;
char *procname;
package pack;
language_defs language;
short ref;
char is_static; // if set, proc not accessible for user
char trace_flag;
procinfodata data;
};
#endif
procinfo *iiInitSingularProcinfo(procinfo* pi, const char *libname,
const char *procname, int line, long pos, BOOLEAN pstatic=FALSE);
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style,
idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB);
void reinit_yylp();
EXTERN_VAR char * text_buffer;
# define YYLP_ERR_NONE 0
# define YYLP_DEF_BR2 1
# define YYLP_BODY_BR2 2
# define YYLP_BODY_BR3 3
# define YYLP_BODY_TMBR2 4
# define YYLP_BODY_TMBR3 5
# define YYLP_EX_BR2 6
# define YYLP_EX_BR3 7
# define YYLP_BAD_CHAR 8
# define YYLP_MISSQUOT 9
# define YYLP_MISS_BR1 10
# define YYLP_MISS_BR2 11
# define YYLP_MISS_BR3 12
# ifdef STANDALONE_PARSER
#define myfopen fopen
#define myfread fread
# endif
#endif /* LIBPARSE_H */
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
FALSE
#define FALSE
Definition auxiliary.h:97
res
CanonicalForm res
Definition facAbsFact.cc:60
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
EXTERN_VAR
#define EXTERN_VAR
Definition globaldefs.h:6
iiInitSingularProcinfo
procinfo * iiInitSingularProcinfo(procinfov pi, const char *libname, const char *procname, int, long pos, BOOLEAN pstatic)
Definition iplib.cc:1059
pi
#define pi
Definition libparse.cc:1145
reinit_yylp
void reinit_yylp()
Definition libparse.cc:3376
text_buffer
VAR char * text_buffer
Definition libparse.cc:1099
lib_style_types
lib_style_types
Definition libparse.h:9
OLD_LIBSTYLE
@ OLD_LIBSTYLE
Definition libparse.h:9
NEW_LIBSTYLE
@ NEW_LIBSTYLE
Definition libparse.h:9
lp_modes
lp_modes
Definition libparse.h:10
LOAD_LIB
@ LOAD_LIB
Definition libparse.h:10
GET_INFO
@ GET_INFO
Definition libparse.h:10
yylplex
int yylplex(const char *libname, const char *libfile, lib_style_types *lib_style, idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB)
idhdl
idrec * idhdl
Definition ring.h:22
procinfov
procinfo * procinfov
Definition structs.h:56
procinfo::libname
char * libname
Definition subexpr.h:56
procinfo::language
language_defs language
Definition subexpr.h:59
proc_singular::body
char * body
Definition subexpr.h:36
proc_singular::help_start
long help_start
Definition subexpr.h:29
proc_singular::example_lineno
int example_lineno
Definition subexpr.h:35
procinfo::data
procinfodata data
Definition subexpr.h:63
procinfo::procname
char * procname
Definition subexpr.h:57
proc_singular::def_end
long def_end
Definition subexpr.h:28
leftv
sleftv * leftv
Definition subexpr.h:79
proc_singular::help_end
long help_end
Definition subexpr.h:30
proc_singular::proc_end
long proc_end
Definition subexpr.h:27
proc_singular::example_start
long example_start
Definition subexpr.h:33
procinfo::trace_flag
char trace_flag
Definition subexpr.h:62
proc_singular::help_chksum
long help_chksum
Definition subexpr.h:37
uprocinfodata::s
proc_singular s
Definition subexpr.h:48
procinfo::is_static
char is_static
Definition subexpr.h:61
proc_singular::proc_start
long proc_start
Definition subexpr.h:26
language_defs
language_defs
Definition subexpr.h:22
LANG_MAX
@ LANG_MAX
Definition subexpr.h:22
LANG_SINGULAR
@ LANG_SINGULAR
Definition subexpr.h:22
LANG_NONE
@ LANG_NONE
Definition subexpr.h:22
LANG_MIX
@ LANG_MIX
Definition subexpr.h:22
LANG_C
@ LANG_C
Definition subexpr.h:22
LANG_TOP
@ LANG_TOP
Definition subexpr.h:22
proc_singular::body_start
long body_start
Definition subexpr.h:31
procinfo::ref
short ref
Definition subexpr.h:60
uprocinfodata::o
struct proc_object o
Definition subexpr.h:49
proc_singular::body_end
long body_end
Definition subexpr.h:32
proc_singular::body_lineno
int body_lineno
Definition subexpr.h:34
proc_object::function
BOOLEAN(* function)(leftv res, leftv v)
Definition subexpr.h:42
proc_singular
Definition subexpr.h:24
procinfo
Definition subexpr.h:54
proc_object
Definition subexpr.h:40
uprocinfodata
Definition subexpr.h:46