gov.nist.core
クラス LexerCore

java.lang.Object
  上位を拡張 gov.nist.core.StringTokenizer
      上位を拡張 gov.nist.core.LexerCore
直系の既知のサブクラス:
Lexer, Lexer

public class LexerCore
extends StringTokenizer

A lexical analyzer that is used by all parsers in our implementation.

作成者:
M. Ranganathan

フィールドの概要
static int ALPHA
           
static int AND
           
static int AT
           
static int BACK_QUOTE
           
static int BACKSLASH
           
static int BAR
           
static int COLON
           
static int DIGIT
           
static int DOLLAR
           
static int DOT
           
static int DOUBLEQUOTE
           
static int END
           
static int EQUALS
           
static int EXCLAMATION
           
static int GREATER_THAN
           
static int HAT
           
static int HT
           
static int ID
           
static int L_CURLY
           
static int L_SQUARE_BRACKET
           
static int LESS_THAN
           
static int LPAREN
           
static int MINUS
           
static int NULL
           
static int PERCENT
           
static int PLUS
           
static int POUND
           
static int QUESTION
           
static int QUOTE
           
static int R_CURLY
           
static int R_SQUARE_BRACKET
           
static int RPAREN
           
static int SEMICOLON
           
static int SLASH
           
static int SP
           
static int STAR
           
static int START
           
static int TILDE
           
static int UNDERSCORE
           
static int WHITESPACE
           
 
コンストラクタの概要
LexerCore(java.lang.String lexerName)
           
LexerCore(java.lang.String lexerName, java.lang.String buffer)
          Initialize the lexer with a buffer.
 
メソッドの概要
 java.lang.String byteStringNoComma()
          Return a substring containing no commas
 java.lang.String byteStringNoSemicolon()
          Return a substring containing no semicolons.
static java.lang.String charAsString(char ch)
           
 java.lang.String charAsString(int nchars)
          Lookahead in the inputBuffer for n chars and return as a string.
 java.lang.String comment()
          Parse a comment string cursor is at a "(".
 java.text.ParseException createParseException()
          Create a parse exception.
 java.lang.String getBuffer()
          Get the buffer.
 java.lang.String getNextId()
          Get the next id.
 Token getNextToken()
           
 int getPtr()
          Get the read pointer.
 java.lang.String getRest()
          Get the rest of the String
 java.lang.String getString(char c)
          Get the sub-String until the character is encountered
 java.lang.String lookupToken(int value)
           
 int markInputPosition()
          Mark the position for backtracking.
 Token match(int tok)
          Match the given token or throw an exception if no such token can be matched.
 java.lang.String number()
          Get and consume the next number.
 java.lang.String peekNextId()
          Peek the next id but dont move the buffer pointer forward.
 Token peekNextToken()
          Look ahead for one token.
 java.util.Vector peekNextToken(int ntokens)
           
 java.lang.String quotedString()
          Parse a comment string cursor is at a ".
 void rewindInputPosition(int position)
          Rewind the input ptr to the marked position.
 void selectLexer(java.lang.String lexerName)
           
 void SPorHT()
           
 boolean startsId()
           
 java.lang.String ttoken()
           
 java.lang.String ttokenAllowSpace()
           
 
クラス gov.nist.core.StringTokenizer から継承されたメソッド
consume, consume, getLine, getLines, getNextChar, getNextToken, getSDPFieldName, hasMoreChars, isAlpha, isDigit, isHexDigit, lookAhead, lookAhead, nextToken, peekLine
 
クラス java.lang.Object から継承されたメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

START

public static final int START
関連項目:
定数フィールド値

END

public static final int END
関連項目:
定数フィールド値

ID

public static final int ID
関連項目:
定数フィールド値

WHITESPACE

public static final int WHITESPACE
関連項目:
定数フィールド値

DIGIT

public static final int DIGIT
関連項目:
定数フィールド値

ALPHA

public static final int ALPHA
関連項目:
定数フィールド値

BACKSLASH

public static final int BACKSLASH
関連項目:
定数フィールド値

QUOTE

public static final int QUOTE
関連項目:
定数フィールド値

AT

public static final int AT
関連項目:
定数フィールド値

SP

public static final int SP
関連項目:
定数フィールド値

HT

public static final int HT
関連項目:
定数フィールド値

COLON

public static final int COLON
関連項目:
定数フィールド値

STAR

public static final int STAR
関連項目:
定数フィールド値

DOLLAR

public static final int DOLLAR
関連項目:
定数フィールド値

PLUS

public static final int PLUS
関連項目:
定数フィールド値

POUND

public static final int POUND
関連項目:
定数フィールド値

MINUS

public static final int MINUS
関連項目:
定数フィールド値

DOUBLEQUOTE

public static final int DOUBLEQUOTE
関連項目:
定数フィールド値

TILDE

