Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
SiliconStudio.Shaders.Analysis.SemanticAnalysis Class Reference

A Type reference analysis is building type references. More...

Inheritance diagram for SiliconStudio.Shaders.Analysis.SemanticAnalysis:
SiliconStudio.Shaders.Analysis.AnalysisBase SiliconStudio.Shaders.Visitor.ShaderVisitor SiliconStudio.Shaders.Visitor.VisitorBase SiliconStudio.Shaders.Analysis.Hlsl.HlslSemanticAnalysis

Public Member Functions

 SemanticAnalysis (ParsingResult result)
 Initializes a new instance of the SemanticAnalysis class. More...
 
override void Run ()
 Runs this instance. More...
 

Protected Member Functions

virtual void Visit (AssignmentExpression assignmentExpression)
 Visits the specified assignement expression. More...
 
virtual void Visit (BinaryExpression binaryExpression)
 Visits the specified binary expression. More...
 
virtual void Visit (ConditionalExpression conditionalExpression)
 Visits the specified conditional expression. More...
 
virtual void Visit (IndexerExpression indexerExpression)
 Visits the specified indexer expression. More...
 
virtual void ProcessIndexerExpression (IndexerExpression indexerExpression)
 Find the type of the expression More...
 
virtual void Visit (LiteralExpression literalExpression)
 Visits the specified literal expression. More...
 
virtual void Visit (ReturnStatement returnStatement)
 
virtual void Visit (IfStatement ifStatement)
 
virtual void ProcessMethodInvocation (MethodInvocationExpression expression, string methodName, List< IDeclaration > declarations)
 Pres the process method invocation. More...
 
virtual bool TestMethodInvocationArgument (TypeBase argTypeBase, TypeBase expectedTypeBase, TypeBase argType, TypeBase expectedType, ref int score)
 Tests the arguments of the method More...
 
virtual void Visit (MethodInvocationExpression expression)
 Visits the specified method invocation expression. More...
 
virtual IEnumerable< IDeclarationFindDeclarationsFromObject (TypeBase typeBase, string memberName)
 
virtual void Visit (MemberReferenceExpression memberReference)
 Visits the specified member reference. More...
 
virtual MethodDefinition Visit (MethodDefinition methodDefinition)
 Visits the specified member reference. More...
 
virtual void CommonVisit (MemberReferenceExpression memberReference)
 Visits the specified member reference. More...
 
virtual void Visit (ParenthesizedExpression parenthesizedExpression)
 Visits the specified parenthesized expression. More...
 
virtual void Visit (ExpressionList expressionList)
 Visits the specified expression list. More...
 
virtual ArrayType Visit (ArrayType arrayType)
 Visits the specified array type. More...
 
virtual TypeBase Visit (TypeName typeName)
 Visits the specified type name. More...
 
virtual void Visit (VariableReferenceExpression variableReferenceExpression)
 Visits the specified variable reference expression. More...
 
virtual void Visit (UnaryExpression unaryExpression)
 Visits the specified unary expression. More...
 
virtual void FindMemberTypeReference (StructType structType, MemberReferenceExpression memberReference)
 Finds the member type reference. More...
 
virtual void FindMemberTypeReference (VectorType vectorType, MemberReferenceExpression memberReference)
 Finds the member type reference. More...
 
virtual void FindMemberTypeReference (ScalarType scalarType, MemberReferenceExpression memberReference)
 Finds the member type reference. More...
 
TypeBase ResolveTypeFromDeclaration (IDeclaration declaration)
 Resolves the type from declaration. More...
 
- Protected Member Functions inherited from SiliconStudio.Shaders.Analysis.AnalysisBase
 AnalysisBase (ParsingResult result)
 Initializes a new instance of the AnalysisBase class. More...
 
void Error (MessageCode message, SourceSpan span)
 Logs an Error with the specified message. More...
 
void Error (MessageCode message, SourceSpan span, params object[] parameters)
 Logs an Error with the specified message. More...
 
void Info (string message, SourceSpan span)
 Logs an Info with the specified message. More...
 
void Info (string message, SourceSpan span, params object[] parameters)
 Logs an Info with the specified message. More...
 
void Warning (MessageCode message, SourceSpan span)
 Logs an Warning with the specified message. More...
 
void Warning (MessageCode message, SourceSpan span, params object[] parameters)
 Logs an Warning with the specified message. More...
 
virtual TypeBase GetBinaryImplicitConversionType (SourceSpan span, TypeBase left, TypeBase right, bool isBinaryOperator)
 Gets the type of the binary implicit conversion. More...
 
virtual TypeBase GetMultiplyImplicitConversionType (SourceSpan span, TypeBase left, TypeBase right)
 Gets the type of the binary implicit conversion. More...
 
