Vaucanson  1.4.1
krat_exp_parser_private.hh
1 // krat_exp_parser.hxx: this file is part of the Vaucanson project.
2 //
3 // Vaucanson, a generic library for finite state machines.
4 //
5 // Copyright (C) 2008, 2009 The Vaucanson Group.
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
11 //
12 // The complete GNU General Public Licence Notice can be found as the
13 // `COPYING' file in the root directory.
14 //
15 // The Vaucanson Group consists of people listed in the `AUTHORS' file.
16 //
17 
18 #ifndef VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PARSER_PRIVATE_HH
19 # define VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PARSER_PRIVATE_HH
20 
21 # include <vaucanson/algebra/implementation/series/krat_exp_proxy.hh>
22 
23 // These definitions really belong to lib/krat_exp/krat_exp_bison.yy,
24 // but we need to have them in the public headers so they are installed.
25 namespace vcsnyy
26 {
27  struct token_queue;
28 
29  struct krat_exp_parser
30  {
31  krat_exp_parser();
32  ~krat_exp_parser();
33  void insert_word(vcsn::algebra::krat_exp_virtual* rexp);
34  void insert_weight(vcsn::algebra::semiring_virtual* sem);
35  void insert_zero(vcsn::algebra::krat_exp_virtual* rexp);
36  void insert_token(int i, std::string* str);
37  int parse(vcsn::algebra::krat_exp_virtual& rexp, std::string& error);
38 
39  token_queue* tok_q_;
40  };
41 } // vcsnyy
42 
43 #endif // VCSN_ALGEBRA_IMPLEMENTATION_SERIES_KRAT_EXP_PARSER_PRIVATE_HH