summary refs log blame commit diff stats
path: root/doc/uml/generation_settings
blob: 8cd2bc141a303b8916c5da77ed67b1f803fe0d95 (plain) (tree)





















































































































































































































































































































                                                                                                                                                         
  python_default_defs 
  cpp_h_extension "h" cpp_src_extension "cpp" java_extension "java" php_extension "php" python_extension "py" idl_extension "idl"
  cpp_inline_dont_force_incl_in_h

  type_forms 15 // uml cpp java idl cpp_in cpp_out cpp_inout cpp_return
    "void" "void" "void" "void" "${type}" "${type} &" "${type}" "${type}"
    "any" "void *" "Object" "any" "const ${type}" "${type}" "${type} &" "${type}"
    "bool" "bool" "boolean" "boolean" "${type}" "${type} &" "${type} &" "${type}"
    "char" "char" "char" "char" "${type}" "${type} &" "${type} &" "${type}"
    "uchar" "unsigned char" "char" "octet" "${type}" "${type} &" "${type} &" "${type}"
    "byte" "unsigned char" "byte" "octet" "${type}" "${type} &" "${type} &" "${type}"
    "short" "short" "short" "short" "${type}" "${type} &" "${type} &" "${type}"
    "ushort" "unsigned short" "short" "unsigned short" "${type}" "${type} &" "${type} &" "${type}"
    "int" "int" "int" "long" "${type}" "${type} &" "${type} &" "${type}"
    "uint" "unsigned int" "int" "unsigned long" "${type}" "${type} &" "${type} &" "${type}"
    "long" "long" "long" "long" "${type}" "${type} &" "${type} &" "${type}"
    "ulong" "unsigned long" "long" "unsigned long" "${type}" "${type} &" "${type} &" "${type}"
    "float" "float" "float" "float" "${type}" "${type} &" "${type} &" "${type}"
    "double" "double" "double" "double" "${type}" "${type} &" "${type} &" "${type}"
    "string" "string" "String" "string" "${type}" "${type} &" "${type} &" "${type}"
  
  relations_stereotypes 5 // uml cpp java pythonidl
    "sequence" "vector" "Vector" "list" "sequence"
    "vector" "vector" "Vector" "list" "sequence"
    "list" "list" "List" "list" "sequence"
    "set" "set" "Set" "set" "sequence"
    "map" "map" "Map" "dict" "sequence"
  
  classes_stereotypes 14 // uml cpp java php python idl
    "class" "class" "class" "class" "class" "valuetype"
    "interface" "class" "interface" "interface" "class" "interface"
    "exception" "class" "class" "class" "class" "exception"
    "enum" "enum" "enum" "enum" "enum" "enum"
    "enum_pattern" "enum" "enum_pattern" "enum" "enum" "enum"
    "struct" "struct" "class" "class" "class" "struct"
    "union" "union" "class" "class" "class" "union"
    "typedef" "typedef" "ignored" "ignored" "ignored" "typedef"
    "boundary" "class" "class" "class" "class" "interface"
    "control" "class" "class" "class" "class" "valuetype"
    "entity" "class" "class" "class" "class" "valuetype"
    "actor" "ignored" "ignored" "ignored" "ignored" "ignored"
    "@interface" "ignored" "@interface" "ignored" "ignored" "ignored"
    "stereotype" "ignored" "ignored" "ignored" "ignored" "ignored"
  
  cpp_enum_default_type_forms "${type}" "${type} &" "${type} &" "${type}" // in out inout return
  other_cpp_types_default_type_forms "const ${type} &" "${type} &" "${type} &" "${type}" // in out inout return

  cpp_default_h_content "#ifndef ${NAMESPACE}_${NAME}_H
#define ${NAMESPACE}_${NAME}_H

${comment}
${includes}
${declarations}
${namespace_start}
${definition}
${namespace_end}
#endif
"
  cpp_default_src_content "${comment}
${includes}
${namespace_start}
${members}
${namespace_end}"
  cpp_default_class_decl "${comment}${template}class ${name}${inherit} {
${members}};
${inlines}
"
  cpp_default_external_class_decl "${name}
#include <${name}.h>
"
  cpp_default_struct_decl "${comment}${template}struct ${name}${inherit} {
${members}};
${inlines}
"
  cpp_default_union_decl "${comment}${template}union ${name} {
${members}};
${inlines}
"
  cpp_default_enum_decl "${comment}enum ${name} {
${items}
};
"
  cpp_default_typedef_decl "${comment}typedef ${type} ${name};