virtual TypeBase GetDivideImplicitConversionType (SourceSpan span, TypeBase left, TypeBase right)
 Gets the type of the binary implicit conversion. More...
 
ScalarType GetBinaryImplicitScalarConversionType (SourceSpan span, TypeBase left, TypeBase right)
 Gets the type of the binary implicit scalar conversion. More...
 
- Protected Member Functions inherited from SiliconStudio.Shaders.Visitor.ShaderVisitor
 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< IDeclarationFindDeclarations (string name)
 Finds a list of declaration by its name. More...
 
IDeclaration FindDeclaration (string name)
 Finds a declaration by its name. More...
 
override bool PreVisitNode (Node node)
 Called before visiting the node. More...
 
override void PostVisitNode (Node node, bool nodeVisited)
 Called after visiting the node. More...
 
- Protected Member Functions inherited from SiliconStudio.Shaders.Visitor.VisitorBase
 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...
 

Static Protected Attributes

static string TagBuiltinUserDefined = "TagBuiltinUserDefined"
 

Properties

bool IsSkippingMode [get, set]
 Gets or sets a value indicating whether the analysis is in skipping mode. More...
 
- Properties inherited from SiliconStudio.Shaders.Analysis.AnalysisBase
ParsingResult ParsingResult [get, set]
 Gets the parsing result. More...
 
- Properties inherited from SiliconStudio.Shaders.Visitor.ShaderVisitor
Node ParentNode [get]
 Gets the parent node or null if no parents More...
 
Stack< ScopeDeclarationScopeStack [get, set]
 Gets the scope stack. More...
 
- Properties inherited from SiliconStudio.Shaders.Visitor.VisitorBase
List< NodeNodeStack [get, set]
 Gets or sets the node stack. More...
 

Detailed Description

A Type reference analysis is building type references.

Definition at line 16 of file SemanticAnalysis.cs.

Constructor & Destructor Documentation

SiliconStudio.Shaders.Analysis.SemanticAnalysis.SemanticAnalysis ( ParsingResult  result)

Initializes a new instance of the SemanticAnalysis class.

Parameters
resultThe result.

Definition at line 28 of file SemanticAnalysis.cs.

Member Function Documentation

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.CommonVisit ( MemberReferenceExpression  memberReference)
protectedvirtual

Visits the specified member reference.

Parameters
memberReferenceThe member reference.

Reimplemented in SiliconStudio.Shaders.Analysis.Hlsl.HlslSemanticAnalysis.

Definition at line 587 of file SemanticAnalysis.cs.

virtual IEnumerable<IDeclaration> SiliconStudio.Shaders.Analysis.SemanticAnalysis.FindDeclarationsFromObject ( TypeBase  typeBase,
string  memberName 
)
protectedvirtual
virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.FindMemberTypeReference ( StructType  structType,
MemberReferenceExpression  memberReference 
)
protectedvirtual

Finds the member type reference.

Parameters
structTypeType of the struct.
memberReferenceThe member reference.

Definition at line 735 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.FindMemberTypeReference ( VectorType  vectorType,
MemberReferenceExpression  memberReference 
)
protectedvirtual

Finds the member type reference.

Parameters
vectorTypeType of the vector.
memberReferenceThe member reference.

Definition at line 756 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.FindMemberTypeReference ( ScalarType  scalarType,
MemberReferenceExpression  memberReference 
)
protectedvirtual

Finds the member type reference.

Parameters
scalarTypeType of the scalar.
memberReferenceThe member reference.

Definition at line 776 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.ProcessIndexerExpression ( IndexerExpression  indexerExpression)
protectedvirtual

Find the type of the expression

Parameters
indexerExpressionthe indexer expression

Definition at line 149 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Utility.MessageCode.ErrorIndexerType, and SiliconStudio.Shaders.Ast.Node.Span.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.ProcessMethodInvocation ( MethodInvocationExpression  expression,
string  methodName,
List< IDeclaration declarations 
)
protectedvirtual

Pres the process method invocation.

Parameters
expressionThe expression.
methodNameName of the method.
declarationsThe declarations.
Returns

Reimplemented in SiliconStudio.Shaders.Analysis.Hlsl.HlslSemanticAnalysis.

Definition at line 239 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Utility.MessageCode.ErrorNoOverloadedMethod.

TypeBase SiliconStudio.Shaders.Analysis.SemanticAnalysis.ResolveTypeFromDeclaration ( IDeclaration  declaration)
protected

Resolves the type from declaration.

Parameters
declarationThe declaration.
Returns
A type

Definition at line 796 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Ast.TypeInference.Declaration, and SiliconStudio.Shaders.Ast.TypeBase.TypeInference.

