Mercurial > ~dholland > hg > ag > index.cgi
comparison anagram/agcore/rproc.h @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 /* | |
2 * AnaGram, A System for Syntax Directed Programming | |
3 * Copyright 1993-2002 Parsifal Software. All Rights Reserved. | |
4 * See the file COPYING for license and usage terms. | |
5 * | |
6 * rproc.h | |
7 */ | |
8 | |
9 #ifndef RPROC_H | |
10 #define RPROC_H | |
11 | |
12 #include "register.h" | |
13 | |
14 struct CSegment { | |
15 unsigned char *begin; | |
16 unsigned char *end; | |
17 int line; | |
18 | |
19 // this is in pgg24.syn and moving it would make an ugly mess | |
20 CSegment(); | |
21 | |
22 int length() { return end - begin; } | |
23 int operator < (const CSegment &s) const { return begin < s.begin; } | |
24 }; | |
25 | |
26 struct ProcedureDescriptor; | |
27 | |
28 class Procedure : public ObjectRegister<ProcedureDescriptor> { | |
29 public: | |
30 Procedure() {} | |
31 Procedure(const int x); | |
32 //Procedure(const Procedure &t) : ObjectRegister<ProcedureDescriptor>(t) {} | |
33 Procedure(const CSegment &t); | |
34 static const int first; | |
35 static void reset(); | |
36 int operator < (const Procedure p) const; | |
37 }; | |
38 | |
39 struct ProcedureDescriptor { | |
40 int cast; | |
41 //int n_params; | |
42 //unsigned cast_index; | |
43 //int auto_proc; | |
44 int alias; | |
45 int line, col; | |
46 int form_number; | |
47 CSegment cSegment; | |
48 //int *args; | |
49 int macro_flag : 1; | |
50 int value_flag : 1; | |
51 | |
52 ProcedureDescriptor(); | |
53 ProcedureDescriptor(const CSegment &); | |
54 int operator < (const ProcedureDescriptor &d) const { | |
55 return cSegment.begin < d.cSegment.begin; | |
56 } | |
57 }; | |
58 | |
59 | |
60 #endif /* RPROC_H */ |