Home | Download | News | Wiki | About ANTLR | Feedback | Support | Bugs


Latest version is 2.7.7.
Download now! »

Download
» Home
» Download
» News
»Using ANTLR
» Documentation
» Wiki
» FAQ
» Articles
» Grammars
» File Sharing
» Code API
» Tech Support
» Bug Tracking
»About ANTLR
» What is ANTLR
» Why use ANTLR
» Showcase
» Testimonials
» Getting Started
» Software License
» ANTLR WebLogs
» ANTLR Workshops
»StringTemplate
»TML
»PCCTS
»Feedback
»Credits
»Contact


Support StringTemplate, ANTLR Project by making a donation! Terence often pays for things like the antlr.org server, conference travel, and this site design (that alone cost US$1000). Buy him a beer and pizza remotely ;)

Search



TokenBuffer


antlr
Class TokenBuffer

java.lang.Object
  extended byantlr.TokenBuffer

public class TokenBuffer
extends java.lang.Object


Constructor Summary
TokenBuffer(TokenStream input_)
          Create a token buffer
 
Method Summary
 void consume()
          Mark another token for deferred consumption
 TokenStream getInput()
          return the Tokenizer (needed by ParseView)
 int LA(int i)
          Get a lookahead token value
 Token LT(int i)
          Get a lookahead token
 int mark()
          Return an integer marker that can be used to rewind the buffer to its current state.
 void reset()
          Reset the input buffer to empty state
 void rewind(int mark)
          Rewind the token buffer to a marker.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenBuffer

public TokenBuffer(TokenStream input_)
Create a token buffer

Method Detail

reset

public final void reset()
Reset the input buffer to empty state


consume

public final void consume()
Mark another token for deferred consumption


getInput

public TokenStream getInput()
return the Tokenizer (needed by ParseView)


LA

public final int LA(int i)
             throws TokenStreamException
Get a lookahead token value

Throws:
TokenStreamException

LT

public final Token LT(int i)
               throws TokenStreamException
Get a lookahead token

Throws:
TokenStreamException

mark

public final int mark()
Return an integer marker that can be used to rewind the buffer to its current state.


rewind

public final void rewind(int mark)
Rewind the token buffer to a marker.

Parameters:
mark - Marker returned previously from mark()