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