antlr

Class TokenStreamRewriteEngine.ReplaceOp

Enclosing Class:
TokenStreamRewriteEngine
Known Direct Subclasses:
TokenStreamRewriteEngine.DeleteOp

(package private) static class TokenStreamRewriteEngine.ReplaceOp
extends TokenStreamRewriteEngine.RewriteOperation

I'm going to try replacing range from x..y with (y-x)+1 ReplaceOp instructions.

Field Summary

protected int
lastIndex

Fields inherited from class antlr.TokenStreamRewriteEngine.RewriteOperation

index, text

Constructor Summary

ReplaceOp(int from, int to, String text)

Method Summary

int
execute(StringBuffer buf)
Execute the rewrite operation by possibly adding to the buffer.

Methods inherited from class antlr.TokenStreamRewriteEngine.RewriteOperation

execute, toString

Field Details

lastIndex

protected int lastIndex

Constructor Details

ReplaceOp

public ReplaceOp(int from,
                 int to,
                 String text)

Method Details

execute

public int execute(StringBuffer buf)
Execute the rewrite operation by possibly adding to the buffer. Return the index of the next token to operate on.
Overrides:
execute in interface TokenStreamRewriteEngine.RewriteOperation