Initial commit
[yaffs-website] / node_modules / node-sass / src / libsass / src / ast_fwd_decl.cpp
1 #include "ast.hpp"
2
3 namespace Sass {
4
5   #define IMPLEMENT_BASE_CAST(T) \
6   template<> \
7   T* Cast(AST_Node* ptr) { \
8     return dynamic_cast<T*>(ptr); \
9   }; \
10   \
11   template<> \
12   const T* Cast(const AST_Node* ptr) { \
13     return dynamic_cast<const T*>(ptr); \
14   }; \
15
16   IMPLEMENT_BASE_CAST(AST_Node)
17   IMPLEMENT_BASE_CAST(Expression)
18   IMPLEMENT_BASE_CAST(Statement)
19   IMPLEMENT_BASE_CAST(Has_Block)
20   IMPLEMENT_BASE_CAST(PreValue)
21   IMPLEMENT_BASE_CAST(Value)
22   IMPLEMENT_BASE_CAST(List)
23   IMPLEMENT_BASE_CAST(String)
24   IMPLEMENT_BASE_CAST(String_Constant)
25   IMPLEMENT_BASE_CAST(Supports_Condition)
26   IMPLEMENT_BASE_CAST(Selector)
27   IMPLEMENT_BASE_CAST(Simple_Selector)
28
29 }