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 intlastIndex-
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 intexecute(java.lang.StringBuilder buf)Execute the rewrite operation by possibly adding to the buffer.java.lang.StringtoString()
-
-
-
Method Detail
-
execute
public int execute(java.lang.StringBuilder buf)
Description copied from class:TokenStreamRewriter.RewriteOperationExecute the rewrite operation by possibly adding to the buffer. Return the index of the next token to operate on.- Overrides:
executein classTokenStreamRewriter.RewriteOperation
-
toString
public java.lang.String toString()
- Overrides:
toStringin classTokenStreamRewriter.RewriteOperation
-
-