Source Code Cross Referenced for IScanner.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » core » compiler » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jdt » org.eclipse.jdt.core.compiler 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdt.core.compiler;
011:
012:        import org.eclipse.jdt.core.compiler.InvalidInputException;
013:
014:        /**
015:         * Definition of a Java scanner, as returned by the <code>ToolFactory</code>.
016:         * The scanner is responsible for tokenizing a given source, providing information about
017:         * the nature of the token read, its positions and source equivalent.
018:         * <p>
019:         * When the scanner has finished tokenizing, it answers an EOF token (<code>
020:         * ITerminalSymbols#TokenNameEOF</code>.
021:         * </p><p>
022:         * When encountering lexical errors, an <code>InvalidInputException</code> is thrown.
023:         * </p><p>
024:         * This interface is not intended to be implemented by clients.
025:         * </p>
026:         * 
027:         * @see org.eclipse.jdt.core.ToolFactory
028:         * @see ITerminalSymbols
029:         * @since 2.0
030:         */
031:        public interface IScanner {
032:
033:            /**
034:             * Answers the current identifier source, after unicode escape sequences have
035:             * been translated into unicode characters.
036:             * For example, if original source was <code>\\u0061bc</code> then it will answer <code>abc</code>.
037:             * 
038:             * @return the current identifier source, after unicode escape sequences have
039:             * been translated into unicode characters
040:             */
041:            char[] getCurrentTokenSource();
042:
043:            /**
044:             * Answers the current identifier source, before unicode escape sequences have
045:             * been translated into unicode characters.
046:             * For example, if original source was <code>\\u0061bc</code> then it will answer <code>\\u0061bc</code>.
047:             * 
048:             * @return the current identifier source, before unicode escape sequences have
049:             * been translated into unicode characters
050:             * @since 2.1
051:             */
052:            char[] getRawTokenSource();
053:
054:            /**
055:             * Answers the starting position of the current token inside the original source.
056:             * This position is zero-based and inclusive. It corresponds to the position of the first character 
057:             * which is part of this token. If this character was a unicode escape sequence, it points at the first 
058:             * character of this sequence.
059:             * 
060:             * @return the starting position of the current token inside the original source
061:             */
062:            int getCurrentTokenStartPosition();
063:
064:            /**
065:             * Answers the ending position of the current token inside the original source.
066:             * This position is zero-based and inclusive. It corresponds to the position of the last character
067:             * which is part of this token. If this character was a unicode escape sequence, it points at the last 
068:             * character of this sequence.
069:             * 
070:             * @return the ending position of the current token inside the original source
071:             */
072:            int getCurrentTokenEndPosition();
073:
074:            /**
075:             * Answers the starting position of a given line number. This line has to have been encountered
076:             * already in the tokenization process (in other words, it cannot be used to compute positions of lines beyond
077:             * current token). Once the entire source has been processed, it can be used without any limit.
078:             * Line starting positions are zero-based, and start immediately after the previous line separator (if any).
079:             * 
080:             * @param lineNumber the given line number
081:             * @return the starting position of a given line number
082:             */
083:            int getLineStart(int lineNumber);
084:
085:            /**
086:             * Answers the ending position of a given line number. This line has to have been encountered
087:             * already in the tokenization process (in other words, it cannot be used to compute positions of lines beyond
088:             * current token). Once the entire source has been processed, it can be used without any limit.
089:             * Line ending positions are zero-based, and correspond to the last character of the line separator 
090:             * (in case multi-character line separators).	 
091:             * 
092:             * @param lineNumber the given line number
093:             * @return the ending position of a given line number
094:             **/
095:            int getLineEnd(int lineNumber);
096:
097:            /**
098:             * Answers an array of the ending positions of the lines encountered so far. Line ending positions
099:             * are zero-based, and correspond to the last character of the line separator (in case multi-character
100:             * line separators).
101:             * 
102:             * @return an array of the ending positions of the lines encountered so far
103:             */
104:            int[] getLineEnds();
105:
106:            /**
107:             * Answers a 1-based line number using the lines which have been encountered so far. If the position
108:             * is located beyond the current scanned line, then the last line number will be answered.
109:             * 
110:             * @param charPosition the given character position
111:             * @return a 1-based line number using the lines which have been encountered so far
112:             */
113:            int getLineNumber(int charPosition);
114:
115:            /**
116:             * Read the next token in the source, and answers its ID as specified by <code>ITerminalSymbols</code>.
117:             * Note that the actual token ID values are subject to change if new keywords were added to the language
118:             * (for instance, 'assert' is a keyword in 1.4).
119:             * 
120:             * @throws InvalidInputException in case a lexical error was detected while reading the current token
121:             * @return the next token
122:             */
123:            int getNextToken() throws InvalidInputException;
124:
125:            /**
126:             * Answers the original source being processed (not a copy of it). 
127:             * 
128:             * @return the original source being processed
129:             */
130:            char[] getSource();
131:
132:            /**
133:             * Reposition the scanner on some portion of the original source. The given endPosition is the last valid position.
134:             * Beyond this position, the scanner will answer EOF tokens (<code>ITerminalSymbols.TokenNameEOF</code>).
135:             * 
136:             * @param startPosition the given start position
137:             * @param endPosition the given end position
138:             */
139:            void resetTo(int startPosition, int endPosition);
140:
141:            /**
142:             * Set the scanner source to process. By default, the scanner will consider starting at the beginning of the
143:             * source until it reaches its end.
144:             * If the given source is <code>null</code>, this clears the source.
145:             * 
146:             * @param source the given source
147:             */
148:            void setSource(char[] source);
149:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.