![]() |
Paradox Game Engine
v1.0.0 beta06
|
A writer for a shader. More...
Public Member Functions | |
ShaderWriter (bool buildScopeDeclaration=false, bool useNodeStack=false) | |
Initializes a new instance of the ShaderWriter class. More... | |
ShaderWriter | Indent () |
Indents this instance. More... | |
ShaderWriter | Outdent () |
Outdents this instance. More... | |
virtual void | Visit (Shader shader) |
Visits the specified shader. More... | |
virtual void | Visit (StructType structType) |
virtual void | Visit (WhileStatement whileStatement) |
virtual void | Visit (ArrayInitializerExpression arrayInitializerExpression) |
virtual void | Visit (BlockStatement blockStatement) |
virtual void | Visit (AssignmentExpression assignmentExpression) |
virtual void | Visit (BinaryExpression binaryExpression) |
virtual void | Visit (CaseStatement statement) |
virtual void | Visit (ArrayType arrayType) |
virtual void | Visit (ExpressionStatement expressionStatement) |
virtual void | Visit (ForStatement forStatement) |
virtual void | Visit (Identifier identifier) |
virtual void | Visit (Statement statement) |
virtual void | Visit (StatementList statementList) |
virtual void | Visit (IfStatement ifStatement) |
virtual void | Visit (IndexerExpression indexerExpression) |
virtual void | Visit (MemberReferenceExpression memberReferenceExpression) |
virtual void | Visit (MethodInvocationExpression methodInvocationExpression) |
virtual void | Visit (Parameter parameter) |
virtual void | Visit (ParenthesizedExpression parenthesizedExpression) |
virtual void | Visit (ExpressionList expressionList) |
virtual void | Visit (ReturnStatement returnStatement) |
virtual void | Visit (ConditionalExpression conditionalExpression) |
virtual void | Visit (UnaryExpression unaryExpression) |
virtual void | Visit (SwitchStatement switchStatement) |
virtual void | Visit (SwitchCaseGroup switchCaseGroup) |
virtual void | Visit (DeclarationStatement declarationStatement) |
virtual void | Visit (MethodDeclaration methodDeclaration) |
virtual void | Visit (MethodDefinition methodDefinition) |
virtual void | Visit (Variable variable) |
virtual void | Visit (ObjectType typeBase) |
virtual void | Visit (TypeName typeBase) |
virtual void | Visit (ScalarType scalarType) |
virtual void | Visit (GenericType genericType) |
virtual void | Visit (Literal literal) |
virtual void | Visit (Qualifier qualifier) |
virtual void | Visit (ParameterQualifier parameterQualifier) |
virtual void | Visit (StorageQualifier storageQualifier) |
ShaderWriter | Write (Qualifier qualifiers, bool writePreQualifiers) |
Writes the specified qualifier. More... | |
ShaderWriter | Write (List< AttributeBase > attributes, bool writePreQualifiers) |
Writes the specified attributes. More... | |
ShaderWriter | Write (string text) |
Writes the specified text. More... | |
virtual void | WriteInitializer (Expression expression) |
Writes the initializer. More... | |
ShaderWriter | WriteLine () |
Writes the line. More... | |
ShaderWriter | WriteLine (string text) |
Writes the line. More... | |
ShaderWriter | WriteSpace () |
Writes the space. More... | |
Protected Member Functions | |
ShaderWriter | WriteLinkLine (Node node) |
Writes a link line using #line preprocessing directive with the specified node More... | |
ShaderWriter | Append (string text) |
Appends the specified text. More... | |
ShaderWriter | Append (string format, params object[] args) |
Appends the specified formatted text. More... | |
ShaderWriter | CloseBrace (bool newLine=true) |
Closes the brace. More... | |
ShaderWriter | OpenBrace () |
Opens the brace. More... | |
virtual ShaderWriter | Write (Identifier identifier) |
Writes the specified identifier. More... | |
virtual ShaderWriter | WriteMethodDeclaration (MethodDeclaration methodDeclaration) |
Writes the specified method declaration. More... | |
ShaderWriter | WriteRankSpecifiers (IEnumerable< Expression > expressionList) |
Writes the rank specifiers. More... | |
void | WriteStatementContent (Statement statement) |
Writes the content of the statement. More... | |
void | WriteVariable (Variable variable) |
Writes the variable. More... | |
override bool | PreVisitNode (Node node) |
Called before visiting the node. More... | |
![]() | |
ShaderVisitor (bool buildScopeDeclaration, bool useNodeStack) | |
Initializes a new instance of the ShaderVisitor class. More... | |
virtual ScopeDeclaration | NewScope (IScopeContainer container=null) |
virtual Node | Visit (Node node) |
virtual IEnumerable< IDeclaration > | FindDeclarations (string name) |
Finds a list of declaration by its name. More... | |
IDeclaration | FindDeclaration (string name) |
Finds a declaration by its name. More... | |
override void | PostVisitNode (Node node, bool nodeVisited) |
Called after visiting the node. More... | |
![]() | |
VisitorBase (bool useNodeStack=false) | |
Initializes a new instance of the VisitorBase class. More... | |
void | VisitDynamicList< T > (IList< T > list, Func< T, bool > filter=null) |
Visits the list. More... | |
virtual Node | VisitDynamic< T > (T node, bool visitRealType=true) |
Visits the node. More... | |
Protected Attributes | |
Stack< bool > | IsDeclaratingVariable = new Stack<bool>() |
Properties | |
List< SourceLocation > | SourceLocations [get, set] |
string | Text [get] |
Gets the text. More... | |
bool | EnablePreprocessorLine [get, set] |
bool | EnableNewLine [get, set] |
Gets or sets a value indicating whether [enable new line]. More... | |
![]() | |
Node | ParentNode [get] |
Gets the parent node or null if no parents More... | |
Stack< ScopeDeclaration > | ScopeStack [get, set] |
Gets the scope stack. More... | |
![]() | |
List< Node > | NodeStack [get, set] |
Gets or sets the node stack. More... | |
A writer for a shader.
Definition at line 15 of file ShaderWriter.cs.
SiliconStudio.Shaders.Writer.ShaderWriter.ShaderWriter | ( | bool | buildScopeDeclaration = false , |
bool | useNodeStack = false |
||
) |
Initializes a new instance of the ShaderWriter class.
buildScopeDeclaration | if set to true [build scope declaration]. |
useNodeStack | if set to true [use node stack]. |
Definition at line 29 of file ShaderWriter.cs.
|
protected |
Appends the specified text.
text | The text. |
Definition at line 775 of file ShaderWriter.cs.
|
protected |
Appends the specified formatted text.
format | The formatted text. |
args | The args to apply to the formatted text. |
Definition at line 787 of file ShaderWriter.cs.
References DirectX.format.
|
protected |
Closes the brace.
newLine | if set to true [new line]. |
Definition at line 803 of file ShaderWriter.cs.
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.Indent | ( | ) |
|
protected |
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.Outdent | ( | ) |
|
protectedvirtual |
Called before visiting the node.
node | The node. |
Reimplemented from SiliconStudio.Shaders.Visitor.ShaderVisitor.
Definition at line 1027 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.SourceLocation.FileSource, SiliconStudio.Shaders.Ast.SourceLocation.Line, SiliconStudio.Shaders.Ast.SourceSpan.Location, SiliconStudio.Shaders.Ast.SourceLocation.Position, and SiliconStudio.Shaders.Ast.Node.Span.
|
virtual |
Visits the specified shader.
shader | The shader. |
Definition at line 129 of file ShaderWriter.cs.
|
virtual |
Definition at line 136 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.TypeBase.Attributes, and SiliconStudio.Shaders.Ast.TypeBase.Name.
|
virtual |
Definition at line 165 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.Statement.Statement().
|
virtual |
Definition at line 193 of file ShaderWriter.cs.
|
virtual |
Definition at line 209 of file ShaderWriter.cs.
|
virtual |
Reimplemented in SiliconStudio.Paradox.Shaders.Parser.Mixins.ShaderMixinCodeGen.
Definition at line 222 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.AssignmentExpression.Target, and SiliconStudio.Shaders.Ast.AssignmentExpression.Value.
|
virtual |
Definition at line 231 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.BinaryExpression.Left, and SiliconStudio.Shaders.Ast.BinaryExpression.Right.
|
virtual |
Definition at line 240 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.CaseStatement.Case.
|
virtual |
Reimplemented in SiliconStudio.Paradox.Shaders.Parser.Mixins.ShaderKeyGeneratorBase.
Definition at line 254 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.ArrayType.Dimensions, and SiliconStudio.Shaders.Ast.ArrayType.Type.
|
virtual |
Definition at line 262 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.ExpressionStatement.Expression.
|
virtual |
Definition at line 271 of file ShaderWriter.cs.
|
virtual |
Definition at line 291 of file ShaderWriter.cs.
|
virtual |
Definition at line 298 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.Statement.Attributes.
|
virtual |
Definition at line 305 of file ShaderWriter.cs.
|
virtual |
Definition at line 313 of file ShaderWriter.cs.
|
virtual |
Definition at line 338 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.IndexerExpression.Index, and SiliconStudio.Shaders.Ast.IndexerExpression.Target.
|
virtual |
Reimplemented in SiliconStudio.Paradox.Shaders.Parser.Mixins.ShaderMixinCodeGen.
Definition at line 348 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.MemberReferenceExpression.Member, and SiliconStudio.Shaders.Ast.MemberReferenceExpression.Target.
|
virtual |
Definition at line 357 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.MethodInvocationExpression.Target.
|
virtual |
Definition at line 374 of file ShaderWriter.cs.
|
virtual |
Definition at line 381 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.ParenthesizedExpression.Content.
|
virtual |
Definition at line 390 of file ShaderWriter.cs.
|
virtual |
Definition at line 402 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.ReturnStatement.Value.
|
virtual |
Definition at line 417 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.ConditionalExpression.Condition, SiliconStudio.Shaders.Ast.ConditionalExpression.Left, and SiliconStudio.Shaders.Ast.ConditionalExpression.Right.
|
virtual |
Definition at line 428 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.UnaryExpression.Expression, and SiliconStudio.Shaders.Ast.UnaryExpression.Operator.
|
virtual |
Definition at line 444 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.SwitchStatement.Condition, and SiliconStudio.Shaders.Ast.SwitchStatement.Groups.
|
virtual |
Definition at line 460 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.SwitchCaseGroup.Cases, and SiliconStudio.Shaders.Ast.SwitchCaseGroup.Statements.
|
virtual |
Definition at line 470 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.DeclarationStatement.Content.
|
virtual |
Definition at line 478 of file ShaderWriter.cs.
|
virtual |
Definition at line 486 of file ShaderWriter.cs.
|
virtual |
Reimplemented in SiliconStudio.Paradox.Shaders.Parser.Mixins.ShaderKeyGeneratorBase.
Definition at line 499 of file ShaderWriter.cs.
|
virtual |
Definition at line 507 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.TypeBase.Name.
|
virtual |
Reimplemented in SiliconStudio.Paradox.Shaders.Parser.Mixins.ShaderKeyGeneratorBase.
Definition at line 514 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.TypeBase.Name.
|
virtual |
Reimplemented in SiliconStudio.Paradox.Shaders.Parser.Mixins.ShaderKeyGeneratorBase.
Definition at line 521 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.TypeBase.Name, and SiliconStudio.Shaders.Ast.TypeBase.Qualifiers.
|
virtual |
Definition at line 529 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.TypeBase.Name.
|
virtual |
Reimplemented in SiliconStudio.Shaders.Writer.Hlsl.HlslToGlslWriter.
Definition at line 545 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.Literal.SubLiterals, and SiliconStudio.Shaders.Ast.Literal.Text.
|
virtual |
Definition at line 570 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.CompositeEnum.Key.
|
virtual |
Definition at line 578 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.CompositeEnum.Key.
|
virtual |
Definition at line 585 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.CompositeEnum.Key.
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.Write | ( | Qualifier | qualifiers, |
bool | writePreQualifiers | ||
) |
Writes the specified qualifier.
qualifiers | The qualifier. |
writePreQualifiers | if set to true [write pre qualifiers]. |
Definition at line 602 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.Qualifier.IsPost, and SiliconStudio.Shaders.Ast.Qualifier.None.
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.Write | ( | List< AttributeBase > | attributes, |
bool | writePreQualifiers | ||
) |
Writes the specified attributes.
attributes | The attributes. |
writePreQualifiers | if set to true [write pre qualifiers]. |
Definition at line 637 of file ShaderWriter.cs.
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.Write | ( | string | text | ) |
Writes the specified text.
text | The text. |
Definition at line 661 of file ShaderWriter.cs.
|
protectedvirtual |
Writes the specified identifier.
identifier | The identifier. |
Reimplemented in SiliconStudio.Shaders.Writer.Hlsl.HlslWriter.
Definition at line 836 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.Identifier.HasIndices, SiliconStudio.Shaders.Ast.Identifier.Indices, SiliconStudio.Shaders.Ast.Identifier.IsSpecialReference, and SiliconStudio.Shaders.Ast.Identifier.Text.
|
virtual |
Writes the initializer.
expression | The expression. |
Reimplemented in SiliconStudio.Shaders.Writer.Hlsl.HlslWriter.
Definition at line 674 of file ShaderWriter.cs.
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.WriteLine | ( | ) |
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.WriteLine | ( | string | text | ) |
Writes the line.
text | The text. |
Definition at line 710 of file ShaderWriter.cs.
|
protected |
Writes a link line using #line preprocessing directive with the specified node
node | The node to use the Span. |
Definition at line 731 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.SourceLocation.Line, SiliconStudio.Shaders.Ast.SourceSpan.Location, and SiliconStudio.Shaders.Ast.Node.Span.
|
protectedvirtual |
Writes the specified method declaration.
methodDeclaration | The method declaration. |
Definition at line 861 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.MethodDeclaration.Attributes, SiliconStudio.Shaders.Ast.MethodDeclaration.Name, SiliconStudio.Shaders.Ast.MethodDeclaration.Qualifiers, and SiliconStudio.Shaders.Ast.MethodDeclaration.ReturnType.
|
protected |
Writes the rank specifiers.
expressionList | The expression list. |
Definition at line 907 of file ShaderWriter.cs.
ShaderWriter SiliconStudio.Shaders.Writer.ShaderWriter.WriteSpace | ( | ) |
|
protected |
Writes the content of the statement.
statement | The statement. |
Definition at line 925 of file ShaderWriter.cs.
|
protected |
Writes the variable.
variable | The variable. |
Definition at line 955 of file ShaderWriter.cs.
References SiliconStudio.Shaders.Ast.Variable.Attributes, SiliconStudio.Shaders.Ast.Variable.InitialValue, SiliconStudio.Shaders.Ast.Variable.IsGroup, SiliconStudio.Shaders.Ast.Variable.Name, and SiliconStudio.Shaders.Ast.Variable.Qualifiers.
|
protected |
Definition at line 93 of file ShaderWriter.cs.
|
getsetprotected |
Gets or sets a value indicating whether [enable new line].
true
if [enable new line]; otherwise, false
.
Definition at line 67 of file ShaderWriter.cs.
|
getset |
Definition at line 59 of file ShaderWriter.cs.
|
getset |
Definition at line 42 of file ShaderWriter.cs.
|
get |
Gets the text.
Definition at line 48 of file ShaderWriter.cs.