"
  cpp_default_attribute_declaration "    ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};
" // multiplicity 1
  "    ${comment}${static}${mutable}${volatile}${const}${stereotype}<${type}> ${name}${value};
" // multiplicity * a..b
  "    ${comment}${static}${mutable}${volatile}${const}${type} ${name}${multiplicity}${value};
" // multiplicity [..]
  cpp_default_enum_item_declaration "  ${name}${value},${comment}"
  cpp_association_aggregation_declaration
    "    ${comment}${static}${mutable}${volatile}${const}${type} * ${name}${value};
" // multiplicity 1
    "    ${comment}${static}${mutable}${volatile}${const}${stereotype}<${type} *> ${name}${value};
" // multiplicity * a..b
    "    ${comment}${static}${mutable}${volatile}${const}${type} * ${name}${multiplicity}${value};
" // multiplicity [..]
  cpp_aggregation_by_value_declaration
    "    ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value};
" // multiplicity 1
    "    ${comment}${static}${mutable}${volatile}${const}${stereotype}<${type}> ${name}${value};
" // multiplicity * a..b
    "    ${comment}${static}${mutable}${volatile}${const}${type} ${name}${multiplicity}${value};
" // multiplicity [..]
  cpp_get "get_${name}" inline const value_const public
  cpp_set "set_${name}" public
  cpp_default_operation_declaration "    ${comment}${friend}${static}${inline}${virtual}${type} ${name}${(}${)}${const}${volatile}${throw}${abstract};
"
  cpp_default_operation_definition "${comment}${inline}${type} ${class}::${name}${(}${)}${const}${volatile}${throw}${staticnl}{
  ${body}}
"
  java_default_src_content "${comment}
${package}
${imports}
${definition}"
  java_default_class_decl "${comment}${@}${visibility}${final}${abstract}class ${name}${extends}${implements} {
${members}}
"
  java_default_external_class_decl "${name}"
  java_default_interface_decl "${comment}${@}${visibility}interface ${name}${extends} {
${members}}
"
  java5_default_enum_decl "${comment}${@}${visibility}${final}${abstract}enum ${name}${implements} {
${items};
${members}}
"
  java_default_enum_decl "${comment}${@}${visibility}final class ${name} {
${members}
  private final int value;

  public int value() {
    return value;
  }

  public static ${name} fromInt(int value) {
    switch (value) {
${cases}    default: throw new Error();
    }

  }
  private ${name}(int v) { value = v; };
}
"
  java_default_attribute_declaration "  ${comment}${@}${visibility}${static}${final}${transient}${volatile}${type} ${name}${value};
" // multiplicity 1
  "  ${comment}${@}${visibility}${static}${final}${transient}${volatile}${stereotype}<${type}> ${name}${value};
" // multiplicity * a..b
  "  ${comment}${@}${visibility}${static}${final}${transient}${volatile}${type}${multiplicity} ${name}${value};
" // multiplicity N
  java5_default_enum_item_declaration "  ${@}${name}${value},${comment}"
  java_default_enum_item_declaration "  ${comment}${@}public static final int _${name}${value};
public static final ${class} ${name} = new ${class}(_${name});
"
  java_default_enum_case "    case _${name}: return ${name};
"
  java_association_aggregation_declaration
    "  ${comment}${@}${visibility}${static}${final}${transient}${volatile}${type} ${name}${value};
" // multiplicity 1
    "  ${comment}${@}${visibility}${static}${final}${transient}${volatile}${stereotype}<${type}> ${name}${value};
" // multiplicity * a..b
    "  ${comment}${@}${visibility}${static}${final}${transient}${volatile}${type}${multiplicity} ${name}${value};
" // multiplicity N
  java_get "get${Name}" final public
  java_set "set${Name}" public
  java_default_operation_definition "  ${comment}${@}${visibility}${final}${static}${abstract}${synchronized}${type} ${name}${(}${)}${throws}${staticnl}{
  ${body}}
"
  php_default_src_content "<?php
${comment}
${definition}
?>
"
  php_default_class_decl "${comment}${final}${visibility}${abstract}class ${name}${extends}${implements} {
${members}}
"
  php_default_enum_decl "${comment}${visibility}final class ${name} {
${items}}
"
  php_default_external_class_decl "${name}"
  php_default_interface_decl "${comment}${visibility}interface ${name} {
${members}}
"
  php_default_attribute_declaration "  ${comment}${visibility}${const}${static}${var}${name}${value};
"
  php_default_enum_item_decl "  const ${name}${value};${comment}
