public override void Visit(ClassDeclNode node)
        {
            ClassType classType = new ClassType(node.className.name);
            ClassBeingVisited = Analysis.Environment.Classes.Add(node.className.name);
            ClassBeingVisited.ClassType = classType;

            if(node.extendsClass != null)
                node.extendsClass.Accept(this);
        }
Example #2
0
 public IdentifierTypeNode(string identifierName, int lineNumber)
 {
     Type = new ClassType(identifierName);
     this.name = identifierName;
     this.lineNumber = lineNumber;
 }
Example #3
0
 private bool IsClassCompatible(ClassType actualType, ClassType expectedType)
 {
     if (actualType.Name == expectedType.Name)
         return true;
     if (actualType.BaseClassType == null)
         return false;
     else
         return IsClassCompatible(actualType.BaseClassType, expectedType);
 }