Commit ad6dc12c authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

Create vcsn-int-b. (It is not functional yet.)

parent 7e9c6519
2008-07-31 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Create vcsn-int-b. (It is not functional yet.)
* taf-kit/src/Makefile.am: Create vcsn-int-b (without using
libvcsn-int-b since it does not exist yet).
* taf-kit/src/getters.hh, taf-kit/src/getters.hxx (get_word): New
function.
* taf-kit/src/common_automaton_commands.hh (eval): Use it.
* configure.ac: Output taf-kit/tests/.
2008-07-31 Alexandre Duret-Lutz <adl@lrde.epita.fr>
* include/vaucanson/algebra/implementation/letter/int_letter.hxx
......
......@@ -210,6 +210,7 @@ m4_define([VCSN_CONFIG_WRAPPER],
VCSN_CONFIG_WRAPPER([vcsn-char-b])
VCSN_CONFIG_WRAPPER([vcsn-char-fmp])
VCSN_CONFIG_WRAPPER([vcsn-char-z])
VCSN_CONFIG_WRAPPER([vcsn-int-b])
......
......@@ -16,7 +16,8 @@ include $(top_srcdir)/vaucanson.mk
AM_CPPFLAGS += $(CXXFLAGS_OPTIMIZE)
AM_LDFLAGS = $(TERMLIBS)
bin_PROGRAMS = vcsn-char-b vcsn-char-z vcsn-char-fmp
bin_PROGRAMS = vcsn-char-b vcsn-char-z vcsn-char-fmp \
vcsn-int-b
COMMON_SOURCES = commands.hh \
commands_macros.hh \
......@@ -70,6 +71,14 @@ vcsn_char_fmp_LDADD = $(LDADD) \
$(top_builddir)/lib/libvcsn-fmp-tdc.la \
$(top_builddir)/lib/libkrat_exp.la
vcsn_int_b_SOURCES = $(COMMON_SOURCES) \
ratexp_commands.hh \
common_automaton_commands.hh \
b_commands.cc
vcsn_int_b_CPPFLAGS = $(AM_CPPFLAGS) -DCONTEXT=int_boolean_automaton
vcsn_int_b_LDADD = $(LDADD) \
$(top_builddir)/lib/libkrat_exp.la
## ------ ##
## argp. ##
......
......@@ -2,7 +2,7 @@
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006 The Vaucanson Group.
// Copyright (C) 2006, 2008 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
......@@ -105,10 +105,11 @@ DEFINE_TWO_ARGS_COMMAND (ARG_KIND (aut)
ALGO (concatenate));
DEFINE_COMMAND (NAME (eval)
CODE (/* Empty */)
OUTPUT (
eval (realtime (get_aut (args.args[1])),
std::string (args.args[2])) << std::endl)
CODE (
automaton_t a = realtime (get_aut (args.args[1]));
bool b = eval (a, get_word (a, args.args[2])).value();
)
OUTPUT (b)
RETURNVALUE (0));
DEFINE_COMMAND (NAME (power)
......
......@@ -2,7 +2,7 @@
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006 The Vaucanson Group.
// Copyright (C) 2006, 2008 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
......@@ -58,6 +58,9 @@ static rat_exp_t get_exp_complete (const std::string& exp,
static automaton_t get_aut (const std::string& s);
template <class S, class T>
static std::basic_string<letter_t>
get_word(Element<S, T>& aut, const std::string& s);
# include "getters.hxx"
......
......@@ -2,7 +2,7 @@
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006 The Vaucanson Group.
// Copyright (C) 2006, 2008 The Vaucanson Group.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
......@@ -206,4 +206,20 @@ static boolean_automaton::automaton_t get_boolean_aut(std::string s)
}
#endif // !WITH_TWO_ALPHABETS
template <class S, class T>
static std::basic_string<letter_t>
get_word(Element<S, T>& aut, const std::string& s)
{
Element<monoid_t, std::basic_string<letter_t> > w(aut.structure().series().monoid());
std::string::const_iterator i = s.begin();
if (!parse_word(w, s, i, std::set<char>()))
{
std::cerr << "FATAL: Cannot parse " << s << std::endl;
exit(1);
}
return w.value();
}
#endif // ! GETTERS_HXX
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment