Java Doc for Token.java in  » Template-Engine » Tea » com » go » tea » 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 » Template Engine » Tea » com.go.tea.compiler 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.go.tea.compiler.Token

All known Subclasses:   com.go.tea.compiler.LongToken,  com.go.tea.compiler.DoubleToken,  com.go.tea.compiler.FloatToken,  com.go.tea.compiler.IntToken,  com.go.tea.compiler.StringToken,
Token
public class Token implements java.io.Serializable(Code)
A Token represents the smallest whole element of a source file. Tokens are produced by a Scanner .
author:
   Brian S O'Neill
version:
   46 , 5/31/01


Field Summary
final public static  intAND
    
final public static  intASSIGN
    
final public static  intBREAK
    
final public static  intCALL
    
final public static  intCOMMA
    
final public static  intCOMMENT
     Token ID for a single-line or multi-line comment.
final public static  intCONCAT
    
final public static  intDIV
    
final public static  intDOT
    
final public static  intDOTDOT
    
final public static  intDOUBLE_HASH
    
final public static  intELLIPSIS
    
final public static  intELSE
    
final public static  intENTER_CODE
     Token ID for the start of a code region.
final public static  intENTER_TEXT
     Token ID for the start of a text region.
final public static  intEOF
     Token ID for the end of file.
final public static  intEQ
    
final public static  intFALSE
    
final public static  intFOREACH
    
final public static  intGE
    
final public static  intGT
    
final public static  intHASH
    
final public static  intIDENT
     Token ID for an identifier.
final public static  intIF
    
final public static  intIN
    
final public static  intISA
    
final public static  intLBRACE
    
final public static  intLBRACK
    
final public static  intLE
    
final public static  intLPAREN
    
final public static  intLT
    
final public static  intMINUS
    
final public static  intMOD
    
final public static  intMULT
    
final public static  intNE
    
final public static  intNOT
    
final public static  intNULL
    
final public static  intNUMBER
     Token ID for a number literal.
final public static  intOR
    
final public static  intPLUS
    
final public static  intRBRACE
    
final public static  intRBRACK
    
final public static  intREVERSE
    
final public static  intRPAREN
    
final public static  intSEMI
    
final public static  intSLASH
    
final public static  intSTRING
     Token ID for a string literal.
final public static  intTEMPLATE
    
final public static  intTRUE
    
final public static  intUNKNOWN
     Token ID for an unknown token.

Constructor Summary
 Token(int sourceLine, int sourceStartPos, int sourceEndPos, int tokenID)
    
 Token(int sourceLine, int sourceStartPos, int sourceEndPos, int sourceDetailPos, int tokenID)
    
public  Token(SourceInfo info, int tokenID)
    

Method Summary
final public  voiddump()
     Dumps the contents of this Token to System.out.
final public  voiddump(PrintStream out)
     Dumps the contents of this Token.
public static  intfindReservedWordID(StringBuffer word)
     If the given StringBuffer starts with a valid token type, its ID is returned.
public  StringgetCode()
     Token code is non-null, and is exactly the same as the name for its ID.
public  doublegetDoubleValue()
     Only valid if token is a number.
public  floatgetFloatValue()
     Only valid if token is a number.
final public  intgetID()
     Returns the ID of this Token, which identifies what type of token it is.
public  StringgetImage()
     Token image represents what a static token looks like in a source file.
public  intgetIntValue()
     Only valid if token is a number.
public  longgetLongValue()
     Only valid if token is a number.
final public static  intgetMatchingBracket(int id)
     If the given id is a bracket: (,[,{,},],) then the matching bracket's id is returned.
public  intgetNumericType()
     Only valid if token is a number.
final public  SourceInfogetSourceInfo()
     Returns information regarding where in the source file this token came from.
public  StringgetStringValue()
    
final public static  booleanisBracket(int id)
    
final public  booleanisBracket()
    
final public static  booleanisCloseBracket(int id)
    
final public  booleanisCloseBracket()
    
