blob: 1fe00e15501b47f3b0b388a82cd67a748e05ccc6 [file] [log] [blame]
Stephan Herrmann7b7062f2010-04-01 19:56:59 +00001/*******************************************************************************
Stephan Herrmanna2818402019-11-05 19:37:30 +01002 * Copyright (c) 2000, 2019 IBM Corporation and others.
Stephan Herrmannaa0c80c2018-09-08 22:11:53 +02003 *
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
Stephan Herrmann7b7062f2010-04-01 19:56:59 +00006 * which accompanies this distribution, and is available at
Stephan Herrmannaa0c80c2018-09-08 22:11:53 +02007 * https://www.eclipse.org/legal/epl-2.0/
8 *
9 * SPDX-License-Identifier: EPL-2.0
10 *
Stephan Herrmann7b7062f2010-04-01 19:56:59 +000011 * Contributors:
12 * IBM Corporation - initial API and implementation
13 * Fraunhofer FIRST - extended API and implementation
14 * Technical University Berlin - extended API and implementation
15 *******************************************************************************/
16
17package org.eclipse.jdt.core.compiler;
18
19/**
20 * Maps each terminal symbol in the java-grammar into a unique integer.
21 * This integer is used to represent the terminal when computing a parsing action.
22 *
23 * @see IScanner
24 * @since 2.0
25 * @noimplement This interface is not intended to be implemented by clients.
26 */
27public interface ITerminalSymbols {
28
29 int TokenNameWHITESPACE = 1000;
30 int TokenNameCOMMENT_LINE = 1001;
31 int TokenNameCOMMENT_BLOCK = 1002;
32 int TokenNameCOMMENT_JAVADOC = 1003;
33
Stephan Herrmann5be9c752018-03-03 19:53:40 +010034 /**
35 * @deprecated With the introduction of "restricted keywords" in Java 9, classification of tokens
36 * by a scanner is inherently unreliable. Any token classified as an identifier could still
37 * be a "restricted keyword". Future versions of Java will introduce more words that have
38 * special syntactical meaning in specific contexts.
39 * For reliably detecting an identifier the only real solution is to use a parser instead
40 * (see also the caveat at the top of the interface documentation of {@link IScanner}).
41 */
42 @Deprecated
Stephan Herrmann7b7062f2010-04-01 19:56:59 +000043 int TokenNameIdentifier = 5;
44 int TokenNameabstract = 98;
45
46 /**
47 * "assert" token (added in J2SE 1.4).
48 */
49 int TokenNameassert = 118;
50 int TokenNameboolean = 18;
51 int TokenNamebreak = 119;
52 int TokenNamebyte = 19;
53 int TokenNamecase = 211;
54 int TokenNamecatch = 225;
55 int TokenNamechar = 20;
56 int TokenNameclass = 165;
57 int TokenNamecontinue = 120;
58 int TokenNamedefault = 212;
59 int TokenNamedo = 121;
60 int TokenNamedouble = 21;
61 int TokenNameelse = 213;
62 int TokenNameextends = 243;
63 int TokenNamefalse = 37;
64 int TokenNamefinal = 99;
65 int TokenNamefinally = 226;
66 int TokenNamefloat = 22;
67 int TokenNamefor = 122;
68 int TokenNameif = 123;
69 int TokenNameimplements = 268;
70 int TokenNameimport = 191;
71 int TokenNameinstanceof = 65;
72 int TokenNameint = 23;
73 int TokenNameinterface = 180;
74 int TokenNamelong = 24;
75 int TokenNamenative = 100;
76 int TokenNamenew = 32;
77 int TokenNamenull = 38;
78 int TokenNamepackage = 214;
79 int TokenNameprivate = 101;
80 int TokenNameprotected = 102;
81 int TokenNamepublic = 103;
82 int TokenNamereturn = 124;
83 int TokenNameshort = 25;
84 int TokenNamestatic = 94;
85 int TokenNamestrictfp = 104;
86 int TokenNamesuper = 33;
87 int TokenNameswitch = 125;
88 int TokenNamesynchronized = 85;
89 int TokenNamethis = 34;
90 int TokenNamethrow = 126;
91 int TokenNamethrows = 227;
92 int TokenNametransient = 105;
93 int TokenNametrue = 39;
94 int TokenNametry = 127;
95 int TokenNamevoid = 26;
96 int TokenNamevolatile = 106;
97 int TokenNamewhile = 117;
98 int TokenNameIntegerLiteral = 40;
99 int TokenNameLongLiteral = 41;
100 int TokenNameFloatingPointLiteral = 42;
101 int TokenNameDoubleLiteral = 43;
102 int TokenNameCharacterLiteral = 44;
103 int TokenNameStringLiteral = 45;
Stephan Herrmanna2818402019-11-05 19:37:30 +0100104 /**
105 * @since 3.20
106 * @noreference This class is not intended to be referenced by clients as it is a part of Java preview feature.
107 */
108 int TokenNameTextBlock = 46;
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000109 int TokenNamePLUS_PLUS = 1;
110 int TokenNameMINUS_MINUS = 2;
111 int TokenNameEQUAL_EQUAL = 35;
112 int TokenNameLESS_EQUAL = 66;
113 int TokenNameGREATER_EQUAL = 67;
114 int TokenNameNOT_EQUAL = 36;
115 int TokenNameLEFT_SHIFT = 14;
116 int TokenNameRIGHT_SHIFT = 11;
117 int TokenNameUNSIGNED_RIGHT_SHIFT = 12;
118 int TokenNamePLUS_EQUAL = 168;
119 int TokenNameMINUS_EQUAL = 169;
120 int TokenNameMULTIPLY_EQUAL = 170;
121 int TokenNameDIVIDE_EQUAL = 171;
122 int TokenNameAND_EQUAL = 172;
123 int TokenNameOR_EQUAL = 173;
124 int TokenNameXOR_EQUAL = 174;
125 int TokenNameREMAINDER_EQUAL = 175;
126 int TokenNameLEFT_SHIFT_EQUAL = 176;
127 int TokenNameRIGHT_SHIFT_EQUAL = 177;
128 int TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 178;
129 int TokenNameOR_OR = 80;
130 int TokenNameAND_AND = 79;
131 int TokenNamePLUS = 3;
132 int TokenNameMINUS = 4;
133 int TokenNameNOT = 71;
134 int TokenNameREMAINDER = 9;
135 int TokenNameXOR = 63;
136 int TokenNameAND = 62;
137 int TokenNameMULTIPLY = 8;
138 int TokenNameOR = 70;
139 int TokenNameTWIDDLE = 72;
140 int TokenNameDIVIDE = 10;
141 int TokenNameGREATER = 68;
142 int TokenNameLESS = 69;
143 int TokenNameLPAREN = 7;
144 int TokenNameRPAREN = 86;
145 int TokenNameLBRACE = 110;
146 int TokenNameRBRACE = 95;
147 int TokenNameLBRACKET = 15;
148 int TokenNameRBRACKET = 166;
149 int TokenNameSEMICOLON = 64;
150 int TokenNameQUESTION = 81;
151 int TokenNameCOLON = 154;
152 int TokenNameCOMMA = 90;
153 int TokenNameDOT = 6;
154 int TokenNameEQUAL = 167;
155 int TokenNameEOF = 158;
156 int TokenNameERROR = 309;
157
158 /**
159 * "enum" keyword (added in J2SE 1.5).
160 * @since 3.0
161 */
162 int TokenNameenum = 400;
163
164 /**
165 * "@" token (added in J2SE 1.5).
166 * @since 3.0
167 */
168 int TokenNameAT = 401;
169
170 /**
171 * "..." token (added in J2SE 1.5).
172 * @since 3.0
173 */
174 int TokenNameELLIPSIS = 402;
175
176 /**
177 * @since 3.1
178 */
179 int TokenNameconst = 403;
180
181 /**
182 * @since 3.1
183 */
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200184 int TokenNamegoto = 404; // goto not found in Java ? :)
185
186 /**
Stephan Herrmann55b2e9a2014-03-29 14:16:38 +0100187 * @since 3.10
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200188 */
189 int TokenNameARROW = 405;
190 /**
Stephan Herrmann55b2e9a2014-03-29 14:16:38 +0100191 * @since 3.10
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200192 */
193 int TokenNameCOLON_COLON = 406;
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000194
195//{ObjectTeams: mirrored from auto-generated TerminalTokens.java. Note: the values here must be constant across Eclipse-versions, so do not simply copy the identifiers!
196 // Take values from 5000 upwards
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200197 int
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000198 TokenNamebase = 5000,
199 TokenNametsuper = 5001,
200 TokenNamecallin = 5002,
201 TokenNamewithin = 5003,
202 TokenNameplayedBy = 5004,
203 TokenNamewith = 5005,
204 TokenNameteam = 5006,
205 TokenNameas = 5007,
206 TokenNameresult = 5008,
207 TokenNamereplace = 5009,
208 TokenNameafter = 5010,
209 TokenNamebefore = 5011,
210 TokenNameBINDIN = 5012,
211 TokenNameBINDOUT = 5013,
212 TokenNameCALLOUT_OVERRIDE = 5014,
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000213 TokenNameget = 5016,
214 TokenNameset = 5017,
215 TokenNamewhen = 5018,
216 TokenNameprecedence = 5019;
Stephan Herrmannf8372722018-03-13 21:21:40 +0100217 /**
218 * @deprecated Modifier 'readonly' is no longer recognized. It was never truly supported.
219 */
220 @Deprecated
221 int TokenNamereadonly = 5015;
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000222// carp}
223}