|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Context
This interface describes the container for all data of an interpreter context.
Method Summary | |
---|---|
void |
addUnit(UnitInfo info)
Add a unit to the list of loaded units. |
java.lang.String |
esc(java.lang.String name)
Attach the current escape character in front of a name and return the result. |
java.lang.String |
esc(Token token)
This method is meant to produce a printable version of a control sequence for error messages. |
UnicodeChar |
escapechar()
Return the current escape character or \0 |
java.lang.Object |
get(java.lang.Object extension,
java.lang.Object key)
Getter for a value from an extended section of the context. |
Token |
getAfterassignment()
Getter for the afterassignment token. |
Box |
getBox(java.lang.String name)
Getter for the box register. |
Conditional |
getConditional()
Getter for the currently active conditional. |
MathDelimiter |
getDelcode(UnicodeChar c)
Getter for the delimiter code mapping. |
Glue |
getGlue(java.lang.String name)
Getter for a glue register. |
java.lang.String |
getId()
Getter for the id string. |
long |
getIfLevel()
Getter for the current if level. |
Language |
getLanguage(java.lang.String language)
Getter for the hyphenation record for a given language. |
LanguageManager |
getLanguageManager()
Getter for the language manager. |
UnicodeChar |
getLccode(UnicodeChar uc)
Getter for the lccode mapping of upper case characters to their lower case equivalent. |
long |
getMagnification()
Getter for the magnification factor in per mille. |
MathCode |
getMathcode(UnicodeChar uc)
Getter for the math code of a character. |
Muskip |
getMuskip(java.lang.String name)
Getter for a muskip register. |
java.lang.String |
getNamespace()
Getter for the current name space. |
ParagraphShape |
getParshape()
Getter for the paragraph shape. |
FixedCount |
getSfcode(UnicodeChar uc)
Getter for the space factor code of a character. |
TokenStream |
getStandardTokenStream()
Getter for standardTokenStream. |
TokenFactory |
getTokenFactory()
Getter for the token factory. |
Tokenizer |
getTokenizer()
Getter for the tokenizer. |
TypesettingContext |
getTypesettingContext()
Getter for the typesetting context. |
UnicodeChar |
getUccode(UnicodeChar lc)
Getter for the uccode mapping of lower case characters to their upper case equivalent. |
Conditional |
popConditional()
Pop the management information for a conditional from the stack and return it. |
Direction |
popDirection()
Pop a direction from the direction stack. |
void |
pushConditional(Locator locator,
boolean value,
Code primitive,
long branch,
boolean neg)
Put a value onto the conditional stack. |
void |
pushDirection(Direction dir)
Push a direction onto the direction stack. |
void |
set(Color color,
boolean global)
Setter for the color in the current typesetting context. |
void |
set(Direction direction,
boolean global)
Setter for the direction in the current typesetting context. |
void |
set(Font font,
boolean global)
Setter for the font in the current typesetting context. |
void |
set(Language language,
boolean global)
Setter for the language in the current typesetting context. |
void |
set(java.lang.Object extension,
java.lang.Object key,
java.lang.Object value,
boolean global)
Setter for a value from an extended section of the context. |
void |
set(TypesettingContext context,
boolean global)
Setter for the typesetting context in the specified groups. |
void |
setAfterassignment(Token token)
Setter for the afterassignment token. |
void |
setBox(java.lang.String name,
Box value,
boolean global)
Setter for the box register in
the current group. |
void |
setCatcode(UnicodeChar c,
Catcode catcode,
boolean global)
Setter for the catcode of a character in the specified groups. |
void |
setDelcode(UnicodeChar c,
MathDelimiter delimiter,
boolean global)
Setter for the delimiter code mapping. |
void |
setGlue(java.lang.String name,
Glue value,
boolean global)
Setter for a glue register. |
void |
setId(java.lang.String id)
Setter for the id string. |
void |
setLanguageManager(LanguageManager manager)
Setter for the language manager. |
void |
setLccode(UnicodeChar uc,
UnicodeChar lc,
boolean global)
Declare the translation from an upper case character to a lower case character. |
void |
setMagnification(long mag,
boolean lock)
Setter for the magnification. |
void |
setMathcode(UnicodeChar uc,
MathCode code,
boolean global)
Setter for the math code of a character |
void |
setMuskip(java.lang.String name,
Muskip value,
boolean global)
Setter for a muskip register. |
void |
setNamespace(java.lang.String namespace,
boolean global)
Setter for the name space. |
void |
setParshape(ParagraphShape shape)
Setter for the paragraph shape. |
void |
setSfcode(UnicodeChar uc,
Count code,
boolean global)
Setter for the space factor code in the specified groups. |
void |
setStandardTokenStream(TokenStream standardTokenStream)
Setter for standardTokenStream. |
void |
setTokenFactory(TokenFactory factory)
Setter for the token factory. |
void |
setUccode(UnicodeChar lc,
UnicodeChar uc,
boolean global)
Declare the translation from a lower case character to an upper case character. |
java.util.Iterator<UnitInfo> |
unitIterator()
Get an iterator to enumerate all unit infos. |
Methods inherited from interface org.extex.interpreter.context.ContextCode |
---|
getCode, setCode |
Methods inherited from interface org.extex.interpreter.context.ContextCount |
---|
getCount, setCount |
Methods inherited from interface org.extex.interpreter.context.ContextDimen |
---|
getDimen, setDimen, setDimen |
Methods inherited from interface org.extex.interpreter.context.ContextFile |
---|
getInFile, getOutFile, setInFile, setOutFile |
Methods inherited from interface org.extex.interpreter.context.ContextFont |
---|
getFont, getFontFactory, setFont, setFontFactory |
Methods inherited from interface org.extex.interpreter.context.ContextGroup |
---|
afterGroup, afterGroup, closeGroup, getGroupInfos, getGroupLevel, getGroupType, isGlobalGroup, openGroup |
Methods inherited from interface org.extex.interpreter.context.ContextErrorCount |
---|
getErrorCount, incrementErrorCount |
Methods inherited from interface org.extex.interpreter.context.ContextInteraction |
---|
getInteraction, setInteraction |
Methods inherited from interface org.extex.interpreter.context.ContextTokens |
---|
getToks, getToksOrNull, setToks |
Methods inherited from interface org.extex.interpreter.context.ContextMark |
---|
clearSplitMarks, getBottomMark, getFirstMark, getSplitBottomMark, getSplitFirstMark, getTopMark, setMark, setSplitMark, startMarks |
Methods inherited from interface org.extex.scanner.api.Tokenizer |
---|
getCatcode |
Methods inherited from interface org.extex.typesetter.PageContext |
---|
getCountOption, getDimenOption, getFont, getGlueOption, getOutFile, getTypesettingContextFactory, setCountOption, setMark, setOutFile |
Method Detail |
---|
void addUnit(UnitInfo info)
info
- the info of the unit loadedunitIterator()
java.lang.String esc(java.lang.String name)
This method is meant to produce a printable version of a control sequence for error messages.
name
- the name of the macro
java.lang.String esc(Token token)
token
- the token
UnicodeChar escapechar()
\0 if it is undefined.
The escape character is retrieved from the count register
\escapechar.
This is a convenience method.
The Count Parameter \escapechar
The count register \escapechar contains code point of the
escape character. This character is used whenever an control sequence
is about to be printed and it has to be prefixed by the escape character.
If the value is less than zero then the escape character is assumed to
be undefined. In this case the control sequence is not prefixed by any
character.
Note that the escape character does not need to be in sync with the
definition of the category codes. In fact they are independent. Usually
they should coincide, but some interesting effects can be achieved with
controlled disagreement.
Syntax
The formal description of this primitive is the following:
〈escapechar〉
→ \escapechar 〈equals〉 〈number〉
Examples
\escapechar=-1
- Returns:
- the escape character
java.lang.Object get(java.lang.Object extension, java.lang.Object key)
extension
- the name of the extensionkey
- the key for the value
set(Object, Object, Object, boolean)
Token getAfterassignment()
setAfterassignment(Token)
Box getBox(java.lang.String name)
box
register.
Box registers are named, either with a number or an arbitrary string. The
numbered registers where limited to 256 in
name
- the name or number of the count register
null
if it is voidsetBox(String, Box, boolean)
Conditional getConditional()
null
if nonepopConditional()
,
pushConditional(Locator, boolean, Code, long, boolean)
,
getIfLevel()
MathDelimiter getDelcode(UnicodeChar c)
c
- the character to which the delcode is assigned
setDelcode(UnicodeChar, MathDelimiter, boolean)
Glue getGlue(java.lang.String name)
name
- the name of the glue register to acquire.
null
if
none is setsetGlue(String, Glue, boolean)
java.lang.String getId()
null
if not known yet.
setId(String)
long getIfLevel()
getConditional()
,
popConditional()
,
pushConditional(Locator, boolean, Code, long, boolean)
Language getLanguage(java.lang.String language) throws HelpingException
language
- the name of the language to use
HelpingException
- in case of an errorset(Language, boolean)
LanguageManager getLanguageManager()
setLanguageManager(LanguageManager)
UnicodeChar getLccode(UnicodeChar uc)
getLccode
in interface PageContext
uc
- the upper case character
setLccode(UnicodeChar, UnicodeChar, boolean)
,
getUccode(UnicodeChar)
,
setUccode(UnicodeChar, UnicodeChar, boolean)
long getMagnification()
MathCode getMathcode(UnicodeChar uc)
uc
- the character index
setMathcode(UnicodeChar, MathCode, boolean)
Muskip getMuskip(java.lang.String name)
getMuskip
in interface PageContext
name
- the name or the number of the register
null
if none is setsetMuskip(String, Muskip, boolean)
java.lang.String getNamespace()
getNamespace
in interface PageContext
getNamespace
in interface Tokenizer
setNamespace(String, boolean)
ParagraphShape getParshape()
getParshape
in interface PageContext
null
if no special shape is
presentsetParshape(ParagraphShape)
FixedCount getSfcode(UnicodeChar uc)
uc
- the Unicode character
setSfcode(UnicodeChar, Count, boolean)
TokenStream getStandardTokenStream()
setStandardTokenStream(TokenStream)
TokenFactory getTokenFactory()
getTokenFactory
in interface PageContext
setTokenFactory(TokenFactory)
Tokenizer getTokenizer()
setCatcode(UnicodeChar, Catcode, boolean)
TypesettingContext getTypesettingContext()
getTypesettingContext
in interface PageContext
set(Color, boolean)
,
set(Direction, boolean)
,
set(Font, boolean)
,
set(Language, boolean)
,
set(TypesettingContext, boolean)
UnicodeChar getUccode(UnicodeChar lc)
lc
- the upper case character
setUccode(UnicodeChar, UnicodeChar, boolean)
,
getLccode(UnicodeChar)
,
setLccode(UnicodeChar, UnicodeChar, boolean)
Conditional popConditional() throws HelpingException
null
is returned.
HelpingException
- in case of an errorpushConditional(Locator, boolean, Code, long, boolean)
,
getConditional()
,
getIfLevel()
Direction popDirection()
null
if the
stack is emptypushDirection(Direction)
void pushConditional(Locator locator, boolean value, Code primitive, long branch, boolean neg)
locator
- the locator for the start of the if statementvalue
- the value to pushprimitive
- the name of the primitive which triggered this operationbranch
- the branch numberneg
- negation indicatorpopConditional()
,
getConditional()
,
getIfLevel()
void pushDirection(Direction dir)
dir
- the directionpopDirection()
void set(Color color, boolean global)
color
- the new colorglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected only
ConfigurationException
- in case of an error in the configuration.getTypesettingContext()
void set(Direction direction, boolean global)
direction
- the new directionglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected only
ConfigurationException
- in case of an error in the configuration.getTypesettingContext()
void set(Font font, boolean global)
font
- the new fontglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected only
ConfigurationException
- in case of an error in the configuration.getTypesettingContext()
void set(Language language, boolean global)
language
- the new languageglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected only
ConfigurationException
- in case of an error in the configuration.getTypesettingContext()
void set(java.lang.Object extension, java.lang.Object key, java.lang.Object value, boolean global)
extension
- the name of the extensionkey
- the key for the valuevalue
- the value to storeglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlyget(Object, Object)
void set(TypesettingContext context, boolean global)
context
- the processor contextglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetTypesettingContext()
void setAfterassignment(Token token)
token
- the afterassignment token.getAfterassignment()
void setBox(java.lang.String name, Box value, boolean global)
box
register in
the current group. Count registers are named, either with a number or an
arbitrary string. The numbered registers where limited to 256 in
name
- the name or the number of the registervalue
- the new value of the registerglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetBox(String)
void setCatcode(UnicodeChar c, Catcode catcode, boolean global) throws HelpingException
c
- the character to assign a catcode forcatcode
- the catcode of the characterglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected only
HelpingException
- in case of an errorgetTokenizer()
void setDelcode(UnicodeChar c, MathDelimiter delimiter, boolean global)
c
- the character to which the delcode is assigneddelimiter
- the delimiter codeglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetDelcode(UnicodeChar)
void setGlue(java.lang.String name, Glue value, boolean global) throws HelpingException
name
- the name of the glue registervalue
- the glue value to setglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected only
HelpingException
- in case of an errorgetGlue(String)
void setId(java.lang.String id)
id
- the id stringgetId()
void setLanguageManager(LanguageManager manager)
manager
- the language manager
ConfigurationException
- in case of an configuration errorgetLanguageManager()
void setLccode(UnicodeChar uc, UnicodeChar lc, boolean global)
uc
- upper case characterlc
- lower case equivalentglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetLccode(UnicodeChar)
,
getUccode(UnicodeChar)
,
setUccode(UnicodeChar, UnicodeChar, boolean)
void setMagnification(long mag, boolean lock) throws HelpingException
mag
- the new magnification factorlock
- lock the new value. Thus it can not be alterd afterwards.
HelpingException
- in case that the magnification factor is not in
the allowed range or that the magnification has been set to a
different value earlier.getMagnification()
void setMathcode(UnicodeChar uc, MathCode code, boolean global)
uc
- the character indexcode
- the new math codeglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetMathcode(UnicodeChar)
void setMuskip(java.lang.String name, Muskip value, boolean global)
name
- the name or the number of the registervalue
- the new valueglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetMuskip(String)
void setNamespace(java.lang.String namespace, boolean global)
namespace
- the new name spaceglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetNamespace()
void setParshape(ParagraphShape shape)
setParshape
in interface PageContext
shape
- the new paragraph shapegetParshape()
void setSfcode(UnicodeChar uc, Count code, boolean global)
uc
- the Unicode character to assign the sfcode tocode
- the new sfcodeglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetSfcode(UnicodeChar)
void setStandardTokenStream(TokenStream standardTokenStream)
standardTokenStream
- the standardTokenStream to set.getStandardTokenStream()
void setTokenFactory(TokenFactory factory)
factory
- the new token factorygetTokenFactory()
void setUccode(UnicodeChar lc, UnicodeChar uc, boolean global)
lc
- lower case characteruc
- uppercase equivalentglobal
- the indicator for the scope; true
means all
groups; otherwise the current group is affected onlygetUccode(UnicodeChar)
,
getLccode(UnicodeChar)
,
setLccode(UnicodeChar, UnicodeChar, boolean)
java.util.Iterator<UnitInfo> unitIterator()
addUnit(UnitInfo)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |