rvl.swv
Interface SyntaxInterface

All Known Implementing Classes:
LaTeXSyntax

public interface SyntaxInterface

This interface specifies methods needed to detect code chunks and other weaving-related patterns in lines of the source file. This is intended for use with file formats that are markup-based (like LaTeX), to allow the possibility of providing a different markup syntax for the same file format.


Method Summary
 java.util.Vector<java.lang.String> getArgs()
          Return the vector of arguments in latest code reference
 java.lang.String getDetails()
          Return details of last result of testInline().
 java.lang.String getLastMatch()
          Return exact string that was matched by most recent tag search
 java.lang.String getOptionList()
          Return the option list for the code chunk just detected.
 boolean isChunkEnd(java.lang.String line)
          Return whether or not the current line ends a code chunk
 void setFileInterface(FileInterface filei)
          Set the FileInterface associated with this instance.
 java.lang.String testChunk(java.lang.String line)
          Test a line of the source file.
 java.lang.String testCoderef(java.lang.String line)
          Test a line of code.
 Tag testInline(java.lang.String line)
          Test the line for an occurrence of an expression or a recall, and return the appropriate tag.
 java.lang.String testOpts(java.lang.String line)
          Test a source line to see if it is a global or language-specific option specification.
 

Method Detail

setFileInterface

void setFileInterface(FileInterface filei)
Set the FileInterface associated with this instance. Implementors probably also may want to get parent info from it


testChunk

java.lang.String testChunk(java.lang.String line)
Test a line of the source file. If it starts a code chunk, return its language. Otherwise, return null


getOptionList

java.lang.String getOptionList()
Return the option list for the code chunk just detected. This is required to be a comma-delimited list


isChunkEnd

boolean isChunkEnd(java.lang.String line)
Return whether or not the current line ends a code chunk


testOpts

java.lang.String testOpts(java.lang.String line)
Test a source line to see if it is a global or language-specific option specification. Return null if not, the name of the language if it is language-specific, or an empty string if it is global. The options themselves are retrieved using getOptionList().


testCoderef

java.lang.String testCoderef(java.lang.String line)
Test a line of code. If it is a code reference, return its label, else null. If non-null, any arguments supplied are available via getArgs() If it is a "starred" code reference, precede the returned label with a *.


getArgs

java.util.Vector<java.lang.String> getArgs()
Return the vector of arguments in latest code reference


testInline

Tag testInline(java.lang.String line)
Test the line for an occurrence of an expression or a recall, and return the appropriate tag. The line argument matters only on the first call for this line. Subsequent calls find subsequent matches. When there are no more, a null should be returned.


getDetails

java.lang.String getDetails()
Return details of last result of testInline(). If it is an expression, it is "lang expr", otherwise for a recall, it is the label being recalled.


getLastMatch

java.lang.String getLastMatch()
Return exact string that was matched by most recent tag search