8 #ifndef PXR_USD_SDF_PATH_PATTERN_PARSER_H
9 #define PXR_USD_SDF_PATH_PATTERN_PARSER_H
14 #include "pxr/base/pegtl/pegtl.hpp"
20 namespace SdfPathPatternParser {
22 using namespace PXR_PEGTL_NAMESPACE;
24 template <
class Rule,
class Sep>
27 template <
class Rule>
using OptSpaced = pad<Rule, blank>;
36 OptSpaced<SdfPredicateExpressionParser::PredExpr>,
41 plus<sor<identifier_other, one<'?','*'>>>,
42 opt<one<'['>,plus<sor<identifier_other, one<'[',']','!','-','?','*'>>>>
47 plus<sor<identifier_other, one<':','?','*'>>>,
48 opt<one<'['>,plus<sor<identifier_other, one<':','[',']','!','-','?','*'>>>>
55 : if_then_else<PrimPathPatternElemText, opt<BracedPredExpr>,
59 : if_then_else<PropPathPatternElemText, opt<BracedPredExpr>,
63 : seq<LookaheadList<PrimPathPatternElem, PathPatSep>,
64 if_must_else<one<'.'>, PropPathPatternElem, opt<PathPatStretch>>> {};
69 struct DotDots : list<DotDot, one<'/'>> {};
77 if_must<AbsoluteStart, AbsPathPattern>,
78 seq<DotDots, if_then_else<PathPatSep, opt<PathPatternElems>, success>>,
80 seq<ReflexiveRelative, opt<PathPatStretch, opt<PathPatternElems>>>
87 namespace SdfPathPatternActions {
89 using namespace PXR_PEGTL_NAMESPACE;
91 using namespace SdfPathPatternParser;
106 template <
class Rule>
112 template <
class Input>
121 template <
class Input>
132 : change_action_and_states<SdfPredicateExpressionParser::PredAction,
133 SdfPredicateExprBuilder>
135 template <
class Input>
146 template <
class Input>
155 template <
class Input>
164 template <
class Input>
175 template <
class Input>
187 template <
class Input>
196 template <
class Input>
206 #endif // PXR_USD_SDF_PATH_PATTERN_PARSER_H
static SDF_API const SdfPath & AbsoluteRootPath()
SDF_API SdfPathPattern & AppendChild(std::string const &text, SdfPredicateExpression &&predExpr)
SdfPredicateExpression curPredExpr
static void apply(Input const &in, PatternBuilder &builder)
static void apply(Input const &in, PatternBuilder &builder)
SDF_API SdfPathPattern & SetPrefix(SdfPath &&p)
constexpr auto in(type t, int set) -> bool
static void apply(Input const &in, PatternBuilder &builder)
pad< Rule, blank > OptSpaced
static void apply(Input const &in, PatternBuilder &builder)
static void apply(Input const &in, PatternBuilder &builder)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
SdfPredicateExpression Finish()
#define PXR_NAMESPACE_CLOSE_SCOPE
static void apply(Input const &in, PatternBuilder &builder)
static void success(Input const &in, SdfPredicateExprBuilder &predExprBuilder, PatternBuilder &builder)
SDF_API SdfPathPattern & AppendStretchIfPossible()
SDF_API SdfPathPattern & AppendProperty(std::string const &text, SdfPredicateExpression &&predExpr)
static void apply(Input const &in, PatternBuilder &builder)
static SDF_API const SdfPath & ReflexiveRelativePath()
The relative path representing "self".
static void apply(Input const &in, PatternBuilder &builder)
seq< Rule, star< at< Sep, Rule >, Sep, Rule >> LookaheadList