- Added some stuff to MANIFEST.SKIP
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / XMI / Parser / V10.pm
CommitLineData
93f4a354 1package SQL::Translator::XMI::Parser::V10;
2
3# -------------------------------------------------------------------
821a0fde 4# $Id$
93f4a354 5# -------------------------------------------------------------------
6# Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>,
7#
8# This program is free software; you can redistribute it and/or
9# modify it under the terms of the GNU General Public License as
10# published by the Free Software Foundation; version 2.
11#
12# This program is distributed in the hope that it will be useful, but
13# WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15# General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
19# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20# 02111-1307 USA
21# -------------------------------------------------------------------
22
23=pod
24
25=head1 NAME
26
27SQL::Translator::XMI::Parser::V10 - Version 1.0 parser.
28
29=cut
30
31use strict;
32use 5.006_001;
33use vars qw/$VERSION/;
821a0fde 34$VERSION = sprintf "%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/;
93f4a354 35
36use base qw(SQL::Translator::XMI::Parser);
37
38my $spec10 = {};
39
40$spec10->{class} = {
41 name => "class",
42 plural => "classes",
43 isRoot => 1,
44 default_path => '//Foundation.Core.Class[@xmi.id]',
45 attrib_data => [],
46 path_data => [
47 {
48 name => "name",
49 path => 'Foundation.Core.ModelElement.name/text()',
50 },
51 {
52 name => "visibility",
53 path => 'Foundation.Core.ModelElement.visibility/@xmi.value',
54 },
55 {
56 name => "isSpecification",
57 path => 'Foundation.Core.ModelElement.isSpecification/@xmi.value',
58 },
59 {
60 name => "isRoot",
61 path => 'Foundation.Core.GeneralizableElement.isRoot/@xmi.value',
62 },
63 {
64 name => "isLeaf",
65 path => 'Foundation.Core.GeneralizableElement.isLeaf/@xmi.value',
66 },
67 {
68 name => "isAbstract",
69 path => 'Foundation.Core.GeneralizableElement.isAbstract/@xmi.value',
70 },
71 {
72 name => "isActive",
73 path => 'Foundation.Core.Class.isActive/@xmi.value',
74 },
75 ],
76 kids => [
77 {
78 name => "attributes",
79 path =>
80 'Foundation.Core.Classifier.feature/Foundation.Core.Attribute',
81 class => "attribute",
82 multiplicity => "*",
83 },
84 # {
85 # name => "operations",
86 # path => "UML:Classifier.feature/UML:Operation",
87 # class => "operation",
88 # multiplicity => "*",
89 # },
90 ],
91};
92
93$spec10->{attribute} = {
94 name => "attribute",
95 plural => "attributes",
96 default_path => '//Foundation.Core.Attribute[@xmi.id]',
97 path_data => [
98 {
99 name => "name",
100 path => 'Foundation.Core.ModelElement.name/text()',
101 },
102 {
103 name => "visibility",
104 path => 'Foundation.Core.ModelElement.visibility/@xmi.value',
105 },
106 {
107 name => "isSpecification",
108 path => 'Foundation.Core.ModelElement.isSpecification/@xmi.value',
109 },
110 {
111 name => "ownerScope",
112 path => 'Foundation.Core.Feature.ownerScope/@xmi.value',
113 },
114 {
115 name => "initialValue",
116 path => 'Foundation.Core.Attribute.initialValue/Foundation.Data_Types.Expression/Foundation.Data_Types.Expression.body/text()',
117 },
118 #{
119 # name => "datatype",
120 # path => 'xmiDeref(Foundation.Core.StructuralFeature.type/Foundation.Core.Classifier)/Foundation.Core.DataType/Foundation.Core.ModelElement.name/text()',
121 #},
122 ],
123};
124
125__PACKAGE__->XmiSpec($spec10);
126
127#-----------------------------------------------------------------------------
128
129sub get_classes {
130 print "******************* HELLO 1.0 ********************\n";
131 shift->_get_classes(@_);
132}
133
1341; #===========================================================================
135
136__END__
137
138=head1 SYNOPSIS
139
140=head1 DESCRIPTION
141
142=head1 SEE ALSO
143
144perl(1).
145
146=head1 TODO
147
148=head1 BUGS
149
150=head1 VERSION HISTORY
151
152=head1 AUTHOR
153
154grommit <mark.addison@itn.co.uk>
155
156=head1 LICENSE
157
158This package is free software and is provided "as is" without express or
159implied warranty. It may be used, redistributed and/or modified under the
160terms of either;
161
162a) the Perl Artistic License.
163
164See F<http://www.perl.com/perl/misc/Artistic.html>
165
166b) the terms of the GNU General Public License as published by the Free Software
167Foundation; either version 1, or (at your option) any later version.
168
169=cut