1 using System;
2 using System.Collections;
3 using Cm.Ast;
4
5
6
7
8
9 namespace soulcm.scmpg
10 {
11 public bool IsPtrType(Cm.Ast.Node* node)
12 {
13 if (!(node != null)) return false;
14 if (node->GetNodeType() == NodeType.constNode)
15 {
16 Cm.Ast.ConstNode* constNode = cast<Cm.Ast.ConstNode*>(node);
17 node = constNode->Subject();
18 }
19 return node->GetNodeType() == NodeType.pointerNode;
20 }
21 public Cm.Ast.Node* RemovePointer(Cm.Ast.Node* node)
22 {
23 if (node->GetNodeType() == NodeType.pointerNode)
24 {
25 Cm.Ast.PointerNode* ptrNode = cast<Cm.Ast.PointerNode*>(node);
26 return ptrNode->Subject();
27 }
28 return node;
29 }
30 }