Obix programming language manual


Table of Contents

Preface
What is Obix?
About this manual
I. Fundamental concepts
1. Root software elements
Type
Object
Factory
Service
Summary
2. Source code
Source code files
Libraries
3. Simple example
II. Concepts for more reliable code
4. Contract Programming, also called Design by Contract (TM)
5. Testing
6. Void values
7. Object immutability
8. Static typing
9. Generic types
10. Feature redefinition
11. Runtime error handling
Introduction
Program error
Resource error
User input error
See also
12. Type inheritance
13. Source code templates
14. Enumerated data type
15. Embedded Java source code
III. Language reference
16. Syntax
Case sensitivity
Identifiers
Simple identifier
Prefixed identifier
Comments
Single-line comment
Multi-line comment
Line continuation
Literals
String literal
Integer literal
Yes_no literal
Character literal
Void literal
17. Root software elements (RSEs)
Type
Factory
Service
18. RSE features
Attribute
Command
Creator
Event
19. Scripts
Introduction to scripts
Command script
Attribute get script
Attribute set script
Check scripts
attribute_check script
Attribute check script
Command in_check script
Input argument check script
Command out_check script
Output argument check script
Default scripts
Attribute default script
Input argument default script
test script
20. Script instructions
Assignments
Variable declaration instruction
Constant declaration instruction
Assignment instruction
Assignment tail
Script execution
Object command execution instruction
Script execution instruction
Script execution tail
Flow control
if then else instruction
case type of instruction
exit script instruction
Loops
repeat while instruction
repeat for each instruction
repeat from to instruction
repeat times instruction
repeat forever instruction
repeat tail
exit repeat instruction
next repeat instruction
Events
generate event instruction
on event instruction
stop event handler instruction
Error handling
check instruction
check script instruction
error instruction
condition
error info
Testing
test instruction
verify instruction
verify error instruction
Embedded Java source code
java instruction
21. Expressions and operators

List of Figures

1.1. Obix programming language: types, factories, services
10.1. Integer types
10.2. Inheritance path of type_id
12.1. T2 inherits from T1
12.2. Additional features in a child type
12.3. Multiple type inheritance
12.4. Nested type inheritance
12.5. Repeated type inheritance
12.6. Cyclic type inheritance
17.1. Types, factories and creators
18.1. Command
18.2. Events
19.1. Script

List of Tables

2.1. Source code file name prefixes
4.1. Links for how to code Contract Programming
9.1. Generic type syntax
9.2. Generified type syntax
9.3. 'On the fly' generified type syntax
9.4. Generic factory syntax
9.5. Generified factory syntax
9.6. 'On the fly' generified factory syntax
11.1. Types of program errors
13.1. Source code template syntax
13.2. Source code template selector syntax
14.1. Enumerated type
14.2. Data of enumerated values
16.1. Identifier
16.2. Prefixed identifier
16.3. Quoted string literal syntax
16.4. Triple apostrophed string literal syntax
16.5. Triple quoted string literal syntax
16.6. Integer literal
16.7. Yes_no literal
16.8. Character literal
16.9. Void literal
17.1. Type
17.2. Factory
17.3. Service
18.1. Attribute
18.2. Attribute properties
18.3. default value for property setable
18.4. attribute_check
18.5. Attribute property kind
18.6. Attribute property setable
18.7. Command
18.8. Command properties
18.9. Command input and output argument properties
18.10. Additional command input argument property
18.11. Creator
18.12. Additional creator property
19.1. Categories and kinds of scripts
19.2. Script execution syntax
19.3. Command script selector
19.4. Definition of command/creator input and output arguments.
19.5. Definition of command/creator instructions.
19.6. Attribute get script selector
19.7. Attribute set script selector
19.8. attribute_check script selector
19.9. Attribute check script selector
19.10. Command in_check script selector
19.11. Input argument check script selector
19.12. Command out_check script selector
19.13. Output argument check script selector
19.14. Attribute default script selector
19.15. Input argument default script selector
19.16. Attribute default script selector
20.1. variable declaration syntax
20.2. constant declaration syntax
20.3. Assignment syntax
20.4. Assignment tail syntax
20.5. Object command execution syntax
20.6. Script execution syntax
20.7. Script execution tail syntax
20.8. if then else variations
20.9. if then else syntax
20.10. case type of syntax
20.11. exit script syntax
20.12. repeat while syntax
20.13. repeat for each syntax
20.14. repeat from to syntax
20.15. repeat times syntax
20.16. repeat forever syntax
20.17. repeat tail syntax
20.18. exit repeat syntax
20.19. next repeat syntax
20.20. generate event syntax
20.21. on event syntax
20.22. stop event handler syntax
20.23. check syntax
20.24. check script syntax
20.25. error syntax
20.26. condition syntax
20.27. error info syntax
20.28. test syntax
20.29. verify syntax
20.30. verify error syntax
20.31. java syntax
21.1. Expression operators
21.2. Expression operators precedence
21.3. Expression syntax

List of Examples

3.1. Simple example of type product
3.2. Simple example of factory product
7.1. Building an immutable list
11.1. Customized program error handling examples
16.1. Identifiers
16.2. Prefixed identifiers
16.3. Single-line comment
16.4. Multi-line comment
16.5. Nested multi-line comment
16.6. Line continuation
16.7. String literals
16.8. Triple apostrophed string literals
16.9. Triple quoted string literals
16.10. Read a string from a file and write it to another file
16.11. Integer literals
16.12. Yes_no literals
16.13. Character literals
16.14. Void literal
17.1. Simple dog
17.2. Type customer
17.3. Type coffee machine
17.4. Factory supplier
17.5. Another factory implementing the same type
17.6. Two creators and a private attribute in a factory
17.7. Creator with additional input argument
17.8. Factory with private command
17.9. Factory supplier using a service
17.10. XML utilities service
18.1. attribute_check example
18.2. A simple logger service
18.3. Check input argument (using an expression)
18.4. Check input argument (using a script)
18.5. Default value for input argument (using an expression)
18.6. Default value for input argument (using a script)
18.7. in_check (using an expression)
18.8. Multiple output arguments
18.9. Creators
18.10. Events in a television delivery stack
19.1. Command in_check script example
19.2. Output argument check script example
19.3. A simple test script example
20.1. Variable declaration examples
20.2. constant declaration examples
20.3. Assignment examples
20.4. Object command execution examples
20.5. Script execution tail examples
20.6. if then else examples
20.7. case type of example
20.8. exit script example
20.9. repeat while example 1
20.10. repeat while example 2
20.11. repeat for each example 1
20.12. repeat for each example 2
20.13. repeat for each example 3
20.14. repeat from to example 1
20.15. repeat from to example 2
20.16. repeat from to example 3
20.17. repeat times example 1
20.18. repeat times example 2
20.19. repeat forever example 1
20.20. repeat forever example 2
20.21. exit repeat example
20.22. next repeat example
20.23. Simple generate event example
20.24. Simple on event example
20.25. check script example
20.26. java example
21.1. Expression examples