diff --git a/TODO b/TODO index 1960232..006a448 100644 --- a/TODO +++ b/TODO @@ -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 diff --git a/man/man1/Parsodus.1.ronn b/man/man1/Parsodus.1.ronn new file mode 100644 index 0000000..e8cb03b --- /dev/null +++ b/man/man1/Parsodus.1.ronn @@ -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) diff --git a/man/man5/Parsodus.5.ronn b/man/man5/Parsodus.5.ronn new file mode 100644 index 0000000..7e4b6df --- /dev/null +++ b/man/man5/Parsodus.5.ronn @@ -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)