|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.interpreter.type.AbstractCode
org.extex.unit.tex.macro.Csname
public class Csname
This class provides an implementation for the primitive
The primitive \csname absorbs further tokens until a matching
If the meaning of the new token is currently not defined then it is defined
to be equivalent to the original meaning of
If a non-expandable token is encountered then an error is raised.
This results in the control sequence \abc.
The example is valid. It shows that even non-character tokens might be
contained.
This is usually illegal since \TeX is defined in plain to contain
some non-expandable primitives.
\csname.
The Primitive \csname
\endcsname is found. The
tokens found are expanded. Spaces are ignored. The expansion should lead to
character tokens only. No primitives producing something different are
allowed. A new token is constructed from the characters. The escape character
is the current escape character.
\relax.
Syntax
The formal description of this primitive is the following:
〈csname〉
→ \csname 〈expandable tokens〉 \endcsname
Examples
\csname abc\endcsname
\csname ab#de\endcsname
\csname \TeX\endcsname
| Field Summary | |
|---|---|
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
| Constructor Summary | |
|---|---|
Csname(CodeToken token)
Creates a new object. |
|
| Method Summary | |
|---|---|
void |
execute(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
This method takes the first token and executes it. |
void |
expand(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
This method takes the first token and expands it. |
static java.lang.String |
scanToEndCsname(Context context,
TokenSource source,
Typesetter typesetter,
Localizer loc)
Expand tokens and collect the result until \endcsname is found. |
| Methods inherited from class org.extex.interpreter.type.AbstractCode |
|---|
getLocalizer, getName, getToken, isIf, isOuter, readResolve, toString, toText, toText |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final long serialVersionUID
| Constructor Detail |
|---|
public Csname(CodeToken token)
token - the initial token for the primitive| Method Detail |
|---|
public static java.lang.String scanToEndCsname(Context context,
TokenSource source,
Typesetter typesetter,
Localizer loc)
throws HelpingException,
ConfigurationException,
TypesetterException
Endcsname.
context - the interpreter contextsource - the source for new tokenstypesetter - the typesetterloc - the localizer
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter
ConfigurationException - in case of an configuration error
public void execute(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
throws HelpingException,
TypesetterException
execute in interface Codeexecute in class AbstractCodeprefix - the prefix controlling the executioncontext - the interpreter contextsource - the token sourcetypesetter - the typesetter
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetterCode.execute(
org.extex.interpreter.Flags, org.extex.interpreter.context.Context,
org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)
public void expand(Flags prefix,
Context context,
TokenSource source,
Typesetter typesetter)
throws HelpingException,
ConfigurationException,
TypesetterException
expand in interface ExpandableCodeprefix - the prefix flags controlling the expansioncontext - the interpreter contextsource - the token sourcetypesetter - the typesetter
HelpingException - in case of an error
ConfigurationException - in case of an configuration error
TypesetterException - in case of an error in the typesetterExpandableCode.expand(
org.extex.interpreter.Flags, org.extex.interpreter.context.Context,
org.extex.interpreter.TokenSource, org.extex.typesetter.Typesetter)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||