Package schrodinger :: Package application :: Package desmond :: Package antlr3 :: Module streams :: Class CharStream
[hide private]
[frames] | no frames]

Class CharStream

object --+    
         |    
 IntStream --+
             |
            CharStream
Known Subclasses:

@brief A source of characters for an ANTLR lexer.

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

Instance Methods [hide private]
 
substring(self, start, stop)
For infinite streams, you don't need this; primarily I'm providing a useful interface for action code.
 
LT(self, i)
Get the ith character of lookahead.
 
getLine(self)
ANTLR tracks the line information automatically
 
setLine(self, line)
Because this stream can rewind, we need to be able to reset the line
 
getCharPositionInLine(self)
The index of the character relative to the beginning of the line 0..n-1
 
setCharPositionInLine(self, pos)

Inherited from IntStream: LA, consume, getSourceName, index, mark, release, rewind, seek, size

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  EOF = -1
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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.

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.