Loading...
Searching...
No Matches
SdfVariableExpressionAST Class Reference

Abstract syntax tree for an SdfVariableExpression. More...

#include <variableExpressionAST.h>

Public Member Functions

SDF_API SdfVariableExpressionAST ()
 Construct an invalid AST.
 
SDF_API SdfVariableExpressionAST (const std::string &expr)
 Construct the AST for the variable expression expr.
 
SDF_API SdfVariableExpressionAST (const SdfVariableExpression &expr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to SdfVariableExpressionAST(expr.GetString());.
 
SDF_API SdfVariableExpressionAST (const SdfVariableExpressionAST &rhs)
 Copy constructor. Performs a deep copy of the AST in rhs.
 
SDF_API SdfVariableExpressionASToperator= (const SdfVariableExpressionAST &rhs)
 Assignment. Performs a deep copy of the AST in rhs.
 
 SdfVariableExpressionAST (SdfVariableExpressionAST &&rhs)=default
 
SdfVariableExpressionASToperator= (SdfVariableExpressionAST &&rhs)=default
 
SDF_API operator bool () const
 Return true if this is a valid AST, false otherwise.
 
SDF_API const std::vector< std::string > & GetErrors () const
 Return list of errors encountered when parsing the expression passed to the constructor.
 
SDF_API SdfVariableExpressionASTNodes::NodeGetRoot ()
 Return the root node of the syntax tree corresponding to the outermost expression if this is a valid AST or nullptr otherwise.
 
SDF_API const SdfVariableExpressionASTNodes::NodeGetRoot () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
SDF_API SdfVariableExpression GetExpression () const
 Return the expression represented by this AST if this is a valid AST or a default constructed SdfVariableExpression otherwise.
 

Detailed Description

Abstract syntax tree for an SdfVariableExpression.

Provides read-only inspection of the structure of a variable expression.

Definition at line 255 of file variableExpressionAST.h.

Constructor & Destructor Documentation

◆ SdfVariableExpressionAST() [1/4]

Construct an invalid AST.

◆ SdfVariableExpressionAST() [2/4]

SDF_API SdfVariableExpressionAST ( const std::string &  expr)
explicit

Construct the AST for the variable expression expr.

Creates an invalid AST if expr cannot be parsed.

◆ SdfVariableExpressionAST() [3/4]

SDF_API SdfVariableExpressionAST ( const SdfVariableExpression expr)
explicit

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Equivalent to SdfVariableExpressionAST(expr.GetString());.

◆ SdfVariableExpressionAST() [4/4]

Copy constructor. Performs a deep copy of the AST in rhs.

Member Function Documentation

◆ GetErrors()

SDF_API const std::vector< std::string > & GetErrors ( ) const

Return list of errors encountered when parsing the expression passed to the constructor.

◆ GetExpression()

SDF_API SdfVariableExpression GetExpression ( ) const

Return the expression represented by this AST if this is a valid AST or a default constructed SdfVariableExpression otherwise.

The expression string may be formatted differently than what was in the original expression passed to the constructor.

The returned SdfVariableExpression may be an invalid expression that cannot be evaluated, e.g. if the expression contains an unrecognized function name. However, calling GetString on the returned SdfVariableExpression will still return the expression string for inspection.

◆ GetRoot() [1/2]

SDF_API SdfVariableExpressionASTNodes::Node * GetRoot ( )

Return the root node of the syntax tree corresponding to the outermost expression if this is a valid AST or nullptr otherwise.

The returned pointer is valid for the lifetime of its associated SdfVariableExpressionAST.

◆ GetRoot() [2/2]

SDF_API const SdfVariableExpressionASTNodes::Node * GetRoot ( ) const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ operator bool()

SDF_API operator bool ( ) const
explicit

Return true if this is a valid AST, false otherwise.

◆ operator=()

SDF_API SdfVariableExpressionAST & operator= ( const SdfVariableExpressionAST rhs)

Assignment. Performs a deep copy of the AST in rhs.


The documentation for this class was generated from the following file: