posts - 274,  comments - 1258,  trackbacks - 0
  相信有大家对UltraEdit都不会太陌生,而事实上,它是一款相当好用的代码编写工具,现在,我不但写C++程序时会使用它,连写ActionsScript代码文件也找它帮忙,它可定制的语法加亮设置使我摆脱了MM Flash那种单调的蓝黑界面。
  不过要实现这一目标,需要一个好的wordfile支持。wordfile是UltraEdit进行语法高亮、缩进设置、函数列表等等功能的依据。我曾经在网上搜寻了不少ActionScript的wordfile,发现效果都不太理想,主要是收录的关键字太少,很多常用的关键字都没有收录,于是便决定亲手去做一个,并放上来与大家分享。
  这份wordfile有以下几个特点:
  1、能够比较完善地显示函数列表。其实我还不会写正则表达式,这几个是综合网上的几个wordfile得到的。
  2、将高亮词划分为运算符、关键字(保留字)、类、属性、方法、事件、常数、自定义共八个部分。收录了动作脚本字典中的所有项和组件字典中的大部分项。其来源主要参考Flash自己的内部数据文件——我很开心地发现Flash关于语法高亮、代码提示的数据文件是用xml格式来保存的。于是我写了一个C++程序,它自动地把xml文件里相应的词找出来,然后进行排序。不过,其实我的工作量还是颇大的,因为Flash对关键字的分类过于简单,我必须手工地将它们划分成不同的类别。
  3、这份wordfile引用了一些内置的高亮着色。比如运算符是STYLE_OPERATOR,关键字是 STYLE_KEYWORD,等等。它具体的着色可能取决于你的设置,如果你对UltraEdit内置的配色方案不满意,你可以在配置→编辑器提示→语法加亮→颜色选择中进行修改(事实上我也全部修改了)。
以下是wordfile全文,你只要把它添加到你原来的wordfile文件的末尾即可(原wordfile文件的地址见配置→编辑器提示→语法加亮→词语列表的完整路径)以下假定你的第20种语言未进行设置,否则你将第一行的/L20改为任一未被设置的语言序号即可。
注:以下着色仅作参考,并非该文件附有。
/L20"ActionScript 2.0(Acumon)" Line Comment = // Block Comment On = /* Block Comment Off = */ Escape Char = \ File Extensions = AS
/Delimiters = ~!@%^&*()-+=|\/{}[]:;"'<> , .?
/Function String 1 = "%[^t ]++function[^t ]+^([~ ^t(]+^)[^t ]++(*)[ ^t{}]++$"
/Function String 2 = "[^t ]++^([a-zA-Z._]+^)[^t ]++=[^t ]++function[^t ]++(*)[ ^t{}]++$"
/Function String 3 = "%^(//[*]+^p"
/Variable String = "%[ ^t]++^([!-~ ^t<>]+*[~a-z^p]^)$S[ ^t;,()^-]"
/Indent Strings = "{"
/Unindent Strings = "}"
/Open Fold Strings = "{"
/Close Fold Strings = "}"
/C1"运算符" STYLE_OPERATOR
!
%
&
*
+
-
// /
<
=
>
^
|
~
?
:
.
,
(
)
[
]
{
}

