jess
Interface Tokenizer

All Known Implementing Classes:
ReaderTokenizer

public interface Tokenizer

The Jess parser reads its input from a Tokenizer. In general, the supplied ReaderTokenizer implementation is sufficient for most needs.

(C) 2013 Sandia Corporation

See Also:
ReaderTokenizer

Field Summary
static java.lang.String BLANK_MULTI
           
static java.lang.String BLANK_PREFIX
           
 
Method Summary
 java.lang.String discardToEOL()
          Discard characters from the current stream position to the end of the current line.
 void eatWhitespace()
          Consume all characters up to, but not including, the next non-whitespace character
 int getStreamPos()
          Return the current character offset.
 JessToken nextToken()
          Return the next parsed token, skipping over all whitespace.
 java.lang.String readLine()
          Return characters from the current location to the end of the current line, as a String
 void reportNewlines(boolean b)
          Specify whether newlines should be reported as tokens
 

Field Detail

BLANK_PREFIX

static final java.lang.String BLANK_PREFIX
See Also:
Constant Field Values

BLANK_MULTI

static final java.lang.String BLANK_MULTI
See Also:
Constant Field Values
Method Detail

reportNewlines

void reportNewlines(boolean b)
Specify whether newlines should be reported as tokens

Parameters:
b - true if newlines should be reported

readLine

java.lang.String readLine()
                          throws JessException
Return characters from the current location to the end of the current line, as a String

Returns:
the rest of the current line
Throws:
JessException - if anything goes wrong

nextToken

JessToken nextToken()
                    throws JessException
Return the next parsed token, skipping over all whitespace.

Returns:
the token
Throws:
JessException - if anything goes wrong

discardToEOL

java.lang.String discardToEOL()
                              throws JessException
Discard characters from the current stream position to the end of the current line.

Returns:
the parsed characters
Throws:
JessException - if anything goes wrong

getStreamPos

int getStreamPos()
Return the current character offset. The meaning depends on the underlying data source.

Returns:
the character position

eatWhitespace

void eatWhitespace()
                   throws JessException
Consume all characters up to, but not including, the next non-whitespace character

Throws:
JessException

2013 Sandia Corporation