123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- { *********************************************************************
- This file is part of the Free Component Library (FCL)
- Copyright (c) 2016 Michael Van Canneyt.
-
- Javascript token definitions
-
- See the file COPYING.FPC, included in this distribution,
- for details about the copyright.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
- unit jstoken;
- {$mode objfpc}{$H+}
- interface
- type
- TJSToken = (tjsUnknown,
- // Specials
- tjsEOF,tjsWhiteSpace,tjsChar,tjsString{this bites TJSString}, tjsIdentifier,tjsNumber, tjsComment,tjsREGEX, tjsRESERVED,
- tjsANDAND, tjsANDEQ,
- tjsBraceOpen,tjsBraceClose,tjsSQuaredBraceOpen,tjsSQuaredBraceClose,tjsCurlyBraceOpen,tjsCurlyBraceClose,
- tjsCOMMA,tjsCOLON, tjsDOT,tjsSEMICOLON, tjsASSIGN,tjsGT,tjsLT, tjsConditional,
- tjsPLUS,tjsMINUS,tjsMUL,tjsDIV,tjsAnd,tjsOR, tjsInv, tjsMod, tjsXOR, tjsNot,
- tjsEQ,
- tjsGE,
- tjsLE, tjsLSHIFT, tjsLSHIFTEQ,
- tjsMINUSEQ, tjsMINUSMINUS, tjsMODEQ,tjsDIVEQ,tjsXOREq,
- tjsNE,
- tjsOREQ, tjsOROR,
- tjsPLUSEQ, tjsPLUSPLUS,
- tjsURSHIFT, tjsURSHIFTEQ,
- tjsRSHIFT, tjsRSHIFTEQ,
- tjsSEQ, tjsSNE, tjsMULEQ,
- { Reserved words start here. They must be last }
- tjsBREAK,tjsCASE, tjsCATCH, tjsCONTINUE,
- tjsDEFAULT, tjsDELETE, tjsDO,
- tjsELSE,
- tjsFalse, tjsFINALLY, tjsFOR, tjsFUNCTION,
- tjsIF, tjsIN, tjsINSTANCEOF,
- tjsNEW,tjsNULL,
- tjsRETURN,
- tjsSWITCH,
- tjsTHIS, tjsTHROW, tjsTrue, tjsTRY, tjsTYPEOF,
- tjsVAR, tjsVOID,
- tjsWHILE, tjsWITH
- );
- const
- FirstKeyword = tjsBreak;
- LastKeyWord = tJSWith;
- TokenInfos: array[TJSToken] of string = ('unknown',
- // Specials
- 'EOF','whitespace','Char','String', 'identifier','number','comment','regular expression', 'reserved word',
- '&&','&=',
- '(',')','[',']','{','}',
- ',',':','.',';','=','>','<','?',
- '+','-','*','/','&','|','~','%','^','!',
- '==',
- '>=',
- '<=', '<<', '<<=',
- '-=', '--', '%=', '/=','^=',
- '!=',
- '|=', '||',
- '+=', '++',
- '>>>', '>>>=',
- '>>', '>>=',
- '===', '!==', '*=',
- // Identifiers last
- 'break','case','catch', 'continue',
- 'default','delete', 'do',
- 'else',
- 'false','finally', 'for', 'function',
- 'if', 'in', 'instanceof',
- 'new','null',
- 'return',
- 'switch',
- 'this', 'throw', 'true', 'try', 'typeof',
- 'var', 'void',
- 'while', 'with'
- );
- implementation
- end.
|