public override bool Visit(AstClassBody node)
 {
     return true;
 }
示例#2
0
 public AstClass(AstIdExpression name, AstClassBody body)
 {
     Name = name;
     Body = body;
 }
示例#3
0
        public override bool Visit(AstClassBody node)
        {
            foreach (AstClassField classField in node.ClassFields)
            {
                classField.Accept(this);
            }
            foreach (AstClassMethod classMethod in node.ClassMethods)
            {
                classMethod.Accept(this);
                table.UseParentScope();
            }

            return false;
        }
示例#4
0
        // #CLASS_BODY BLOCK_START #CLASS_DECLARATIONS BLOCK_END
        private void ConstructClassBody()
        {
            var fieldsList = new List<AstClassField>();
            var methodsList = new List<AstClassMethod>();

            AstNode curr = nodes.Peek() as AstNode;
            while (curr is AstClassField || curr is AstClassMethod)
            {
                if (curr is AstClassField)
                {
                    fieldsList.Insert(0, curr as AstClassField);
                }
                else
                {
                    methodsList.Insert(0, curr as AstClassMethod);
                }
                nodes.Pop();
                curr = nodes.Peek() as AstNode;
            }

            var classBody = new AstClassBody(fieldsList, methodsList);
            PushNode(classBody);
        }
 public abstract bool Visit(AstClassBody node);