Package org.antlr.v4.runtime
Class TokenStreamRewriter.ReplaceOp
- java.lang.Object
-
- org.antlr.v4.runtime.TokenStreamRewriter.RewriteOperation
-
- org.antlr.v4.runtime.TokenStreamRewriter.ReplaceOp
-
- Enclosing class:
- TokenStreamRewriter
class TokenStreamRewriter.ReplaceOp extends TokenStreamRewriter.RewriteOperation
I'm going to try replacing range from x..y with (y-x)+1 ReplaceOp instructions.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
lastIndex
-
Fields inherited from class org.antlr.v4.runtime.TokenStreamRewriter.RewriteOperation
index, instructionIndex, text
-
-
Constructor Summary
Constructors Constructor Description ReplaceOp(int from, int to, java.lang.Object text)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
execute(java.lang.StringBuilder buf)
Execute the rewrite operation by possibly adding to the buffer.java.lang.String
toString()
-
-
-
Method Detail
-
execute
public int execute(java.lang.StringBuilder buf)
Description copied from class:TokenStreamRewriter.RewriteOperation
Execute the rewrite operation by possibly adding to the buffer. Return the index of the next token to operate on.- Overrides:
execute
in classTokenStreamRewriter.RewriteOperation
-
toString
public java.lang.String toString()
- Overrides:
toString
in classTokenStreamRewriter.RewriteOperation
-
-