Difference between revisions of "Delphi language features"

From LibreDevelop
Jump to navigation Jump to search
 
Line 1: Line 1:
 
Here is incomplete Delphi/Object Pascal feature tree. Some features are dependent on others so some have precedence during compiler development.
 
Here is incomplete Delphi/Object Pascal feature tree. Some features are dependent on others so some have precedence during compiler development.
  
* Statements
+
{| class="wikitable sortable"
* Variables (var)
+
! Name !! Description !! Level
* Constants (const)
+
|-
* Name spaces (namespace)
+
| Statements || || 0
* Direct access to memory (pointers, directive absolute)
+
|-
* Compiler directives:
+
| Variables || '''var''' keyword, global || 0
** Conditionals (IFDEF, ENDIF, DEFINE, ...)
+
|-
** Region, code hiding (REGION)
+
| Variables - Local || Inside function and procedures ||
** Compiler options (M, ...)
+
|-
* Operators (and, or, xor, not, shl, shr, +, -, /, *, div, mod, as, in, ...)
+
| Constants || '''const''' keyword, global || 0
* Expressions (parenthesis, operator priority, infix notation)
+
|-
* Assignment (:=)
+
| Name spaces || Not directly supported || Future
* Function overloading (overload)
+
|-
* Integrated assembler (asm-end)
+
| Memory access || Direct access to memory (pointers, directive absolute) ||
* Comments ( {}, //, (* *) )
+
|-
* Subroutines (function, procedure)
+
| Compiler directives || ||
** Nested functions
+
|-
** Functions parameters
+
| Compiler directives - Conditionals || $IFDEF, $ENDIF, $DEFINE, ...) ||
** Inlined code (inline)
+
|-
* Types (type)
+
| Compiler directives - Region || code hiding using $REGION ||
** Elementary
+
|-
*** Enumeration (Boolean, ...)
+
| Compiler directives - Options || ($M+/-, ...) ||
*** Subrange (0..100, ...)
+
|-
*** Ordinals (SmallInt, Byte, Integer, Word, Cardinal, Int64, ...)
+
| Operators || and, or, xor, not, +, -, /, *, div, mod || 0
*** Floating numbers (Real, Single, Double, Extended, ...)
+
|-
*** Characters (Char, WideChar, AnsiChar, ...)
+
| Operators - Shifting || shl, shr ||
*** Strings (String, ShortString, AnsiString, WideString, PChar, ...)
+
|-
*** Pointers (Pointer, @, ^)
+
| Operators - Type || as, in ||
*** Variant
+
|-
*** Procedural types
+
| Expressions || operator priority, infix notation || 0
** Composed
+
|-
*** Array, static/dynamic
+
| Expressions - Parentheses || || 1
*** Record
+
|-
**** Překrývání proměnných (variant records): case Integer of...
+
| Assignment || ''':=''' symbol || 0
**** Packed
+
|-
**** Operator redefinition
+
| Integrated assembler || asm-end ||
**** Advanced with constants,types,variables,procedure/functions
+
|-
*** Set
+
| Comments || One line // or Block level {}, (* *) ||
*** Class
+
|-
**** Visibility (published, public, private, protected)
+
| Functions || Functions and procedures || 0
**** Methods (procedure, function)
+
|-
***** Virtual methods (virtual, override)
+
| Functions - Overloading || Function overloading, '''overload''' keyword ||
***** Inlined (inline)
+
|-
**** Inheritance (inherited)
+
| Functions - Nested || Local functions inside function
**** Properties (property, default, indexed)
+
|-
**** Events (property with function type)
+
| Functions - Parameters ||  ||
**** Nested definitions
+
|-
**** Constructors and destructors (constructor, destructor)
+
| Functions - Parameters - Reference || '''var''' keyword for references ||
*** Interface (interface)
+
|-
* Globals (variables, constants, types, functions)
+
| Functions - Parameters - Default value || parameters with default value ||
* Modularity (unit)
+
|-
** Types (program, unit, package, library)
+
| Functions - Inlined || Inlining code using '''inline''' keyword
** Initialization (initialization)
+
|-
** Finalization (finalization)
+
| Types || '''type''' keyword || 0
** Sections (interface, implementation)
+
|-
* Controls structures
+
| Types - Enumeration || (Boolean, ...) ||
** Condition (if-then-else)
+
|-
** Loop with known cycle count (for-to-do)
+
| Types - Subrange || (0..100, ...) ||
** Loop (repeat-until)
+
|-
** Loop (while-do)
+
| Types - Ordinals || SmallInt, Byte, Integer, Word, Cardinal, Int64, ... || 0
** Loop exit (break)
+
|-
** Jump to next iteration (continue)
+
| Types - Floating numbers || Real, Single, Double, Extended, ... ||
** Compound statement (begin-end)
+
|-
** Multiple branching (case-of)
+
| Types - Characters || Char, WideChar, AnsiChar, ... ||
** Context change (with-do)
+
|-
** Exception raise (raise)
+
| Types - Strings || String, ShortString, AnsiString, WideString, PChar, ... ||
** Exception handling (try-except)
+
|-
** Exception finalization (try-finally)
+
| Types - Pointers || Pointer, @, ^ ||
** Loop with enumerators (for-in-do)
+
|-
* Parametric types (generics)
+
| Types - Variant || ||
** Constraints (class, record, ordinal, float, ...)
+
|-
* Translation strings (resourcestring)
+
| Types - Procedural types || ||
* Thread local variables (threadvar)
+
|-
* Reference counting (interface)
+
| Types - Composed || ||
* Automatic memory management (memory manager)
+
|-
 
+
| Types - Array || static/dynamic ||
=Historic features=
+
|-
 
+
| Types - Record || ||
* File types (file, text)
+
|-
* Direct jump (goto, label)
+
| Types - Record - Variant ||  Překrývání proměnných (variant records): case Integer of... ||
 +
|-
 +
| Types - Record - Packed || ||
 +
|-
 +
| Types - Record - Operator redefinition || ||
 +
|-
 +
| Types - Record - Advanced || with constants,types,variables,procedure/functions ||
 +
|-
 +
| Types - Set || '''set of''', ''in'' operator, [] as set initializer ||
 +
|-
 +
| Types - Class || '''class''' keyword ||
 +
|-
 +
| Types - Class - Visibility || published, public, private, protected ||
 +
|-
 +
| Types - Class - Methods || Methods (procedure, function) ||
 +
|-
 +
| Types - Class - Virtual methods || (virtual, override)
 +
|-
 +
| Types - Class - Inlining || inline ||
 +
|-
 +
| Types - Class - Inheritance || inherited ||
 +
|-
 +
| Types - Class - Properties || (property, read, write, default, indexed) ||
 +
|-
 +
| Types - Class - Nested definitions || ||
 +
|-
 +
| Types - Class - Constructors and destructors || constructor, destructor ||
 +
|-
 +
| Types - Interface || '''interface''' keyword ||
 +
|-
 +
| Globals || (variables, constants, types, functions) ||
 +
|-
 +
| Units || Modularity using '''unit''' keyword, interface and implementation sections ||
 +
|-
 +
| Units - Types || program, unit, package, library ||
 +
|-
 +
| Units - Initialization/Finalization || (initialization, finalization) ||
 +
|-
 +
| Controls structures || ||
 +
|-
 +
| Condition || (if-then-else) ||
 +
|-
 +
| Loop with known cycle count || for-to-do ||
 +
|-
 +
| Repeat loop || repeat-until ||
 +
|-
 +
| While loop || while-do ||
 +
|-
 +
| Loop exit || break
 +
|-
 +
| Loops - Continue || Jump to next iteration (continue) ||
 +
|-
 +
| Compound statement || begin-end ||
 +
|-
 +
| Multiple branching || case-of ||
 +
|-
 +
| Context change || with-do ||
 +
|-
 +
| Exceptions || || raise (raise)
 +
|-
 +
| Exceptions - handling || try-except ||
 +
|-
 +
| Exceptions - Finalization || try-finally ||
 +
|-
 +
| Loop with enumerators || for-in-do ||
 +
|-
 +
| Generics || Parametric types  
 +
|-
 +
| Generics - Constraints || Limit generics parameters to class, record, ordinal, float, ...
 +
|-
 +
| Translation strings || '''resourcestring''' keyword
 +
|-
 +
| Multi-threading || ||
 +
|-
 +
| Multi-threading - Thread local variables || '''threadvar''' keyword
 +
|-
 +
| Interfaces || like abstract classes, multiple inheritance ||
 +
|-
 +
| Interfaces - Reference counting || ||
 +
|-
 +
| Memory manager || Automatic memory management ||
 +
|-
 +
| File types || file, text || Obsolete
 +
|-
 +
| Direct jump || goto, label keywords || Obsolete
 +
|}
  
 
[[Category:Main]]
 
