Delphi language features: Difference between revisions
Jump to navigation
Jump to search
(Created page with "* Statements * Variables (var) * Constants (const) * Name spaces (namespace) * Direct access to memory (pointers, directive absolute) * Compiler directives: IFDEF, ENDIF, DEFI...") |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
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. |
|||
* Statements |
|||
* Variables (var) |
|||
* Constants (const) |
|||
* Name spaces (namespace) |
|||
* Direct access to memory (pointers, directive absolute) |
|||
* Compiler directives: IFDEF, ENDIF, DEFINE, ... |
|||
* Operators (and, or, xor, not, shl, shr, +, -, /, *, div, mod, as, in, ...) |
|||
* Expressions (parenthesis, operator priority, infix notation) |
|||
* Assignment (:=) |
|||
* Function overloading (overload) |
|||
* Integrated assembler (asm-end) |
|||
* Subroutines (function, procedure) |
|||
** Nested functions |
|||
** Functions parameters |
|||
** Inlined code (inline) |
|||
* Types (type) |
|||
** Elementary |
|||
*** Enumeration (Boolean, ...) |
|||
*** Subrange (0..100, ...) |
|||
*** Ordinals (SmallInt, Byte, Integer, Word, Cardinal, Int64, ...) |
|||
*** Floating numbers (Real, Single, Double, Extended, ...) |
|||
*** Characters (Char, WideChar, AnsiChar, ...) |
|||
*** Strings (String, ShortString, AnsiString, WideString, PChar, ...) |
|||
*** Pointers (Pointer, @, ^) |
|||
*** Variant |
|||
*** Procedural types |
|||
** Composed |
|||
*** Array, static/dynamic |
|||
*** Record |
|||
**** Překrývání proměnných (variant records): case Integer of... |
|||
**** Packed |
|||
**** Operator redefinition |
|||
**** Advanced with constants,types,variables,procedure/functions |
|||
*** Set |
|||
*** Class |
|||
**** Visibility (published, public, private, protected) |
|||
**** Methods (procedure, function) |
|||
***** Virtual methods (virtual, override) |
|||
***** Inlined (inline) |
|||
**** Inheritance (inherited) |
|||
**** Properties (property, default, indexed) |
|||
**** Events (property with function type) |
|||
**** Nested definitions |
|||
**** Constructors and destructors (constructor, destructor) |
|||
*** Interface (interface) |
|||
* Globals (variables, constants, types, functions) |
|||
* Modularity (unit) |
|||
** Initialization (initialization) |
|||
** Finalization (finalization) |
|||
** Sections (interface, implementation) |
|||
* Controls structures |
|||
** Condition (if-then-else) |
|||
** Loop with known cycle count (for-to-do) |
|||
** Loop (repeat-until) |
|||
** Loop (while-do) |
|||
** Loop exit (break) |
|||
** Jump to next iteration (continue) |
|||
** Compound statement (begin-end) |
|||
** Multiple branching (case-of) |
|||
** Context change (with-do) |
|||
** Exception raise (raise) |
|||
** Exception handling (try-except) |
|||
** Exception finalization (try-finally) |
|||
** Loop with enumerators (for-in-do) |
|||
* Parametric types (generics) |
|||
* Translation strings (resourcestring) |
|||
* Thread local variables (threadvar) |
|||
* Reference counting (interface) |
|||
* Automatic memory management (memory manager) |
|||
{| class="wikitable sortable" |
|||
=Historic features= |
|||
! Name !! Description !! Level |
|||
|- |
|||
* File types (file, text) |
|||
| Statements || || 0 |
|||
* Direct jump (goto, label) |
|||
|- |
|||
| 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 |
|||
|} |
|||
[[Category:Main]] |
[[Category:Main]] |
Latest revision as of 08: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 |