From 695c2700de54a5fec72ce7214c137a1dc3a02d7b Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Wed, 9 Aug 2017 10:13:40 -0700 Subject: Major naming overhaul: - `ExpressionSyntaxNode` becomes `Expr` - `StatementSyntaxNode` becomes `Stmt` - `StructSyntaxNode` becomes `StructDecl` - `ProgramSyntaxNode` becomes `ModuleDecl` - `ExpressionType` becomes `Type` - Existing fields names `Type` become `type` - There might be some collateral damage here if there were, e.g., `enum`s named `Type`, but I can live with that for now and fix those up as a I see them --- source/slang/syntax-base-defs.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'source/slang/syntax-base-defs.h') diff --git a/source/slang/syntax-base-defs.h b/source/slang/syntax-base-defs.h index bcb37de09..d76607106 100644 --- a/source/slang/syntax-base-defs.h +++ b/source/slang/syntax-base-defs.h @@ -2,7 +2,7 @@ // This file defines the primary base classes for the hierarchy of // AST nodes and related objects. For example, this is where the -// basic `Decl`, `Stmt`, `Expr`, `Type`, etc. definitions come from. +// basic `Decl`, `Stmt`, `Expr`, `type`, etc. definitions come from. // Base class for all nodes representing actual syntax // (thus having a location in the source code) @@ -64,7 +64,7 @@ END_SYNTAX_CLASS() // "canonical" type. The reprsentation caches a pointer to // a canonical type on every type, so we can easily // operate on the raw representation when needed. -ABSTRACT_SYNTAX_CLASS(ExpressionType, Val) +ABSTRACT_SYNTAX_CLASS(Type, Val) RAW(typedef ITypeVisitor Visitor;) RAW(virtual void accept(IValVisitor* visitor, void* extra) override;) @@ -77,8 +77,8 @@ public: virtual String ToString() = 0; - bool Equals(ExpressionType * type); - bool Equals(RefPtr type); + bool Equals(Type * type); + bool Equals(RefPtr type); bool IsVectorType() { return As() != nullptr; } bool IsArray() { return As() != nullptr; } @@ -105,16 +105,16 @@ public: bool IsSampler() { return As() != nullptr; } bool IsStruct(); bool IsClass(); - ExpressionType* GetCanonicalType(); + Type* GetCanonicalType(); virtual RefPtr SubstituteImpl(Substitutions* subst, int* ioDiff) override; virtual bool EqualsVal(Val* val) override; protected: - virtual bool EqualsImpl(ExpressionType * type) = 0; + virtual bool EqualsImpl(Type * type) = 0; - virtual ExpressionType* CreateCanonicalType() = 0; - ExpressionType* canonicalType = nullptr; + virtual Type* CreateCanonicalType() = 0; + Type* canonicalType = nullptr; Session* session = nullptr; ) @@ -234,16 +234,16 @@ ABSTRACT_SYNTAX_CLASS(Decl, DeclBase) ) END_SYNTAX_CLASS() -ABSTRACT_SYNTAX_CLASS(ExpressionSyntaxNode, SyntaxNode) +ABSTRACT_SYNTAX_CLASS(Expr, SyntaxNode) RAW(typedef IExprVisitor Visitor;) - FIELD(QualType, Type) + FIELD(QualType, type) RAW(virtual void accept(IExprVisitor* visitor, void* extra) = 0;) END_SYNTAX_CLASS() -ABSTRACT_SYNTAX_CLASS(StatementSyntaxNode, ModifiableSyntaxNode) +ABSTRACT_SYNTAX_CLASS(Stmt, ModifiableSyntaxNode) RAW(typedef IStmtVisitor Visitor;) RAW(virtual void accept(IStmtVisitor* visitor, void* extra) = 0;) -- cgit v1.2.3