Top Description Fields Constructors Methods
com.jogamp.gluegen.jcpp

public Class Macro

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Iterator, .List

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.

Field Summary

Modifier and TypeField and Description
private List<String>
private boolean
private final String
private final Source
private List<Token>
private boolean

Constructor Summary

AccessConstructor and Description
public
Macro(final Source source, final String name)

public
Macro(final Macro o)

public
Macro(final Macro o, final List<Token> tokens)

private
Macro(final Macro o, final List<Token> tokens, final boolean copyTokens)

public
Macro(final String name)

Method Summary

Modifier and TypeMethod and Description
public void
addPaste(final Token tok)

Adds a "paste" operator to the expansion of this macro.

public void
addToken(final Token tok)

Adds a token to the expansion of this macro.

public int
getArgs()

Returns the number of arguments to this macro.

public String
getName()

Returns the name of this macro.

public Source
getSource()

Returns the Source from which this macro was parsed.

public String
pack-priv List<Token>
public boolean
hasPaste()

Returns true if this macro contains a "paste" operator.

public boolean
isFunctionLike()

Returns true if this is a function-like macro.

public boolean
isVariadic()

Returns true if this is a variadic function-like macro.

pack-priv void
setArgs(final List<String> args)

Sets the arguments to this macro.

public void
setVariadic(final boolean b)

Sets the variadic flag on this Macro.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

argsback to summary
private List<String> args
hasPasteback to summary
private boolean hasPaste
nameback to summary
private final String name
sourceback to summary
private final Source source
tokensback to summary
private List<Token> tokens
variadicback to summary
private boolean variadic

Constructor Detail

Macroback to summary
public Macro(final Source source, final String name)
Macroback to summary
public Macro(final Macro o)
Macroback to summary
public Macro(final Macro o, final List<Token> tokens)
Macroback to summary
private Macro(final Macro o, final List<Token> tokens, final boolean copyTokens)
Macroback to summary
public Macro(final String name)

Method Detail

addPasteback to summary
public void addPaste(final 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.

addTokenback to summary
public void addToken(final Token tok)

Adds a token to the expansion of this macro.

getArgsback to summary
public int getArgs()

Returns the number of arguments to this macro.

getNameback to summary
public String getName()

Returns the name of this macro.

getSourceback to summary
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.

getTextback to summary
public String getText()
getTokensback to summary
pack-priv List<Token> getTokens()
hasPasteback to summary
public boolean hasPaste()

Returns true if this macro contains a "paste" operator.

isFunctionLikeback to summary
public boolean isFunctionLike()

Returns true if this is a function-like macro.

isVariadicback to summary
public boolean isVariadic()

Returns true if this is a variadic function-like macro.

setArgsback to summary
pack-priv void setArgs(final List<String> args)

Sets the arguments to this macro.

setVariadicback to summary
public void setVariadic(final boolean b)

Sets the variadic flag on this Macro.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override