jp.cssj.sakae.sac.parser
クラス Scanner

java.lang.Object
  拡張jp.cssj.sakae.sac.parser.Scanner

public class Scanner
extends Object

This class represents a CSS scanner - an object which decodes CSS lexical units.

バージョン:
$Id: Scanner.java,v 1.3 2005/08/02 08:52:41 harumanx Exp $
作成者:
Stephane Hillion

フィールドの概要
protected  int blankCharacters
          The characters to skip to create the string which represents the current token.
protected  char[] buffer
          The recording buffer.
protected  int current
          The current char.
protected  int end
          The end offset of the last lexical unit.
protected  int position
          The current position in the buffer.
protected  NormalizingReader reader
          The reader.
protected  int start
          The start offset of the last lexical unit.
protected  int type
          The type of the current lexical unit.
 
コンストラクタの概要
Scanner(Reader r)
          Creates a new Scanner object.
Scanner(String s)
          Creates a new Scanner object.
 
メソッドの概要
protected  void addChar(char ch)
           
 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.
 String getStringValue()
          Returns the string representation of the current lexical unit.
 int getType()
          The current lexical unit type like defined in LexicalUnits.
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  void prevChar()
           
 void scanAtRule()
          Scans a
protected  int string1()
          Scans a single quoted string.
protected  int string2()
          Scans a double quoted string.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

reader

protected NormalizingReader reader
The reader.


current

protected int current
The current char.


buffer

protected char[] buffer
The recording buffer.


position

protected int position
The current position in the buffer.


type

protected int type
The type of the current lexical unit.


start

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


end

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


blankCharacters

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

コンストラクタの詳細

Scanner

public Scanner(Reader r)
        throws IOException
Creates a new Scanner object.

パラメータ:
r - The reader to scan.

Scanner

public Scanner(String s)
        throws IOException
Creates a new Scanner object.

メソッドの詳細

getLine

public int getLine()
Returns the current line.


getColumn

public int getColumn()
Returns the current column.


getBuffer

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


getStart

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


getEnd

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


clearBuffer

public void clearBuffer()
Clears the buffer.


getType

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


getStringValue

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


scanAtRule

public void scanAtRule()
                throws IOException
Scans a

例外:
IOException

next

public int next()
         throws IOException,
                ParseException
Returns the next token.

例外:
IOException
ParseException

endGap

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


nextToken

protected void nextToken()
                  throws IOException,
                         ParseException
Returns the next token.

例外:
IOException
ParseException

string1

protected int string1()
               throws IOException,
                      ParseException
Scans a single quoted string.

例外:
IOException
ParseException

string2

protected int string2()
               throws IOException,
                      ParseException
Scans a double quoted string.

例外:
IOException
ParseException

number

protected int number()
              throws IOException,
                     ParseException
Scans a number.

例外:
IOException
ParseException

dotNumber

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

例外:
IOException

numberUnit

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

例外:
IOException

escape

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

例外:
IOException
ParseException

isEqualIgnoreCase

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


nextChar

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

例外:
IOException

prevChar

protected void prevChar()

addChar

protected void addChar(char ch)


(c)2009 GNN & Co.,Ltd.