|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.anarres.cpp.Macro
public class Macro
A macro object.
This encapsulates a name, an argument count, and a token stream
for replacement. The replacement token stream may contain the
extra tokens Token.M_ARG
and Token.M_STRING
.
Constructor Summary | |
---|---|
Macro(Source source,
String name)
|
|
Macro(String name)
|
Method Summary | |
---|---|
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 |
isFunctionLike()
Returns true if this is a function-like macro. |
boolean |
isVariadic()
Returns true if this is a variadic function-like macro. |
void |
setArgs(List<String> args)
Sets the arguments to this macro. |
void |
setSource(Source s)
Sets the Source from which this macro was parsed. |
void |
setVariadic(boolean b)
Sets the variadic flag on this Macro. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Macro(Source source, String name)
public Macro(String name)
Method Detail |
---|
public void setSource(Source s)
public Source getSource()
public String getName()
public void setArgs(List<String> args)
public boolean isFunctionLike()
public int getArgs()
public void setVariadic(boolean b)
public boolean isVariadic()
public void addToken(Token tok)
public void addPaste(Token tok)
public String getText()
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |