Package kawa.lang
Class Macro
- java.lang.Object
-
- kawa.lang.Syntax
-
- kawa.lang.Macro
-
- All Implemented Interfaces:
gnu.kawa.format.Printable
,Named
,Externalizable
,Serializable
public class Macro extends Syntax implements gnu.kawa.format.Printable, Externalizable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description Object
expander
static int
HYGIENIC
static int
SKIP_SCAN_FORM
If this flag is set, then don't expand during the scan-body phase.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
expand(Object form, Translator tr)
ScopeExp
getCapturedScope()
boolean
isHygienic()
static Macro
make(Declaration decl)
static Macro
make(Object name, Procedure expander)
static Macro
make(Object name, Procedure expander, Object instance)
static Macro
makeNonHygienic(Object name, Procedure expander)
static Macro
makeNonHygienic(Object name, Procedure expander, Object instance)
static Macro
makeSkipScanForm(Object name, Procedure expander, Object instance)
void
print(Consumer out)
void
readExternal(ObjectInput in)
Expression
rewriteForm(Pair form, Translator tr)
Object
rewriteIfNeeded()
void
scanForm(Pair st, ScopeExp defs, Translator tr)
void
setCapturedScope(ScopeExp scope)
void
setFlags(int flags)
void
setHygienic(boolean hygienic)
String
toString()
void
writeExternal(ObjectOutput out)
-
-
-
Field Detail
-
expander
public Object expander
-
HYGIENIC
public static final int HYGIENIC
- See Also:
- Constant Field Values
-
SKIP_SCAN_FORM
public static final int SKIP_SCAN_FORM
If this flag is set, then don't expand during the scan-body phase.- See Also:
- Constant Field Values
-
-
Method Detail
-
setFlags
public final void setFlags(int flags)
-
isHygienic
public final boolean isHygienic()
-
setHygienic
public final void setHygienic(boolean hygienic)
-
getCapturedScope
public ScopeExp getCapturedScope()
-
setCapturedScope
public void setCapturedScope(ScopeExp scope)
-
make
public static Macro make(Declaration decl)
-
makeNonHygienic
public static Macro makeNonHygienic(Object name, Procedure expander, Object instance)
-
makeSkipScanForm
public static Macro makeSkipScanForm(Object name, Procedure expander, Object instance)
-
rewriteForm
public Expression rewriteForm(Pair form, Translator tr)
- Overrides:
rewriteForm
in classSyntax
-
print
public void print(Consumer out)
-
rewriteIfNeeded
public Object rewriteIfNeeded()
-
expand
public Object expand(Object form, Translator tr)
-
scanForm
public void scanForm(Pair st, ScopeExp defs, Translator tr)
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
-