/C2"关键字" STYLE_KEYWORD
#endinitclip #include #initclip
add and
break
case catch class continue
default delete do dynamic
else eq extends
finally for function
ge gt get
if implements import in instanceof interface
le lt
ne new not
on onClipEvent or
private public
return
set static switch super
this throw try typeof
var void
while with
/C3"类" STYLE_IDENTIFIER
Accessibility Accordion Alert Array
Binding Boolean Button
Camera CheckBox Color ComboBox ComponentMixins ContextMenu ContextMenuItem CustomActions
DataGrid DataHolder DataSet DataType Date DateChooser DateField Delta DeltaItem DeltaPacket
EndPoint Error
Function
Key
Label List LoadVars Loader LocalConnection Log
Math MediaController MediaDisplay MediaPlayback Menu MenuBar Microphone Mouse MovieClip MovieClipLoader
NetConnection NetStream Number NumericStepper
Object
PendingCall PopUpManager PrintJob ProgressBar
RDBMSResolver RadioButton RadioButtonGroup
SOAPCall ScrollPane Selection SharedObject Sound Stage String StyleSheet System
TextArea TextField TextFormat TextInput TextSnapshot Tree TypedValue
Video Void
WebService WebServiceConnector Window
XML XMLConnector XMLNode XMLSocket XUpdateResolver
/C4"属性" STYLE_ATTRIBUTE
COMM
TALB TBPM TCOM TCON TCOP TDAT TDLY TENC TEXT TFLT TIME TIT1 TIT2 TIT3 TKEY TLAN TLEN TMED TOAL TOFN TOLY TOPE TORY TOWN TPE1 TPE2 TPE3 TPE4 TPOS TPUB TRCK TRDA TRSN TRSO TSIZ TSRX TSSE TYER
WXXX
__proto__ _accProps _alpha _currentframe _droptarget _focusrect _framesloaded _global _height _highquality _level _lockroot _name _parent _quality _root _rotation _soundbuftime _target _totalframes _url _visible _width _x _xmouse _xscale _y _ymouse _yscale
activePlayControl activityLevel album align arguments artist aspectRatio attributes autoLoad autoPlay autoSize avHardwareDisable
background backgroundColor backgroundStyle bandwidth blockIndent bold border borderColor bottomScroll bufferLength bufferTime bullet buttonHeight buttonStyleDeclaration buttonWidth bytesLoaded bytesTotal
callee caller cancelLabel capabilities caption cellRenderer childNodes closeButton color columnCount columnNames comment condenseWhite content contentPath contentType controlPlacement controllerPolicy conversion cuePoints currentFps customItems
data dataProvider dateFormatter dayNames deblocking direction disabledDays disabledRanges displayedMonth displayedYear docTypeDecl dropdown dropdownWidth duration
editable embedFonts enabled exactSettings
firstChild firstDayOfWeek firstVisibleNode focusEnabled focusedCell font forward_back fps
gain genre groupName
hLineScrollSize hPageScrollSize hPosition hScrollPolicy hasAccessibility hasAudio hasAudioEncoder hasEmbeddedVideo hasMP3 hasPrinting hasScreenBroadcast hasScreenPlayback hasStreamingAudio hasStreamingVideo hasVideoEncoder headerHeight height hitArea horizontal hscroll html htmlText
icon iconField iconFunction ignoreWhite indent indeterminate index isDebugger italic
label labelField labelFunction labelPlacement language lastChild leading leftMargin length loaded localFileReadDisable loop
manufacturer maxChars maxHPosition maxVPosition maxhscroll maximum maxscroll mediaType menu message messageStyleDeclaration minimum mode monthNames motionLevel motionTimeOut mouseWheelEnabled multiline multipleSelection muted
name names nextSibling nextValue noLabel nodeName nodeType nodeValue numChildren
okLabel orientation os
pageHeight pageWidth paperHeight paperWidth parentNode password percentComplete percentLoaded pixelAspectRatio playerType playheadTime playing position preferredHeight preferredWidth previousSibling previousValue print prototype pullDown
quality
rate resizableColumns restrict rewind rightMargin rowCount rowHeight
save scaleContent scaleMode scaleX scaleY screenColor screenDPI screenResolutionX screenResolutionY scroll scrollDrag selectable selectableRange selected selectedChild selectedData selectedDate selectedIndex selectedIndices selectedItem selectedItems selectedNode selectedNodes selection separatorBefore serverString showHeaders showMenu showToday silenceLevel silenceTimeOut size smoothing songtitle sortableColumns source status stepSize styleSheet
tabChildren tabEnabled tabIndex tabStops target text textColor textField textHeight textWidth time title titleStyleDeclaration toggle totalTime track trackAsMenu type
underline url useCodePage useEchoSuppression useHandCursor
vLineScrollSize vPageScrollSize vPosition vScrollPolicy value variable version visible volume
width windowlessDisable wordWrap
xmlDecl
year yesLabel
zoom

