comparison anagram/guisupport/items.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 * items.h
7 */
8
9 #ifndef ITEMS_H
10 #define ITEMS_H
11
12 #include "dc.h"
13
14 class state_table_dc : public dc {
15 public:
16 static MenuOption *auxTable[];
17 virtual MenuOption **getAuxWinMenu(void) { return auxTable; }
18
19 state_table_dc(void);
20 state_table_dc(state_table_dc &x) : dc(x) {}
21
22 virtual void getLine(unsigned) const;
23 virtual void synchCursor(unsigned) const;
24
25 virtual dc_ref aux_trace(unsigned);
26 virtual dc_ref expansion_rules(unsigned);
27 virtual dc_ref keywords(unsigned);
28 virtual dc_ref previous_states(unsigned);
29 virtual dc_ref productions(unsigned);
30 virtual dc_ref reduction_states(unsigned);
31 virtual dc_ref rule_context(unsigned);
32 virtual dc_ref set_elements(unsigned);
33 virtual dc_ref state_expansion(unsigned);
34 virtual dc_ref usage(unsigned);
35
36 virtual int expansion_rules_ok(unsigned);
37 virtual int keywords_ok(unsigned);
38 virtual int previous_states_ok(unsigned);
39 virtual int productions_ok(unsigned);
40 virtual int reduction_states_ok(unsigned);
41 virtual int rule_context_ok(unsigned ln) { return ln != 0; }
42 virtual int set_elements_ok(unsigned);
43 virtual int usage_ok(unsigned);
44
45 struct item {
46 unsigned state;
47 unsigned rule;
48 unsigned index;
49 int first_flag;
50 item(unsigned ln);
51 unsigned token(void);
52 };
53 };
54
55 class expansion_rules_dc : public dc {
56 public:
57 unsigned token_number;
58
59 static MenuOption *auxTable[];
60 virtual MenuOption **getAuxWinMenu(void) { return auxTable; }
61
62 expansion_rules_dc(unsigned, const AgString);
63 expansion_rules_dc(expansion_rules_dc &x)
64 : dc(x),token_number(x.token_number) {}
65
66 virtual unsigned rule(unsigned) const;
67 virtual unsigned token(unsigned) const;
68
69 virtual void getLine(unsigned) const;
70 virtual void synchCursor(unsigned) const;
71
72 virtual dc_ref expansion_rules(unsigned);
73 virtual dc_ref productions(unsigned);
74 virtual dc_ref rule_context(unsigned);
75 virtual dc_ref set_elements(unsigned);
76 virtual dc_ref usage(unsigned);
77
78 virtual int expansion_rules_ok(unsigned);
79 virtual int productions_ok(unsigned);
80 virtual int rule_context_ok(unsigned k) { return k != 0; }
81 virtual int set_elements_ok(unsigned);
82 virtual int usage_ok(unsigned);
83 };
84
85 dc_ref build_item_list(int tn);
86 int build_item_list_ok(int tn);
87 dc_ref expand_specific_item(dc_ref, int, int);
88
89 #endif /* ITEMS_H */