My Project
fevoices.h
Go to the documentation of this file.
1#ifndef FEVOICES_H
2#define FEVOICES_H
3/****************************************
4 * * Computer Algebra System SINGULAR *
5 * ****************************************/
6/*
7 * * ABSTRACT: class Voice
8 * */
9
10#include "reporter/reporter.h"
11
13
14#include "kernel/structs.h"
15
17{
18 BT_none = 0, // entry level
19 BT_break = 1, // while, for
20 BT_proc, // proc
21 BT_example, // example
22 BT_file, // <"file"
23 BT_execute, // execute
24 BT_if, // if
25 BT_else // else
26};
27
29{
33};
35{
43}; /* for scanner.l */
44
47extern const char sNoName_fe[];
48
49#ifdef __cplusplus
50
51/* the C++-part: */
52
53// LANG_TOP : Toplevel package only
54// LANG_SINGULAR:
55// LANG_C :
56//
57
58class Voice
59{
60 public:
63 char * filename; // file name or proc name
64 procinfo * pi; // proc info
65 void * oldb; // internal scanner buffer
66 // for files only:
67 FILE * files; // file handle
68 // for buffers only:
69 char * buffer; // buffer pointer
70 long fptr; // current position in buffer
71 long ftellptr; // with glibc 2.22, file position gets lost
72 // in sig_chld_hdl (ssi:ffork link), see examples/waitall.sing
73 int buff_size; // malloc size of buffer
74
75 int start_lineno; // lineno, to restore in recursion
76 int curr_lineno; // current lineno
77 feBufferInputs sw; // BI_stdin: read from STDIN
78 // BI_buffer: buffer
79 // BI_file: files
80 char ifsw; // if-switch:
81 /*1 ifsw==0: no if statement, else is invalid
82 * ==1: if (0) processed, execute else
83 * ==2: if (1) processed, else allowed but not executed
84 */
85 feBufferTypes typ; // buffer type: see BT_..
86
87 Voice() { memset(this,0,sizeof(*this));}
89 void Next();
90} ;
91
93
95
96const char * VoiceName();
97int VoiceLine();
98void VoiceBackTrack();
102void monitor(void *F, int mode); /* FILE*, int */
103BOOLEAN newFile(char* fname);
104void newBuffer(char* s, feBufferTypes t, procinfo *pname = NULL, int start_lineno = 0);
105void * myynewbuffer();
106void myyoldbuffer(void * oldb);
107
108#endif
109#endif
110
int BOOLEAN
Definition: auxiliary.h:87
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:676
Definition: fevoices.h:59
int curr_lineno
Definition: fevoices.h:76
Voice * next
Definition: fevoices.h:61
FILE * files
Definition: fevoices.h:67
Voice()
Definition: fevoices.h:87
char * buffer
Definition: fevoices.h:69
void Next()
Definition: fevoices.cc:94
feBufferTypes Typ()
Definition: fevoices.cc:111
long ftellptr
Definition: fevoices.h:71
char ifsw
Definition: fevoices.h:80
int start_lineno
Definition: fevoices.h:75
procinfo * pi
Definition: fevoices.h:64
int buff_size
Definition: fevoices.h:73
char * filename
Definition: fevoices.h:63
feBufferInputs sw
Definition: fevoices.h:77
void * oldb
Definition: fevoices.h:65
Voice * prev
Definition: fevoices.h:62
feBufferTypes typ
Definition: fevoices.h:85
long fptr
Definition: fevoices.h:70
const CanonicalForm int s
Definition: facAbsFact.cc:51
EXTERN_VAR Voice * currentVoice
Definition: fevoices.h:92
feBufferInputs
Definition: fevoices.h:29
@ BI_file
Definition: fevoices.h:32
@ BI_buffer
Definition: fevoices.h:31
@ BI_stdin
Definition: fevoices.h:30
void myyoldbuffer(void *oldb)
Definition: scanner.cc:2304
noeof_t
Definition: fevoices.h:35
@ noeof_string
Definition: fevoices.h:42
@ noeof_brace
Definition: fevoices.h:36
@ noeof_comment
Definition: fevoices.h:40
@ noeof_asstring
Definition: fevoices.h:37
@ noeof_block
Definition: fevoices.h:38
@ noeof_procname
Definition: fevoices.h:41
@ noeof_bracket
Definition: fevoices.h:39
BOOLEAN exitBuffer(feBufferTypes typ)
Definition: fevoices.cc:236
BOOLEAN contBuffer(feBufferTypes typ)
Definition: fevoices.cc:304
const char * VoiceName()
Definition: fevoices.cc:58
void newBuffer(char *s, feBufferTypes t, procinfo *pname=NULL, int start_lineno=0)
Definition: fevoices.cc:166
EXTERN_VAR char my_yylinebuf[80]
Definition: fevoices.h:46
feBufferTypes
Definition: fevoices.h:17
@ BT_none
Definition: fevoices.h:18
@ BT_else
Definition: fevoices.h:25
@ BT_if
Definition: fevoices.h:24
@ BT_break
Definition: fevoices.h:19
@ BT_example
Definition: fevoices.h:21
@ BT_execute
Definition: fevoices.h:23
@ BT_proc
Definition: fevoices.h:20
@ BT_file
Definition: fevoices.h:22
const char sNoName_fe[]
Definition: fevoices.cc:57
void * myynewbuffer()
Definition: scanner.cc:2297
void VoiceBackTrack()
Definition: fevoices.cc:77
void monitor(void *F, int mode)
Definition: febase.cc:68
BOOLEAN newFile(char *fname)
Definition: fevoices.cc:129
Voice * feInitStdin(Voice *pp)
Definition: fevoices.cc:677
int VoiceLine()
Definition: fevoices.cc:66
EXTERN_VAR int yylineno
Definition: fevoices.h:45
BOOLEAN exitVoice()
Definition: fevoices.cc:341
#define EXTERN_VAR
Definition: globaldefs.h:6
#define NULL
Definition: omList.c:12