Lugaru's Epsilon Programmer's Editor 14.04
Context:
|
Epsilon User's Manual and Reference >
Epsilon Extension Language >
Data Types >
Type Names
EEL's sizeof operator and its casting operator specify particular
types using type names. A type name looks like a declaration of a
single variable, except that the variable name is missing (as is the
semicolon at the end). For example, int * is a type name
referring to a pointer to an int.
type-name:
type-specifier abstract-declarator
abstract-declarator:
empty
( abstract-declarator )
* abstract-declarator
abstract-declarator [ constant-expression ]
abstract-declarator [ ]
abstract-declarator ( )
abstract-declarator ( ansi-argument-list )
Note that you could interpret a type name like int *() in two
ways: either as a function returning a pointer to an int (like
int *foo(); ) or as a pointer to an int (like int
*(foo); ). EEL rules out the latter by requiring that a
parenthesized abstract-declarator be nonempty. Given this, the
system is not ambiguous, and an identifier can appear in only one
place in each type name to make a legal declaration.
The same precedence rules apply to type names as to normal
declarators (or to expressions). For example, the type name
char *[10] refers to an array of 10 pointers to characters, but
char (*)[10] refers to a pointer to an array of 10 characters.
Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.
|