Mercurial > ~dholland > hg > ag > index.cgi
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/anagram/guisupport/conflicttrc.h Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,74 @@ +/* + * AnaGram, A System for Syntax Directed Programming + * Copyright 1993-2002 Parsifal Software. All Rights Reserved. + * See the file COPYING for license and usage terms. + * + * conflicttrc.h + */ + +#ifndef CONFLICTTRC_H +#define CONFLICTTRC_H + +#include <stdio.h> +#include "port.h" + +class AgString; // from agstring.h +#include "dc.h" +#include "tsd.h" + + +class rule_stack_dc : public dc { +public: + tsd *parser_stack; + + static MenuOption *auxTable[]; + virtual MenuOption **getAuxWinMenu(void) { return auxTable; } + + rule_stack_dc(tsd *, unsigned, const AgString); + rule_stack_dc(rule_stack_dc &x) : dc(x), parser_stack(x.parser_stack) {} + ~rule_stack_dc(void) { delete_tsd(parser_stack); } + + virtual void getLine(unsigned) const; + virtual void synchCursor(unsigned) const; + + struct item { + unsigned rule; + unsigned index; + item(tsd *, unsigned ln); + }; + + virtual item getItem(unsigned) const; + virtual unsigned state(unsigned); + virtual unsigned token(unsigned); + + virtual dc_ref expansion_chain(unsigned ln); + virtual dc_ref expansion_rules(unsigned ln); + virtual dc_ref keywords(unsigned ln); + virtual dc_ref productions(unsigned ln); + virtual dc_ref rule_context(unsigned ln); + virtual dc_ref set_elements(unsigned ln); + virtual dc_ref state_definition(unsigned ln); + virtual dc_ref state_expansion(unsigned ln); + virtual dc_ref usage(unsigned ln); + + virtual int expansion_chain_ok(unsigned ln); + virtual int expansion_rules_ok(unsigned ln); + virtual int keywords_ok(unsigned ln); + virtual int productions_ok(unsigned ln); + virtual int rule_context_ok(unsigned ln); // { return ln != 0; } + virtual int set_elements_ok(unsigned ln); + virtual int usage_ok(unsigned ln); + +}; + +dc_ref build_conflict_trace(int s, int t, int f); +dc_ref build_et_window(void); +dc_ref build_red_trace(int, int,int); +dc_ref conflict_red_trace(int s, int t, int f); +dc_ref new_item_stack_kernel(dc_ref d, tsd *isl); +dc_ref problem_states_window(int sn, int fn, int fx, int ct); +dc_ref set_up_stack_window(AgString); + +tsd *build_et(FILE *f); + +#endif /* CONFLICTTRC_H */