Re: keyword as attribute?

From: Steven Sharp (sharp@cadence.com)
Date: Fri Oct 19 2001 - 13:04:37 PDT


Precedence: bulk

System tasks and functions start with '$'. It doesn't matter that the
rest of the identifier matches a keyword. The name of the system task
would be "$case", not "case". This is no more a problem than a variable
named "zcase". Compiler directives start with '`'. It doesn't matter
that the rest of the directive matches a keyword. The directive is
effectively "`case", which is not "case". The lexer has to do processing
on directives anyway, so any context sensitivity is localized. On the
other hand, an attribute named "case" would be an identifier named "case",
which is a reserved word. It would require a context-sensitive lexer to
treat it as an identifier.

There are good reasons why modern languages use reserved words. I don't
see why this should be an exception.

Steven Sharp
sharp@cadence.com



This archive was generated by hypermail 2.1.4 : Mon Jul 08 2002 - 12:54:47 PDT and
sponsored by Boyd Technology, Inc.