final public static  booleanisOpenBracket(int id)
    
final public  booleanisOpenBracket()
    
final public static  booleanisOperator(int id)
    
final public  booleanisOperator()
    
final public static  booleanisReservedWord(int id)
    
final public  booleanisReservedWord()
     Returns true if this Token is a reserved word.
public  StringtoString()
    

Field Detail
AND
final public static int AND(Code)
Token ID for the and keyword: 'and'



ASSIGN
final public static int ASSIGN(Code)
Token ID for the assignment operator: '='



BREAK
final public static int BREAK(Code)
Token ID for the break keyword: 'break'



CALL
final public static int CALL(Code)
Token ID for the call keyword: 'call'



COMMA
final public static int COMMA(Code)
Token ID for the comma: ','



COMMENT
final public static int COMMENT(Code)
Token ID for a single-line or multi-line comment.



CONCAT
final public static int CONCAT(Code)
Token ID for the concatenation operator: '&'



DIV
final public static int DIV(Code)
Token ID for the division operator: '/'



DOT
final public static int DOT(Code)
Token ID for the dot: '.'



DOTDOT
final public static int DOTDOT(Code)
Token ID for the double dot: '..'



DOUBLE_HASH
final public static int DOUBLE_HASH(Code)
Token ID for the double hash: '##'



ELLIPSIS
final public static int ELLIPSIS(Code)
Token ID for the ellipsis: '...'



ELSE
final public static int ELSE(Code)
Token ID for the else keyword: 'else'



ENTER_CODE
final public static int ENTER_CODE(Code)
Token ID for the start of a code region.



ENTER_TEXT
final public static int ENTER_TEXT(Code)
Token ID for the start of a text region.



EOF
final public static int EOF(Code)
Token ID for the end of file.



EQ
final public static int EQ(Code)
Token ID for the equal operator: '=='



FALSE
final public static int FALSE(Code)
Token ID for the false literal: 'false'



FOREACH
final public static int FOREACH(Code)
Token ID for the for-each keyword: 'foreach'



GE
final public static int GE(Code)
Token ID for the greater than or equal operator: '>='



GT
final public static int GT(Code)
Token ID for the greater than operator: '>'



HASH
final public static int HASH(Code)
Token ID for the hash: '#'



IDENT
final public static int IDENT(Code)
Token ID for an identifier.



IF
final public static int IF(Code)
Token ID for the if keyword: 'if'



IN
final public static int IN(Code)
Token ID for the in keyword: 'in'



ISA
final public static int ISA(Code)
Token ID for the is-a keyword: 'isa'



LBRACE
final public static int LBRACE(Code)
Token ID for the left brace: '{'



LBRACK
final public static int LBRACK(Code)
Token ID for the left bracket: '['



LE
final public static int LE(Code)
Token ID for the less than or equal operator: '<='



LPAREN
final public static int LPAREN(Code)
Token ID for the left parenthesis: '('



LT
final public static int LT(Code)
Token ID for the less than operator: '<'



MINUS
final public static int MINUS(Code)
Token ID for the minus operator: '-'



MOD
final public static int MOD(Code)
Token ID for the modulus operator: '%'



MULT
final public static int MULT(Code)
Token ID for the multiplication operator: '*'



NE
final public static int NE(Code)
Token ID for the not equal operator: '!='



NOT
final public static int NOT(Code)
Token ID for the not keyword: 'not'



NULL
final public static int NULL(Code)
Token ID for the null literal: 'null'



NUMBER
final public static int NUMBER(Code)
Token ID for a number literal.



OR
final public static int OR(Code)
Token ID for the or keyword: 'or'



PLUS
final public static int PLUS(Code)
Token ID for the plus operator: '+'



RBRACE
final public static int RBRACE(Code)
Token ID for the right brace: '}'



RBRACK
final public static int RBRACK(Code)
Token ID for the right bracket: ']'



REVERSE
final public static int REVERSE(Code)
Token ID for the reverse keyword: 'reverse'



