Bug 12417 - api: IScanner, ITerminalSymbols - no way to get some tokens
Summary: api: IScanner, ITerminalSymbols - no way to get some tokens
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 2.0 M5   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-03-28 07:26 EST by Adam Kiezun CLA
Modified: 2002-03-28 18:38 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Kiezun CLA 2002-03-28 07:26:36 EST
there's now way to get 

Scanner.TokenNameWHITESPACE
Scanner.TokenNameCOMMENT_LINE
Scanner.TokenNameCOMMENT_BLOCK
Scanner.TokenNameCOMMENT_JAVADOC
Comment 1 Adam Kiezun CLA 2002-03-28 08:29:56 EST
i meant 'there's no way' 
Comment 2 Olivier Thomann CLA 2002-03-28 09:16:32 EST
Which way are you creating the scanner?

If you want comments and whitespaces, you have to 
use:
ToolFactory.createScanner(true, true, false); // false if you don't want to be in assert 
mode

Let me know if this is the way you created your scanner.
Comment 3 Adam Kiezun CLA 2002-03-28 09:52:42 EST
yes, i use ToolFactory
(well, for now i use new Scanner(...)) but wanted to move to using the API

but these token IDs are missing
Comment 4 Philipe Mulet CLA 2002-03-28 10:08:29 EST
If you properly toggle the scanner factory method, then it will tokenize these 
tokens, see Olivier's comment.

Please reopen if you can provide a test case where it doesn't work.

Closing
Comment 5 Adam Kiezun CLA 2002-03-28 10:14:31 EST
i do get them tokenized 
but how do i know (using API types) that i have one of these tokens in hand?

the only way is to use constants defined in Scanner
but Scanner is not API
Comment 6 Philipe Mulet CLA 2002-03-28 18:38:01 EST
Constants surfaced on ITerminalSymbols.

Fixed.