ActionScript 3.0
關鍵字與保留字
「保留字」是不可以在程式碼中用來當做識別名稱的字詞,因為這些字詞是保留給 ActionScript 使用的。保留字包括「語彙關鍵字」,是由編譯器從程式命名空間中移除。若使用語彙關鍵字做為識別名稱,則編譯器會報告錯誤。下表列出 ActionScript 3.0 語彙關鍵字。
as
|
break
|
case
|
catch
|
class
|
const
|
continue
|
default
|
delete
|
do
|
else
|
extends
|
false
|
finally
|
for
|
function
|
if
|
implements
|
import
|
in
|
instanceof
|
interface
|
internal
|
is
|
native
|
new
|
null
|
package
|
private
|
protected
|
public
|
return
|
super
|
switch
|
this
|
throw
|
to
|
true
|
try
|
typeof
|
use
|
var
|
void
|
while
|
with
|
有一小組關鍵字稱為「語法關鍵字」,可用來做為識別名稱,但在某些內容中會有特殊的意義。下表列出 ActionScript 3.0 語法關鍵字。
each
|
get
|
set
|
namespace
|
include
|
dynamic
|
final
|
native
|
override
|
static
|
也有一些識別名稱有時稱為「未來保留字」。雖然與 ActionScript 3.0 結合的軟體可能將其中部分識別名稱視為關鍵字,但是,ActionScript 3.0 並未保留這些識別名稱。雖然您可以在程式碼中任意使用這些識別名稱,不過 Adobe 建議您不要使用這些識別名稱,因為在後續的語言版本中,它們可能是關鍵字。
abstract
|
boolean
|
byte
|
cast
|
char
|
debugger
|
double
|
enum
|
export
|
float
|
goto
|
intrinsic
|
long
|
prototype
|
short
|
synchronized
|
throws
|
to
|
transient
|
type
|
virtual
|
volatile
|
沒有留言:
張貼留言