samples/uml2sql.yml2
author Volker Birk <vb@pep.foundation>
Sun, 15 Oct 2017 09:05:19 +0200
changeset 16 da8160da8d3e
parent 0 76005e62091d
permissions -rw-r--r--
glob() does not sort any more - adding sorted() function
define operator "†(\w+)" as call "printType" with "name", "%1";
define operator "“(.*?)”" as call "ucase" with "text", "%1";

function "ucase" {
    param "text";

    > «translate(substring($text, 1, 1), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')»
    > «substring($text, 2)»
}

function "printType" {
    param "name";

    choose {
        when '$name/@href = "http://schema.omg.org/spec/UML/2.1/uml.xml#UnlimitedNatural"'
            > INTEGER
        when '$name/@href = "http://schema.omg.org/spec/UML/2.1/uml.xml#String"'
            > VARCHAR
    }
}