blob: b3a9feaaa5407d653510a9b0f15080e00f8a80b4 [file] [log] [blame]
Stephan Herrmann7b7062f2010-04-01 19:56:59 +00001/*******************************************************************************
Stephan Herrmann5be9c752018-03-03 19:53:40 +01002 * Copyright (c) 2000, 2018 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;
104 int TokenNamePLUS_PLUS = 1;
105 int TokenNameMINUS_MINUS = 2;
106 int TokenNameEQUAL_EQUAL = 35;
107 int TokenNameLESS_EQUAL = 66;
108 int TokenNameGREATER_EQUAL = 67;
109 int TokenNameNOT_EQUAL = 36;
110 int TokenNameLEFT_SHIFT = 14;
111 int TokenNameRIGHT_SHIFT = 11;
112 int TokenNameUNSIGNED_RIGHT_SHIFT = 12;
113 int TokenNamePLUS_EQUAL = 168;
114 int TokenNameMINUS_EQUAL = 169;
115 int TokenNameMULTIPLY_EQUAL = 170;
116 int TokenNameDIVIDE_EQUAL = 171;
117 int TokenNameAND_EQUAL = 172;
118 int TokenNameOR_EQUAL = 173;
119 int TokenNameXOR_EQUAL = 174;
120 int TokenNameREMAINDER_EQUAL = 175;
121 int TokenNameLEFT_SHIFT_EQUAL = 176;
122 int TokenNameRIGHT_SHIFT_EQUAL = 177;
123 int TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL = 178;
124 int TokenNameOR_OR = 80;
125 int TokenNameAND_AND = 79;
126 int TokenNamePLUS = 3;
127 int TokenNameMINUS = 4;
128 int TokenNameNOT = 71;
129 int TokenNameREMAINDER = 9;
130 int TokenNameXOR = 63;
131 int TokenNameAND = 62;
132 int TokenNameMULTIPLY = 8;
133 int TokenNameOR = 70;
134 int TokenNameTWIDDLE = 72;
135 int TokenNameDIVIDE = 10;
136 int TokenNameGREATER = 68;
137 int TokenNameLESS = 69;
138 int TokenNameLPAREN = 7;
139 int TokenNameRPAREN = 86;
140 int TokenNameLBRACE = 110;
141 int TokenNameRBRACE = 95;
142 int TokenNameLBRACKET = 15;
143 int TokenNameRBRACKET = 166;
144 int TokenNameSEMICOLON = 64;
145 int TokenNameQUESTION = 81;
146 int TokenNameCOLON = 154;
147 int TokenNameCOMMA = 90;
148 int TokenNameDOT = 6;
149 int TokenNameEQUAL = 167;
150 int TokenNameEOF = 158;
151 int TokenNameERROR = 309;
152
153 /**
154 * "enum" keyword (added in J2SE 1.5).
155 * @since 3.0
156 */
157 int TokenNameenum = 400;
158
159 /**
160 * "@" token (added in J2SE 1.5).
161 * @since 3.0
162 */
163 int TokenNameAT = 401;
164
165 /**
166 * "..." token (added in J2SE 1.5).
167 * @since 3.0
168 */
169 int TokenNameELLIPSIS = 402;
170
171 /**
172 * @since 3.1
173 */
174 int TokenNameconst = 403;
175
176 /**
177 * @since 3.1
178 */
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200179 int TokenNamegoto = 404; // goto not found in Java ? :)
180
181 /**
Stephan Herrmann55b2e9a2014-03-29 14:16:38 +0100182 * @since 3.10
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200183 */
184 int TokenNameARROW = 405;
185 /**
Stephan Herrmann55b2e9a2014-03-29 14:16:38 +0100186 * @since 3.10
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200187 */
188 int TokenNameCOLON_COLON = 406;
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000189
190//{ObjectTeams: mirrored from auto-generated TerminalTokens.java. Note: the values here must be constant across Eclipse-versions, so do not simply copy the identifiers!
191 // Take values from 5000 upwards
Stephan Herrmann5fa7f312012-07-13 01:52:51 +0200192 int
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000193 TokenNamebase = 5000,
194 TokenNametsuper = 5001,
195 TokenNamecallin = 5002,
196 TokenNamewithin = 5003,
197 TokenNameplayedBy = 5004,
198 TokenNamewith = 5005,
199 TokenNameteam = 5006,
200 TokenNameas = 5007,
201 TokenNameresult = 5008,
202 TokenNamereplace = 5009,
203 TokenNameafter = 5010,
204 TokenNamebefore = 5011,
205 TokenNameBINDIN = 5012,
206 TokenNameBINDOUT = 5013,
207 TokenNameCALLOUT_OVERRIDE = 5014,
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000208 TokenNameget = 5016,
209 TokenNameset = 5017,
210 TokenNamewhen = 5018,
211 TokenNameprecedence = 5019;
Stephan Herrmannf8372722018-03-13 21:21:40 +0100212 /**
213 * @deprecated Modifier 'readonly' is no longer recognized. It was never truly supported.
214 */
215 @Deprecated
216 int TokenNamereadonly = 5015;
Stephan Herrmann7b7062f2010-04-01 19:56:59 +0000217// carp}
218}