comparison anagram/guisupport/conflicttrc.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 * conflicttrc.h
7 */
8
9 #ifndef CONFLICTTRC_H
10 #define CONFLICTTRC_H
11
12 #include <stdio.h>
13 #include "port.h"
14
15 class AgString; // from agstring.h
16 #include "dc.h"
17 #include "tsd.h"
18
19
20 class rule_stack_dc : public dc {
21 public:
22 tsd *parser_stack;
23
24 static MenuOption *auxTable[];
25 virtual MenuOption **getAuxWinMenu(void) { return auxTable; }
26
27 rule_stack_dc(tsd *, unsigned, const AgString);
28 rule_stack_dc(rule_stack_dc &x) : dc(x), parser_stack(x.parser_stack) {}
29 ~rule_stack_dc(void) { delete_tsd(parser_stack); }
30
31 virtual void getLine(unsigned) const;
32 virtual void synchCursor(unsigned) const;
33
34 struct item {
35 unsigned rule;
36 unsigned index;
37 item(tsd *, unsigned ln);
38 };
39
40 virtual item getItem(unsigned) const;
41 virtual unsigned state(unsigned);
42 virtual unsigned token(unsigned);
43
44 virtual dc_ref expansion_chain(unsigned ln);
45 virtual dc_ref expansion_rules(unsigned ln);
46 virtual dc_ref keywords(unsigned ln);
47 virtual dc_ref productions(unsigned ln);
48 virtual dc_ref rule_context(unsigned ln);
49 virtual dc_ref set_elements(unsigned ln);
50 virtual dc_ref state_definition(unsigned ln);
51 virtual dc_ref state_expansion(unsigned ln);
52 virtual dc_ref usage(unsigned ln);
53
54 virtual int expansion_chain_ok(unsigned ln);
55 virtual int expansion_rules_ok(unsigned ln);
56 virtual int keywords_ok(unsigned ln);
57 virtual int productions_ok(unsigned ln);
58 virtual int rule_context_ok(unsigned ln); // { return ln != 0; }
59 virtual int set_elements_ok(unsigned ln);
60 virtual int usage_ok(unsigned ln);
61
62 };
63
64 dc_ref build_conflict_trace(int s, int t, int f);
65 dc_ref build_et_window(void);
66 dc_ref build_red_trace(int, int,int);
67 dc_ref conflict_red_trace(int s, int t, int f);
68 dc_ref new_item_stack_kernel(dc_ref d, tsd *isl);
69 dc_ref problem_states_window(int sn, int fn, int fx, int ct);
70 dc_ref set_up_stack_window(AgString);
71
72 tsd *build_et(FILE *f);
73
74 #endif /* CONFLICTTRC_H */