Class Token
- java.lang.Object
-
- com.google.javascript.jscomp.parsing.parser.Token
-
- Direct Known Subclasses:
IdentifierToken,LiteralToken
public class Token extends java.lang.ObjectA Token in a javascript file. Immutable. A plain old data structure. Should contain data members and simple accessors only.
-
-
Field Summary
Fields Modifier and Type Field Description SourceRangelocationTokenTypetype
-
Constructor Summary
Constructors Constructor Description Token(TokenType type, SourceRange location)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IdentifierTokenasIdentifier()LiteralTokenasLiteral()TemplateLiteralTokenasTemplateLiteral()SourcePositiongetStart()java.lang.StringtoString()
-
-
-
Field Detail
-
location
public final SourceRange location
-
type
public final TokenType type
-
-
Constructor Detail
-
Token
public Token(TokenType type, SourceRange location)
-
-
Method Detail
-
getStart
public SourcePosition getStart()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
asIdentifier
public IdentifierToken asIdentifier()
-
asLiteral
public LiteralToken asLiteral()
-
asTemplateLiteral
public TemplateLiteralToken asTemplateLiteral()
-
-