Source (C
language):
int main(int argc, char* argv[]) {
printf("Hello,
World\n");
<?xml
version="1.0" encoding="UTF-8"?>
<kdm:Segment xmi:version="2.1"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:action="http://kdm.omg.org/action"
xmlns:code="http://kdm.omg.org/code"
xmlns:kdm="http://kdm.omg.org/kdm"
xmlns:source="http://kdm.omg.org/source"
name="HelloWorld Example">
<model xmi:id="id.0" xmi:type="code:CodeModel" name="HelloWorld">
<codeElement
xmi:id="id.1" xmi:type="code:CompilationUnit"
name="hello.c">
<codeElement
xmi:id="id.2" xmi:type="code:CallableUnit"
name="main" type="id.5" kind="regular">
<source xmi:id="id.3" language="C"
snippet="int main(int argc, char* argv[]) {}"/>
<entryFlow
xmi:id="id.4"
to="id.12" from="id.2"/>
<codeElement
xmi:id="id.5" xmi:type="code:Signature"
name="main">
<source xmi:id="id.6" snippet="int main(int argc,
char * argv[]);"/>
<parameterUnit
xmi:id="id.7"
name="argc" type="id.25"
pos="1"/>
<parameterUnit
xmi:id="id.8"
name="argv" type="id.9"
pos="1">
<codeElement
xmi:id="id.9" xmi:type="code:ArrayType">
<itemUnit xmi:id="id.10"
type="id.19"/>
</codeElement>
</parameterUnit>
<parameterUnit
xmi:id="id.11"
type="id.25" kind="return"/>
</codeElement>
<codeElement
xmi:id="id.12" xmi:type="action:ActionElement"
name="a1" kind="Call">
<source xmi:id="id.13" language="C"
snippet="printf("Hello,
World!\n");"/>
<codeElement
xmi:id="id.14" xmi:type="code:Value"
name=""Hello, World!\n"" type="id.19"/>
<actionRelation
xmi:id="id.15" xmi:type="action:Reads"
to="id.14" from="id.12"/>
<actionRelation
xmi:id="id.16" xmi:type="action:Calls"
to="id.20" from="id.12"/>
<actionRelation
xmi:id="id.17" xmi:type="action:CompliesTo"
to="id.20" from="id.12"/>
</codeElement>
</codeElement>
</codeElement>
<codeElement
xmi:id="id.18" xmi:type="code:LanguageUnit">
<codeElement
xmi:id="id.19" xmi:type="code:StringType" name="char
*"/>
<codeElement xmi:id="id.20"
xmi:type="code:CallableUnit" name="printf"
type="id.21">
<codeElement xmi:id="id.21"
xmi:type="code:Signature"
name="printf">
<parameterUnit
xmi:id="id.22"
name="" type="id.25" kind="return"
pos="0"/>
<parameterUnit
xmi:id="id.23"
name="format" type="id.19" pos="1"/>
<parameterUnit
xmi:id="id.24"
name="arguments" kind="variadic"
pos="2"/>
</codeElement>
</codeElement>
<codeElement
xmi:id="id.25" xmi:type="code:IntegerType"
name="int"/>
</codeElement>
</model>
<model xmi:id="id.26" xmi:type="source:InventoryModel" name="HelloWorld">
<inventoryElement
xmi:id="id.27" xmi:type="source:SourceFile"
name="hello.c" language="C"/>
</model>
</kdm:Segment>