---
name: "sdf2table"
section: "1"
platform: "linux"
package: "xt-sdf2"
version: "2.0.1-3"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/sdf2table"
---

# sdf2table(1)

generate parse tables from SDF2 language definitions

## NAME

SDF2TABLE - generate parse tables from SDF2 language definitions

## SYNOPSIS

**sdf2table** \[-**bh**\] \[-**i** *file*\] \[-**l**\] \[-**m** *name*\] \[-**n**\] \[-**o** *file*\] \[-**tvVx**\] file0 ...

## DESCRIPTION

**sdf2table** parses SDF2 syntax definitions, normalizes them to Kernel SDF2, and constructs the corresponding parse table.

A number of options can be supplied; these are as follows:\

- **-b**

  Write term output in BAF (Binary ATerm) format. This is the default.\

- \-**h**

  Displays concise usage information.\

- \-**i** *file*

  Read input from *file*; by default, input is either read from stdin, or from the named files supplied as arguments.\

- \-**l**

  Displays statistic information.\

- \-**m** *name*

  Use *name* as top module when generating a parse table.\

- \-**n**

  Generated only normalized grammar.\

- \-**o** *file*

  Write output to *file*.  By default, output is written to file with a name derived from the name of the input file for named files, and to standard output on input from standard input.\

- **-t**

  Write term output in plain text format.\

- **-v**

  Operate in verbose mode.\

- **-V**

  Returns the current version number.

## USAGE

## EXAMPLES

```
    $ sdf2table test.sdf
```

## EXIT STATUS

## SEE ALSO

the *sglr* manpage, the *ParseTable-Generator* manpage

## KNOWN BUGS

## NOTES

Expected input for sdf2table is a full, flattened SDF2 specification in a single file.  In such a file, all modules for the language defined are present; each module is identified by "module \<ModuleName\>", and at the top the keyword "definition" identifies the consecutive list of modules as a full SDF2 specification.

The normalizer expects a top-level module to be present by the name of "Main".  Failure to include such a module will yield the parse table for the empty grammar.

## AUTHOR

Mark van den Brand \<Mark.van.den.Brand@cwi.nl\>
