net.sf.jse
Class Template

java.lang.Object
  |
  +--net.sf.jse.Fragment
        |
        +--net.sf.jse.CompoundFragment
              |
              +--net.sf.jse.NestedFragment
                    |
                    +--net.sf.jse.Template
All Implemented Interfaces:
java.lang.Cloneable

public class Template
extends NestedFragment

A #{ } nested fragment used for code quotes

Version:
0.9, 03OCT00
Author:
Jonathan Bachrach, Keith Playford

Fields inherited from class net.sf.jse.Fragment
out
 
Constructor Summary
Template(FragmentList fragments)
           
Template(antlr.Token left, FragmentList fragments, antlr.Token right)
           
 
Method Summary
 Expansion compilePattern(Fragment expression, IdentifierFragment endVar)
           
 Fragment compileQuestionExpression(int tDepth, int qDepth)
           
 Fragment compileTemplate(int depth)
          Template code generator -- probably should be compileTemplateElement
 Fragment expandMacros(MacroExpander expander, boolean isRecursive)
           
 Fragment expandTemplates()
           
 Fragment markMacros(MacroExpander expander)
           
static BracesFragment processBraces(FragmentList fragments)
           
static BracketsFragment processBrackets(FragmentList fragments)
           
static Template processNestedTemplate(FragmentList fragments)
           
static ParensFragment processParens(FragmentList fragments)
           
static QuestionExpressionFragment processQuestionExpression(Fragment fragment)
           
static QuestionExpressionFragment processQuestionExpression(FragmentList fragments)
           
static Expansion processTemplate(FragmentList fragments)
           
static FloatFragment substituteAsFloat(float x)
           
static FloatFragment substituteAsFloat(java.lang.Float x)
           
static IntegerFragment substituteAsInteger(int x)
           
static IntegerFragment substituteAsInteger(java.lang.Integer x)
           
static StringFragment substituteAsString(java.lang.String string)
           
static CommaFragment substituteComma()
           
static DotFragment substituteDot()
           
static IdentifierFragment substituteIdentifier(java.lang.String name)
           
static PatternVariableFragment substitutePatternVariable(java.lang.String name)
           
static QuestionFragment substituteQuestion()
           
static SemicolonFragment substituteSemicolon()
           
 List tokens()
           
 
Methods inherited from class net.sf.jse.NestedFragment
compileNestedPatternElements, compilePatternElement, getInsideFragments, getNestedFragments, setInsideFragments, toString
 
Methods inherited from class net.sf.jse.CompoundFragment
collectBoundVariables, compileNestedTemplate
 
Methods inherited from class net.sf.jse.Fragment
capitalize, die, generatePatternCode, getChar, getCurrentLine, getFloat, getInt, getLine, getString, getValue, isTerminator, makeToken, makeToken, setCurrentLine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Template

public Template(FragmentList fragments)

Template

public Template(antlr.Token left,
                FragmentList fragments,
                antlr.Token right)
Method Detail

tokens

public List tokens()
Overrides:
tokens in class NestedFragment

expandTemplates

public Fragment expandTemplates()
Overrides:
expandTemplates in class NestedFragment

compileTemplate

public Fragment compileTemplate(int depth)
Description copied from class: Fragment
Template code generator -- probably should be compileTemplateElement
Overrides:
compileTemplate in class NestedFragment
Following copied from class: net.sf.jse.Fragment
See Also:
compileTemplate(int)

compileQuestionExpression

public Fragment compileQuestionExpression(int tDepth,
                                          int qDepth)
Overrides:
compileQuestionExpression in class Fragment

compilePattern

public Expansion compilePattern(Fragment expression,
                                IdentifierFragment endVar)

markMacros

public Fragment markMacros(MacroExpander expander)
Overrides:
markMacros in class NestedFragment

expandMacros

public Fragment expandMacros(MacroExpander expander,
                             boolean isRecursive)
Overrides:
expandMacros in class NestedFragment

processTemplate

public static Expansion processTemplate(FragmentList fragments)

processNestedTemplate

public static Template processNestedTemplate(FragmentList fragments)

substituteIdentifier

public static IdentifierFragment substituteIdentifier(java.lang.String name)

substitutePatternVariable

public static PatternVariableFragment substitutePatternVariable(java.lang.String name)

substituteDot

public static DotFragment substituteDot()

substituteComma

public static CommaFragment substituteComma()

substituteSemicolon

public static SemicolonFragment substituteSemicolon()

substituteQuestion

public static QuestionFragment substituteQuestion()

processParens

public static ParensFragment processParens(FragmentList fragments)

processBraces

public static BracesFragment processBraces(FragmentList fragments)

processBrackets

public static BracketsFragment processBrackets(FragmentList fragments)

processQuestionExpression

public static QuestionExpressionFragment processQuestionExpression(FragmentList fragments)

processQuestionExpression

public static QuestionExpressionFragment processQuestionExpression(Fragment fragment)

substituteAsString

public static StringFragment substituteAsString(java.lang.String string)

substituteAsInteger

public static IntegerFragment substituteAsInteger(java.lang.Integer x)

substituteAsInteger

public static IntegerFragment substituteAsInteger(int x)

substituteAsFloat

public static FloatFragment substituteAsFloat(java.lang.Float x)

substituteAsFloat

public static FloatFragment substituteAsFloat(float x)