sample2.msg

来自「通用数据库管理的VC程序」· MSG 代码 · 共 80 行

MSG
80
字号
{ DISCLAIMER:  This is provided as is, expressly without a warranty of any kind.}
{ You use it at your own risc. }

TmwSampleSyn {first Identifier is considered to be the Class Name }
tk        {second Identifier is considered to be the Identifier Prefix }
Sensitive { : Optional}
IdentStart '_', 'a'..'z', 'A'..'Z':: '_', '0'..'9', 'a'..'z', 'A'..'Z'::

KEYS  { all between KEYS and |><| is considered to be a keyword }
mwEdit
mwEDIT
|><| { token names }
Comment
Identifier
Key
Null
Space
String
Unknown
|><|

CHARS

#0:: Null
BeginProc
  fTokenID := tkNull;
EndProc

#1..#32:: Space
BeginProc
  fTokenID := tkSpace;
  repeat
    inc(Run);
  until not (fLine[Run] in [#1..#32]);
EndProc

'A'..'Z', 'a'..'z', '_':: Ident
BeginProc
  fTokenID := IdentKind((fLine + Run));
  inc(Run, fStringLen);
  while Identifiers[fLine[Run]] do inc(Run);
EndProc

'/':: Slash
BeginProc
  Inc(Run);
  case fLine[Run] of
    '/':
      begin
        fTokenID := tkComment;
        repeat
          Inc(Run);
        until fLine[Run] = #0;
      end;
    '*':
      begin
        Inc(Run);
        fRange := rsComment;
        CommentProc;
      end;
    else fTokenID := tkUnknown;
  end;
EndProc

'"':: String
BeginProc
  fTokenID := tkString;
  Inc(Run);
  repeat
    if fLine[Run] = '"' then
    begin
      Inc(Run);
      if fLine[Run] <> '"' then break;
    end;
    Inc(Run);
  until fLine[Run] in [#0, #10, #13];
EndProc
|><|

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?