"
  php_default_relation_declaration"  ${comment}${visibility}${const}${static}${var}${name}${value};
"
  php_get "get${Name}" final
  php_set "set${Name}"
  php_default_operation_definition "  ${comment}${final}${visibility}${abstract}${static}function ${name}${(}${)}
{
  ${body}}
"
  python_2_2
  python_indent_step "    "
  python_default_src_content "${comment}
${import}
${definition}"
  python_default_class_decl "class ${name}${inherit}:
${docstring}${members}
"
  python_default_enum_decl "class ${name}:
${docstring}${members}
"
  python_default_external_class_decl "${name}"
  python_default_attribute_declaration "${comment}${self}${name} = ${value}
" // multiplicity 1
  "${comment}${self}${name} = ${stereotype}()
" // multiplicity != 1
  python_default_enum_item_decl "${comment}${self}${name} = ${value}
"
  python_default_relation_declaration"${comment}${self}${name} = ${value}
" // multiplicity 1
  "${comment}${self}${name} = ${stereotype}()
" // multiplicity != 1
  python_default_composition_declaration"${comment}${self}${name} = ${type}()
" // multiplicity 1
  "${comment}${self}${name} = ${stereotype}()
" // multiplicity != 1
  python_default_operation_definition "${@}${static}${abstract}def ${name}${(}${)}:
${docstring}${body}
"
  python_default_initoperation_definition "${@}${static}${abstract}def ${name}${(}${p0}${v0}${)}:
${docstring}super(${class}, ${p0}).__init__()
${body}
"
  python_get "get${Name}"
  python_set "set${Name}"
  idl_default_src_content "#ifndef ${MODULE}_${NAME}_H
#define ${MODULE}_${NAME}_H

${comment}
${includes}
${module_start}
${definition}
${module_end}
#endif
"
  idl_default_interface_decl "${comment}${abstract}${local}interface ${name}${inherit} {
${members}};
"
  idl_default_valuetype_decl "${comment}${abstract}${custom}valuetype ${name}${inherit} {
${members}};
"
  idl_default_struct_decl "${comment}struct ${name} {
${members}};
"
  idl_default_typedef_decl "${comment}typedef ${type} ${name};
"
  idl_default_exception_decl "${comment}exception ${name} {
${members}};
"
  idl_default_union_decl "${comment}union ${name} switch(${switch}) {
${members}};
"
  idl_default_enum_decl "${comment}enum ${name} {
${items}};
"
  idl_default_external_class_decl "${name}
#include \"${name}.idl\"
"
  idl_default_attribute_declaration "  ${comment}${readonly}${attribute}${type} ${name};
" // multiplicity 1
  "  ${comment}${readonly}${attribute}${stereotype}<${type}> ${name};
" // multiplicity * a..b
  "  ${comment}${readonly}${attribute}${stereotype}<${type},${multiplicity}> ${name};
" // multiplicity N
  idl_default_valuetype_attribute_declaration "  ${comment}${visibility}${type} ${name};
" // multiplicity 1
  "  ${comment}${visibility}${stereotype}<${type}> ${name};
" // multiplicity * a..b
  "  ${comment}${visibility}${stereotype}<${type},${multiplicity}> ${name};
" // multiplicity N
  idl_default_const_declaration "  ${comment}const ${type} ${name}${value};
" // multiplicity 1
  "  ${comment}const ${stereotype}<${type}> ${name}${value};
" // multiplicity * a..b
  "  ${comment}const ${stereotype}<${type},${multiplicity}> ${name}${value};
" // multiplicity N
  idl_default_enum_item_declaration "  ${name},${comment}"
  idl_default_union_item_declaration "  ${comment}case ${case} : ${readonly}${type} ${name};" // multiplicity 1
  "  ${comment}case ${case} : ${readonly}${stereotype}<${type}> ${name};" // multiplicity * a..b
  "  ${comment}case ${case} : ${readonly}${stereotype}<${type},${multiplicity}> ${name};" // multiplicity N
  idl_association_aggregation_declaration
    "  ${comment}${readonly}${attribute}${type} ${name};
" // multiplicity 1
    "  ${comment}${readonly}${attribute}${stereotype}<${type}> ${name};
" // multiplicity * a..b
    "  ${comment}${readonly}${attribute}${stereotype}<${type},${multiplicity}> ${name};
" // multiplicity N
  idl_valuetype_association_aggregation_declaration
    "  ${comment}${visibility}${type} ${name};
" // multiplicity 1
    "  ${comment}${visibility}${stereotype}<${type}> ${name};
