Man pages

This commit is contained in:
Robin Jadoul 2017-01-16 14:49:12 +01:00
parent 4e36148c80
commit ebcf1338c9
3 changed files with 104 additions and 2 deletions

9
TODO
View File

@ -28,8 +28,6 @@ K> Parsodus Parsodus parser
-> Table generator (independent of specific tables)???
-> presentation
R> README
R> man pages
-> Error reporting
-> bash completion
@ -41,7 +39,14 @@ R> man pages
-> Generator: logging
-> driver/main: debug flag
-----------------------------------------------------------------------
- MOSTLY DONE -
-----------------------------------------------------------------------
R> README
-----------------------------------------------------------------------
- DONE -
-----------------------------------------------------------------------
R> Precedence resolution in generator
R> man pages

53
man/man1/Parsodus.1.ronn Normal file
View File

@ -0,0 +1,53 @@
Parsodus(1) -- A language agnostic parser generator
============================================================
SYNOPSIS
--------
`Parsodus` [`-d` <outputdir>] [`-l` <language>] [`-n` <parsername>] <inputfile.pds>
DESCRIPTION
-----------
Generate a parser from a Parsodus(5) configuration file
Options:
* `-h`, `--help`:
show a help message and exit
* `--version`:
show program's version number and exit
* `-d` <directory>, `--outputdir`=<directory>:
Output the generated files to this directory
[default: .]
* `-l` <language>, `--lang`=<language>, `--language`=<language>:
The programming language to generate source files for
[default: c++]
* `-n` <parsername>, `--name`=<parsername>:
Use this name for the generated parser, the default is
based on the input file name
EXAMPLES
--------
`Parsodus -l c++ -d lexers -n MyParser parser.pds`
`Parsodus --language c++ --outputdir parsers --name MyParser parser.pds`
AUTHORS
-------
* Thomas Avé
* Robin Jadoul
* Kobe Wullaert
SEE ALSO
--------
Parsodus(5)

44
man/man5/Parsodus.5.ronn Normal file
View File

@ -0,0 +1,44 @@
Parsodus(5) -- Syntax rules for Parsodus .pds files
=================================================
DESCRIPTION
-----------
Input files for Lexesis have a `.pds` extension and have a set of some very simple rules:
Variables in the grammar follow the regular expression `<[a-zA-Z_][a-zA-Z0-9_]*>`, and terminals use the same scheme, except using double quotes instead of angular brackets.
Furthermore, Parsodus uses a couple of key-value associations, including
- *parser*: the parsing algorithm to use
- *terminals*: a whitespace separated list of terminals
- *lexesis* (optional): a reference to a lexesis specification file. If given, terminals will be read from the lexesis file, and should as such not be specified separately in this file.
- *precedence* (optional): a whitespace separated list of `left`, `right`, or `nonassoc` followed by terminals, higher up is a higher precedence
- start: a variable to use as the start symbol
- grammar: a list of rules (see below)
A grammar rule is a variable followed by `::=` followed by a `|`-separated list of rule tails ended with a semicolon. A rule tail is a list of variables and terminals followed by an optional rule name of the form `[name]`.
parser: lalr(1)
terminals:
"A"
start: <s>
grammar:
<s> ::= "A" [single]
| "A" "A" [double]
;
We are building an LALR(1) parser, with replacement rules, both starting from the start-symbol `<s>`, named appropriately `single` and `double`.
Conventionally, terminals are all caps, while variables are lowercase.
AUTHORS
-------
* Thomas Avé
* Robin Jadoul
* Kobe Wullaert
SEE ALSO
--------
Parsodus(1)