summaryrefslogtreecommitdiff
path: root/source/slang/syntax-base-defs.h
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-09-05 13:16:21 -0700
committerGitHub <noreply@github.com>2017-09-05 13:16:21 -0700
commite59a1b39317c10815baaed3b70c4a6580dbe1e63 (patch)
treedc908e481eb5d73ceb7dc9d1f5da1e40d5b0e7e8 /source/slang/syntax-base-defs.h
parent620734080f825cb205b887fa1d6203e35dd60663 (diff)
parent8b91fb8e2db782c73541c83042209b4263402902 (diff)
Merge pull request #175 from tfoleyNV/implicit-conversion
Move implicit conversion operations to stdlib
Diffstat (limited to 'source/slang/syntax-base-defs.h')
-rw-r--r--source/slang/syntax-base-defs.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/slang/syntax-base-defs.h b/source/slang/syntax-base-defs.h
index e6f7cc55e..8a22a61d2 100644
--- a/source/slang/syntax-base-defs.h
+++ b/source/slang/syntax-base-defs.h
@@ -4,10 +4,16 @@
// AST nodes and related objects. For example, this is where the
// basic `Decl`, `Stmt`, `Expr`, `type`, etc. definitions come from.
+ABSTRACT_SYNTAX_CLASS(NodeBase, RefObject)
+ // A helper to access the corresponding class on a concrete instance
+ RAW(
+ virtual SyntaxClass<NodeBase> getClass() = 0;
+ )
+END_SYNTAX_CLASS()
+
// Base class for all nodes representing actual syntax
// (thus having a location in the source code)
-ABSTRACT_SYNTAX_CLASS(SyntaxNodeBase, RefObject)
-
+ABSTRACT_SYNTAX_CLASS(SyntaxNodeBase, NodeBase)
// The primary source location associated with this AST node
FIELD(SourceLoc, loc)
@@ -26,7 +32,7 @@ END_SYNTAX_CLASS()
// These are *not* syntax nodes, because they do not have
// a unique location, and any two `Val`s representing
// the same value should be conceptually equal.
-ABSTRACT_SYNTAX_CLASS(Val, RefObject)
+ABSTRACT_SYNTAX_CLASS(Val, NodeBase)
RAW(typedef IValVisitor Visitor;)
RAW(virtual void accept(IValVisitor* visitor, void* extra) = 0;)