NAME

Text::Flowchart::Lingua - A simple language for Text::Flowchart

SYNOPSIS

use Text::Flowchart::Lingua;
my $p = Text::Flowchart::Lingua->new();

# Parse the program
$p->parse($program);

# Draw the chart
print $p->render;

# Tokenize the source code
print $p->tokenize;

# Print translated code
print $p->debug;

DESCRIPTION

Text::Flowchart is a tool for generating flowcharts in ASCII style. However, users have to process some repeated things themselves, such as variable declaration, parentheses. As to this point, Text::Flowchart::Lingua defines a simple language for users to create text flowcharts much easier.

This module provides two styles of interface for users to choose, as shown in SYNOPSIS.

Now, let's get down to the language. See an example.

Initialize a flowchart.

init : width => 50, directed => 0;

Let 'begin' be a box.

begin = box :
        string  => "BEGIN",
        x_coord => 0,
        y_coord => 0,
        width   => 9,
        y_pad   => 0
;

Let 'end' be another box.

end = box :
        string => "OMEGA",
        x_coord => 15,
        y_coord => 0
;

Draw a line from 'begin' to 'end'

relate
      : begin bottom
      : end top
;

For details of the functions and parameters, see Text::Flowchart

NOTES

  • Variables does not come with the dollar sign ($).

  • Users can treat an initialized variable as a function for modification variable's attributes

  • Users can insert comments quoted by /* and */

  • Arguments are grouped by ':'

  • Every statement should be ended with a semicolon.

SEE ALSO

Text::Flowchart

CAVEATS

This is an experimental. Use it at your own risk.

TO DO

Error handling

COPYRIGHT

xern <xern@cpan.org>

This module is free software; you can redistribute it or modify it under the same terms as Perl itself.