forked from jasder/antlr
Added links to documentation
This commit is contained in:
parent
0949ff8249
commit
77342c2256
|
@ -43,30 +43,32 @@ import java.util.Map;
|
|||
*
|
||||
* <p>
|
||||
* You can insert stuff, replace, and delete chunks. Note that the operations
|
||||
* are done lazily--only if you convert the buffer to a String with getText().
|
||||
* This is very efficient because you are not moving data around all the time.
|
||||
* As the buffer of tokens is converted to strings, the getText() method(s) scan
|
||||
* the input token stream and check to see if there is an operation at the
|
||||
* current index. If so, the operation is done and then normal String rendering
|
||||
* continues on the buffer. This is like having multiple Turing machine
|
||||
* instruction streams (programs) operating on a single input tape. :)</p>
|
||||
* are done lazily--only if you convert the buffer to a {@link String} with
|
||||
* {@link TokenStream#getText()}. This is very efficient because you are not
|
||||
* moving data around all the time. As the buffer of tokens is converted to
|
||||
* strings, the {@link #getText()} method(s) scan the input token stream and
|
||||
* check to see if there is an operation at the current index. If so, the
|
||||
* operation is done and then normal {@link String} rendering continues on the
|
||||
* buffer. This is like having multiple Turing machine instruction streams
|
||||
* (programs) operating on a single input tape. :)</p>
|
||||
*
|
||||
* <p>
|
||||
* This rewriter makes no modifications to the token stream. It does not ask the
|
||||
* stream to fill itself up nor does it advance the input cursor. The token
|
||||
* stream index() will return the same value before and after any getText()
|
||||
* call.</p>
|
||||
* stream {@link TokenStream#index()} will return the same value before and
|
||||
* after any {@link #getText()} call.</p>
|
||||
*
|
||||
* <p>
|
||||
* The rewriter only works on tokens that you have in the buffer and ignores the
|
||||
* current input cursor. If you are buffering tokens on-demand, calling
|
||||
* getText() halfway through the input will only do rewrites for those tokens in
|
||||
* the first half of the file.</p>
|
||||
* {@link #getText()} halfway through the input will only do rewrites for those
|
||||
* tokens in the first half of the file.</p>
|
||||
*
|
||||
* <p>
|
||||
* Since the operations are done lazily at getText-time, operations do not screw
|
||||
* up the token index values. That is, an insert operation at token index i does
|
||||
* not change the index values for tokens i+1..n-1.</p>
|
||||
* Since the operations are done lazily at {@link #getText}-time, operations do
|
||||
* not screw up the token index values. That is, an insert operation at token
|
||||
* index {@code i} does not change the index values for tokens
|
||||
* {@code i}+1..n-1.</p>
|
||||
*
|
||||
* <p>
|
||||
* Because operations never actually alter the buffer, you may always get the
|
||||
|
|
Loading…
Reference in New Issue