/C5"方法" STYLE_FUNCTION
MMExecute
UTC
abs acos addColumn addColumnAt addCuePoint addEventListener addItem addItemAt addListener addMenu addMenuAt addMenuItem addMenuItemAt addPage addProperty addRequestHeader addTreeNode addTreeNodeAt allowDomain allowInsecureDomain appendChild apply asin associateController associateDisplay atan atan2 attachAudio attachMovie attachSound attachVideo
beginFill beginGradientFill
call ceil charAt charCodeAt chr clear clearInterval cloneNode close concat connect copy cos createChild createClassObject createElement createEmptyMovieClip createMenu createObject createPopUp createSegment createTextField createTextNode curveTo
deletePopUp destroyChildAt destroyObject displayFull displayNormal doLayout domain duplicateMovieClip
editField endFill escape eval exp
findText floor flush fromCharCode fscommand
get getAscii getBeginIndex getBounds getBytesLoaded getBytesTotal getCaretIndex getChildAt getCode getColumnAt getColumnIndex getCount getCuePoints getDate getDay getDepth getDisplayIndex getEndIndex getFocus getFontList getFullYear getHours getInstanceAtDepth getIsBranch getIsOpen getItemAt getLocal getMenuAt getMenuEnabledAt getMenuItemAt getMilliseconds getMinutes getMonth getNewTextFormat getNextHighestDepth getNodeDisplayedAt getPan getProgress getProperty getRGB getSWFVersion getSeconds getSelected getSelectedText getSize getStyle getStyleNames getText getTextExtent getTextFormat getTextSnapshot getTime getTimer getTimezoneOffset getTransform getTreeNodeAt getURL getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getVersion getVolume getYear globalToLocal gotoAndPlay gotoAndStop
handleEvent hasChildNodes hide hideBuiltInItems hitTest hitTestTextNearPos
ifFrameLoaded indexOf insertBefore install int invalidate isDown isFinite isNaN isToggled
join
lastIndexOf length lineStyle lineTo list load loadClip loadMovie loadMovieNum loadSound loadVariables loadVariablesNum localToGlobal log
max mbchr mblength mbord mbsubstring min move moveTo
nextFrame nextScene
on onClipEvent open ord
parseCSS parseFloat parseInt parseXML pause play pop pow prevFrame prevScene print printAsBitmap printAsBitmapNum printNum push
random redraw refresh refreshPane registerClass removeAll removeAllColumns removeAllCuePoints removeColumnAt removeCuePoint removeItemAt removeListener removeMenuAt removeMenuItem removeMenuItemAt removeMovieClip removeNode removeTextField removeTreeNodeAt replaceItemAt replaceSel replaceText reverse round
seek send sendAndLoad setBufferTime setClipboard setDate setFocus setFullYear setGain setHPosition setHours setIcon setInterval setIsBranch setIsOpen setMask setMedia setMenuEnabledAt setMenuItemEnabled setMenuItemSelected setMilliseconds setMinutes setMode setMonth setMotionLevel setNewTextFormat setPan setProgress setPropertiesAt setProperty setRGB setRate setSeconds setSelectColor setSelected setSelection setSilenceLevel setSize setStyle setTextFormat setTime setTransform setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setUseEchoSuppression setVPosition setVolume setYear shift show showSettings sin slice sort sortItems sortItemsBy sortOn spaceColumnsEqually splice split sqrt start startDrag stop stopAllSounds stopDrag substr substring swapDepths
tan targetPath tellTarget toggleHighQuality toLowerCase toString toUpperCase trace transform
unescape uninstall unloadClip unloadMovie unloadMovieNum unshift unwatch updateAfterEvent
valueOf
watch
/C6"事件" STYLE_EVENT
allowDomain allowInsecureDomain
cellEdit cellFocusIn cellFocusOut cellPress change click close columnStretch complete cuePoint
data dragOut dragOver draw
enter enterFrame
focusIn focusOut
headerRelease
itemRollOut itemRollOver
keyDown keyPress keyUp
load
menuHide menuShow mouseDown mouseDownOutside mouseMove mouseUp move
nodeClose nodeOpen
onActivity onChanged onClose onConnect onData onDragOut onDragOver onEnterFrame onID3 onKeyDown onKeyUp onKillFocus onLoad onMouseDown onMouseMove onMouseUp onMouseWheel onPress onRelease onReleaseOutside onResize onRollOut onRollOver onScroller onSelect onSetFocus onSoundComplete onStatus onSync onUnload onXML open
pause play playheadChange press progress
release releaseOutside resize rollOut rollOver
scroll start
unload
volume
/C7"常数" STYLE_ELEMENT
-Infinity
ALT
BACKSPACE
CAPSLOCK CASEINSENSITIVE CONTROL
DELETEKEY DESCENDING DOWN
E END ENTER ESCAPE
HOME
INSERT Infinity
LEFT LN10 LN2 LOG10E LOG2E
MAX_VALUE MIN_VALUE
NEGATIVE_INFINITY NUMERIC NaN
PGDN PGUP PI POSITIVE_INFINITY
RETURNINDEXEDARRAY RIGHT
SHIFT SPACE SQRT1_2 SQRT2
TAB
UNIQUESORT UP
false
newline null
true
undefined
/C8"自定义" STYLE_ELEMENT
posted on 2007-02-14 13:18 踏雪赤兔 阅读(2573) 评论(1)  编辑 收藏 引用 所属分类: 玩转编程

FeedBack:
# re: [AS]完美的ActionScript 2.0 wordfile for UltraEdit by Acumon
2007-02-21 01:36 | AC
哇...赞...!~  回复  更多评论
  
只有注册用户登录后才能发表评论。

百度空间| 见闻日记| 编程感悟
我的twitter


LOGO

自我介绍:百度厂基础平台车间的一名挨踢民工。擅长C++、算法、语言设计、分布式计算,也用过Java,Python, PHP,JS/AS等语言开发。请关注我的twitter (免翻墙版) 发QQ消息


添加到收藏夹 Locations of visitors to this page

常用链接

随笔分类(300)

随笔档案(274)

文章分类(38)

相册

收藏夹(54)

与博主互动

博客手拉手

搜索

  •  

积分与排名

  • 积分 - 336245
  • 排名 - 8

最新评论

阅读排行榜

评论排行榜