]> git.tuebingen.mpg.de Git - paraslash.git/commit
Version 2 moods.
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 11 Jul 2017 14:08:32 +0000 (16:08 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Sun, 20 Aug 2017 13:57:03 +0000 (15:57 +0200)
commit3d3a2f50a05501cf27f1155629799953f952bd4b
tree70624015e3827d271434934ed9fa836bb85ff491
parenta61e862450dc1e74394bf5bbf7002d9947f98d31
Version 2 moods.

This introduces a context-free grammar for moods. The parser for the
corresponding language (the version 2 mood parser) is generated by
flex and bison and will eventually replace the open-coded parser for
traditional (version 1) moods. Those are still supported, but the
server now logs a deprecation warning when a version 1 mood is loaded,

Loading a version 2 mood is a two step procedure. In the first step the
bison parser reads the mood definition stored in the moods table of the
afs database. If there are no errors, the parser returns an abstract
syntax tree which represents the syntactic structure of the mood
definition. In the second step the abstract syntax tree is evaluated
for each row of the audio file table in turn. If the evaluation
function returns true, the audio file is considered admissible. In
this case a reference to the row is added to the score table in the
same way the version 1 mood parser stores the set of admissible files.

The commit adds the following new files to the repository:

* yy/mp.lex: the lexer
* yy/mp.y: the bison parser
* yy/makefile: rules for building the parser, included from main Makefile
* mp.c: frontend (high-level API) and backend (helpers for yy/mp.[ch])
* mp.h: backend data structures and function prototypes

The frontend is only needed in the existing mood.c, which now also
contains the declarations of the frontend API so that mp.h needs only
be included by the lexer and the parser.

The comment at the top of mp.c gives an overview of the mood parser
API. All non-static functions of mp.c (both frontend and backend)
are fully documented. The section on moods of the user manual has
been rewritten and extended.

Since flex and bison are required to build para_server, the list
of optional software packages now mentions these tools, with links
to their home page. If either tool is not installed, the configure
script succeeds but para_server will not be built.
13 files changed:
Makefile.in
Makefile.real
afs.c
configure.ac
error.h
mood.c
mood.h
mp.c [new file with mode: 0644]
mp.h [new file with mode: 0644]
web/manual.md
yy/makefile [new file with mode: 0644]
yy/mp.lex [new file with mode: 0644]
yy/mp.y [new file with mode: 0644]