Mercurial > ~dholland > hg > ag > index.cgi
diff anagram/agcore/tree.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 | 607e3be6bad8 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/anagram/agcore/tree.h Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,53 @@ +/* + * AnaGram, A System for Syntax Directed Programming + * Copyright 1993-2002 Parsifal Software. All Rights Reserved. + * See the file COPYING for license and usage terms. + * + * tree.h + */ + +#ifndef TREE_H +#define TREE_H + +class CharSetExpression; // from csexp.h +#include "register.h" + + +struct parse_tree_map; + +class ParseTree : public KeyedObjectRegister<parse_tree_map> { +public: + ParseTree() {} + ParseTree(unsigned x); + ParseTree(const ParseTree &t); + ParseTree(CharSetExpression *x); + static void reset(); + + class Map; + friend class Map; + + class Map { + public: + parse_tree_map &operator [] (unsigned x); + }; +}; + +#include "symbol.h" +#include "token.h" + +struct parse_tree_map { + Token token_number; + Symbol token_name; + CharSetExpression *expression; + int char_set; + + parse_tree_map(); + parse_tree_map(CharSetExpression *x); + ~parse_tree_map() {} + int operator < (const parse_tree_map &t) const; +}; + +extern ParseTree::Map map_parse_tree; + + +#endif /* TREE_H */