File: go-export-prolog.pl

package info (click to toggle)
libgo-perl 0.15-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 8,104 kB
  • ctags: 1,560
  • sloc: perl: 13,147; sh: 21; makefile: 7
file content (50 lines) | stat: -rwxr-xr-x 922 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/local/bin/perl -w

use strict;
use GO::Parser;
use Getopt::Long;
use Data::Dumper;

my $opt = {};
GetOptions($opt,
           "format|p=s",
           "handler|h=s",
           "force_namespace=s",
           "replace_underscore",
           "litemode|l",
           "multifile",
           "expand|e");

my @fns = @ARGV;

my $fmt = $opt->{format};

my $parser =
  new GO::Parser (format=>$fmt, handler=>'prolog');
if ($opt->{force_namespace}) {
    $parser->force_namespace($opt->{force_namespace});
}
if ($opt->{replace_underscore}) {
    $parser->replace_underscore(' ');
}
$parser->litemode(1) if $opt->{litemode};
if ($opt->{multifile}) {
    print <<EOM
:- multifile class/2, subclass/2, restriction/3, def/2, belongs/2.
restriction(id,type,to):- fail.
EOM
      ;
}
$parser->parse (@fns);

=head1 NAME

go-export-prolog - exports to prolog

=head1 DESCRIPTION

Exports to prolog

=head1 SEE ALSO

L<go-perl>