sidekick.enhanced
Interface PartialParser

All Known Implementing Classes:
SourceParser

public interface PartialParser

Parsers that implement this interface have the ability to parse just part of a buffer. This makes it possible to combine parsers so that, for example, an html parser can delegate to a javascript parser to handle javascript embedded in the html file, and to a css parser to handle embedded style sections.


Method Summary
 SideKickParsedData parse(org.gjt.sp.jedit.Buffer buffer, java.lang.String text, errorlist.DefaultErrorSource errorSource)
          Parse the contents of the given text.
 void setStartLine(int startLine)
          If called by another parser to parse part of a file (for example, to parse a script tag in an html document), this can be set to the offset of the text to be parsed so that the node locations can be set correctly.
 

Method Detail

setStartLine

void setStartLine(int startLine)
If called by another parser to parse part of a file (for example, to parse a script tag in an html document), this can be set to the offset of the text to be parsed so that the node locations can be set correctly.

Parameters:
startLine - the starting line in the buffer of the text that is to be parsed.

parse

SideKickParsedData parse(org.gjt.sp.jedit.Buffer buffer,
                         java.lang.String text,
                         errorlist.DefaultErrorSource errorSource)
Parse the contents of the given text. This is the entry point to use when only a portion of the buffer text is to be parsed. Note that setLineOffset should be called prior to calling this method, otherwise, tree node positions may be off.

Parameters:
buffer - the buffer containing the text to parse
text - the text to parse
errorSource - where to send errors
Returns:
the parsed buffer as a tree