org.antlr.runtime.CharStream Interface Reference

Inheritance diagram for org.antlr.runtime.CharStream:

Inheritance graph
[legend]
Collaboration diagram for org.antlr.runtime.CharStream:

Collaboration graph
[legend]

List of all members.

Public Member Functions

String substring (int start, int stop)
int LT (int i)
int getLine ()
void setLine (int line)
void setCharPositionInLine (int pos)
int getCharPositionInLine ()

Static Public Attributes

static final int EOF = -1


Detailed Description

A source of characters for an ANTLR lexer

Definition at line 31 of file CharStream.java.


Member Function Documentation

String org.antlr.runtime.CharStream.substring ( int  start,
int  stop 
)

For infinite streams, you don't need this; primarily I'm providing a useful interface for action code. Just make sure actions don't use this on streams that don't support it.

Implemented in org.antlr.runtime.ANTLRStringStream.

int org.antlr.runtime.CharStream.LT ( int  i  ) 

Get the ith character of lookahead. This is the same usually as LA(i). This will be used for labels in the generated lexer code. I'd prefer to return a char here type-wise, but it's probably better to be 32-bit clean and be consistent with LA.

Implemented in org.antlr.runtime.ANTLRStringStream.

int org.antlr.runtime.CharStream.getLine (  ) 

ANTLR tracks the line information automatically

Implemented in org.antlr.runtime.ANTLRStringStream.

void org.antlr.runtime.CharStream.setLine ( int  line  ) 

Because this stream can rewind, we need to be able to reset the line

Implemented in org.antlr.runtime.ANTLRStringStream.

void org.antlr.runtime.CharStream.setCharPositionInLine ( int  pos  ) 

int org.antlr.runtime.CharStream.getCharPositionInLine (  ) 

The index of the character relative to the beginning of the line 0..n-1

Implemented in org.antlr.runtime.ANTLRStringStream.


Member Data Documentation

final int org.antlr.runtime.CharStream.EOF = -1 [static]

Definition at line 32 of file CharStream.java.


The documentation for this interface was generated from the following file:

Generated on Wed Oct 1 14:13:39 2008 for ANTLR API by  doxygen 1.5.5