le border=1 cellpadding=6> :annotation (or variable declaration) t(e)cast (downcast (need runtime checking)) t(e)cast (upcast) type n is tdeclaration constant Tmutability, constness (type of a constant value) it is the defaultmutability, constness (type of a mutable value)

  • Object Oriented & Reflexivity

    method(parent(dispatching-parameter))accessing parent method
    type c is tagged record ... end recordclass declaration
    dispatching parametercurrent instance
    type child is new parent with record ... end recordinheritance
    Requires instantiation of Ada.Unchecked_Deallocationmanually call an object's destructor
    method(object, para)method invocation
    method(object)method invocation (with no parameter)
    o2.all := o.allobject cloning
    newobject creation
    intesting class membership

  • Package, Module

    package p is
       -- Declare public package members here
    private
       -- Declare private package members here
    end p;
    
    package body p is
     ... -- Define package implementation here
    end p;
    declare
    package p is ... end; package body p is ... end;declare (selective export)
    with p; use p;import (everything into current namespace)
    with p;import (package (ie. load the package))
    with p; use type p.type1; ...import (selectively)
    .package scope

  • Strings

    s(n)accessing n-th character
    'Valascii to character
    'z'character "z"
    'Poscharacter to ascii
    Charactercharacter type name
    'Imageconvert something to a string (see also string interpolation)
    *duplicate n times
    s(n..m)extract a substring
    index / index_non_blank / find_tokenlocate a substring
    index(Going => Backward)locate a substring (starting at the end)
    Putsimple print (on any objects)
    Put_Linesimple print (on strings)
    &string concatenation
    = /=string equality & inequality
    'Lengthstring size
    "..."strings (verbatim)
    Stringtype name
    To_Upper / To_Lowerupper / lower case character
    to_upper / to_loweruppercase / lowercase / capitalized string

    Missing:


    strings (with interpolation)
    strings (end-of-line (without writing the real CR or LF character))
    multi-line
    serialize (marshaling)
    unserialize (un-marshaling)
  • Booleans

    falsefalse value
    notlogical not
    or / andlogical or / and (non short circuit (always evaluates both arguments))
    or else / and thenlogical or / and (short circuit)
    truetrue value
    Booleantype name

  • Bags and Lists

    for v in range loop .. end loopfor each element do something
    a(i)list/array indexing

  • Various Data Types

    Null (81)optional value (null value)
    voptional value (value)
    a .. brange (inclusive .. inclusive)
    .record selector
    ' (82)record selector
    'accessreference (pointer) (creation)
    .[all]reference (pointer) (dereference)
    ( a, b, c )tuple constructor

  • Mathematics

    **exponentiation (power)
    Log / Log(X => val, Base => 10.0)logarithm
    remmodulo (modulo of -3 / 2 is -1)
    modmodulo (modulo of -3 / 2 is 1)
    -negation
    1000., 1E3numbers syntax (decimals)
    1_000numbers syntax (integer thousand-seperator)
    2#1#, 8#7#, 16#f#numbers syntax (integers in base 2, octal and hexadecimal)
    1000numbers syntax (integers)
    sqrt / exp / abssquare root / e-exponential / absolute value
    sin / cos / tantrigonometry (basic)
    asin / acos / atan (88)trigonometry (inverse)
    / Rounding / Floor / Ceilingtruncate / round / floor / ceil

    Missing:


    type name
    addition / subtraction / multiplication / division
    random (random number)
    random (seed the pseudo random generator)
    operator priorities and associativities
    bitwise operators
  • Threads

    Call a task entry on the other threadJoining Another Thread (Suspending a Thread Until Another Thread Establishes An Internal State)
    Call task entry serviced just before task terminationJoining Another Thread (Suspending a thread until another thread completes)
    Set_Priority(Priority_Value);Thread Prioritization (Changing Thead Priority)
    pragma Priority(expression);Thread Prioritization (Establishing a base thread priority)
    pragma Locking_Policy(Ceiling_Locking);Thread Prioritization (Selecting a Prioritization Model)
    protected Object_Name is [entry entry_name(Parameter : [in out] is type [...]);
    procedure procedure_name(Parameter : [in out] is type [...]);
    function function_name return type;
    private
    shared data declaration
    end Object_Name;
    Thread Synchronization (Defining a Synchronized Shared Resource)
    Objectg_Name.Entry_Name(Parms)Thread Synchronization (Monitor Syntax)
    Object_Name.Function_NameThread Synchronization (Synchronized Reading of a Shared Resource)
    Object_Name.Entry_Name(Parms)
    Object_Name.Procedure_Name(Parms)
    Thread Synchronization (Synchronized Writing to a shared resource)
    pragma Volatile(Object_Name);Thread-safe sharing of data without synchronization (Ensuring access is always via a local copy of the shared data)
    pragma Atomic(Object_Name);Thread-safe sharing of data without synchronization (Ensuring access is atomic)
    call an entry with paramterspassing data directly between threads
    Tasks are started when created / call Stop entry or "abort task-object-name"starting / stopping threads
    select task_entry_call; or delay timeout_limit; end select;terminating thread communication due to a time-out
    task task_name is [entry entry_name[(parameter ...)]...] end task_namethread definition
    task type task_type_name is [entry entry_name[(parameter ...)]...] end task_type_namethread definition
    MyTask : task_type_name;thread object creation

    Remarks


    Pixel
    This document is licensed under GFDL (GNU Free Documentation License).
    $Id: syntax-across-languages.html.pl 327 2006-09-25 15:47:54Z pixel $