blob: 959fba033e83450100cf2f01e71cf3b8620c0ffd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
/* NSC -- new Scala compiler
* Copyright 2005-2006 LAMP/EPFL
* @author Martin Odersky
*/
// $Id$
package scala.tools.nsc.ast.parser
object Tokens {
/** special tokens */
final val EMPTY = -3
final val UNDEF = -2
final val ERROR = -1
final val EOF = 0
/** literals */
final val CHARLIT = 1
final val INTLIT = 2
final val LONGLIT = 3
final val FLOATLIT = 4
final val DOUBLELIT = 5
final val STRINGLIT = 6
final val SYMBOLLIT = 7
def isLiteral(code : Int) =
code >= CHARLIT && code <= SYMBOLLIT
/** identifiers */
final val IDENTIFIER = 10
final val BACKQUOTED_IDENT = 11
def isIdentifier(code : Int) =
code >= IDENTIFIER && code <= BACKQUOTED_IDENT
/** keywords */
final val IF = 20
final val FOR = 21
final val ELSE = 22
final val THIS = 23
final val NULL = 24
final val NEW = 25
final val WITH = 26
final val SUPER = 27
final val CASE = 28
final val CASECLASS = 29
final val CASEOBJECT = 30
final val VAL = 31
final val ABSTRACT = 32
final val FINAL = 33
final val PRIVATE = 34
final val PROTECTED = 35
final val OVERRIDE = 36
final val IMPLICIT = 37
final val VAR = 38
final val DEF = 39
final val TYPE = 40
final val EXTENDS = 41
final val TRUE = 42
final val FALSE = 43
final val OBJECT = 44
final val CLASS = 45
final val IMPORT = 46
final val PACKAGE = 47
final val YIELD = 48
final val DO = 49
final val TRAIT = 50
final val SEALED = 51
final val THROW = 52
final val TRY = 53
final val CATCH = 54
final val FINALLY = 55
final val WHILE = 56
final val RETURN = 57
final val MATCH = 58
final val FORSOME = 59
final val REQUIRES = 60
final val LAZY = 61
def isKeyword(code : Int) =
code >= IF && code <= LAZY
/** special symbols */
final val COMMA = 70
final val SEMI = 71
final val DOT = 72
final val USCORE = 73
final val COLON = 74
final val EQUALS = 75
final val LARROW = 76
final val ARROW = 77
final val NEWLINE = 78
final val NEWLINES = 79
final val SUBTYPE = 80
final val SUPERTYPE = 81
final val HASH = 82
final val AT = 83
final val VIEWBOUND = 84
def isSymbol(code : Int) =
code >= COMMA && code <= VIEWBOUND
/** parenthesis */
final val LPAREN = 90
final val RPAREN = 91
final val LBRACKET = 92
final val RBRACKET = 93
final val LBRACE = 94
final val RBRACE = 95
def isParen(code : Int) =
code >= LPAREN && code <= RBRACE
/** XML mode */
final val XMLSTART = 96
/** for IDE only */
final val LINE_COMMENT = 97
final val COMMENT_START = 98
final val COMMENT_END = 99
final val DOC_START = 100
final val DOUBLE_QUOTE = 101
final val BACK_QUOTE = 102
final val MULTI_QUOTE = 103
//final val EMPTY_STRING = 104
final val WHITESPACE = 105
final val IGNORE = 106
final val XML_SINGLEEND = 107
final val XML_STARTEND = 108
final val ESCAPE = 109
}
|