Ejemplo n.º 1
0
        /// <summary>
        /// Resolves all the labels and updates the information in the given 
        /// IParseItem tree.
        /// </summary>
        /// <param name="target">The IParseItem tree to traverse.</param>
        /// <exception cref="System.ArgumentNullException">If target is null.</exception>
        public void Resolve(IParseItem target)
        {
            if (target == null)
                throw new ArgumentNullException("target");

            tree = new GetInfoTree();
            target.Accept(this);
            tree.Resolve();

            var info = tree.EndFunc();
            GlobalCaptures = info.CapturedLocals;
            GlobalNested = info.HasNested;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Resolves all the labels and updates the information in the given IParseItem tree.
        /// </summary>
        /// <param name="target">The IParseItem tree to traverse.</param>
        /// <exception cref="System.ArgumentNullException">If target is null.</exception>
        public void Resolve(IParseItem target)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            _tree = new GetInfoTree();
            target.Accept(this);
            _tree.Resolve();

            var info = _tree.EndFunc();

            _globalCaptures = info.CapturedLocals;
            _globalNested   = info.HasNested;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new instance of GetInfoVisitor.
 /// </summary>
 public GetInfoVisitor()
 {
     _tree = new GetInfoTree();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a new instance of GetInfoVisitor.
 /// </summary>
 public GetInfoVisitor()
 {
     this.tree = new GetInfoTree();
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Creates a new instance of GetInfoVisitor.
 /// </summary>
 public GetInfoVisitor()
 {
     this.tree = new GetInfoTree();
 }