|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.extex.scanner.type.tokens.Tokens
org.extex.unit.tex.macro.util.MacroPattern
public class MacroPattern
This class provides a container for the pattern of a macro.
| Field Summary | |
|---|---|
static MacroPattern |
EMPTY
The constant EMPTY contains the empty macro pattern. |
protected static long |
serialVersionUID
The constant serialVersionUID contains the id for serialization. |
| Constructor Summary | |
|---|---|
protected |
MacroPattern(CodeToken cs)
Creates a new object. |
protected |
MacroPattern(Tokens tokens)
Creates a new object. |
| Method Summary | |
|---|---|
protected void |
compile(Context context)
Compile the pattern into a list of function elements to perform the operations required for doing the matching. |
static MacroPattern |
getPattern(Context context,
TokenSource source,
boolean longP,
CodeToken cs)
Parse a pattern specification. |
protected static Tokens |
getTokenOrBlock(Context context,
TokenSource source,
Typesetter typesetter,
CodeToken cs)
Get a single token or a block if the first token is a LeftBraceToken. |
Tokens[] |
match(Context context,
TokenSource source,
Typesetter typesetter,
boolean notLong,
ArgumentMatchingObserver observer)
Match the pattern of this macro with the next tokens from the token source. |
protected void |
setArity(int arity)
Setter for the arity. |
java.lang.String |
toString()
Return a String, which show all tokens in the list. |
| Methods inherited from class org.extex.scanner.type.tokens.Tokens |
|---|
add, add, clear, equals, get, hashCode, insert, iterator, length, pop, push, removeFirst, removeLast, show, toString, toString, toText, toText |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final MacroPattern EMPTY
protected static final long serialVersionUID
| Constructor Detail |
|---|
protected MacroPattern(CodeToken cs)
cs - the name of the invoking macroprotected MacroPattern(Tokens tokens)
tokens - the tokens contained| Method Detail |
|---|
public static MacroPattern getPattern(Context context,
TokenSource source,
boolean longP,
CodeToken cs)
throws HelpingException
context - the processor contextsource - the source for new tokenslongP - indicator for the long flagcs - the macro being defined
HelpingException - in case of an error
protected static Tokens getTokenOrBlock(Context context,
TokenSource source,
Typesetter typesetter,
CodeToken cs)
throws HelpingException,
TypesetterException
LeftBraceToken.
context - the processor contextsource - the source for new tokenstypesetter - the typesettercs - the control sequence for error reporting
HelpingException - in case of an error
TypesetterException - in case of an error in the typesetter
protected void compile(Context context)
throws HelpingException
context - the interpreter context
HelpingException - in case of an error
public Tokens[] match(Context context,
TokenSource source,
Typesetter typesetter,
boolean notLong,
ArgumentMatchingObserver observer)
throws HelpingException,
TypesetterException
Tokens. This array is
returned.
Note that the first argument – denoted #1 – can be found at position 0 of the array.
context - the processor contextsource - the source for new tokenstypesetter - the typesetternotLong - observer - the observer for argument matching events
null.
HelpingException - in case of an error during the matching
TypesetterException - in case of an error in the typesetterprotected void setArity(int arity)
arity - the new aritypublic java.lang.String toString()
toString in interface FixedTokenstoString in class TokensTokens.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||