hi,
trying to make a complete list of reserved words in pike.
i found all of these in language.yacc, and i hope the list is complete. they are grouped loosly by type, with each line representing a subgroup based on a gut feeling. i would appreciate any suggestions for better categorization, and expecially any explanations of what the keywords in the last two groups do.
types: array mapping multiset object function program string float int void mixed
related to types: constant enum typedef
flow control: if do for while else foreach case switch break continue return
special "functions": sscanf typeof
special blocks: catch gauge class lambda
don't know how to name that group: import inherit
class access: final static private local public protected
i don't know what these do, but they seem to belong to class access: nomask inline extern optional variant
i have no clue what these are: default predef global
hi,
trying to make a complete list of reserved words in pike.
i found all of these in language.yacc, and i hope the list is complete.
A better place to look is lexer.h.
types: array mapping multiset object function program string float int void mixed
related to types: constant enum typedef
flow control: if do for while else foreach case switch break continue return
special "functions": sscanf typeof
special blocks: catch gauge class lambda
don't know how to name that group: import inherit
You've missed facet.
class access: final static private local public protected
i don't know what these do, but they seem to belong to class access: nomask inline extern optional variant
nomask makes the symbol not overloadable. inline is the old name for local. extern makes a prototype for a variable (not implemented yet). optional makes the symbol optional in the type for the surrounding class. variant is reserved for polymorphic overloading (not implemented yet).
i have no clue what these are: default predef global
default is the fallback label in swtich statements. predef is the namespace for interpreter global constants. global has two uses; it is the root for the module tree (global.), and it is the namespace for the toplevel class (global::).
Note that there are also a few special symbols that are unreserved:
this Evaluates to this_program() for the context it is looked up in. this_program Evaluates to object_program(this).
There is also one hardcoded module:
UNDEFINED Constant 0 with zero_type 1.
On Wed, Aug 10, 2005 at 10:05:00AM +0000, Henrik Grubbström (Lysator) @ Pike (-) developers forum wrote:
i found all of these in language.yacc, and i hope the list is complete.
A better place to look is lexer.h.
would not have gained much. language.yacc has them in groups which gave me the idea to sort the words by type.
You've missed facet.
i looked at the 7.6 source. btw. i need to write up my criticism of facets some time...
nomask makes the symbol not overloadable.
how is that different from final?
extern makes a prototype for a variable (not implemented yet).
does that relate to shared? speaking of which, is shared going to be added to 7.7?
optional makes the symbol optional in the type for the surrounding class.
what does that mean? can i redeclare the symbol with a different type?
greetings, martin.
On Thu, Aug 11, 2005 at 10:28:06PM +0200, Martin Baehr wrote:
optional makes the symbol optional in the type for the surrounding class.
can i redeclare the symbol with a different type?
or does it mean that this symbol is not part of the interface and is ignored when doing type comparisons?
greetings, martin.
There is such a type, but there is no keyword for it. So it's beyond the scope of this list.
but it's not beyond the scope of my interest, so please tell us more about it.
greetings, martin.
pike-devel@lists.lysator.liu.se