tinyap is an abstract and adaptive recursive parser, bound to C (and Java). It is not yet another parser. Tinyap takes some text and an a grammar describing AST as inputs, and outputs another AST that describes the text contents, according to the provided grammar.
This parser is meant to allow quick and easy development of new languages and the corresponding interpreters or compilers, by defining a single tool to parse the source grammar as well as the source text according to the source grammar.
By default, TinyaP knows two grammar forms that allow the user to parse and generate AST for any LL(k) language.
The parser is initially developed in C, and is bound to C++ and Java using the JNI.
Until further request, C++ and Java API are more or less discontinued.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system.
Running `configure' might take a while. While running, it prints some messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with the package.
4. Type `make install' to install the programs and any data files and documentation.
5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution.
Usage: /home/marius/Desktop/tinyap-1.2-1/src/.libs/lt-tinyap [--input,-i [inputFile]] [--output,-o [outputFile]] [--grammar,-g [grammarFile]] [--parse,-p] [--parse-as-grammar,-pag] [--walk, -w [pilotName]] [--help,-h]
--grammar,-g name use this grammar to parse input
"explicit" (default) selects explicit variant
"CamelCasing" selects CamelCasing variant
any other string is a filename to read grammar from
--print-grammar,-pg output the current grammar in `explicit' dialect
argument is the same as above
--input,-i name text source to use
- (default) selects standard input
any other string is a filename to read from
--output,-o name redirect serialized AST output
- (default) selects standard output
any other string is a filename to write to
--parse,-p parse input text
--parse-as-grammar,-pag parse input text and use output AST as new grammar
--walk,-w name walk the current output tree using named ape
(try prettyprint !)
--help,-h display this text
What's New in This Release:
· Tinyap now supports AST "unparsing" (or "reverse parsing").
· This turns AST back to text, with some formatting support.
· It can be useful for data (un)serialization and prettyprinting source code.