[[Category:Main]]

Latest revision as of 10:36, 24 March 2016

Here is incomplete Delphi/Object Pascal feature tree. Some features are dependent on others so some have precedence during compiler development.

Name Description Level
Statements 0
Variables var keyword, global 0
Variables - Local Inside function and procedures
Constants const keyword, global 0
Name spaces Not directly supported Future
Memory access Direct access to memory (pointers, directive absolute)
Compiler directives
Compiler directives - Conditionals $IFDEF, $ENDIF, $DEFINE, ...)
Compiler directives - Region code hiding using $REGION
Compiler directives - Options ($M+/-, ...)
Operators and, or, xor, not, +, -, /, *, div, mod 0
Operators - Shifting shl, shr
Operators - Type as, in
Expressions operator priority, infix notation 0
Expressions - Parentheses 1
Assignment := symbol 0
Integrated assembler asm-end
Comments One line // or Block level {}, (* *)
Functions Functions and procedures 0
Functions - Overloading Function overloading, overload keyword
Functions - Nested Local functions inside function
Functions - Parameters
Functions - Parameters - Reference var keyword for references
Functions - Parameters - Default value parameters with default value
Functions - Inlined Inlining code using inline keyword
Types type keyword 0
Types - Enumeration (Boolean, ...)
Types - Subrange (0..100, ...)
Types - Ordinals SmallInt, Byte, Integer, Word, Cardinal, Int64, ... 0
Types - Floating numbers Real, Single, Double, Extended, ...
Types - Characters Char, WideChar, AnsiChar, ...
Types - Strings String, ShortString, AnsiString, WideString, PChar, ...
Types - Pointers Pointer, @, ^
Types - Variant
Types - Procedural types
Types - Composed
Types - Array static/dynamic
Types - Record
Types - Record - Variant Překrývání proměnných (variant records): case Integer of...
Types - Record - Packed
Types - Record - Operator redefinition
Types - Record - Advanced with constants,types,variables,procedure/functions
Types - Set set of, in operator, [] as set initializer
Types - Class class keyword
Types - Class - Visibility published, public, private, protected
Types - Class - Methods Methods (procedure, function)
Types - Class - Virtual methods (virtual, override)
Types - Class - Inlining inline
Types - Class - Inheritance inherited
Types - Class - Properties (property, read, write, default, indexed)
Types - Class - Nested definitions
Types - Class - Constructors and destructors constructor, destructor
Types - Interface interface keyword
Globals (variables, constants, types, functions)
Units Modularity using unit keyword, interface and implementation sections
Units - Types program, unit, package, library
Units - Initialization/Finalization (initialization, finalization)
Controls structures
Condition (if-then-else)
Loop with known cycle count for-to-do
Repeat loop repeat-until
While loop while-do
Loop exit break
Loops - Continue Jump to next iteration (continue)
Compound statement begin-end
Multiple branching case-of
Context change with-do
Exceptions raise (raise)
Exceptions - handling try-except
Exceptions - Finalization try-finally
Loop with enumerators for-in-do
Generics Parametric types
Generics - Constraints Limit generics parameters to class, record, ordinal, float, ...
Translation strings resourcestring keyword
Multi-threading
Multi-threading - Thread local variables threadvar keyword
Interfaces like abstract classes, multiple inheritance
Interfaces - Reference counting
Memory manager Automatic memory management
File types file, text Obsolete
Direct jump goto, label keywords Obsolete