|
Constraint Dependency Grammar
|
The CDG Reference Manual
0.95
Purpose of this documentThis document is a thorough description of all data structures and functions used in the CDG system and serves as a technical documentation of the parser.
Most of the core functionality is exported by the modules in the directory
OverviewTheCDG library is organized into several modules each of which offers a specialized service to the environment. The set of all modules can be further divided into those offering the basic infrastructure for CDG parsing whereas others are build on top and offer the different parsing flavours that are available.Basic Modules
Parsing Flavours
General guidelinesFile structureEvery module consists of a declaration part<moduleName>.h and an implementation part <moduleName>.c . Another module can use the exported services of this modules by including its declarations in <moduleName>.h . Note that many of the functions covered in this manual are not exported and therefore cannot be used from other modules at all. The files skel.c and skel.h provide a skeleton for a new module.Terms used in this documentWhile some of the functions in thelibcdg library explicitly use variable-length argument lists, other have a prototype like the following: int no, char **args In this case it is always assumed that args is an array of valid zero-terminated strings, and that no specifies the number of these strings. This is an alternate way of passing a varying number of additional arguments. The strings contained in the array are called command words in this document to distinguish them from the actual function arguments. Coding styleMost identifiers of data structures and algorithms are complete English phrases such as `ConstraintNet' or `printLexiconItem'. When a module deals primarily with one data structure, it is common practice to abbreviate the name of this structure and use it as a prefix to all exported identifiers, as in `lvNew', `lvPrint', and `lvDelete' (rather than `newLevelValue', `printLevelValue', and `deleteLevelValue').
To avoid the explicit use of pointer variables, most modules export
typedef struct { String id; Boolean active; int counter; } SectionStruct; typedef SectionStruct *Section;
Although ANSI C allows the programmer to collapse these two
One consequence of this definition style is that although very few pointer symbols are used in the code, most A more practical demonstration of the coding style is given in Skel - A Skeleton Module. CDG 0.95 (28 Oct 2004) A printable manual his here: libcdg-refman.pdf: | |