Package com.jogamp.gluegen.jcpp
Class Macro
- java.lang.Object
-
- com.jogamp.gluegen.jcpp.Macro
-
public class Macro extends Object
A macro object. This encapsulates a name, an argument count, and a token stream for replacement. The replacement token stream may contain the extra tokensToken.M_ARGandToken.M_STRING.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPaste(Token tok)Adds a "paste" operator to the expansion of this macro.voidaddToken(Token tok)Adds a token to the expansion of this macro.intgetArgs()Returns the number of arguments to this macro.StringgetName()Returns the name of this macro.SourcegetSource()Returns the Source from which this macro was parsed.StringgetText()booleanhasPaste()Returns true if this macro contains a "paste" operator.booleanisFunctionLike()Returns true if this is a function-like macro.booleanisVariadic()Returns true if this is a variadic function-like macro.voidsetVariadic(boolean b)Sets the variadic flag on this Macro.StringtoString()
-
-
-
Method Detail
-
getSource
public Source getSource()
Returns the Source from which this macro was parsed. This method may return null if the macro was not parsed from a regular file.
-
getName
public String getName()
Returns the name of this macro.
-
isFunctionLike
public boolean isFunctionLike()
Returns true if this is a function-like macro.
-
getArgs
public int getArgs()
Returns the number of arguments to this macro.
-
setVariadic
public void setVariadic(boolean b)
Sets the variadic flag on this Macro.
-
isVariadic
public boolean isVariadic()
Returns true if this is a variadic function-like macro.
-
hasPaste
public boolean hasPaste()
Returns true if this macro contains a "paste" operator.
-
addToken
public void addToken(Token tok)
Adds a token to the expansion of this macro.
-
addPaste
public void addPaste(Token tok)
Adds a "paste" operator to the expansion of this macro. A paste operator causes the next token added to be pasted to the previous token when the macro is expanded. It is an error for a macro to end with a paste token.
-
getText
public String getText()
-
-