Skip to content

Redefine keywords and reserved words

General Information

Mantis ID/URL:

Clauses:

Affiliation:

Description

An explicit distinction between keywords and reserved words is a prerequisite for moving language parts, such as predefined functions, matching-mechanism or timers to some kind of predefined standard library. It would also simplify BNF rules.

Where's the difference?

A _reserved word_ is an identifier which cannot be used as a name for user-defined variables, functions, parameters, etc. For example the identifiers "int2str", "integer", "this" or "object" are reserved words and have not special syntactic meaning except for being predefined or reserved. In some scopes reserved words are allowed to be used by the user (for example as name in field-definitions).

A _keyword_ is a word with special meaning in a particular context. Keywords should not be used as identifiers (for example "for", "while", ...). There are some few exceptions however ("testcase", "class", "all", "any", ...):

    testcase.stop; // "testcase" is used as identifier referencing the current testcase
    testcase TC1() {} // "testcase" is a keyword introducing a testcase definition

Edited by Jens Grabowski