{-------------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.

Code template generated with SynGen.
The original code is: C:\Documents and Settings\daniele\Desktop\FBasic-Ide\resources\luasyntax.pas, released 2008-06-29.
Description: Syntax Parser/Highlighter
The initial author of this file is daniele.
Copyright (c) 2008, all rights reserved.

Contributors to the SynEdit and mwEdit projects are listed in the
Contributors.txt file.

Alternatively, the contents of this file may be used under the terms of the
GNU General Public License Version 2 or later (the "GPL"), in which case
the provisions of the GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms
of the GPL and not to allow others to use your version of this file
under the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.

$Id: $

You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net

-------------------------------------------------------------------------------}

unit luasyntax;

{$I SynEdit.inc}

interface

uses
{$IFDEF SYN_CLX}
  QGraphics,
  QSynEditTypes,
  QSynEditHighlighter,
{$ELSE}
  Graphics,
  SynEditTypes,
  SynEditHighlighter,
{$ENDIF}
  SysUtils,
  Classes;

type
  TtkTokenKind = (
    tkComment,
    tkFunctionKeys,
    tkIdentifier,
    tkKey,
    tkNull,
    tkSpace,
    tkString,
    tkUnknown);

  TRangeState = (rsUnKnown, rsBlockComment, rsString, rsBlockString);

  TProcTableProc = procedure of object;

  PIdentFuncTableFunc = ^TIdentFuncTableFunc;
  TIdentFuncTableFunc = function: TtkTokenKind of object;

const
  MaxKey = 253;

