Source Code Cross Referenced for Token.java in  » Database-Client » SQL-Workbench » workbench » sql » formatter » 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 » Database Client » SQL Workbench » workbench.sql.formatter 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * This file is part of a syntax highlighting package
003:         * Copyright (C) 1999, 2000  Stephen Ostermiller
004:         * http://ostermiller.org/contact.pl?regarding=Syntax+Highlighting
005:         *
006:         * This program is free software; you can redistribute it and/or modify
007:         * it under the terms of the GNU General Public License as published by
008:         * the Free Software Foundation; either version 2 of the License, or
009:         * (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful,
012:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014:         * GNU General Public License for more details.
015:         *
016:         * See COPYING.TXT for details.
017:         */
018:        package workbench.sql.formatter;
019:
020:        /**
021:         * A generic token class.
022:         */
023:        public abstract class Token {
024:
025:            /**
026:             * A unique ID for this type of token.
027:             * Typically, ID numbers for each type will
028:             * be static variables of the Token class.
029:             *
030:             * @return an ID for this type of token.
031:             */
032:            public abstract int getID();
033:
034:            /**
035:             * A description of this token.  The description should
036:             * be appropriate for syntax highlighting.  For example
037:             * "comment" might be returned for a comment.  This should
038:             * make it easy to do html syntax highlighting.  Just use
039:             * style sheets to define classes with the same name as
040:             * the description and write the token in the html file
041:             * with that css class name.
042:             *
043:             * @return a description of this token.
044:             */
045:            public abstract String getDescription();
046:
047:            /**
048:             * The actual meat of the token.
049:             *
050:             * @return a string representing the text of the token.
051:             */
052:            public abstract String getContents();
053:
054:            /**
055:             * Determine if this token is a comment.  Sometimes comments should be
056:             * ignored (compiling code) other times they should be used
057:             * (syntax highlighting).  This provides a method to check
058:             * in case you feel you should ignore comments.
059:             *
060:             * @return true if this token represents a comment.
061:             */
062:            public abstract boolean isComment();
063:
064:            /**
065:             * Determine if this token is whitespace.  Sometimes whitespace should be
066:             * ignored (compiling code) other times they should be used
067:             * (code beautification).  This provides a method to check
068:             * in case you feel you should ignore whitespace.
069:             *
070:             * @return true if this token represents whitespace.
071:             */
072:            public abstract boolean isWhiteSpace();
073:
074:            /**
075:             * Determine if this token is an error.  Lets face it, not all code
076:             * conforms to spec. The lexer might know about an error
077:             * if a string literal is not closed, for example.
078:             *
079:             * @return true if this token is an error.
080:             */
081:            public abstract boolean isError();
082:
083:            /**
084:             * get the line number of the input on which this token started
085:             *
086:             * @return the line number of the input on which this token started
087:             */
088:            public abstract int getLineNumber();
089:
090:            /**
091:             * get the offset into the input in characters at which this token started
092:             *
093:             * @return the offset into the input in characters at which this token started
094:             */
095:            public abstract int getCharBegin();
096:
097:            /**
098:             * get the offset into the input in characters at which this token ended
099:             *
100:             * @return the offset into the input in characters at which this token ended
101:             */
102:            public abstract int getCharEnd();
103:
104:            /**
105:             * get a String that explains the error, if this token is an error.
106:             *
107:             * @return a  String that explains the error, if this token is an error, null otherwise.
108:             */
109:            public abstract String errorString();
110:
111:            /**
112:             * The state of the tokenizer is undefined.
113:             */
114:            public static final int UNDEFINED_STATE = -1;
115:
116:            /**
117:             * The initial state of the tokenizer.
118:             * Anytime the tokenizer returns to this state,
119:             * the tokenizer could be restarted from that point
120:             * with side effects.
121:             */
122:            public static final int INITIAL_STATE = 0;
123:
124:            /**
125:             * Get an integer representing the state the tokenizer is in after
126:             * returning this token.
127:             * Those who are interested in incremental tokenizing for performance
128:             * reasons will want to use this method to figure out where the tokenizer
129:             * may be restarted.  The tokenizer starts in Token.INITIAL_STATE, so
130:             * any time that it reports that it has returned to this state, the
131:             * tokenizer may be restarted from there.
132:             */
133:            public abstract int getState();
134:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.