Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.parser.css
Class CSSLexer

java.lang.Object
  extended by oracle.javatools.parser.AbstractLexer
      extended by oracle.javatools.parser.java.v2.scanner.FastLexer
          extended by oracle.javatools.parser.css.CSSLexer

All Implemented Interfaces:
CSSTokens, LexicalUnits, Lexer, LexerToken
Direct Known Subclasses:
CSSAtRuleLexer, CSSDeclarationsLexer, CSSFontFaceRuleLexer, CSSImportRuleLexer, CSSMediaRuleLexer, CSSNamespaceRuleLexer, CSSPageRuleLexer, CSSPseudoRuleSetLexer, CSSRuleSetLexer

public class CSSLexer
extends FastLexer
implements CSSTokens

Code Editor lexer for CSS documents.


Nested Class Summary

 

Nested classes/interfaces inherited from class oracle.javatools.parser.AbstractLexer
AbstractLexer.DefaultLexerToken

 

Field Summary
protected  int _mEndOffset
          The ending offset of the last token found.
protected  int _mLastToken
          The last token found from lex() operation.
protected  LineMap _mLineMap
           
protected  oracle.javatools.parser.css.CSSLexer.TextBufferReader _mReader
           
protected  int _mStartOffset
          The starting offset of the last token found.
protected  boolean _mUseLastToken
          Whether to use the last token that was found.

 

Fields inherited from class oracle.javatools.parser.java.v2.scanner.FastLexer
skipComments

 

Fields inherited from class oracle.javatools.parser.AbstractLexer
currentPos, textBuffer

 

Fields inherited from interface oracle.javatools.parser.css.CSSTokens
TK_CSS_BLOCK, TK_CSS_RULE_SET

 

Fields inherited from interface oracle.javatools.parser.css.LexicalUnits
ANY, AT_KEYWORD, BEGINS, CARET, CDC, CDO, CHARSET_SYMBOL, CM, COLON, COMMA, COMMENT, CONTAINS, DASHMATCH, DEG, DIMENSION, DIVIDE, DOLLAR, DOT, DOUBLE_COLON, EM, ENDS, EOF, EQUAL, ERROR, EX, FONT_FACE_SYMBOL, FUNCTION, GRAD, HASH, HZ, IDENTIFIER, IMPORT_SYMBOL, IMPORTANT_SYMBOL, IN, INCLUDES, INTEGER, KHZ, LEFT_BRACE, LEFT_BRACKET, LEFT_CURLY_BRACE, MEDIA_SYMBOL, MINUS, MM, MS, NAMESPACE_MATCH, NAMESPACE_SYMBOL, PAGE_SYMBOL, PC, PERCENTAGE, PLUS, PRECEDE, PT, PX, RAD, REAL, RIGHT_BRACE, RIGHT_BRACKET, RIGHT_CURLY_BRACE, S, SEMI_COLON, SPACE, STRING, TILDE, UNICODE_RANGE, URI

 

Fields inherited from interface oracle.javatools.parser.Lexer
TK_EOF, TK_NOT_FOUND

 

Constructor Summary
CSSLexer()
           

 

Method Summary
 void backup()
          Unlexes the last found token.
protected  void convertToken()
           
