Subject | Re: [Firebird-Architect] Reserved keywords |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2004-11-24T19:45:26Z |
Jim Starkey wrote:
In some cases it's possible to a keyword be a symbol name too, for example:
valid_symbol_name : SYMBOL
| non_reserved_word
;
/* list of non-reserved words */
non_reserved_word :
KW_BREAK /* added in FB 1.0 */
| KW_DESCRIPTOR
| SUBSTRING
| COALESCE /* added in FB 1.5 */
...
And you can:
create table coalesce (n integer);
Adriano
>When lex sees the word "primary", it must recognize it as a token andThis is not entirely true.
>return the lexeme 401 to yacc/bison. Unless it knows more about
>context, it can't know whether to return "primary" as a known token or a
>potential identifier string. An identifier string won't match the token
>"PRIMARY" and the token 401 won't match an indentifier string.
>
>
In some cases it's possible to a keyword be a symbol name too, for example:
valid_symbol_name : SYMBOL
| non_reserved_word
;
/* list of non-reserved words */
non_reserved_word :
KW_BREAK /* added in FB 1.0 */
| KW_DESCRIPTOR
| SUBSTRING
| COALESCE /* added in FB 1.5 */
...
And you can:
create table coalesce (n integer);
>The obvious trick is to make lex sensitive to the context, which isAgreed.
>known in the industry as a hack. Too many hacks, and the structure
>crumbles.
>
>
Adriano