" // multiplicity * a..b
    "  ${comment}${visibility}${stereotype}<${type},${multiplicity}> ${name};
" // multiplicity N
  idl_union_association_aggregation_declaration
    "  ${comment}case ${case} : ${readonly}${type} ${name};" // multiplicity 1
    "  ${comment}case ${case} : ${readonly}${stereotype}<${type}> ${name};" // multiplicity * a..b
    "  ${comment}case ${case} : ${readonly}${stereotype}<${type},${multiplicity}> ${name};" // multiplicity N
  idl_get "get_${name}"
  idl_set "set_${name}"  twoways
  idl_default_operation_declaration "  ${comment}${oneway}${type} ${name}${(}${)}${raisesnl}${raises};
"
  uml_get_name uml uml_set_name uml
end
of space. - `read-byte-buffered`: buffered-file -> byte - `read-line-buffered`: buffered-file -> stream - Will abort the entire program if there isn't enough room. - `read-grapheme`: stream -> grapheme - `read-grapheme-buffered`: buffered-file -> grapheme - `read-lines`: buffered-file -> array of strings #### non-IO operations on streams - `populate-stream`: allocates space in a stream for `n` objects of the appropriate type. - Will abort the entire program if `n*b` requires more than 32 bits. - `clear-stream`: resets everything in the stream to `0` (except its `size`). - `rewind-stream`: resets the read index of the stream to `0` without modifying its contents. #### reading/writing hex representations of integers - `is-hex-int?`: slice -> boolean - `parse-hex-int`: string -> int - `parse-hex-int-from-slice`: slice -> int - `is-hex-digit?`: byte -> boolean - `parse-array-of-ints` - `parse-array-of-decimal-ints` #### printing to screen All screen primitives require a screen object, which can be either the real screen on the computer or a fake screen for tests. Mu supports a subset of Unix terminal properties supported by almost all modern terminal emulators. - `enable-screen-type-mode` (default) - `enable-screen-grid-mode` - `clear-screen` - `screen-size` - `move-cursor` - `hide-cursor` - `show-cursor` - `print-string`: string -> screen - `print-stream` - `print-grapheme` - `print-code-point` - `print-int32-hex` - `print-int32-decimal` - `print-int32-decimal-right-justified` - `print-array-of-ints-in-decimal` - `print-float-hex` - `print-float-decimal-approximate`: up to some precision Printing to screen is stateful, and preserves formatting unless explicitly manipulated. - `reset-formatting` - `start-color`: adjusts foreground and background - `start-bold` - `start-underline` - `start-reverse-video` - `start-blinking` Assertions for tests: - `screen-grapheme-at` - `screen-color-at` - `screen-background-color-at` - `screen-bold-at?` - `screen-underline-at?` - `screen-reverse-at?` - `screen-blink-at?` - `check-screen-row` - `check-screen-row-from` - `check-screen-row-in-color` - `check-screen-row-in-color-from` - `check-screen-row-in-background-color` - `check-screen-row-in-background-color-from` - `check-screen-row-in-bold` - `check-screen-row-in-bold-from` - `check-screen-row-in-underline` - `check-screen-row-in-underline-from` - `check-screen-row-in-reverse` - `check-screen-row-in-reverse-from` - `check-screen-row-in-blinking` - `check-screen-row-in-blinking-from` #### keyboard - `enable-keyboard-type-mode`: process keystrokes on `enter` (default mode) - `read-line-from-real-keyboard` - `enable-keyboard-immediate-mode`: process keystrokes as they're typed - `read-key-from-real-keyboard` #### tokenization from a stream: - `next-token`: stream, delimiter byte -> slice - `skip-chars-matching`: stream, delimiter byte - `skip-chars-not-matching`: stream, delimiter byte from a slice: - `next-token-from-slice`: start, end, delimiter byte -> slice - Given a slice and a delimiter byte, returns a new slice inside the input that ends at the delimiter byte. - `skip-chars-matching-in-slice`: curr, end, delimiter byte -> new-curr (in `eax`) - `skip-chars-not-matching-in-slice`: curr, end, delimiter byte -> new-curr (in `eax`) #### miscellaneous sensors and actuators - `open`: filename, write? -> buffered-file - `time`: returns the time in seconds since the epoch. - `ntime`: returns the number of nanoseconds since some arbitrary point. Saturates at 32 bits. Useful for fine-grained measurements over relatively short durations. - `sleep`: sleep for some number of whole seconds and some fraction of a second expressed in nanoseconds. Not having decimal literals can be awkward here.