type
  TSynLuaSyn = class(TSynCustomHighlighter)
  private
    fLineRef: string;
    fLine: PChar;
    fLineNumber: Integer;
    fProcTable: array[#0..#255] of TProcTableProc;
    fRange: TRangeState;
    Run: LongInt;
    fStringLen: Integer;
    fToIdent: PChar;
    fTokenPos: Integer;
    fTokenID: TtkTokenKind;
    fIdentFuncTable: array[0 .. MaxKey] of TIdentFuncTableFunc;
    fCommentAttri: TSynHighlighterAttributes;
    fFunctionKeysAttri: TSynHighlighterAttributes;
    fIdentifierAttri: TSynHighlighterAttributes;
    fKeyAttri: TSynHighlighterAttributes;
    fSpaceAttri: TSynHighlighterAttributes;
    fStringAttri: TSynHighlighterAttributes;
    function KeyHash(ToHash: PChar): Integer;
    function KeyComp(const aKey: string): Boolean;
    function Func15: TtkTokenKind;
    function Func16: TtkTokenKind;
    function Func19: TtkTokenKind;
    function Func22: TtkTokenKind;
    function Func23: TtkTokenKind;
    function Func29: TtkTokenKind;
    function Func30: TtkTokenKind;
    function Func31: TtkTokenKind;
    function Func32: TtkTokenKind;
    function Func33: TtkTokenKind;
    function Func34: TtkTokenKind;
    function Func35: TtkTokenKind;
    function Func36: TtkTokenKind;
    function Func37: TtkTokenKind;
    function Func38: TtkTokenKind;
    function Func39: TtkTokenKind;
    function Func40: TtkTokenKind;
    function Func41: TtkTokenKind;
    function Func42: TtkTokenKind;
    function Func43: TtkTokenKind;
    function Func44: TtkTokenKind;
    function Func45: TtkTokenKind;
    function Func46: TtkTokenKind;
    function Func47: TtkTokenKind;
    function Func49: TtkTokenKind;
    function Func50: TtkTokenKind;
    function Func52: TtkTokenKind;
    function Func54: TtkTokenKind;
    function Func56: TtkTokenKind;
    function Func57: TtkTokenKind;
    function Func58: TtkTokenKind;
    function Func59: TtkTokenKind;
    function Func60: TtkTokenKind;
    function Func62: TtkTokenKind;
    function Func63: TtkTokenKind;
    function Func64: TtkTokenKind;
    function Func65: TtkTokenKind;
    function Func66: TtkTokenKind;
    function Func67: TtkTokenKind;
    function Func68: TtkTokenKind;
    function Func69: TtkTokenKind;
    function Func70: TtkTokenKind;
    function Func72: TtkTokenKind;
    function Func73: TtkTokenKind;
    function Func74: TtkTokenKind;
    function Func76: TtkTokenKind;
    function Func77: TtkTokenKind;
    function Func78: TtkTokenKind;
    function Func79: TtkTokenKind;
    function Func81: TtkTokenKind;
    function Func82: TtkTokenKind;
    function Func83: TtkTokenKind;
    function Func84: TtkTokenKind;
    function Func85: TtkTokenKind;
    function Func86: TtkTokenKind;
    function Func87: TtkTokenKind;
    function Func89: TtkTokenKind;
    function Func90: TtkTokenKind;
    function Func92: TtkTokenKind;
    function Func93: TtkTokenKind;
    function Func95: TtkTokenKind;
    function Func96: TtkTokenKind;
    function Func97: TtkTokenKind;
    function Func98: TtkTokenKind;
    function Func99: TtkTokenKind;
    function Func102: TtkTokenKind;
    function Func103: TtkTokenKind;
    function Func104: TtkTokenKind;
    function Func105: TtkTokenKind;
    function Func107: TtkTokenKind;
    function Func108: TtkTokenKind;
    function Func114: TtkTokenKind;
    function Func115: TtkTokenKind;
    function Func119: TtkTokenKind;
    function Func121: TtkTokenKind;
    function Func122: TtkTokenKind;
    function Func124: TtkTokenKind;
    function Func127: TtkTokenKind;
    function Func128: TtkTokenKind;
    function Func129: TtkTokenKind;
    function Func133: TtkTokenKind;
    function Func134: TtkTokenKind;
    function Func135: TtkTokenKind;
    function Func141: TtkTokenKind;
    function Func143: TtkTokenKind;
    function Func144: TtkTokenKind;
    function Func146: TtkTokenKind;
    function Func152: TtkTokenKind;
    function Func153: TtkTokenKind;
    function Func154: TtkTokenKind;
    function Func155: TtkTokenKind;
    function Func160: TtkTokenKind;
    function Func161: TtkTokenKind;
    function Func166: TtkTokenKind;
    function Func169: TtkTokenKind;
    function Func171: TtkTokenKind;
    function Func174: TtkTokenKind;
    function Func179: TtkTokenKind;
    function Func187: TtkTokenKind;
    function Func202: TtkTokenKind;
    function Func210: TtkTokenKind;
    function Func212: TtkTokenKind;
    function Func216: TtkTokenKind;
    function Func221: TtkTokenKind;
    function Func253: TtkTokenKind;
    procedure IdentProc;
    procedure UnknownProc;
    function AltFunc: TtkTokenKind;
    procedure InitIdent;
    function IdentKind(MayBe: PChar): TtkTokenKind;
    procedure MakeMethodTables;
    procedure NullProc;
    procedure SpaceProc;
    procedure CRProc;
    procedure LFProc;
    procedure BlockCommentOpenProc;
    procedure BlockCommentProc;
    procedure StringOpenProc;
    procedure StringProc;
    procedure BlockStringOpenProc;
    procedure BlockStringProc;
  protected
    function GetIdentChars: TSynIdentChars; override;
    function GetSampleSource: string; override;
    function IsFilterStored: Boolean; override;
  public
    constructor Create(AOwner: TComponent); override;
    {$IFNDEF SYN_CPPB_1} class {$ENDIF}
    function GetLanguageName: string; override;
    function GetRange: Pointer; override;
    procedure ResetRange; override;
    procedure SetRange(Value: Pointer); override;
    function GetDefaultAttribute(Index: integer): TSynHighlighterAttributes; override;
    function GetEol: Boolean; override;
    function GetKeyWords: string;
    function GetTokenID: TtkTokenKind;
    procedure SetLine(NewValue: String; LineNumber: Integer); override;
    function GetToken: String; override;
    function GetTokenAttribute: TSynHighlighterAttributes; override;
    function GetTokenKind: integer; override;
    function GetTokenPos: Integer; override;
    procedure Next; override;
  published
    property CommentAttri: TSynHighlighterAttributes read fCommentAttri write fCommentAttri;
    property FunctionKeysAttri: TSynHighlighterAttributes read fFunctionKeysAttri write fFunctionKeysAttri;
    property IdentifierAttri: TSynHighlighterAttributes read fIdentifierAttri write fIdentifierAttri;
    property KeyAttri: TSynHighlighterAttributes read fKeyAttri write fKeyAttri;
    property SpaceAttri: TSynHighlighterAttributes read fSpaceAttri write fSpaceAttri;
    property StringAttri: TSynHighlighterAttributes read fStringAttri write fStringAttri;
  end;

implementation

uses
{$IFDEF SYN_CLX}
  QSynEditStrConst;
{$ELSE}
  SynEditStrConst;
{$ENDIF}

{$IFDEF SYN_COMPILER_3_UP}
resourcestring
{$ELSE}
const
{$ENDIF}
  SYNS_Filter = 'All files (*.*)|*.*';
  SYNS_Lang = '';
  SYNS_AttrFunctionKeys = 'FunctionKeys';

var
  Identifiers: array[#0..#255] of ByteBool;
  mHashTable : array[#0..#255] of Integer;

procedure MakeIdentTable;
var
  I, J: Char;
begin
  for I := #0 to #255 do
  begin
    case I of
      '_', 'a'..'z', 'A'..'Z': Identifiers[I] := True;
    else
      Identifiers[I] := False;
    end;
    J := UpCase(I);
    case I in ['_', 'A'..'Z', 'a'..'z'] of
      True: mHashTable[I] := Ord(J) - 64
    else
      mHashTable[I] := 0;
    end;
  end;
end;

procedure TSynLuaSyn.InitIdent;
var
  I: Integer;
  pF: PIdentFuncTableFunc;
begin
  pF := PIdentFuncTableFunc(@fIdentFuncTable);
  for I := Low(fIdentFuncTable) to High(fIdentFuncTable) do
  begin
    pF^ := AltFunc;
    Inc(pF);
  end;
  fIdentFuncTable[15] := Func15;
  fIdentFuncTable[16] := Func16;
  fIdentFuncTable[19] := Func19;
  fIdentFuncTable[22] := Func22;
  fIdentFuncTable[23] := Func23;
  fIdentFuncTable[29] := Func29;
  fIdentFuncTable[30] := Func30;
  fIdentFuncTable[31] := Func31;
  fIdentFuncTable[32] := Func32;
  fIdentFuncTable[33] := Func33;
  fIdentFuncTable[34] := Func34;
  fIdentFuncTable[35] := Func35;
  fIdentFuncTable[36] := Func36;
  fIdentFuncTable[37] := Func37;
  fIdentFuncTable[38] := Func38;
  fIdentFuncTable[39] := Func39;
  fIdentFuncTable[40] := Func40;
  fIdentFuncTable[41] := Func41;
  fIdentFuncTable[42] := Func42;
  fIdentFuncTable[43] := Func43;
  fIdentFuncTable[44] := Func44;
  fIdentFuncTable[45] := Func45;
  fIdentFuncTable[46] := Func46;
  fIdentFuncTable[47] := Func47;
  fIdentFuncTable[49] := Func49;
  fIdentFuncTable[50] := Func50;
  fIdentFuncTable[52] := Func52;
  fIdentFuncTable[54] := Func54;
  fIdentFuncTable[56] := Func56;
  fIdentFuncTable[57] := Func57;
  fIdentFuncTable[58] := Func58;
  fIdentFuncTable[59] := Func59;
  fIdentFuncTable[60] := Func60;
  fIdentFuncTable[62] := Func62;
  fIdentFuncTable[63] := Func63;
  fIdentFuncTable[64] := Func64;
  fIdentFuncTable[65] := Func65;
  fIdentFuncTable[66] := Func66;
  fIdentFuncTable[67] := Func67;
  fIdentFuncTable[68] := Func68;
  fIdentFuncTable[69] := Func69;
  fIdentFuncTable[70] := Func70;
  fIdentFuncTable[72] := Func72;
  fIdentFuncTable[73] := Func73;
  fIdentFuncTable[74] := Func74;
  fIdentFuncTable[76] := Func76;
  fIdentFuncTable[77] := Func77;
  fIdentFuncTable[78] := Func78;
  fIdentFuncTable[79] := Func79;
  fIdentFuncTable[81] := Func81;
  fIdentFuncTable[82] := Func82;
  fIdentFuncTable[83] := Func83;
  fIdentFuncTable[84] := Func84;
  fIdentFuncTable[85] := Func85;
  fIdentFuncTable[86] := Func86;
  fIdentFuncTable[87] := Func87;
  fIdentFuncTable[89] := Func89;
  fIdentFuncTable[90] := Func90;
  fIdentFuncTable[92] := Func92;
  fIdentFuncTable[93] := Func93;
  fIdentFuncTable[95] := Func95;
  fIdentFuncTable[96] := Func96;
  fIdentFuncTable[97] := Func97;
  fIdentFuncTable[98] := Func98;
  fIdentFuncTable[99] := Func99;
  fIdentFuncTable[102] := Func102;
  fIdentFuncTable[103] := Func103;
  fIdentFuncTable[104] := Func104;
  fIdentFuncTable[105] := Func105;
  fIdentFuncTable[107] := Func107;
  fIdentFuncTable[108] := Func108;
  fIdentFuncTable[114] := Func114;
  fIdentFuncTable[115] := Func115;
  fIdentFuncTable[119] := Func119;
  fIdentFuncTable[121] := Func121;
  fIdentFuncTable[122] := Func122;
  fIdentFuncTable[124] := Func124;
  fIdentFuncTable[127] := Func127;
  fIdentFuncTable[128] := Func128;
  fIdentFuncTable[129] := Func129;
  fIdentFuncTable[133] := Func133;
  fIdentFuncTable[134] := Func134;
  fIdentFuncTable[135] := Func135;
  fIdentFuncTable[141] := Func141;
  fIdentFuncTable[143] := Func143;
  fIdentFuncTable[144] := Func144;
  fIdentFuncTable[146] := Func146;
  fIdentFuncTable[152] := Func152;
  fIdentFuncTable[153] := Func153;
  fIdentFuncTable[154] := Func154;
  fIdentFuncTable[155] := Func155;
  fIdentFuncTable[160] := Func160;
  fIdentFuncTable[161] := Func161;
  fIdentFuncTable[166] := Func166;
  fIdentFuncTable[169] := Func169;
  fIdentFuncTable[171] := Func171;
  fIdentFuncTable[174] := Func174;
  fIdentFuncTable[179] := Func179;
  fIdentFuncTable[187] := Func187;
  fIdentFuncTable[202] := Func202;
  fIdentFuncTable[210] := Func210;
  fIdentFuncTable[212] := Func212;
  fIdentFuncTable[216] := Func216;
  fIdentFuncTable[221] := Func221;
  fIdentFuncTable[253] := Func253;
end;

function TSynLuaSyn.KeyHash(ToHash: PChar): Integer;
begin
  Result := 0;
  while ToHash^ in ['_', 'a'..'z', 'A'..'Z'] do
  begin
    inc(Result, mHashTable[ToHash^]);
    inc(ToHash);
  end;
  fStringLen := ToHash - fToIdent;
end;

function TSynLuaSyn.KeyComp(const aKey: String): Boolean;
var
  I: Integer;
  Temp: PChar;
begin
  Temp := fToIdent;
  if Length(aKey) = fStringLen then
  begin
    Result := True;
    for i := 1 to fStringLen do
    begin
      if mHashTable[Temp^] <> mHashTable[aKey[i]] then
      begin
        Result := False;
        break;
      end;
      inc(Temp);
    end;
  end
  else
    Result := False;
end;

function TSynLuaSyn.Func15: TtkTokenKind;
begin
  if KeyComp('if') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func16: TtkTokenKind;
begin
  if KeyComp('deg') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func19: TtkTokenKind;
begin
  if KeyComp('do') then Result := tkKey else
    if KeyComp('and') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func22: TtkTokenKind;
begin
  if KeyComp('abs') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func23: TtkTokenKind;
begin
  if KeyComp('rad') then Result := tkFunctionKeys else
    if KeyComp('in') then Result := tkKey else
      if KeyComp('end') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func29: TtkTokenKind;
begin
  if KeyComp('ceil') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func30: TtkTokenKind;
begin
  if KeyComp('char') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func31: TtkTokenKind;
begin
  if KeyComp('len') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func32: TtkTokenKind;
begin
  if KeyComp('mod') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func33: TtkTokenKind;
begin
  if KeyComp('or') then Result := tkKey else
    if KeyComp('find') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func34: TtkTokenKind;
begin
  if KeyComp('log') then Result := tkFunctionKeys else
    if KeyComp('log10') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func35: TtkTokenKind;
begin
  if KeyComp('nil') then Result := tkKey else
    if KeyComp('tan') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func36: TtkTokenKind;
begin
  if KeyComp('min') then Result := tkFunctionKeys else
    if KeyComp('atan2') then Result := tkFunctionKeys else
      if KeyComp('atan') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func37: TtkTokenKind;
begin
  if KeyComp('cos') then Result := tkFunctionKeys else
    if KeyComp('break') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func38: TtkTokenKind;
begin
  if KeyComp('acos') then Result := tkFunctionKeys else
    if KeyComp('max') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func39: TtkTokenKind;
begin
  if KeyComp('debug') then Result := tkFunctionKeys else
    if KeyComp('for') then Result := tkKey else
      if KeyComp('for') then Result := tkKey else
        if KeyComp('clear') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func40: TtkTokenKind;
begin
  if KeyComp('line') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func41: TtkTokenKind;
begin
  if KeyComp('else') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func42: TtkTokenKind;
begin
  if KeyComp('sub') then Result := tkFunctionKeys else
    if KeyComp('sin') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func43: TtkTokenKind;
begin
  if KeyComp('asin') then Result := tkFunctionKeys else
    if KeyComp('local') then Result := tkKey else
      if KeyComp('false') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func44: TtkTokenKind;
begin
  if KeyComp('clock') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func45: TtkTokenKind;
begin
  if KeyComp('exp') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func46: TtkTokenKind;
begin
  if KeyComp('rect') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func47: TtkTokenKind;
begin
  if KeyComp('then') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func49: TtkTokenKind;
begin
  if KeyComp('global') then Result := tkKey else
    if KeyComp('not') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func50: TtkTokenKind;
begin
  if KeyComp('circle') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func52: TtkTokenKind;
begin
  if KeyComp('byte') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func54: TtkTokenKind;
begin
  if KeyComp('pow') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func56: TtkTokenKind;
begin
  if KeyComp('concat') then Result := tkFunctionKeys else
    if KeyComp('rename') then Result := tkFunctionKeys else
      if KeyComp('foreach') then Result := tkFunctionKeys else
        if KeyComp('elseif') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func57: TtkTokenKind;
begin
  if KeyComp('while') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func58: TtkTokenKind;
begin
  if KeyComp('exit') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func59: TtkTokenKind;
begin
  if KeyComp('lines') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func60: TtkTokenKind;
begin
  if KeyComp('readfile') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func62: TtkTokenKind;
begin
  if KeyComp('getdate') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func63: TtkTokenKind;
begin
  if KeyComp('next') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func64: TtkTokenKind;
begin
  if KeyComp('true') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func65: TtkTokenKind;
begin
  if KeyComp('foreachi') then Result := tkFunctionKeys else
    if KeyComp('repeat') then Result := tkKey else
      if KeyComp('random') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func66: TtkTokenKind;
begin
  if KeyComp('flush') then Result := tkFunctionKeys else
    if KeyComp('type') then Result := tkFunctionKeys else
      if KeyComp('floor') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func67: TtkTokenKind;
begin
  if KeyComp('loadimage') then Result := tkFunctionKeys else
    if KeyComp('quit') then Result := tkFunctionKeys else
      if KeyComp('blending') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func68: TtkTokenKind;
begin
  if KeyComp('poly') then Result := tkFunctionKeys else
    if KeyComp('include') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func69: TtkTokenKind;
begin
  if KeyComp('frexp') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func70: TtkTokenKind;
begin
  if KeyComp('gridcell') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func72: TtkTokenKind;
begin
  if KeyComp('sort') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func73: TtkTokenKind;
begin
  if KeyComp('lower') then Result := tkFunctionKeys else
    if KeyComp('getfps') then Result := tkFunctionKeys else
      if KeyComp('format') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func74: TtkTokenKind;
begin
  if KeyComp('getres') then Result := tkFunctionKeys else
    if KeyComp('sqrt') then Result := tkFunctionKeys else
      if KeyComp('point') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func76: TtkTokenKind;
begin
  if KeyComp('upper') then Result := tkFunctionKeys else
    if KeyComp('until') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func77: TtkTokenKind;
begin
  if KeyComp('print') then Result := tkFunctionKeys else
    if KeyComp('fillgrid') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func78: TtkTokenKind;
begin
  if KeyComp('remove') then Result := tkFunctionKeys else
    if KeyComp('keyup') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func79: TtkTokenKind;
begin
  if KeyComp('keyfire3') then Result := tkFunctionKeys else
    if KeyComp('keyfire2') then Result := tkFunctionKeys else
      if KeyComp('keyfire1') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func81: TtkTokenKind;
begin
  if KeyComp('drawimage') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func82: TtkTokenKind;
begin
  if KeyComp('openfile') then Result := tkFunctionKeys else
    if KeyComp('posfile') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func83: TtkTokenKind;
begin
  if KeyComp('deletefile') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func84: TtkTokenKind;
begin
  if KeyComp('drawgrid') then Result := tkFunctionKeys else
    if KeyComp('keyleft') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func85: TtkTokenKind;
begin
  if KeyComp('fillrect') then Result := tkFunctionKeys else
    if KeyComp('insert') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func86: TtkTokenKind;
begin
  if KeyComp('closefile') then Result := tkFunctionKeys else
    if KeyComp('clipping') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func87: TtkTokenKind;
begin
  if KeyComp('createimage') then Result := tkFunctionKeys else
    if KeyComp('loadfont') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func89: TtkTokenKind;
begin
  if KeyComp('fillcircle') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func90: TtkTokenKind;
begin
  if KeyComp('creategrid') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func92: TtkTokenKind;
begin
  if KeyComp('openres') then Result := tkFunctionKeys else
    if KeyComp('imageheight') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func93: TtkTokenKind;
begin
  if KeyComp('require') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func95: TtkTokenKind;
begin
  if KeyComp('getcolor') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func96: TtkTokenKind;
begin
  if KeyComp('mousein') then Result := tkFunctionKeys else
    if KeyComp('return') then Result := tkKey else
      if KeyComp('closeres') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func97: TtkTokenKind;
begin
  if KeyComp('keydown') then Result := tkFunctionKeys else
    if KeyComp('mousex') then Result := tkFunctionKeys else
      if KeyComp('loadmusic') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func98: TtkTokenKind;
begin
  if KeyComp('rawequal') then Result := tkFunctionKeys else
    if KeyComp('mousey') then Result := tkFunctionKeys else
      if KeyComp('randomseed') then Result := tkFunctionKeys else
        if KeyComp('imagecolor') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func99: TtkTokenKind;
begin
  if KeyComp('imagewidth') then Result := tkFunctionKeys else
    if KeyComp('setfont') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func102: TtkTokenKind;
begin
  if KeyComp('function') then Result := tkKey else Result := tkIdentifier;
end;

function TSynLuaSyn.Func103: TtkTokenKind;
begin
  if KeyComp('keyright') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func104: TtkTokenKind;
begin
  if KeyComp('openconfig') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func105: TtkTokenKind;
begin
  if KeyComp('loadsound') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func107: TtkTokenKind;
begin
  if KeyComp('writefile') then Result := tkFunctionKeys else
    if KeyComp('fillpoly') then Result := tkFunctionKeys else
      if KeyComp('colormask') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func108: TtkTokenKind;
begin
  if KeyComp('closeconfig') then Result := tkFunctionKeys else
    if KeyComp('tonumber') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func114: TtkTokenKind;
begin
  if KeyComp('getresline') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func115: TtkTokenKind;
begin
  if KeyComp('drawtext') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func119: TtkTokenKind;
begin
  if KeyComp('playmusic') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func121: TtkTokenKind;
begin
  if KeyComp('screenheight') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func122: TtkTokenKind;
begin
  if KeyComp('tostring') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func124: TtkTokenKind;
begin
  if KeyComp('loadgfxfont') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func127: TtkTokenKind;
begin
  if KeyComp('pausemusic') then Result := tkFunctionKeys else
    if KeyComp('playsound') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func128: TtkTokenKind;
begin
  if KeyComp('fileexists') then Result := tkFunctionKeys else
    if KeyComp('screenwidth') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func129: TtkTokenKind;
begin
  if KeyComp('mousedown') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func133: TtkTokenKind;
begin
  if KeyComp('textwidth') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func134: TtkTokenKind;
begin
  if KeyComp('gridworldx') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func135: TtkTokenKind;
begin
  if KeyComp('gridworldy') then Result := tkFunctionKeys else
    if KeyComp('stopmusic') then Result := tkFunctionKeys else
      if KeyComp('rendertarget') then Result := tkFunctionKeys else
        if KeyComp('pausesound') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func141: TtkTokenKind;
begin
  if KeyComp('destroyimage') then Result := tkFunctionKeys else
    if KeyComp('openresext') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func143: TtkTokenKind;
begin
  if KeyComp('stopsound') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func144: TtkTokenKind;
begin
  if KeyComp('destroygrid') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func146: TtkTokenKind;
begin
  if KeyComp('resumemusic') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func152: TtkTokenKind;
begin
  if KeyComp('drawgfxtext') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func153: TtkTokenKind;
begin
  if KeyComp('musicvolume') then Result := tkFunctionKeys else
    if KeyComp('openconfigext') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func154: TtkTokenKind;
begin
  if KeyComp('resumesound') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func155: TtkTokenKind;
begin
  if KeyComp('readconfignumber') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func160: TtkTokenKind;
begin
  if KeyComp('drawrotateimage') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func161: TtkTokenKind;
begin
  if KeyComp('windowfocused') then Result := tkFunctionKeys else
    if KeyComp('soundvolume') then Result := tkFunctionKeys else
      if KeyComp('destroyfont') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func166: TtkTokenKind;
begin
  if KeyComp('numkeypress') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func169: TtkTokenKind;
begin
  if KeyComp('readconfigstring') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func171: TtkTokenKind;
begin
  if KeyComp('destroymusic') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func174: TtkTokenKind;
begin
  if KeyComp('drawstretchimage') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func179: TtkTokenKind;
begin
  if KeyComp('destroysound') then Result := tkFunctionKeys else
    if KeyComp('stopallmusics') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func187: TtkTokenKind;
begin
  if KeyComp('stopallsounds') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func202: TtkTokenKind;
begin
  if KeyComp('writeconfignumber') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func210: TtkTokenKind;
begin
  if KeyComp('getnumiterations') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func212: TtkTokenKind;
begin
  if KeyComp('destroygfxtext') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func216: TtkTokenKind;
begin
  if KeyComp('writeconfigstring') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func221: TtkTokenKind;
begin
  if KeyComp('getmemorystatus') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.Func253: TtkTokenKind;
begin
  if KeyComp('drawrotatestretchimage') then Result := tkFunctionKeys else Result := tkIdentifier;
end;

function TSynLuaSyn.AltFunc: TtkTokenKind;
begin
  Result := tkIdentifier;
end;

function TSynLuaSyn.IdentKind(MayBe: PChar): TtkTokenKind;
var
  HashKey: Integer;
begin
  fToIdent := MayBe;
  HashKey := KeyHash(MayBe);
  if HashKey <= MaxKey then
    Result := fIdentFuncTable[HashKey]
  else
    Result := tkIdentifier;
end;

procedure TSynLuaSyn.MakeMethodTables;
var
  I: Char;
begin
  for I := #0 to #255 do
    case I of
      #0: fProcTable[I] := NullProc;
      #10: fProcTable[I] := LFProc;
      #13: fProcTable[I] := CRProc;
      '-': fProcTable[I] := BlockCommentOpenProc;
      '"': fProcTable[I] := StringOpenProc;
      '[': fProcTable[I] := BlockStringOpenProc;
      #1..#9,
      #11,
      #12,
      #14..#32 : fProcTable[I] := SpaceProc;
      'A'..'Z', 'a'..'z', '_': fProcTable[I] := IdentProc;
    else
      fProcTable[I] := UnknownProc;
    end;
end;

procedure TSynLuaSyn.SpaceProc;
begin
  fTokenID := tkSpace;
  repeat
    inc(Run);
  until not (fLine[Run] in [#1..#32]);
end;

procedure TSynLuaSyn.NullProc;
begin
  fTokenID := tkNull;
end;

procedure TSynLuaSyn.CRProc;
begin
  fTokenID := tkSpace;
  inc(Run);
  if fLine[Run] = #10 then
    inc(Run);
end;

procedure TSynLuaSyn.LFProc;
begin
  fTokenID := tkSpace;
  inc(Run);
end;

 
{ ??? ???. } 
procedure TSynLuaSyn.BlockCommentOpenProc;  
begin  
  Inc(Run);  
  if (fLine[Run] = '-') then  
    begin  
      if (fLine[Run + 1] = '[') and (fLine[Run + 2] = '[') then { block comment }  
        begin  
          fRange := rsBlockComment;  
          BlockCommentProc;  
          fTokenID := tkComment;  
        end  
      else { line comment }  
        begin  
          fTokenID := tkComment;  
          inc(Run, 1);  
          while not (fLine[Run] in [#0, #10, #13]) do  
            Inc(Run);  
        end;  
    end  
  else  
    fTokenID := tkIdentifier;  
end; 

procedure TSynLuaSyn.BlockCommentProc;
begin
  case fLine[Run] of
     #0: NullProc;
    #10: LFProc;
    #13: CRProc;
  else
    begin
      fTokenID := tkComment;
      repeat
        if (fLine[Run] = '-') and
           (fLine[Run + 1] = '-') and
           (fLine[Run + 2] = ']') and
           (fLine[Run + 3] = ']') then
        begin
          Inc(Run, 4);
          fRange := rsUnKnown;
          Break;
        end;
        if not (fLine[Run] in [#0, #10, #13]) then
          Inc(Run);
      until fLine[Run] in [#0, #10, #13];
    end;
  end;
end;

procedure TSynLuaSyn.StringOpenProc;
begin
  Inc(Run);
  fRange := rsString;
  StringProc;
  fTokenID := tkString;
end;

procedure TSynLuaSyn.StringProc;
begin
  fTokenID := tkString;
  repeat
    if (fLine[Run] = '"') then
    begin
      Inc(Run, 1);
      fRange := rsUnKnown;
      Break;
    end;
    if not (fLine[Run] in [#0, #10, #13]) then
      Inc(Run);
  until fLine[Run] in [#0, #10, #13];
end;

procedure TSynLuaSyn.BlockStringOpenProc;
begin
  Inc(Run);
  if (fLine[Run] = '[') then
  begin
    fRange := rsBlockString;
    BlockStringProc;
    fTokenID := tkString;
  end
  else
    fTokenID := tkIdentifier;
end;

procedure TSynLuaSyn.BlockStringProc;
begin
  case fLine[Run] of
     #0: NullProc;
    #10: LFProc;
    #13: CRProc;
  else
    begin
      fTokenID := tkString;
      repeat
        if (fLine[Run] = ']') and
           (fLine[Run + 1] = ']') then
        begin
          Inc(Run, 2);
          fRange := rsUnKnown;
          Break;
        end;
        if not (fLine[Run] in [#0, #10, #13]) then
          Inc(Run);
      until fLine[Run] in [#0, #10, #13];
    end;
  end;
end;

constructor TSynLuaSyn.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
  fCommentAttri := TSynHighLighterAttributes.Create(SYNS_AttrComment);
  fCommentAttri.Style := [fsItalic];
  fCommentAttri.Foreground := clYellow;
  AddAttribute(fCommentAttri);

  fFunctionKeysAttri := TSynHighLighterAttributes.Create(SYNS_AttrFunctionKeys);
  fFunctionKeysAttri.Style := [fsBold];
  fFunctionKeysAttri.Foreground := $00E2B88D;
  AddAttribute(fFunctionKeysAttri);

  fIdentifierAttri := TSynHighLighterAttributes.Create(SYNS_AttrIdentifier);
  AddAttribute(fIdentifierAttri);

  fKeyAttri := TSynHighLighterAttributes.Create(SYNS_AttrReservedWord);
  fKeyAttri.Style := [fsBold];
  fKeyAttri.Foreground := clAqua;
  AddAttribute(fKeyAttri);

  fSpaceAttri := TSynHighLighterAttributes.Create(SYNS_AttrSpace);
  AddAttribute(fSpaceAttri);

  fStringAttri := TSynHighLighterAttributes.Create(SYNS_AttrString);
  fStringAttri.Foreground := $0066ff00;
  AddAttribute(fStringAttri);

  SetAttributesOnChange(DefHighlightChange);
  InitIdent;
  MakeMethodTables;
  fDefaultFilter := SYNS_Filter;
  fRange := rsUnknown;
end;

procedure TSynLuaSyn.SetLine(NewValue: String; LineNumber: Integer);
begin
  fLineRef := NewValue;
  fLine := PChar(fLineRef);
  Run := 0;
  fLineNumber := LineNumber;
  Next;
end;

procedure TSynLuaSyn.IdentProc;
begin
  fTokenID := IdentKind((fLine + Run));
  inc(Run, fStringLen);
  while Identifiers[fLine[Run]] do
    Inc(Run);
end;

procedure TSynLuaSyn.UnknownProc;
begin
{$IFDEF SYN_MBCSSUPPORT}
  if FLine[Run] in LeadBytes then
    Inc(Run,2)
  else
{$ENDIF}
  inc(Run);
  fTokenID := tkUnknown;
end;

procedure TSynLuaSyn.Next;
begin
  fTokenPos := Run;
  case fRange of
    rsBlockComment: BlockCommentProc;
    rsBlockString: BlockStringProc;
  else
    begin
      fRange := rsUnknown;
      fProcTable[fLine[Run]];
    end;
  end;
end;

function TSynLuaSyn.GetDefaultAttribute(Index: integer): TSynHighLighterAttributes;
begin
  case Index of
    SYN_ATTR_COMMENT    : Result := fCommentAttri;
    SYN_ATTR_IDENTIFIER : Result := fIdentifierAttri;
    SYN_ATTR_KEYWORD    : Result := fKeyAttri;
    SYN_ATTR_STRING     : Result := fStringAttri;
    SYN_ATTR_WHITESPACE : Result := fSpaceAttri;
    SYN_ATTR_SYMBOL	: Result := fFunctionKeysAttri;
  else
    Result := nil;
  end;
end;

function TSynLuaSyn.GetEol: Boolean;
begin
  Result := fTokenID = tkNull;
end;

function TSynLuaSyn.GetKeyWords: string;
begin
  Result := 
    'abs,acos,and,asin,atan,atan2,blending,break,byte,ceil,char,circle,cle' +
    'ar,clipping,clock,closeconfig,closefile,closeres,colormask,concat,cos,' +
    'creategrid,createimage,debug,deg,deletefile,destroyfont,destroygfxtext' +
    ',destroygrid,destroyimage,destroymusic,destroysound,do,drawgfxtext,dra' +
    'wgrid,drawimage,drawrotateimage,drawrotatestretchimage,drawstretchimag' +
    'e,drawtext,else,elseif,end,exit,exp,false,fileexists,fillcircle,fillgr' +
    'id,fillpoly,fillrect,find,floor,flush,for,foreach,foreachi,format,frex' +
    'p,function,getcolor,getdate,getfps,getmemorystatus,getnumiterations,ge' +
    'tres,getresline,global,gridcell,gridworldx,gridworldy,if,imagecolor,im' +
    'ageheight,imagewidth,in,include,insert,keydown,keyfire1,keyfire2,keyfi' +
    're3,keyleft,keyright,keyup,len,line,lines,loadfont,loadgfxfont,loadima' +
    'ge,loadmusic,loadsound,local,log,log10,lower,max,min,mod,mousedown,mou' +
    'sein,mousex,mousey,musicvolume,next,nil,not,numkeypress,openconfig,ope' +
    'nconfigext,openfile,openres,openresext,or,pausemusic,pausesound,playmu' +
    'sic,playsound,point,poly,posfile,pow,print,quit,rad,random,randomseed,' +
    'rawequal,readconfignumber,readconfigstring,readfile,rect,remove,rename' +
    ',rendertarget,repeat,require,resumemusic,resumesound,return,screenheig' +
    'ht,screenwidth,setfont,sin,sort,soundvolume,sqrt,stopallmusics,stopall' +
    'sounds,stopmusic,stopsound,sub,tan,textwidth,then,tonumber,tostring,tr' +
    'ue,type,until,upper,while,windowfocused,writeconfignumber,writeconfigs' +
    'tring,writefile';
end;

function TSynLuaSyn.GetToken: String;
var
  Len: LongInt;
begin
  Len := Run - fTokenPos;
  SetString(Result, (FLine + fTokenPos), Len);
end;

function TSynLuaSyn.GetTokenID: TtkTokenKind;
begin
  Result := fTokenId;
end;

function TSynLuaSyn.GetTokenAttribute: TSynHighLighterAttributes;
begin
  case GetTokenID of
    tkComment: Result := fCommentAttri;
    tkFunctionKeys: Result := fFunctionKeysAttri;
    tkIdentifier: Result := fIdentifierAttri;
    tkKey: Result := fKeyAttri;
    tkSpace: Result := fSpaceAttri;
    tkString: Result := fStringAttri;
    tkUnknown: Result := fIdentifierAttri;
  else
    Result := nil;
  end;
end;

function TSynLuaSyn.GetTokenKind: integer;
begin
  Result := Ord(fTokenId);
end;

function TSynLuaSyn.GetTokenPos: Integer;
begin
  Result := fTokenPos;
end;

function TSynLuaSyn.GetIdentChars: TSynIdentChars;
begin
  Result := ['_', 'a'..'z', 'A'..'Z'];
end;

function TSynLuaSyn.GetSampleSource: string;
begin
  Result := '/* this is sample source for lua script */'#13#10 +
            #13#10 +
            '/* This hightlight will recognize a lua script */'#13#10 +
            #13#10 +
            'const char* myString = "this is string";'#13#10 +
            'int a = 0;';
end;

function TSynLuaSyn.IsFilterStored: Boolean;
begin
  Result := fDefaultFilter <> SYNS_Filter;
end;

{$IFNDEF SYN_CPPB_1} class {$ENDIF}
function TSynLuaSyn.GetLanguageName: string;
begin
  Result := SYNS_Lang;
end;

procedure TSynLuaSyn.ResetRange;
begin
  fRange := rsUnknown;
end;

procedure TSynLuaSyn.SetRange(Value: Pointer);
begin
  fRange := TRangeState(Value);
end;

function TSynLuaSyn.GetRange: Pointer;
begin
  Result := Pointer(fRange);
end;

initialization
  MakeIdentTable;
{$IFNDEF SYN_CPPB_1}
  RegisterPlaceableHighlighter(TSynLuaSyn);
{$ENDIF}
end.
