public ForLoopExpression(CompoundLeftValue/*!*/ variables, Expression/*!*/ list, Statements body, SourceSpan location)
     : base(location) {
     Assert.NotNull(variables, list);
     
     _block = new BlockDefinition(null, variables, body, location);
     _list = list;
 }
Exemple #2
0
        public ForLoopExpression(LexicalScope/*!*/ definedScope, Parameters/*!*/ variables, Expression/*!*/ list, Statements body, SourceSpan location)
            : base(location) {
            Assert.NotNull(definedScope, variables, list);

            _block = new BlockDefinition(definedScope, variables, body, location);
            _list = list;
        }
 // misc:
 public virtual bool Enter(BlockDefinition/*!*/ node) { return true; }
 public virtual void Exit(BlockDefinition/*!*/ node) { }
 public ShutdownHandlerStatement(LexicalScope/*!*/ definedScope, Statements/*!*/ body, SourceSpan location)
     : base(location) {
     _block = new BlockDefinition(definedScope, null, body, location);
 }
Exemple #6
0
        protected override void Walk(BlockDefinition node)
        {
            var statements = currentClass == null ? AST.Statements : currentClass.Body.Statements;
            var methodname = "__lambda_" + blockPrefix + "_" + ++blockUniqueId;

            LexicalScope scope = currentClass != null ? currentClass.DefinedScope
                : /* HACK HACK HACK */
                (LexicalScope)AST.GetType().GetField("_definedScope", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(AST);

            statements.Add(new MethodDefinition(scope, null, methodname, node.Parameters, new Body(node.Body, null, null, null, node.Location), node.Location));
            transformations.RefactoredBlocksToMethods.Add(node, methodname);
        }
Exemple #7
0
 public ShutdownHandlerStatement(LexicalScope /*!*/ definedScope, Statements /*!*/ body, SourceSpan location)
     : base(location)
 {
     _block = new BlockDefinition(definedScope, null, body, location);
 }
Exemple #8
0
 public LambdaDefinition(BlockDefinition block)
     : base(block.Location)
 {
     _block = block;
 }
Exemple #9
0
 public virtual void Exit(BlockDefinition /*!*/ node)
 {
 }
Exemple #10
0
 // misc:
 public virtual bool Enter(BlockDefinition /*!*/ node)
 {
     return(true);
 }
Exemple #11
0
 public LambdaDefinition(BlockDefinition block)
     : base(block.Location)
 {
     _block = block;
 }
 public ShutdownHandlerStatement(LexicalScope /*!*/ definedScope, Statements /*!*/ body, SourceSpan location)
     : base(location)
 {
     _block = new BlockDefinition(definedScope, CompoundLeftValue.UnspecifiedBlockSignature, body, location);
 }
 public ShutdownHandlerStatement(LexicalScope/*!*/ definedScope, Statements/*!*/ body, SourceSpan location)
     : base(location) {
     _block = new BlockDefinition(definedScope, CompoundLeftValue.UnspecifiedBlockSignature, body, location);
 }