Package gw.internal.gosu.template
Class TemplateTokenizerInstructor
- java.lang.Object
-
- gw.internal.gosu.template.TemplateTokenizerInstructor
-
- All Implemented Interfaces:
ITokenizerInstructor
public class TemplateTokenizerInstructor extends java.lang.Object implements ITokenizerInstructor
An ITokenizerInstructor for Gosu templates. Implemented as a finite state machine where states correspond to template directives.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean_bAltTag(package private) boolean_bEndTagPending(package private) boolean_bStartTagBuffer(package private) boolean_bTag(package private) int_iLines(package private) int_iState(package private) char_lastC(package private) java.lang.StringBuffer_sbStartTag(package private) ISourceCodeTokenizer_tokenizer(package private) static intANALYZE(package private) static intANALYZE_DIRECTIVE(package private) static intANALYZE_DIRECTIVE_END_PENDING(package private) static intANALYZE_DIRECTIVE_PENDING(package private) static intANALYZE_END_PENDING(package private) static intANALYZE_PENDING(package private) static intANALYZE_SEPARATELY(package private) static intANALYZE_SEPARATELY_END_PENDING(package private) static intANALYZE_SEPARATELY_PENDING(package private) static intANALYZE_START_PENDING(package private) static intCOMMENT_END_PENDING(package private) static intCOMMENT_END_PENDING2(package private) static java.lang.String[]DELIMITERS(package private) static intIGNORE(package private) static intIGNORE_COMMENT
-
Constructor Summary
Constructors Constructor Description TemplateTokenizerInstructor(ISourceCodeTokenizer tokenizer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcountLines(char c)ITokenizerInstructorcreateNewInstance(ISourceCodeTokenizer tokenizer)voidgetInstructionFor(int iC)private intgetState()booleanisAnalyzingDirective()booleanisAnalyzingSeparately()private booleanisAnalyzingSeparatelyWaitingForCloseBrace()booleanisAtIgnoredPos()voidreset()Reset stateprivate voidsetState(int iState)voidsetTokenizer(ISourceCodeTokenizer tokenizer)private voidstartTagBuffer()
-
-
-
Field Detail
-
IGNORE
static final int IGNORE
- See Also:
- Constant Field Values
-
IGNORE_COMMENT
static final int IGNORE_COMMENT
- See Also:
- Constant Field Values
-
COMMENT_END_PENDING
static final int COMMENT_END_PENDING
- See Also:
- Constant Field Values
-
COMMENT_END_PENDING2
static final int COMMENT_END_PENDING2
- See Also:
- Constant Field Values
-
ANALYZE_START_PENDING
static final int ANALYZE_START_PENDING
- See Also:
- Constant Field Values
-
ANALYZE_PENDING
static final int ANALYZE_PENDING
- See Also:
- Constant Field Values
-
ANALYZE_SEPARATELY_PENDING
static final int ANALYZE_SEPARATELY_PENDING
- See Also:
- Constant Field Values
-
ANALYZE_DIRECTIVE_PENDING
static final int ANALYZE_DIRECTIVE_PENDING
- See Also:
- Constant Field Values
-
ANALYZE
static final int ANALYZE
- See Also:
- Constant Field Values
-
ANALYZE_SEPARATELY
static final int ANALYZE_SEPARATELY
- See Also:
- Constant Field Values
-
ANALYZE_DIRECTIVE
static final int ANALYZE_DIRECTIVE
- See Also:
- Constant Field Values
-
ANALYZE_END_PENDING
static final int ANALYZE_END_PENDING
- See Also:
- Constant Field Values
-
ANALYZE_SEPARATELY_END_PENDING
static final int ANALYZE_SEPARATELY_END_PENDING
- See Also:
- Constant Field Values
-
ANALYZE_DIRECTIVE_END_PENDING
static final int ANALYZE_DIRECTIVE_END_PENDING
- See Also:
- Constant Field Values
-
DELIMITERS
static final java.lang.String[] DELIMITERS
-
_tokenizer
ISourceCodeTokenizer _tokenizer
-
_iState
int _iState
-
_bAltTag
boolean _bAltTag
-
_bTag
boolean _bTag
-
_bEndTagPending
boolean _bEndTagPending
-
_bStartTagBuffer
boolean _bStartTagBuffer
-
_iLines
int _iLines
-
_sbStartTag
java.lang.StringBuffer _sbStartTag
-
_lastC
char _lastC
-
-
Constructor Detail
-
TemplateTokenizerInstructor
public TemplateTokenizerInstructor(ISourceCodeTokenizer tokenizer)
-
-
Method Detail
-
reset
public void reset()
Reset state- Specified by:
resetin interfaceITokenizerInstructor
-
createNewInstance
public ITokenizerInstructor createNewInstance(ISourceCodeTokenizer tokenizer)
- Specified by:
createNewInstancein interfaceITokenizerInstructor
-
isAtIgnoredPos
public boolean isAtIgnoredPos()
- Specified by:
isAtIgnoredPosin interfaceITokenizerInstructor
-
isAnalyzingDirective
public boolean isAnalyzingDirective()
- Specified by:
isAnalyzingDirectivein interfaceITokenizerInstructor
-
isAnalyzingSeparately
public boolean isAnalyzingSeparately()
- Specified by:
isAnalyzingSeparatelyin interfaceITokenizerInstructor
-
getInstructionFor
public void getInstructionFor(int iC)
- Specified by:
getInstructionForin interfaceITokenizerInstructor
-
isAnalyzingSeparatelyWaitingForCloseBrace
private boolean isAnalyzingSeparatelyWaitingForCloseBrace()
-
setState
private void setState(int iState)
-
getState
private int getState()
-
countLines
private void countLines(char c)
-
startTagBuffer
private void startTagBuffer()
-
setTokenizer
public void setTokenizer(ISourceCodeTokenizer tokenizer)
- Specified by:
setTokenizerin interfaceITokenizerInstructor
-
-