예제 #1
0
        internal TRY_BLOCK(Scope parent_scope, Node body, Node rescue, Node _else, Node ensure, YYLTYPE location)
            : base(location)
        {
            this.parent_scope = parent_scope;
            this.body = body;
            this.rescue = (RESCUE_CLAUSE)rescue;
            this._else = _else;
            this.ensure = ensure;

        }
예제 #2
0
        internal ControlFlowNode(Scope parent_scope, ARGS return_val, YYLTYPE location)
            : base(location)
        {
            this.parent_scope = parent_scope;

            // no return value
            if (return_val == null)
                return;
 
            if (return_val.block != null)
                throw new System.Exception("block argument should not be given");

            // just a single value => return that value
            if (return_val.hashlist == null && return_val.array == null && return_val.parameters.nd_next == null)
            {
                this.return_val = return_val.parameters;
                return;
            }

            // just hash values => return a HASH
            if (return_val.parameters == null && return_val.array == null)
            {
                this.return_val = new HASH(return_val.hashlist, return_val.location);
                return;
            }

            // return *p => if p is an ARRAY then ... else ...
            if (return_val.parameters == null && return_val.hashlist == null)
            {
                this.array = return_val.array;
                this.return_val = new ProxyNode(ReturnArray, return_val.location);
            }
            else
            {
                this.args = return_val;
                this.return_val = new ProxyNode(ReturnRubyArray, return_val.location);
            }
        }
예제 #3
0
        internal RESCUE_CLAUSE(Scope parent_scope, Node types, LVALUE var, Node body, Node next, YYLTYPE location)
            : base(location)
        {
            if (types == null)
                types = new CONST(parent_scope, ID.intern("StandardError"), location);

            this.parent_scope = parent_scope;
            this.types = types;
            this.var = var;
            this.body = body;
            this.next = (RESCUE_CLAUSE)next;
        }
예제 #4
0
 internal RESCUE_CLAUSE(Scope parent_scope, Node body, YYLTYPE location)
     : base(location)
 {
     this.parent_scope = parent_scope;
     this.body = body;
 }
예제 #5
0
        // return return_val;

        internal RETURN(Scope current, Node return_val, YYLTYPE location)
            : base(current, (ARGS)return_val, location)
        {
        }
예제 #6
0
        // retry

        internal RETRY(Scope current, YYLTYPE location): base(current, location)
        {
        }
예제 #7
0
        protected Node return_val;    // optional

        internal ControlFlowNode(Scope parent_scope, YYLTYPE location)
            : base(location)
        {
            this.parent_scope = parent_scope;
        }