RPAREN
final public static int RPAREN(Code)
Token ID for the right parenthesis: ')'



SEMI
final public static int SEMI(Code)
Token ID for the semi-colon: ';'



SLASH
final public static int SLASH(Code)
Token ID for the forward slash: '/'



STRING
final public static int STRING(Code)
Token ID for a string literal.



TEMPLATE
final public static int TEMPLATE(Code)
Token ID for the template keyword: 'template'



TRUE
final public static int TRUE(Code)
Token ID for the true literal: 'true'



UNKNOWN
final public static int UNKNOWN(Code)
Token ID for an unknown token.




Constructor Detail
Token
Token(int sourceLine, int sourceStartPos, int sourceEndPos, int tokenID)(Code)



Token
Token(int sourceLine, int sourceStartPos, int sourceEndPos, int sourceDetailPos, int tokenID)(Code)



Token
public Token(SourceInfo info, int tokenID)(Code)




Method Detail
dump
final public void dump()(Code)
Dumps the contents of this Token to System.out.



dump
final public void dump(PrintStream out)(Code)
Dumps the contents of this Token.
Parameters:
  out - The PrintStream to write to.



findReservedWordID
public static int findReservedWordID(StringBuffer word)(Code)
If the given StringBuffer starts with a valid token type, its ID is returned. Otherwise, the token ID UNKNOWN is returned.



getCode
public String getCode()(Code)
Token code is non-null, and is exactly the same as the name for its ID.



getDoubleValue
public double getDoubleValue()(Code)
Only valid if token is a number.



getFloatValue
public float getFloatValue()(Code)
Only valid if token is a number.



getID
final public int getID()(Code)
Returns the ID of this Token, which identifies what type of token it is.



getImage
public String getImage()(Code)
Token image represents what a static token looks like in a source file. Token image is null if token is a string, number or identifier because these tokens don't have static images.



getIntValue
public int getIntValue()(Code)
Only valid if token is a number.



getLongValue
public long getLongValue()(Code)
Only valid if token is a number.



getMatchingBracket
final public static int getMatchingBracket(int id)(Code)
If the given id is a bracket: (,[,{,},],) then the matching bracket's id is returned. If id is not a bracket, then -1 is returned.



getNumericType
public int getNumericType()(Code)
Only valid if token is a number. Returns 0 if token is not a number or is an invalid number. Returns 1 for int, 2 for long, 3 for float and 4 for double. The token ID for all numbers (even invalid ones) is NUMBER. 0, 1, 2, 3 or 4.



getSourceInfo
final public SourceInfo getSourceInfo()(Code)
Returns information regarding where in the source file this token came from.



getStringValue
public String getStringValue()(Code)



isBracket
final public static boolean isBracket(int id)(Code)
Returns true if id is a bracket
Parameters:
  id - The Token id to test



isBracket
final public boolean isBracket()(Code)
Returns true if this Token is a bracket: (,[,{,},],)



isCloseBracket
final public static boolean isCloseBracket(int id)(Code)
Returns true if id is a close bracket: ), ], }
Parameters:
  id - The Token id to test



isCloseBracket
final public boolean isCloseBracket()(Code)
Returns true if this Token is a close bracket: ),],}



isOpenBracket
final public static boolean isOpenBracket(int id)(Code)
Returns true if id is an open bracket: (,[,{
Parameters:
  id - The Token id to test



isOpenBracket
final public boolean isOpenBracket()(Code)
Returns true if this Token is an open bracket: (,[,{



isOperator
final public static boolean isOperator(int id)(Code)
Returns true if id is an operator
Parameters:
  id - The Token id to test



isOperator
final public boolean isOperator()(Code)
Returns true if this Token is an operator



isReservedWord
final public static boolean isReservedWord(int id)(Code)
Returns true if id is a reserved word
Parameters:
  id - The Token id to test



isReservedWord
final public boolean isReservedWord()(Code)
Returns true if this Token is a reserved word.



toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.