override void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Run ( )
virtual

Runs this instance.

Implements SiliconStudio.Shaders.Analysis.AnalysisBase.

Definition at line 45 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Parser.ParsingResult.Shader.

virtual bool SiliconStudio.Shaders.Analysis.SemanticAnalysis.TestMethodInvocationArgument ( TypeBase  argTypeBase,
TypeBase  expectedTypeBase,
TypeBase  argType,
TypeBase  expectedType,
ref int  score 
)
protectedvirtual

Tests the arguments of the method

Parameters
argTypeBasethe argument typebase
expectedTypeBasethe expected typebase
argTypethe argument type
expectedTypethe expected type
scorethe score of the overload
Returns
true if the overload is correct, false otherwise

Definition at line 403 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Ast.TypeBase.HasDimensions().

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( AssignmentExpression  assignmentExpression)
protectedvirtual

Visits the specified assignement expression.

Parameters
assignmentExpressionThe assignement expression.

Definition at line 55 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( BinaryExpression  binaryExpression)
protectedvirtual

Visits the specified binary expression.

Parameters
binaryExpressionThe binary expression.

Definition at line 70 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Ast.Node.Span.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( ConditionalExpression  conditionalExpression)
protectedvirtual

Visits the specified conditional expression.

Parameters
conditionalExpressionThe conditional expression.

Definition at line 117 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( IndexerExpression  indexerExpression)
protectedvirtual

Visits the specified indexer expression.

Parameters
indexerExpressionThe indexer expression.

Definition at line 138 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( LiteralExpression  literalExpression)
protectedvirtual

Visits the specified literal expression.

Parameters
literalExpressionThe literal expression.

Definition at line 187 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Utility.MessageCode.ErrorLiteralType, and SiliconStudio.Shaders.Ast.Node.Span.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( ReturnStatement  returnStatement)
protectedvirtual

Definition at line 211 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( IfStatement  ifStatement)
protectedvirtual

Definition at line 224 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( MethodInvocationExpression  expression)
protectedvirtual
virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( MemberReferenceExpression  memberReference)
protectedvirtual

Visits the specified member reference.

Parameters
memberReferenceThe member reference.

Definition at line 544 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Utility.MessageCode.ErrorNoTypeReferenceMember, and SiliconStudio.Shaders.Ast.Node.Span.

virtual MethodDefinition SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( MethodDefinition  methodDefinition)
protectedvirtual

Visits the specified member reference.

Parameters
memberReferenceThe member reference.

Definition at line 560 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( ParenthesizedExpression  parenthesizedExpression)
protectedvirtual

Visits the specified parenthesized expression.

Parameters
parenthesizedExpressionThe parenthesized expression.

Definition at line 604 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( ExpressionList  expressionList)
protectedvirtual

Visits the specified expression list.

Parameters
expressionListThe expression list.

Definition at line 617 of file SemanticAnalysis.cs.

virtual ArrayType SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( ArrayType  arrayType)
protectedvirtual

Visits the specified array type.

Parameters
arrayTypeArray type.

Definition at line 630 of file SemanticAnalysis.cs.

References DirectX.Convert().

virtual TypeBase SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( TypeName  typeName)
protectedvirtual

Visits the specified type name.

Parameters
typeNameName of the type.

Reimplemented in SiliconStudio.Shaders.Analysis.Hlsl.HlslSemanticAnalysis.

Definition at line 661 of file SemanticAnalysis.cs.

References SiliconStudio.Shaders.Utility.MessageCode.ErrorNoTypeReferenceTypename, and SiliconStudio.Shaders.Ast.Node.Span.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( VariableReferenceExpression  variableReferenceExpression)
protectedvirtual

Visits the specified variable reference expression.

Parameters
variableReferenceExpressionThe variable reference expression.

Definition at line 699 of file SemanticAnalysis.cs.

virtual void SiliconStudio.Shaders.Analysis.SemanticAnalysis.Visit ( UnaryExpression  unaryExpression)
protectedvirtual

Visits the specified unary expression.

Parameters
unaryExpressionThe unary expression.

Definition at line 713 of file SemanticAnalysis.cs.

Member Data Documentation

string SiliconStudio.Shaders.Analysis.SemanticAnalysis.TagBuiltinUserDefined = "TagBuiltinUserDefined"
staticprotected

Definition at line 18 of file SemanticAnalysis.cs.

Property Documentation

bool SiliconStudio.Shaders.Analysis.SemanticAnalysis.IsSkippingMode
getsetprotected

Gets or sets a value indicating whether the analysis is in skipping mode.

true if the analysis is in skipping mode; otherwise, false.

Definition at line 40 of file SemanticAnalysis.cs.


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