Commit a4518c3a authored by Guillaume Leroi's avatar Guillaume Leroi
Browse files

Separate common commands for all types from commands specific to automata.

	* taf-kit/src/common_automaton_commands.hh: New. Add commands specific
	to automata only.
	* taf-kit/src/b_commands.cc,
	* taf-kit/src/common_commands.hh,
	* taf-kit/src/Makefile.am,
	* taf-kit/src/z_commands.cc: Update accordingly.
parent e762214e
2006-07-24 Guillaume Leroi <guillaume.leroi@lrde.epita.fr>
Separate common commands for all types from commands specific to automata.
* taf-kit/src/common_automaton_commands.hh: New. Add commands specific
to automata only.
* taf-kit/src/b_commands.cc,
* taf-kit/src/common_commands.hh,
* taf-kit/src/Makefile.am,
* taf-kit/src/z_commands.cc: Update accordingly.
2006-07-24 Guillaume Leroi <guillaume.leroi@lrde.epita.fr>
Add sub_normalize_here.
......
......@@ -54,10 +54,10 @@ vcsn_tdc_CPPFLAGS = $(AM_CPPFLAGS) \
-DWITH_TWO_ALPHABETS
vcsn_b_SOURCES = $(COMMON_SOURCES) \
ratexp_commands.hh b_commands.cc
ratexp_commands.hh common_automaton_commands.hh b_commands.cc
vcsn_z_SOURCES = $(COMMON_SOURCES) \
ratexp_commands.hh z_commands.cc
ratexp_commands.hh common_automaton_commands.hh z_commands.cc
vcsn_tdc_SOURCES = $(COMMON_SOURCES) \
tdc_commands.cc
......
......@@ -26,6 +26,7 @@
#include "commands.hh"
#include "ratexp_commands.hh"
#include "common_commands.hh"
#include "common_automaton_commands.hh"
/*-------------------.
| Command definition |
......
// common_automaton_commands.hh: this file is part of Vaucanson.
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2006 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
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// The complete GNU General Public Licence Notice can be found as the
// `COPYING' file in the root directory.
//
// The Vaucanson Group consists of people listed in the `AUTHORS' file.
//
#ifndef COMMON_AUTOMATON_COMMANDS_HH
# define COMMON_AUTOMATON_COMMANDS_HH
/**
* @file common_automaton_commands.hh
* @author Guillaume Leroi
* @date Mon Jul 24 16:57:33 2006
*
* @brief Commands declarations and definitions specific for automata.
*
*/
# include "common.hh"
# include CONTEXT_HEADER
# include <vaucanson/xml/XML.hh>
# include <vaucanson/tools/dot_display.hh>
# include <vaucanson/tools/dot_dump.hh>
using namespace CONTEXT_NAMESPACE;
using namespace vcsn;
using namespace vcsn::io;
using vcsn::xml::XML;
# include <cstdlib>
# include <iostream>
# include "getters.hh"
# include "edition_commands.hh"
# include "library_commands.hh"
# include "commands.hh"
# include "commands_macros.hh"
/*---------------------------------------.
| Command definition (RatExp excluded). |
`---------------------------------------*/
DEFINE_IS_PROPERTY_COMMAND (ambiguous);
DEFINE_IS_PROPERTY_COMMAND (normalized);
DEFINE_IS_PROPERTY_COMMAND (realtime);
DEFINE_IS_PROPERTY_COMMAND (standard);
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (realtime));
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (coaccessible));
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (accessible));
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (normalize));
DEFINE_ONE_ARG_COMMAND_TWO_ALGOS (NAME (quotient)
ARG_KIND (aut)
ALGOS (quotient, realtime));
DEFINE_TWO_ARGS_COMMAND (ARG_KIND (aut)
ALGO (sum));
DEFINE_TWO_ARGS_COMMAND (ARG_KIND (aut)
ALGO (product));
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])))
RETURNVALUE (0));
DEFINE_COMMAND (NAME (power)
CODE (int n = atoi (args.args[2]);
automaton_t a = get_aut (args.args[1]);
automaton_t p (a);
for (int i = 1; i < n; ++i)
p = product (p, a))
OUTPUT (automaton_saver (p, string_out (), XML ()))
RETURNVALUE (0));
DEFINE_COMMAND (NAME (standardize)
CODE (automaton_t a = get_aut (args.args[1]);
standardize (a))
OUTPUT (automaton_saver (a, string_out (), XML ()))
RETURNVALUE (0));
#endif // ! COMMON_AUTOMATON_COMMANDS_HH
......@@ -50,62 +50,7 @@ using vcsn::xml::XML;
/*---------------------------------------.
| Command definition (RatExp excluded). |
`---------------------------------------*/
#ifndef WITH_TWO_ALPHABETS
DEFINE_IS_PROPERTY_COMMAND (ambiguous);
DEFINE_IS_PROPERTY_COMMAND (normalized);
DEFINE_IS_PROPERTY_COMMAND (realtime);
DEFINE_IS_PROPERTY_COMMAND (standard);
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (realtime));
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (coaccessible));
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (accessible));
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (normalize));
DEFINE_ONE_ARG_COMMAND_TWO_ALGOS (NAME (quotient)
ARG_KIND (aut)
ALGOS (quotient, realtime));
DEFINE_TWO_ARGS_COMMAND (ARG_KIND (aut)
ALGO (sum));
DEFINE_TWO_ARGS_COMMAND (ARG_KIND (aut)
ALGO (product));
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])))
RETURNVALUE (0));
DEFINE_COMMAND (NAME (power)
CODE (int n = atoi (args.args[2]);
automaton_t a = get_aut (args.args[1]);
automaton_t p (a);
for (int i = 1; i < n; ++i)
p = product (p, a))
OUTPUT (automaton_saver (p, string_out (), XML ()))
RETURNVALUE (0));
DEFINE_COMMAND (NAME (standardize)
CODE (automaton_t a = get_aut (args.args[1]);
standardize (a))
OUTPUT (automaton_saver (a, string_out (), XML ()))
RETURNVALUE (0));
#endif
DEFINE_ONE_ARG_COMMAND (ARG_KIND (aut)
ALGO (trim));
......
......@@ -26,6 +26,7 @@
#include "commands.hh"
#include "ratexp_commands.hh"
#include "common_commands.hh"
#include "common_automaton_commands.hh"
/*-----------------------------.
| Define the set of commands. |
......
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