public class CSSToken
extends org.antlr.runtime.CommonToken
| Modifier and Type | Field and Description |
|---|---|
protected URL |
base
Base URL for URIs
|
protected CSSLexer.LexerState |
ls
Current lexer state
|
| Constructor and Description |
|---|
CSSToken(org.antlr.runtime.CharStream input,
int type,
int channel,
int start,
int stop)
Creates CSSToken, this is base
emit() constructor |
CSSToken(int type,
CSSLexer.LexerState state)
Creates CSSToken of given type with cloning lexer state
automatically
|
CSSToken(int type,
CSSLexer.LexerState state,
int start,
int stop)
Creates CSSToken of given type with cloning lexer state
automatically, allows to set text boundaries in input stream
|
| Modifier and Type | Method and Description |
|---|---|
static String |
extractCLASSKEYWORD(String className)
Considers text as content of CLASSKEYWORD token,
and models view at this text as an common string,
that is removed
'.' from the beginning of string |
static String |
extractFUNCTION(String function)
Considers text as content of FUNCTION token,
and models view at this text as an common string,
that is removed
'(' from the end of string |
static String |
extractHASH(String hash)
Considers text as content of HASH token,
and models view at this text as an common string,
that is removed
'#' from the beginning of string |
static String |
extractSTRING(String string)
Considers text as content of STRING token,
and models view at this text as an common string,
that is one character removed from the both beginning
and the end.
|
static String |
extractURI(String uri)
Considers text as content of URI token,
and models view at this text as an common string,
that is removed
'url(' from the beginning
and ')' from the and. |
URL |
getBase()
Obtains the base URL used for the relative URIs
|
CSSLexer.LexerState |
getLexerState()
Gets lexer state at creation of token
|
String |
getText()
Returns common text stored in token.
|
void |
setBase(URL base)
Sets the base URL used for the relative URIs
|
CSSToken |
setLexerState(CSSLexer.LexerState state)
Sets lexer state for current token
|
String |
toString() |
protected CSSLexer.LexerState ls
protected URL base
public CSSToken(org.antlr.runtime.CharStream input,
int type,
int channel,
int start,
int stop)
emit() constructorinput - Input streamtype - Type of tokenchannel - Channel of tokenstart - Start position in streamstop - End position in streampublic CSSToken(int type,
CSSLexer.LexerState state)
type - Type of tokenstate - State of lexer, which will be copiedpublic CSSToken(int type,
CSSLexer.LexerState state,
int start,
int stop)
type - Type of tokenstate - State of lexer, which will be copiedstart - Start position in streamstop - End position in streampublic CSSToken setLexerState(CSSLexer.LexerState state)
state - Current lexer statepublic CSSLexer.LexerState getLexerState()
public URL getBase()
public void setBase(URL base)
base - the base URL to setpublic static String extractSTRING(String string)
string - Content of STRING tokenpublic static String extractURI(String uri)
'url(' from the beginning
and ')' from the and. If result of this operation
is STRING, remove even quotation marksuri - Content of URI tokenpublic static String extractFUNCTION(String function)
'(' from the end of stringfunction - Content of FUNCTION tokenpublic static String extractHASH(String hash)
'#' from the beginning of stringhash - Content of HASH tokenpublic static String extractCLASSKEYWORD(String className)
'.' from the beginning of stringclassName - Content of CLASSKEYWORD tokenpublic String getText()
getText in interface org.antlr.runtime.TokengetText in class org.antlr.runtime.CommonTokenpublic String toString()
toString in class org.antlr.runtime.CommonTokenCopyright © 2014. All rights reserved.