The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

parse.pl - Run MarpaX::Demo::StringParser::Parser.

SYNOPSIS

parse.pl [options]

        Options:
        -description graphDescription
        -help
        -input_file aGEFileName
        -report_tokens 0 or 1
        -token_file aTokenFileName
        -verbose Integer

Exit value: 0 for success, 1 for failure. Die upon error.

Typical usage:

        perl -Ilib scripts/parse.pl -d '[node]{color:blue; label: "Node name"}' -r 1 -v 1 -t output.tokens

        perl -Ilib scripts/parse.pl -i data/node.04.ge -r 1 -t node.04.tokens
        diffdata/node.04.tokens node.04.tokens

You can use scripts/parse.sh to simplify this process:

        scripts/parse.sh data/node.04.ge node.04.tokens

OPTIONS

o -description graphDescription

Specify a graph description string to parse.

You are strongly encouraged to surround this string with '...' to protect it from your shell.

See also the -input_file option to read the description from a file.

The -description option takes precedence over the -input_file option.

Default: ''.

o -help

Print help and exit.

o -input_file aGEFileName

Read the graph description string from a file.

See also the -description option to read the graph description from the command line.

The whole file is slurped in as 1 graph.

The first lines of the file can start with /\s*#/, and will be discarded as comments.

The -description option takes precedence over the -input_file option.

Default: ''.

o -report_tokens 0 or 1

Report the tokens recognised by the parser.

This is a neat list of what is optionally written if a -token_file is specified.

Default: 0.

o -token_file aTokenFileName

The name of a CSV file of parsed tokens to write.

This is a permanent copy of what is reported if the -report_tokens option is set to 1.

If '', no output file will be written.

Default: ''.

o -verbose Integer

Print more (1, 2) or less (0) progress messages.

Default: 0.