Groovy Documentation

org.codehaus.groovy.antlr
[Java] Class SourceBuffer

java.lang.Object
  org.codehaus.groovy.antlr.SourceBuffer

public class SourceBuffer
extends java.lang.Object

A simple buffer that provides line/col access to chunks of source code held within itself.

Authors:
Jeremy Rayner
Version:
\$Revision\$


Constructor Summary
SourceBuffer()

 
Method Summary
java.lang.String getSnippet(LineColumn start, LineColumn end)

Obtains a snippet of the source code within the bounds specified

void write(int c)

Writes the specified character into the buffer

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Constructor Detail

SourceBuffer

public SourceBuffer()


 
Method Detail

getSnippet

public java.lang.String getSnippet(LineColumn start, LineColumn end)
Obtains a snippet of the source code within the bounds specified
Parameters:
start - (inclusive line/ inclusive column)
end - (inclusive line / exclusive column)
Returns:
specified snippet of source code as a String, or null if no source available


write

public void write(int c)
Writes the specified character into the buffer
Parameters:
c


 

Groovy Documentation