luxor.css
Class CssLexer

java.lang.Object
  |
  +--luxor.css.CssLexer

public class CssLexer
extends java.lang.Object

CSS scanner - an object which decodes CSS lexical units.


Field Summary
protected  int _blankCharacters
          The characters to skip to create the string which represents the current token.
protected  char[] _buffer
          The recording buffer.
protected  int _column
          The current column.
protected  int _current
          The current char.
protected  int _end
          The end offset of the last lexical unit.
protected  int _line
          The current line.
protected  int _position
          The current position in the buffer.
protected  char[] _readBuffer
          The reading buffer.
protected  int _readCount
          The current read buffer count.
protected  java.io.Reader _reader
           
protected  int _readPosition
          The current position in the read buffer.
protected  int _start
          The start offset of the last lexical unit.
protected  int _type
          The type of the current lexical unit.
 
Constructor Summary
CssLexer(java.io.Reader r)
          Creates a new Scanner object.
CssLexer(java.lang.String s)
          Creates a new Scanner object.
 
Method Summary
 void clearBuffer()
          Clears the buffer.
protected  int dotNumber()
          Scans the decimal part of a number.
protected  int endGap()
          Returns the end gap of the current lexical unit.
protected  void escape()
          Scans an escape sequence, if one.
 char[] getBuffer()
          Returns the buffer used to store the chars.
 int getColumn()
          Returns the current column.
 int getEnd()
          Returns the end offset of the last lexical unit.
 int getLine()
          Returns the current line.
 int getStart()
          Returns the start offset of the last lexical unit.
 java.lang.String getStringValue()
          Returns the string representation of the current lexical unit.
 int getType()
          The current lexical unit type like defined in Css.Token
protected static boolean isEqualIgnoreCase(int i, char c)
          Compares the given int with the given character, ignoring case.
 int next()
          Returns the next token.
protected  int nextChar()
          Sets the value of the current char to the next character or -1 if the end of stream has been reached.
protected  void nextToken()
          Returns the next token.
protected  int number()
          Scans a number.
protected  int numberUnit(boolean integer)
          Scans the unit of a number.
protected  int string1()
          Scans a single quoted string.
protected  int string2()
          Scans a double quoted string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_blankCharacters

protected int _blankCharacters
The characters to skip to create the string which represents the current token.


_buffer

protected char[] _buffer
The recording buffer.


_column

protected int _column
The current column.


_current

protected int _current
The current char.


_end

protected int _end
The end offset of the last lexical unit.


_line

protected int _line
The current line.


_position

protected int _position
The current position in the buffer.


_readBuffer

protected char[] _readBuffer
The reading buffer.


_readCount

protected int _readCount
The current read buffer count.


_readPosition

protected int _readPosition
The current position in the read buffer.


_reader

protected java.io.Reader _reader

_start

protected int _start
The start offset of the last lexical unit.


_type

protected int _type
The type of the current lexical unit.

Constructor Detail

CssLexer

public CssLexer(java.io.Reader r)
         throws CssParseException
Creates a new Scanner object.

Parameters:
r - The reader to scan.
Throws:
CssParseException - Description of the Exception

CssLexer

public CssLexer(java.lang.String s)
         throws CssParseException
Creates a new Scanner object.

Parameters:
s - Description of the Parameter
Throws:
CssParseException - Description of the Exception
Method Detail

getBuffer

public char[] getBuffer()
Returns the buffer used to store the chars.


getColumn

public int getColumn()
Returns the current column.


getEnd

public int getEnd()
Returns the end offset of the last lexical unit.


getLine

public int getLine()
Returns the current line.


getStart

public int getStart()
Returns the start offset of the last lexical unit.


getStringValue

public java.lang.String getStringValue()
Returns the string representation of the current lexical unit.


getType

public int getType()
The current lexical unit type like defined in Css.Token


isEqualIgnoreCase

protected static boolean isEqualIgnoreCase(int i,
                                           char c)
Compares the given int with the given character, ignoring case.


clearBuffer

public void clearBuffer()
Clears the buffer.


next

public int next()
         throws CssParseException
Returns the next token.

CssParseException

dotNumber

protected int dotNumber()
                 throws java.io.IOException
Scans the decimal part of a number.

java.io.IOException

endGap

protected int endGap()
Returns the end gap of the current lexical unit.


escape

protected void escape()
               throws java.io.IOException
Scans an escape sequence, if one.

java.io.IOException

nextChar

protected int nextChar()
                throws java.io.IOException
Sets the value of the current char to the next character or -1 if the end of stream has been reached.

java.io.IOException

nextToken

protected void nextToken()
                  throws CssParseException
Returns the next token.

CssParseException

number

protected int number()
              throws java.io.IOException
Scans a number.

java.io.IOException

numberUnit

protected int numberUnit(boolean integer)
                  throws java.io.IOException
Scans the unit of a number.

java.io.IOException

string1

protected int string1()
               throws java.io.IOException
Scans a single quoted string.

java.io.IOException

string2

protected int string2()
               throws java.io.IOException
Scans a double quoted string.

java.io.IOException


Copyright 2001, 2002 Gerald Bauer. All Rights Reserved. Hosted by SourceForge Logo