コード例 #1
0
 private void ProtoStruct(List <Tree> @class)
 {
     _byteCodeMapper.OpenClass(null, @class[0].Content);
     foreach (var tree in @class)
     {
         if (tree.Kind == Kind.TypeAssigne)
         {
             TypeAssign(tree.Children);
         }
         else if (tree.Kind == Kind.Function)
         {
             ProtoMethod(tree.Children);
         }
         else if (tree.Kind == Kind.Constructor)
         {
             ProtoConstructor(tree.Children);
         }
     }
     _byteCodeMapper.CloseClass();
 }
コード例 #2
0
        private void ProtoClass(Tree tree)
        {
            List <Tree> children = tree.Children;
            string      Base     = tree.Kind == Kind.Struct
                ? null
                : children.Count > 1 && children[1].Content == ":" ? children[2].Content : "System.object";

            _byteCodeMapper.OpenClass(Base, children[0].Content);
            if (!_summary.Contain(_byteCodeMapper.CurrentClass))
            {
                _summary.Add(_byteCodeMapper.CurrentClass, children[0].Parent);
            }
            _byteCodeMapper.CloseClass();
        }