|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmmp.engine.Macro
public abstract class Macro
Abstract class that must be extended by the provider of a Java macro.
Contract:
public myMacro() {
super( false );
}
Nested Class Summary | |
---|---|
static class |
Macro.Style
Enumeration classifying whether the macro needs parenthesis to be recognized as a macro. |
Field Summary | |
---|---|
static java.lang.String |
MMPTRACE_CALL
MMPTRACE_CALL is the format string for tracing the call of a macro. |
static java.lang.String |
MMPTRACE_EXP
MMPTRACE_EXP is the format string for tracing the expansion of a macro. |
Constructor Summary | |
---|---|
Macro(Macro.Style style,
java.lang.String... instInfo)
Constructor for a user defined Java macro. |
Method Summary | |
---|---|
abstract java.lang.String |
call(java.util.List<java.lang.String> macArgs,
EngineContext engineContext)
Calls the macro with the argument 'macArg' in the 'engineContext'. |
java.util.List<java.lang.String> |
getInstInfo()
Provides instantiation info for a Java macro. |
boolean |
needsParenthesis()
Macro needs parenthesis to be recognized as a macro. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MMPTRACE_CALL
public static final java.lang.String MMPTRACE_EXP
Constructor Detail |
---|
public Macro(Macro.Style style, java.lang.String... instInfo)
style
- If the macro needs parenthesis to be recognized as a
macro, the parameter must be Mode.NEEDS_PARENTHESIS,
Mode.DOES_NOT_NEED_PARENTHESIS otherwise. instInfo
- are the parameters of the constructor of the
macro. It has to be parameters of type String.Method Detail |
---|
public abstract java.lang.String call(java.util.List<java.lang.String> macArgs, EngineContext engineContext) throws java.io.IOException, SyntaxErrorException, RuntimeErrorException, M4ExitException
macArgs
- macArgs[0] is always the name of the macroengineContext
- the engineContext is provided by the
mmp engine and can be used by the implementation of the macro.
java.io.IOException
- io error
SyntaxErrorException
- syntax error
RuntimeErrorException
- runtime error
M4ExitException
- m4exitpublic final java.util.List<java.lang.String> getInstInfo()
public final boolean needsParenthesis()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |