HDK
|
#include <MdlSyntax.h>
Public Member Functions | |
MdlSyntax () | |
const string & | getConstantQualifier () const override |
const string & | getUniformQualifier () const override |
const string & | getSourceFileExtension () const override |
Return the file extension used for source code files in this language. More... | |
string | getSwizzledVariable (const string &srcName, const TypeDesc *srcType, const string &channels, const TypeDesc *dstType) const override |
Get syntax for a swizzled variable. More... | |
string | getArrayTypeSuffix (const TypeDesc *type, const Value &value) const override |
Override to return array type suffix. More... | |
string | getArrayVariableSuffix (const TypeDesc *, const Value &) const override |
Override to indicate array variables have no array suffix. More... | |
const TypeDesc * | getEnumeratedType (const string &value) const |
Get an type description for an enumeration based on member value. More... | |
bool | remapEnumeration (const string &value, const TypeDesc *type, const string &enumNames, std::pair< const TypeDesc *, ValuePtr > &result) const override |
void | makeValidName (string &name) const override |
Modify the given name string to remove any invalid characters or tokens. More... | |
Public Member Functions inherited from Syntax | |
virtual | ~Syntax () |
void | registerTypeSyntax (const TypeDesc *type, TypeSyntaxPtr syntax) |
void | registerReservedWords (const StringSet &names) |
void | registerInvalidTokens (const StringMap &tokens) |
const StringSet & | getReservedWords () const |
Returns a set of names that are reserved words for this language syntax. More... | |
const StringMap & | getInvalidTokens () const |
Returns a mapping from disallowed tokens to replacement strings for this language syntax. More... | |
const TypeSyntax & | getTypeSyntax (const TypeDesc *type) const |
const vector< TypeSyntaxPtr > & | getTypeSyntaxes () const |
Returns an array of all registered type syntax objects. More... | |
const TypeDesc * | getTypeDescription (const TypeSyntaxPtr &typeSyntax) const |
const string & | getTypeName (const TypeDesc *type) const |
Returns the name syntax of the given type. More... | |
virtual string | getOutputTypeName (const TypeDesc *type) const |
Returns the type name in an output context. More... | |
const string & | getTypeAlias (const TypeDesc *type) const |
const string & | getTypeDefinition (const TypeDesc *type) const |
const string & | getDefaultValue (const TypeDesc *type, bool uniform=false) const |
Returns the default value string for the given type. More... | |
virtual string | getValue (const TypeDesc *type, const Value &value, bool uniform=false) const |
Returns the value string for a given type and value object. More... | |
virtual string | getValue (const ShaderPort *port, bool uniform=false) const |
Returns the value string for a given shader port object. More... | |
virtual ValuePtr | getSwizzledValue (ValuePtr value, const TypeDesc *srcType, const string &channels, const TypeDesc *dstType) const |
Get swizzled value. More... | |
virtual const string & | getInputQualifier () const |
virtual const string & | getOutputQualifier () const |
virtual const string & | getNewline () const |
Return the characters used for a newline. More... | |
virtual const string & | getIndentation () const |
Return the characters used for a single indentation level. More... | |
virtual const string & | getStringQuote () const |
Return the characters used to begin/end a string definition. More... | |
virtual const string & | getIncludeStatement () const |
Return the string pattern used for a file include statement. More... | |
virtual const string & | getSingleLineComment () const |
Return the characters used for single line comment. More... | |
virtual const string & | getBeginMultiLineComment () const |
Return the characters used to begin a multi line comments block. More... | |
virtual const string & | getEndMultiLineComment () const |
Return the characters used to end a multi line comments block. More... | |
virtual bool | typeSupported (const TypeDesc *type) const |
virtual void | makeIdentifier (string &name, IdentifierMap &identifiers) const |
virtual string | getVariableName (const string &name, const TypeDesc *type, IdentifierMap &identifiers) const |
Static Public Member Functions | |
static SyntaxPtr | create () |
Static Public Attributes | |
static const string | CONST_QUALIFIER |
static const string | UNIFORM_QUALIFIER |
static const string | SOURCE_FILE_EXTENSION |
static const StringVec | VECTOR2_MEMBERS |
static const StringVec | VECTOR3_MEMBERS |
static const StringVec | VECTOR4_MEMBERS |
static const StringVec | COLOR3_MEMBERS |
static const StringVec | COLOR4_MEMBERS |
static const StringVec | ADDRESSMODE_MEMBERS |
static const StringVec | COORDINATESPACE_MEMBERS |
static const StringVec | FILTERLOOKUPMODE_MEMBERS |
static const StringVec | FILTERTYPE_MEMBERS |
static const StringVec | DISTRIBUTIONTYPE_MEMBERS |
static const StringVec | SCATTER_MODE_MEMBERS |
Static Public Attributes inherited from Syntax | |
static const string | NEWLINE |
Constants with commonly used strings. More... | |
static const string | SEMICOLON |
static const string | COMMA |
Additional Inherited Members | |
Public Types inherited from Syntax | |
enum | Punctuation { PARENTHESES, CURLY_BRACKETS, SQUARE_BRACKETS, DOUBLE_SQUARE_BRACKETS } |
Punctuation types. More... | |
Protected Member Functions inherited from Syntax | |
Syntax () | |
Protected constructor. More... | |
Protected Attributes inherited from Syntax | |
vector< TypeSyntaxPtr > | _typeSyntaxes |
std::unordered_map< const TypeDesc *, size_t > | _typeSyntaxByType |
StringSet | _reservedWords |
StringMap | _invalidTokens |
Static Protected Attributes inherited from Syntax | |
static const string | INDENTATION |
static const string | STRING_QUOTE |
static const string | INCLUDE_STATEMENT |
static const string | SINGLE_LINE_COMMENT |
static const string | BEGIN_MULTI_LINE_COMMENT |
static const string | END_MULTI_LINE_COMMENT |
static const std::unordered_map< char, size_t > | CHANNELS_MAPPING |
Syntax class for MDL (Material Definition Language)
Definition at line 25 of file MdlSyntax.h.
MdlSyntax::MdlSyntax | ( | ) |
|
inlinestatic |
Definition at line 30 of file MdlSyntax.h.
|
overridevirtual |
Override to return array type suffix.
Reimplemented from Syntax.
|
inlineoverridevirtual |
Override to indicate array variables have no array suffix.
Reimplemented from Syntax.
Definition at line 42 of file MdlSyntax.h.
|
inlineoverridevirtual |
Get the qualifier used when declaring constant variables. Derived classes must define this method.
Implements Syntax.
Definition at line 32 of file MdlSyntax.h.
Get an type description for an enumeration based on member value.
|
inlineoverridevirtual |
Return the file extension used for source code files in this language.
Implements Syntax.
Definition at line 34 of file MdlSyntax.h.
|
overridevirtual |
Get syntax for a swizzled variable.
Reimplemented from Syntax.
|
inlineoverridevirtual |
Get the qualifier used when declaring uniform variables. Default implementation returns empty string and derived syntax classes should override this method.
Reimplemented from Syntax.
Definition at line 33 of file MdlSyntax.h.
Modify the given name string to remove any invalid characters or tokens.
Reimplemented from Syntax.
|
overridevirtual |
Given an input specification attempt to remap this to an enumeration which is accepted by the shader generator. The enumeration may be converted to a different type than the input.
Reimplemented from Syntax.
|
static |
Definition at line 52 of file MdlSyntax.h.
|
static |
Definition at line 50 of file MdlSyntax.h.
|
static |
Definition at line 51 of file MdlSyntax.h.
|
static |
Definition at line 42 of file MdlSyntax.h.
|
static |
Definition at line 53 of file MdlSyntax.h.
|
static |
Definition at line 56 of file MdlSyntax.h.
|
static |
Definition at line 54 of file MdlSyntax.h.
|
static |
Definition at line 55 of file MdlSyntax.h.
|
static |
Definition at line 57 of file MdlSyntax.h.
|
static |
Definition at line 46 of file MdlSyntax.h.
|
static |
Definition at line 45 of file MdlSyntax.h.
|
static |
Definition at line 47 of file MdlSyntax.h.
|
static |
Definition at line 48 of file MdlSyntax.h.
|
static |
Definition at line 49 of file MdlSyntax.h.