-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathquattro_parser.h
78 lines (69 loc) · 1.95 KB
/
quattro_parser.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//@+leo-ver=4-thin
//@+node:leonardoce.20090629082550.190:@thin quattro_parser.h
//@@language c
#ifndef __QUATTRO_PARSER_H
#define __QUATTRO_PARSER_H
#include <stdio.h>
//@+others
//@+node:leonardoce.20090629082550.230:ForthWord
/****c* forth/ForthWord
* NAME
* ForthWord
* FUNCTION
* Rappresenta una parola di forth
* SOURCE
*/
typedef struct ForthWord ForthWord;
struct ForthWord {
char *fileName;
char *stringValue;
int intValue;
double doubleValue;
int wordType;
int row, col;
};
enum ForthWordType {
UNKNOWN_WORD,
INT_WORD,
DOUBLE_WORD,
EXECUTE_WORD
};
ForthWord *ForthWord_NewExecute(const char *fileName, const char *forthString, int row, int col);
ForthWord *ForthWord_NewInt(const char *fileName, int value, int row, int col);
ForthWord *ForthWord_NewDouble(const char *fileName, double value, int row, int col);
void ForthWord_Delete(ForthWord *self);
void ForthWord_Dump(ForthWord *self);
/****/
//@-node:leonardoce.20090629082550.230:ForthWord
//@+node:leonardoce.20090629082550.231:ForthStream
/****c* forth/ForthStream
* NAME
* ForthStream
* FUNCTION
* Stream di ingresso di parole Forth
* SOURCE
*/
typedef struct ForthStream ForthStream;
struct ForthStream {
char *buffer;
int row, col;
int index;
int fileSize;
char *fileName;
};
ForthStream *ForthStream_NewForFile( const char *fileName );
ForthStream *ForthStream_NewForBuffer( const char *fileName, const char *buffer );
void ForthStream_ResetForBuffer(ForthStream *self, const char *fileName, const char *buffer);
void ForthStream_Delete(ForthStream *self);
ForthWord *ForthStream_ParseWord( ForthStream *in );
void ForthStream_SkipSpaces( ForthStream *in );
int ForthStream_Eof( ForthStream *self );
char ForthStream_Getc( ForthStream *self );
void ForthStream_Ungetc( ForthStream *self );
int forthIsSpace( char c );
/****/
//@-node:leonardoce.20090629082550.231:ForthStream
//@-others
#endif
//@-node:leonardoce.20090629082550.190:@thin quattro_parser.h
//@-leo