protected  int fillLexerToken(LexerToken lexedToken)
          Utility routine to fill in the LexerToken structure with the current token information we have.
 int getEndOffset()
          Fetches the end offset of the token (offset relative to the original ReadTextBuffer being lexed.
 int getStartOffset()
          Fetches the start offset of the token (offset relative to the original ReadTextBuffer being lexed.
 int getToken()
          Fetches the (language-specific) token represented by this LexerToken.
 int lex()
          Calls lex( LexerToken ) but does not call fillLexerToken.
 int lex(LexerToken lexedToken)
          Scans the text buffer at the current position and returns the token that was found.
protected  int nextToken()
           
protected  void resetTokenizer()
           
 void setLineMap(LineMap lineMap)
           
 void setPosition(int offset)
          Sets the current lex (read) position to the given offset in the buffer.
protected  int skipAtRule()
           
protected  int skipBlock()
          Utility routine which scans through the text buffer to find the end of an CSS style rule.
protected  int skipStyleRule()
          Utility routine which scans through the text buffer to find the end of an CSS style rule.
protected  int TokenizerToLanguageToken(int token)
           
protected  void updateState()
           

 

Methods inherited from class oracle.javatools.parser.java.v2.scanner.FastLexer
isComment, setSkipComments

 

Methods inherited from class oracle.javatools.parser.AbstractLexer
createLexerToken, getTextBuffer, setTextBuffer

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

_mLastToken

protected int _mLastToken
The last token found from lex() operation.

_mStartOffset

protected int _mStartOffset
The starting offset of the last token found.

_mEndOffset

protected int _mEndOffset
The ending offset of the last token found.

_mUseLastToken

protected boolean _mUseLastToken
Whether to use the last token that was found.

_mReader

protected oracle.javatools.parser.css.CSSLexer.TextBufferReader _mReader

_mLineMap

protected LineMap _mLineMap

Constructor Detail

CSSLexer

public CSSLexer()

Method Detail

setLineMap

public void setLineMap(LineMap lineMap)

setPosition

public void setPosition(int offset)
Description copied from class: AbstractLexer
Sets the current lex (read) position to the given offset in the buffer. It is the clients responsibility to ensure that this offset corresponds to the start of a token, otherwise unexpected (and incorrect) results may occur.
Specified by:
setPosition in interface Lexer
Overrides:
setPosition in class AbstractLexer
Parameters:
offset - the offset for the next lex() operation.

lex

public int lex(LexerToken lexedToken)
Scans the text buffer at the current position and returns the token that was found. The token and offset information is also stored in the lexedToken instance passed in to the call.
Specified by:
lex in interface Lexer
Specified by:
lex in class FastLexer
Parameters:
lexedToken - the instance passed in where token info is stored
Returns:
the token that was found, same as calling lexedToken.getToken() (for convenience)

backup

public void backup()
Unlexes the last found token. The next call to lex() will return the last token and offset information found.
Specified by:
backup in interface Lexer
Overrides:
backup in class FastLexer

skipStyleRule

protected int skipStyleRule()
Utility routine which scans through the text buffer to find the end of an CSS style rule. Sets the current position following the trailing '}', or at the end of the file.

skipBlock

protected int skipBlock()
Utility routine which scans through the text buffer to find the end of an CSS style rule. Sets the current position following the trailing '}', or at the end of the file.

skipAtRule

protected int skipAtRule()

fillLexerToken

protected int fillLexerToken(LexerToken lexedToken)
Utility routine to fill in the LexerToken structure with the current token information we have. Returns the current token.
Parameters:
lexedToken - the client-specified LexerToken
Returns:
the last token found

resetTokenizer

protected void resetTokenizer()

nextToken

protected int nextToken()

updateState

protected void updateState()
                    throws ParseException
Throws:
ParseException

convertToken

protected void convertToken()

getToken

public int getToken()
Description copied from interface: LexerToken
Fetches the (language-specific) token represented by this LexerToken. You must refer to the language-specific Lexer that was responsible for filling this LexerToken instance to interpret the token.
Specified by:
getToken in interface LexerToken
Specified by:
getToken in class FastLexer
Returns:
the lexer token

getStartOffset

public int getStartOffset()
Description copied from interface: LexerToken
Fetches the start offset of the token (offset relative to the original ReadTextBuffer being lexed. Note that the start offset is inclusive (compare to end offset which is exclusive), to match the behavior in the String class.
Specified by:
getStartOffset in interface LexerToken
Specified by:
getStartOffset in class FastLexer
Returns:
the starting offset

getEndOffset

public int getEndOffset()
Description copied from interface: LexerToken
Fetches the end offset of the token (offset relative to the original ReadTextBuffer being lexed. Note that the end offset is exclusive (similar to end offsets in the String class.)
Specified by:
getEndOffset in interface LexerToken
Specified by:
getEndOffset in class FastLexer
Returns:
the ending offset

lex

public int lex()
Description copied from class: FastLexer
Calls lex( LexerToken ) but does not call fillLexerToken.
Specified by:
lex in class FastLexer

TokenizerToLanguageToken

protected int TokenizerToLanguageToken(int token)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.