Class Macro
java.lang.Object
io.github.douira.glsl_preprocessor.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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a "paste" operator to the expansion of this macro.voidAdds a token to the expansion of this macro.intgetArgs()Returns the number of arguments to this macro.getName()Returns the name of this macro.Returns the Source from which this macro was parsed.getText()booleanReturns true if this is a function-like macro.booleanReturns true if this is a variadic function-like macro.voidSets the arguments to this macro.voidSets the Source from which this macro was parsed.voidsetVariadic(boolean b) Sets the variadic flag on this Macro.toString()
-
Constructor Details
-
Macro
-
Macro
-
-
Method Details
-
setSource
Sets the Source from which this macro was parsed. -
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
Returns the name of this macro. -
setArgs
Sets the arguments to 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. -
addToken
Adds a token to the expansion of this macro. -
addPaste
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
-
toString
-