module Prec:Prec implements precedence relation grammars.sig
..end
author: Jeff Heinz
last updated: June 2, 2007
This page explains how to use the prec
command line executable.
Prec implements precedence relation grammars.
Like other OCaML executables, the program is run by typing ./prec
or
ocamlrun prec
at the command prompt. If you compiled using ocamlopt
then you can just type prec
. Generally it is invoked as follows.
prec subcommand
options
The output of the prec
command is always written to standard output.
Therefore it is possible to pipe it |
to other commands or direct it >
to a file.
By itself prec
will not do anything-- the argument subcommand
is mandatory.
The subcommand
arguments recognized by prec
are shown in the list below.
A brief description of each subcommand is given.
accepts
: prec accepts precfile word
options returns true if the
precedence grammar in precfile
accepts word
. find
: prec find file
options prints to standard output the precedence relations in
file. The option -c
provides counts of the precedence relations. If
no input file is specified, prec
reads from standard input.2fsa
: prec 2fsa file
converts the precedence grammar in file to a fsa
(readable with the fsa
command). If
no input file is specified, prec
reads from standard input.Following the first argument (the main command) you can optionally list as many of the following flags as you like (separated by spaces):
-d delim
specifies how segments are delimited in the string representation of a word (default ""
).-b B
specifies the word boundary symbol as B
.