source: git/Singular/libparse.h @ c45b8f0

spielwiese
Last change on this file since c45b8f0 was 599326, checked in by Kai Krüger <krueger@…>, 14 years ago
Anne, Kai, Frank: - changes to #include "..." statements to allow cleaner build structure - affected directories: omalloc, kernel, Singular - not yet done: IntergerProgramming git-svn-id: file:///usr/local/Singular/svn/trunk@13032 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 2.8 KB
Line 
1#ifndef LIBPARSE_H
2#define LIBPARSE_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id$ */
7/*
8* ABSTRACT: lib parsing
9*/
10typedef enum { OLD_LIBSTYLE, NEW_LIBSTYLE } lib_style_types;
11typedef enum { LOAD_LIB, GET_INFO } lp_modes;
12
13#ifdef STANDALONE_PARSER
14
15
16#define idhdl void*
17#define leftv void*
18#define package void*
19#define BOOLEAN int
20
21typedef enum { LANG_NONE, LANG_TOP, LANG_SINGULAR, LANG_C, LANG_MAX} language_defs;
22// LANG_TOP     : Toplevel package only
23// LANG_SINGULAR:
24// LANG_C       :
25//
26
27class proc_singular
28{
29public:
30  long   proc_start;       // position where proc is starting
31  long   def_end;          // position where proc header is ending
32  long   help_start;       // position where help is starting
33  long   help_end;         // position where help is starting
34  long   body_start;       // position where proc-body is starting
35  long   body_end;         // position where proc-body is ending
36  long   example_start;    // position where example is starting
37  long   proc_end;         // position where proc is ending
38  int    proc_lineno;
39  int    body_lineno;
40  int    example_lineno;
41  char   *body;
42  long help_chksum;
43};
44
45struct proc_object
46{
47//public:
48  BOOLEAN (*function)(leftv res, leftv v);
49};
50union uprocinfodata
51{
52public:
53  proc_singular  s;        // data of Singular-procedure
54  struct proc_object    o; // pointer to binary-function
55};
56
57typedef union uprocinfodata procinfodata;
58
59class procinfo;
60typedef procinfo *         procinfov;
61
62class procinfo
63{
64public:
65  char          *libname;
66  char          *procname;
67  package       pack;
68  language_defs language;
69  short         ref;
70  char          is_static;        // if set, proc not accessible for user
71  char          trace_flag;
72  procinfodata  data;
73};
74#else
75#include <kernel/febase.h>
76#endif
77
78procinfo *iiInitSingularProcinfo(procinfo* pi, const char *libname,
79              const char *procname, int line, long pos, BOOLEAN pstatic=FALSE);
80
81int yylplex(char *libname, char *libfile, lib_style_types *lib_style,
82           idhdl pl, BOOLEAN autoexport=FALSE, lp_modes=LOAD_LIB);
83
84void reinit_yylp();
85
86extern char * text_buffer;
87
88#  define YYLP_ERR_NONE    0
89#  define YYLP_DEF_BR2     1
90#  define YYLP_BODY_BR2    2
91#  define YYLP_BODY_BR3    3
92#  define YYLP_BODY_TMBR2  4
93#  define YYLP_BODY_TMBR3  5
94#  define YYLP_EX_BR2      6
95#  define YYLP_EX_BR3      7
96#  define YYLP_BAD_CHAR    8
97#  define YYLP_MISSQUOT    9
98#  define YYLP_MISS_BR1   10
99#  define YYLP_MISS_BR2   11
100#  define YYLP_MISS_BR3   12
101
102#  ifdef STANDALONE_PARSER
103#ifndef unix
104extern FILE* myfopen(char *path, char *mode);
105extern size_t myfread(void *ptr, size_t size, size_t nmemb, FILE *stream);
106#else
107#define myfopen fopen
108#define myfread fread
109#endif
110#  endif
111
112#endif /* LIBPARSE_H */
113
114
Note: See TracBrowser for help on using the repository browser.