Commit 0c161a99 authored by Florent Terrones's avatar Florent Terrones
Browse files

2006-04-03 Florent Terrones <terron_f@lrde.epita.fr>

	* include/vaucanson/xml/tools.hxx: Add 2006 Copyright.
	* src/tests/xml/xml_geometry_tester.cc: New. Test for the geometry tag.
	* src/tests/xml/tester.sh: Add Geometry test in the script.
	* src/tests/xml/geometry_ref.xml,
	* src/tests/xml/geometry_ref.dot: Add references for the geometry test.
	* src/tests/xml/Makefile.am: Update accordingly.
	* src/vaucanson.xsd: Change 'geometry_xy' to `geometry_state', and
	`geometry_full' to `geometry_global'. Remove attribute edgeStyle from
	the `geometry_global' complexType.
parent 6cce7ac3
2006-04-03 Florent Terrones <terron_f@lrde.epita.fr>
* include/vaucanson/xml/tools.hxx: Add 2006 Copyright.
* src/tests/xml/xml_geometry_tester.cc: New. Test for the geometry tag.
* src/tests/xml/tester.sh: Add Geometry test in the script.
* src/tests/xml/geometry_ref.xml,
* src/tests/xml/geometry_ref.dot: Add references for the geometry test.
* src/tests/xml/Makefile.am: Update accordingly.
* src/vaucanson.xsd: Change 'geometry_xy' to `geometry_state', and
`geometry_full' to `geometry_global'. Remove attribute edgeStyle from
the `geometry_global' complexType.
2006-04-03 Michael Cadilhac <michael.cadilhac@lrde.epita.fr>
 
* include/vaucanson/xml/ios.hxx,
......
......@@ -2,7 +2,7 @@
//
// Vaucanson, a generic library for finite state machines.
//
// Copyright (C) 2005 The Vaucanson Group.
// Copyright (C) 2005, 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
......
......@@ -35,6 +35,8 @@ trans_tester_SOURCES = xml_trans_tester.cc
session_tester_SOURCES = xml_session_tester.cc
geometry_tester_SOURCES = xml_geometry_tester.cc
if XML_CHECK
check_SCRIPTS = \
tester.sh
......@@ -49,7 +51,8 @@ check_PROGRAMS = \
z_min_plus_tester \
fmp_tester \
trans_tester \
session_tester
session_tester \
geometry_tester
CLEANFILES = \
b_result.tmp \
......@@ -67,7 +70,9 @@ CLEANFILES = \
session_result.dot.tmp \
z_max_plus_result.dot.tmp \
r_result.dot.tmp \
z_min_plus_result.dot.tmp
z_min_plus_result.dot.tmp \
geometry_result.tmp \
geometry_result.dot.tmp
endif
......@@ -100,4 +105,6 @@ EXTRA_DIST = \
z_min_plus_ref.xml \
z_ref.xml \
session_ref.xml \
session_ref.dot
session_ref.dot \
geometry_ref.xml \
geometry_ref.dot
digraph vcsn {
label="A { 3 states, 2 edges, #I = 1, #T = 1 }";
node [shape=circle];
"A1" [style=invis,label="",width=.01,height=.01];
"A1" -> "A0" [label="1"];
"A0" [label="0"];
"A3" [style=invis,label="",width=.01,height=.01];
"A2" -> "A3" [label="1"];
"A2" [label="1"];
"A4" [label="2"];
"A0" -> "A2" [label="a"];
"A2" -> "A4" [label="b"];
}
<automaton xmlns="http://vaucanson.lrde.epita.fr">
<label_type>
<monoid generators="letters" type="free">
<generator value="a"/>
<generator value="b"/>
</monoid>
<semiring operations="numerical" set="B"/>
</label_type>
<content>
<states>
<state name="s0"/>
<state name="s1"/>
<state name="s2">
<geometry x="12" y="14"/>
</state>
</states>
<transitions>
<transition src="s0" dst="s1" label="a">
<drawing labelPositionX="1" labelPositionY="2"/>
</transition>
<transition src="s1" dst="s2" label="b"/>
<initial state="s0">
<drawing labelPositionX="10" labelPositionY="3.14"/>
</initial>
<final state="s1">
<drawing labelPositionX="5" labelPositionY="5"/>
</final>
</transitions>
</content>
</automaton>
#!/bin/sh
out=0
for i in b z r z_min_plus z_max_plus fmp trans session; do
for i in b z r z_min_plus z_max_plus fmp trans session geometry; do
prog="./${i}_tester"
$prog output > ${i}_result.tmp
......
// xml_geometry_tester.cc: this file is part of the Vaucanson project.
//
// 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.
//
#include <iostream>
#include <string.h>
#include <vaucanson/boolean_automaton.hh>
#include <vaucanson/tools/dot_dump.hh>
#include <vaucanson/xml/XML.hh>
int main(int argc, char** argv)
{
using namespace vcsn;
using namespace vcsn::xml;
if (argc > 1 && ! strcmp(argv[1], "output"))
{
using namespace vcsn::boolean_automaton;
alphabet_t alpha; alpha.insert('a'); alpha.insert('b');
automaton_t a = new_automaton(alpha);
hstate_t s0 = a.add_state();
hstate_t s1 = a.add_state();
hstate_t s2 = a.add_state();
hedge_t e;
a.set_initial(s0);
a.set_final(s1);
e = a.add_letter_edge(s0, s1, 'a');
a.add_letter_edge(s1, s2, 'b');
a.geometry().edges()[e] = make_pair(1, 2);
a.geometry().states()[s2] = make_pair(12, 14);
a.geometry().initials()[s0] = make_pair(10, 3.14);
a.geometry().finals()[s1] = make_pair(5, 5);
std::cout << automaton_saver(a, io::string_out(), xml::XML());
}
else
{
using namespace vcsn::boolean_automaton;
alphabet_t alpha;
automaton_t a = new_automaton(alpha);
std::cin >> automaton_loader(a, io::string_out(), xml::XML());
vcsn::tools::dot_dump(std::cout, a, "A");
}
}
......@@ -18,7 +18,7 @@ element.
This type is scinded in two parts, since it's irrelevant to set
edgeType for states or coordinates for transitions.
-->
<xs:complexType name="geometry_xy">
<xs:complexType name="geometry_state">
<xs:attribute name="x" type="xs:decimal"/>
<xs:attribute name="y" type="xs:decimal"/>
</xs:complexType>
......@@ -34,16 +34,9 @@ edgeType for states or coordinates for transitions.
<xs:attribute name="direction" type="xs:decimal"/>
</xs:complexType>
<xs:complexType name="geometry_full">
<xs:complexType name="geometry_global">
<xs:attribute name="x" type="xs:decimal"/>
<xs:attribute name="y" type="xs:decimal"/>
<xs:attribute name="edgeStyle">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="line|arc|curve"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="orientation" type="xs:decimal"/>
</xs:complexType>
......@@ -286,7 +279,7 @@ set using the <drawing> tag.
<xs:sequence>
<xs:element name="automaton" type="automaton" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="transducer" type="transducer" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="geometry" type="geometry_full" minOccurs="0"/>
<xs:element name="geometry" type="geometry_global" minOccurs="0"/>
<xs:element name="drawing" type="drawing" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
......@@ -304,7 +297,7 @@ properties can be set with the <drawing> tag.
-->
<xs:complexType name="state">
<xs:sequence>
<xs:element name="geometry" type="geometry_xy" minOccurs="0"/>
<xs:element name="geometry" type="geometry_state" minOccurs="0"/>
<xs:element name="drawing" type="drawing" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
......@@ -369,7 +362,7 @@ Global geometry and drawing properties can be set for all states.
<xs:complexType name="states">
<xs:sequence>
<xs:element name="state" type="state" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="geometry" type="geometry_xy" minOccurs="0"/>
<xs:element name="geometry" type="geometry_state" minOccurs="0"/>
<xs:element name="drawing" type="drawing" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
......@@ -468,7 +461,7 @@ Two possible contents are available, one for automata and one for transducers.
-->
<xs:complexType name="content_automaton">
<xs:sequence>
<xs:element name="geometry" type="geometry_full" minOccurs="0"/>
<xs:element name="geometry" type="geometry_global" minOccurs="0"/>
<xs:element name="drawing" type="drawing" minOccurs="0"/>
<xs:element name="states" type="states"/>
<xs:element name="transitions" type="transitions"/>
......@@ -477,7 +470,7 @@ Two possible contents are available, one for automata and one for transducers.
<xs:complexType name="content_transducer">
<xs:sequence>
<xs:element name="geometry" type="geometry_full" minOccurs="0"/>
<xs:element name="geometry" type="geometry_global" minOccurs="0"/>
<xs:element name="drawing" type="drawing" minOccurs="0"/>
<xs:element name="states" type="states"/>
<xs:element name="transitions" type="transitions_transducer"/>
......@@ -494,7 +487,7 @@ be set.
<xs:sequence>
<xs:element name="label_type" type="type_automaton" minOccurs="0"/>
<xs:element name="content" type="content_automaton"/>
<xs:element name="geometry" type="geometry_full" minOccurs="0"/>
<xs:element name="geometry" type="geometry_global" minOccurs="0"/>
<xs:element name="drawing" type="drawing" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
......@@ -509,7 +502,7 @@ be set.
<xs:sequence>
<xs:element name="label_type" type="type_transducer" minOccurs="0"/>
<xs:element name="content" type="content_transducer"/>
<xs:element name="geometry" type="geometry_full" minOccurs="0"/>
<xs:element name="geometry" type="geometry_global" minOccurs="0"/>
<xs:element name="drawing" type="drawing" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
......
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