public class Macro extends Object
Token.M_ARG
and Token.M_STRING
.Constructor and Description |
---|
Macro(Macro o) |
Macro(Macro o,
List<Token> tokens) |
Macro(Source source,
String name) |
Macro(String name) |
Modifier and Type | Method and Description |
---|---|
void |
addPaste(Token tok)
Adds a "paste" operator to the expansion of this macro.
|
void |
addToken(Token tok)
Adds a token to the expansion of this macro.
|
int |
getArgs()
Returns the number of arguments to this macro.
|
String |
getName()
Returns the name of this macro.
|
Source |
getSource()
Returns the Source from which this macro was parsed.
|
String |
getText() |
boolean |
hasPaste()
Returns true if this macro contains a "paste" operator.
|
boolean |
isFunctionLike()
Returns true if this is a function-like macro.
|
boolean |
isVariadic()
Returns true if this is a variadic function-like macro.
|
void |
setVariadic(boolean b)
Sets the variadic flag on this Macro.
|
String |
toString() |
public Source getSource()
public String getName()
public boolean isFunctionLike()
public int getArgs()
public void setVariadic(boolean b)
public boolean isVariadic()
public boolean hasPaste()
public void addToken(Token tok)
public void addPaste(Token tok)
public String getText()