Skip to content

Commit fdfa2d0

Browse files
committed
分析keyword部分
1 parent 5bfc5a1 commit fdfa2d0

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/language/wordinfo.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,14 +321,25 @@ export function getcharMsg(char:string) {
321321
enum AllowKinds {
322322
Memory, Variables, Constants, All, Size, None, Inst, Macro, Label, Interrupt
323323
}
324+
enum KeywordType {
325+
MacroLabel,File,Instruction, Register, PreCompileCommand,MemoryAllocation,SavedWord,Size,Variable,Method,Structure,Macro,Label,Segment
326+
}
324327
class KeywordDef {
325328
opCount: number;
326329
name : string;
327330
def : string;
328331
data: string;
329332
type : KeywordType;
330333
allowType : AllowKinds;
331-
334+
/**
335+
* 注册关键字相关的信息
336+
* @param name string关键字名称
337+
* @param def string定义 描述
338+
* @param type keywordType类型
339+
* @param data syntax等提示信息
340+
* @param count 操作数个数
341+
* @param allow 是否允许使用
342+
*/
332343
constructor(name : string, def : string,type: KeywordType = KeywordType.Instruction,data? : string,count : number = 2,allow? : AllowKinds){
333344
this.def = def;
334345
if(data !== undefined){
@@ -342,15 +353,13 @@ class KeywordDef {
342353
}else{
343354
this.allowType = allow;
344355
}
345-
356+
// console.log('"info.'+name+'":"'+def+'"')
346357
this.opCount = count;
347358
this.type = type;
348359
this.name = name;
349360
}
350361
}
351-
enum KeywordType {
352-
MacroLabel,File,Instruction, Register, PreCompileCommand,MemoryAllocation,SavedWord,Size,Variable,Method,Structure,Macro,Label,Segment
353-
}
362+
354363
const KEYWORD_DICONTARY : Array<KeywordDef>= [
355364
//Sizes
356365
new KeywordDef("small","128KB",KeywordType.Size,"small",0),

0 commit comments

Comments
 (0)