ooc v0.2.1 ninja Language Reference

Amos Wenger

This is the reference language manual for ooc v0.2.1 ninja. It should be used as a reliable reference for implementation and dispute about the use of the ooc programming language.

Distributed under the terms of the GNU Free Documentation License v1.3


Table of Contents
Preface
1. Variables
Types
Syntax
Types from C
Covers
Arrays
Raw C arrays
The Array class
Pointers
2. Functions
Definition
Syntax
Same name, different arguments
The main function: entry point
Calling functions
Callbacks and pointers
Simple case
Pointer to member functions
Covers
3. Classes
Syntax
Definition
Instanciation
Static fields
Inheritance
Constructors, super-constructors
Abstract class and functions
Getters, setters
Pointers to member functions
Reflection
4. Statements
loops
classic for
for in ranges
foreach
while
conditionals
if, else
switch, case
flow control
break, continue
5. Operators
6. Packages, headers, libraries
ooc packages
C headers
Automagic library management
A. ABI (Application Binary Interface)
Types
Classes
Structs in memory
Order of fields in structs
Functions and constructors
Static fields
Name mangling
B. FAQ (Frequently Asked Questions)
C. How to contribute
D. Links
E. GNU Free Documentation License
List of Tables
1-1. Correspondance tables of types in C, Java, and ooc.
5-1. Table of reference of the ooc operators