public static final int TILDE
関連項目:
定数フィールド値

BACK_QUOTE

public static final int BACK_QUOTE
関連項目:
定数フィールド値

NULL

public static final int NULL
関連項目:
定数フィールド値

EQUALS

public static final int EQUALS
関連項目:
定数フィールド値

SEMICOLON

public static final int SEMICOLON
関連項目:
定数フィールド値

SLASH

public static final int SLASH
関連項目:
定数フィールド値

L_SQUARE_BRACKET

public static final int L_SQUARE_BRACKET
関連項目:
定数フィールド値

R_SQUARE_BRACKET

public static final int R_SQUARE_BRACKET
関連項目:
定数フィールド値

R_CURLY

public static final int R_CURLY
関連項目:
定数フィールド値

L_CURLY

public static final int L_CURLY
関連項目:
定数フィールド値

HAT

public static final int HAT
関連項目:
定数フィールド値

BAR

public static final int BAR
関連項目:
定数フィールド値

DOT

public static final int DOT
関連項目:
定数フィールド値

EXCLAMATION

public static final int EXCLAMATION
関連項目:
定数フィールド値

LPAREN

public static final int LPAREN
関連項目:
定数フィールド値

RPAREN

public static final int RPAREN
関連項目:
定数フィールド値

GREATER_THAN

public static final int GREATER_THAN
関連項目:
定数フィールド値

LESS_THAN

public static final int LESS_THAN
関連項目:
定数フィールド値

PERCENT

public static final int PERCENT
関連項目:
定数フィールド値

QUESTION

public static final int QUESTION
関連項目:
定数フィールド値

AND

public static final int AND
関連項目:
定数フィールド値

UNDERSCORE

public static final int UNDERSCORE
関連項目:
定数フィールド値
コンストラクタの詳細

LexerCore

public LexerCore(java.lang.String lexerName)

LexerCore

public LexerCore(java.lang.String lexerName,
                 java.lang.String buffer)
Initialize the lexer with a buffer.

メソッドの詳細

lookupToken

public java.lang.String lookupToken(int value)

selectLexer

public void selectLexer(java.lang.String lexerName)

peekNextId

public java.lang.String peekNextId()
Peek the next id but dont move the buffer pointer forward.


getNextId

public java.lang.String getNextId()
Get the next id.


getNextToken

public Token getNextToken()

peekNextToken

public Token peekNextToken()
                    throws java.text.ParseException
Look ahead for one token.

例外:
java.text.ParseException

peekNextToken

public java.util.Vector peekNextToken(int ntokens)
                               throws java.text.ParseException
例外:
java.text.ParseException

match

public Token match(int tok)
            throws java.text.ParseException
Match the given token or throw an exception if no such token can be matched.

例外:
java.text.ParseException

SPorHT

public void SPorHT()

startsId

public boolean startsId()

ttoken

public java.lang.String ttoken()

ttokenAllowSpace

public java.lang.String ttokenAllowSpace()

quotedString

public java.lang.String quotedString()
                              throws java.text.ParseException
Parse a comment string cursor is at a ". Leave cursor at closing "

戻り値:
the substring containing the quoted string excluding the closing quote.
例外:
java.text.ParseException

comment

public java.lang.String comment()
                         throws java.text.ParseException
Parse a comment string cursor is at a "(". Leave cursor at )

戻り値:
the substring containing the comment excluding the closing brace.
例外:
java.text.ParseException

byteStringNoSemicolon

public java.lang.String byteStringNoSemicolon()
Return a substring containing no semicolons.

戻り値:
a substring containing no semicolons.

byteStringNoComma

public java.lang.String byteStringNoComma()
Return a substring containing no commas

戻り値:
a substring containing no commas.

charAsString

public static java.lang.String charAsString(char ch)

charAsString

public java.lang.String charAsString(int nchars)
Lookahead in the inputBuffer for n chars and return as a string. Do not consume the input.


number

public java.lang.String number()
                        throws java.text.ParseException
Get and consume the next number.

戻り値:
a substring corresponding to a number (i.e. sequence of digits).
例外:
java.text.ParseException

markInputPosition

public int markInputPosition()
Mark the position for backtracking.

戻り値:
the current location of the pointer.

rewindInputPosition

public void rewindInputPosition(int position)
Rewind the input ptr to the marked position.

パラメータ:
position - - the position to rewind the parser to.

getRest

public java.lang.String getRest()
Get the rest of the String

戻り値:
rest of the buffer.

getString

public java.lang.String getString(char c)
                           throws java.text.ParseException
Get the sub-String until the character is encountered

パラメータ:
c - the character to match
戻り値:
the substring that matches.
例外:
java.text.ParseException

getPtr

public int getPtr()
Get the read pointer.


getBuffer

public java.lang.String getBuffer()
Get the buffer.


createParseException

public java.text.ParseException createParseException()
Create a parse exception.