antlr3.CharStream Class Reference

A source of characters for an ANTLR lexer. More...

Inheritance diagram for antlr3.CharStream:

Inheritance graph
[legend]
Collaboration diagram for antlr3.CharStream:

Collaboration graph
[legend]

List of all members.

Public Member Functions

def substring
 For infinite streams, you don't need this; primarily I'm providing a useful interface for action code.
def LT
 Get the ith character of lookahead.
def getLine
 ANTLR tracks the line information automatically.
def setLine
 Because this stream can rewind, we need to be able to reset the line.
def getCharPositionInLine
 The index of the character relative to the beginning of the line 0.
def setCharPositionInLine

Static Public Attributes

int EOF = 1


Detailed Description

A source of characters for an ANTLR lexer.

This is an abstract class that must be implemented by a subclass.

Definition at line 1124 of file antlr3.py.


Member Function Documentation

def antlr3.CharStream.substring (   self,
  start,
  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.

Reimplemented in antlr3.ANTLRStringStream.

Definition at line 1138 of file antlr3.py.

def antlr3.CharStream.LT (   self,
  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.

Reimplemented in antlr3.ANTLRStringStream.

Definition at line 1150 of file antlr3.py.

def antlr3.CharStream.getLine (   self  ) 

ANTLR tracks the line information automatically.

Reimplemented in antlr3.ANTLRStringStream.

Definition at line 1157 of file antlr3.py.

def antlr3.CharStream.setLine (   self,
  line 
)

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

Reimplemented in antlr3.ANTLRStringStream.

Definition at line 1166 of file antlr3.py.

def antlr3.CharStream.getCharPositionInLine (   self  ) 

The index of the character relative to the beginning of the line 0.

.n-1

Reimplemented in antlr3.ANTLRStringStream.

Definition at line 1175 of file antlr3.py.

def antlr3.CharStream.setCharPositionInLine (   self,
  pos 
)

Reimplemented in antlr3.ANTLRStringStream.

Definition at line 1180 of file antlr3.py.


Member Data Documentation

int antlr3.CharStream.EOF = 1 [static]

Definition at line 1129 of file antlr3.py.


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

Generated on Mon Nov 29 17:24:27 2010 for ANTLR Python API by  doxygen 1.5.5