DDLP(1)

NAME
ddlp - Data Definition Language Processor

SYNOPSIS
ddlp [-a[1|2|4]] [-f] [-h<file>] file

DESCRIPTION
ddlp processes a ddl-file and generates a dbd-file and a header file with structures and ids for records, fields and keys.
The -a option sets the structure alignment which must match the one used by the C compiler. Specifying the -f options causes ddlp to only generate constants for those fields that are keys. The -h option overrides the default header file name by the one specified by the user.

DATA DEFINITION LANGUAGE GRAMMER

database
    -> "database" name "{" decl {decl} "}"

decl
    -> "data" "file" "[" pagesize "]" name "contains"
       name ";"
    | "key" "file" "[" pagesize "]" name "contains"
       name "." name ";"
    | "define" name expr
    | "sequence" name int [sortorder] "by" int ';'
    | "record" name "{" field {field} [key_decls] "}"

key_decls
    -> primary_key {alternate_key} {foreign_key}

primary_key
    -> "primary" "key" name key_def ";"

alternate_key
    -> "alternate" ["optional"] ["unique"] "key" name
        key_def ";"

foreign_key
    -> "foreign" ["optional"] foreign_keydef name
       "references" name ";"

foreign_keydef
    -> name | name "{" name { "," name } "}"

key_def
    -> "{" key_field { "," key_field } "}"
       "on" "update" action
       "on" "delete" action ";"

key_field
    -> name [sortorder]

sortorder
    -> "asc" | "desc"

action
    -> "restrict" | "cascade"

pagesize
    -> "[" int "]"

field
    -> type name [dimension] ";"

dimension
    -> array {array} [ "variable" "by" name ]

array
    -> "[" integer "]"

type
    -> int_type
    | "signed" int_type
    | "unsigned" int_type
    | float_type
    | struct_type

int_type
    -> "char"
    | "int"
    | "long"

float_type
    -> "float"
    | "double"

struct_type
    -> struct_head [name] "{" field {field} "}" name
       [dimension]

struct_head
    -> "struct"
    | "union"

expr
    -> expr "+" expr
    | expr "-" expr
    | expr "/" expr
    | expr "*" expr
    | "(" expr ")"
    | integer

IDENTIFICATION
Author: Thomas B. Pedersen.
Copyright (c) 1994 Thomas B. Pedersen.

SEE ALSO