Ron Savage > GraphViz2-Marpa > lex.pl

Download:
GraphViz2-Marpa-1.13.tgz

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source  

NAME ^

lex.pl - Run GraphViz2::Marpa::Lexer.

SYNOPSIS ^

lex.pl [options]

        Options:
        -description graphDescription
        -help
        -input_file aDotInputFileName
        -lexed_file aLexedOutputFileName
        -maxlevel logOption1
        -minlevel logOption2
        -report_items Boolean
        -report_stt Boolean
        -stt_file sttFileName
        -timeout seconds
        -type '' or csv or ods

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

OPTIONS ^

-description graphDescription

Read the DOT-style graph definition from the command line.

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: ''.

-help

Print help and exit.

-input_file aDotInputFileName

Read the DOT-style graph definition from a file.

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

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

Default: ''.

See the distro for data/*.dot.

-lexed_file aLexedOutputFileName

Specify the name of a CSV file of lexed tokens to write. This file can be input to the parser.

Default: ''.

The default means the file is not written.

See the distro for data/*.lex.

-maxlevel logOption1

This option affects Log::Handler.

See the Log::Handler docs.

Default: 'notice'.

-minlevel logOption2

This option affects Log::Handler.

See the Log::Handler docs.

Default: 'error'.

No lower levels are used.

-report_items Boolean

Log the items recognised by the lexer.

Default: 0.

-report_stt Boolean

Log the State Transition Table.

Calls Set::FA::Element.report(). Set min and max log levels to 'info' for this.

Default: 0.

-stt_file sttFileName

Specify which file contains the State Transition Table.

Default: ''.

The default value means the STT is read from the source code of GraphViz2::Marpa::Lexer.

Candidate files are '' and 'data/default.stt.csv'.

The type of this file must be specified by the -type option.

If the file name matches /csv$/, the value of the -type option is set to 'csv'.

-timeout seconds

Run the DFA for at most this many seconds.

Default: 10.

-type '' or cvs or ods

Specify the type of the stt_file: '' for internal STT and 'csv' for CSV.

Default: ''.

The default value means the STT is read from the source code of GraphViz2::Marpa::Lexer.

This option must be used with the -stt_file option.

Warning: The 'ods' option is disabled, because I can find no way in LibreOffice to make it operate in ASCII. What happens is that when you type " (i.e. the double-quote character on the keyboard), LibreOffice inserts a different double-quote character, which, when exported as CSV in Unicode format, produces these 3 bytes: 0xe2, 0x80, 0x9c. This means that if you edit the STT, you absolutely must export to a CSV file in ASCII format. It also means that DOT identifiers in (normal) double-quotes will never match the double-quotes in the *.ods file.

syntax highlighting: