1 //////////////////////////////////////////////////////////////////////////////
4 // ADLib, Prop and their related set of tools and documentation are in the
5 // public domain. The author(s) of this software reserve no copyrights on
6 // the source code and any code generated using the tools. You are encouraged
7 // to use ADLib and Prop to develop software, in both academic and commercial
8 // settings, and are welcomed to incorporate any part of ADLib and Prop into
11 // Although you are under no obligation to do so, we strongly recommend that
12 // you give away all software developed using our tools.
14 // We also ask that credit be given to us when ADLib and/or Prop are used in
15 // your programs, and that this notice be preserved intact in all the source
18 // This software is still under development and we welcome(read crave for)
19 // any suggestions and help from the users.
23 //////////////////////////////////////////////////////////////////////////////
29 #include <AD/automata/treegram.h> // tree grammar
30 #include <AD/generic/ordering.h> // hashing functions
32 //////////////////////////////////////////////////////////////////////////////
33 // Items used in the bottom up rewrite system (BURS) generator.
34 // An item encodes the following information:
35 // (1) A non-terminal,
36 // (2) The reduction rule used to arrive at this non-terminal, and
37 // (3) The reduction cost.
38 //////////////////////////////////////////////////////////////////////////////
42 ///////////////////////////////////////////////////////////////////////////
44 ///////////////////////////////////////////////////////////////////////////
45 typedef TreeGrammar::State State
;
46 typedef TreeGrammar::Functor Functor
;
47 typedef TreeGrammar::Arity Arity
;
48 typedef TreeGrammar::NonTerminal NonTerminal
;
49 typedef TreeGrammar::Cost Cost
; // reduction cost
50 typedef TreeGrammar::Rule Rule
; // reduction rule
54 ///////////////////////////////////////////////////////////////////////////
55 // The internal representation is visible.
56 ///////////////////////////////////////////////////////////////////////////
57 Cost cost
; // cost of reduction
58 Rule rule
; // reduction rule
62 ///////////////////////////////////////////////////////////////////////////
64 ///////////////////////////////////////////////////////////////////////////
65 friend std::ostream
& operator << (std::ostream
&, const BURS_Item
&);