net.sf.jse
Class PatternVariableFragment
java.lang.Object
|
+--net.sf.jse.Fragment
|
+--net.sf.jse.CompoundFragment
|
+--net.sf.jse.CompoundMacroFragment
|
+--net.sf.jse.PatternVariableFragment
- All Implemented Interfaces:
- java.lang.Cloneable
- Direct Known Subclasses:
- DotDotDotFragment
- public class PatternVariableFragment
- extends net.sf.jse.CompoundMacroFragment
A pattern/template variable
- Version:
- 0.9, 03OCT00
- Author:
- Jonathan Bachrach, Keith Playford
Methods inherited from class net.sf.jse.Fragment |
capitalize, die, expandMacros, expandTemplates, getChar, getCurrentLine, getFloat, getInt, getLine, getString, getValue, isTerminator, makeToken, makeToken, markMacros, setCurrentLine |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PatternVariableFragment
public PatternVariableFragment()
PatternVariableFragment
public PatternVariableFragment(java.lang.String string)
PatternVariableFragment
public PatternVariableFragment(java.lang.String string,
antlr.Token t)
PatternVariableFragment
public PatternVariableFragment(antlr.Token t)
getConstraint
public SyntaxConstraint getConstraint()
getVariableName
public IdentifierFragment getVariableName()
getFragmentClassName
public java.lang.String getFragmentClassName()
getName
public java.lang.String getName()
getInsideFragments
public FragmentList getInsideFragments()
- Overrides:
getInsideFragments
in class Fragment
setInsideFragments
public void setInsideFragments(FragmentList fs)
- Overrides:
setInsideFragments
in class CompoundFragment
tokens
public List tokens()
- Overrides:
tokens
in class CompoundFragment
toString
public java.lang.String toString()
- Overrides:
toString
in class CompoundFragment
collectBoundVariables
public FragmentList collectBoundVariables()
- Overrides:
collectBoundVariables
in class CompoundFragment
compilePatternElement
public Expansion compilePatternElement(FragmentList tail,
IdentifierFragment nowVar,
IdentifierFragment endVar)
- Description copied from class:
Fragment
- Top level entry point to compiling fragments within a pattern
- Overrides:
compilePatternElement
in class Fragment
- Following copied from class:
net.sf.jse.Fragment
- Parameters:
tail
- remaining fragments to compiling through tail callingnowVar
- runtime variable bound to current input fragments- See Also:
Template.compilePattern(net.sf.jse.Fragment, net.sf.jse.IdentifierFragment)
generatePatternCode
public Expansion generatePatternCode(IdentifierFragment nowVar,
IdentifierFragment nextVar)
- Description copied from class:
Fragment
- Pattern matching code generator
- Overrides:
generatePatternCode
in class Fragment
- Following copied from class:
net.sf.jse.Fragment
- Parameters:
nowVar
- runtime variable bound to current input fragmentsnextVar
- where to put remaining fragments after matching- See Also:
Fragment.compilePatternElement(net.sf.jse.FragmentList, net.sf.jse.IdentifierFragment, net.sf.jse.IdentifierFragment)
compileTemplate
public Fragment compileTemplate(int depth)
- Description copied from class:
Fragment
- Template code generator -- probably should be compileTemplateElement
- Overrides:
compileTemplate
in class CompoundFragment
- Following copied from class:
net.sf.jse.Fragment
- See Also:
Template.compileTemplate(int)
compileQuestionExpression
public Fragment compileQuestionExpression(int tDepth,
int qDepth)
- Overrides:
compileQuestionExpression
in class Fragment