Example #1
0
 public override void run( State state )
 {
     // We execute by pushing the number we represent onto the results stack.
     state.pushAction(
     new Step( this, s => s.pushResult( this.value ) )
     );
 }
Example #2
0
 public override void run( State state )
 {
     // We execute here by searching up the stack for the for loop scope
     // marker, then unwinding past that.
     state.pushAction( new Step( this, st =>
     {
     st.unwindActions( step => AstFor.IsLoopMarker( step ) || AstWhile.IsLoopMarker( step ) );
     }, "break: stack unwinder" ) );
 }
Example #3
0
 public override void run( State state )
 {
     // We execute here by searching up the stack for the for loop block
     // marker, then unwinding up to it.
     state.pushAction( new Step( this, st =>
     {
     st.unwindActions( step => AstFor.IsBlockMarker( step ) || AstWhile.IsBlockMarker( step ), true );
     }, "continue: stack unwinder" ) );
 }
Example #4
0
 public override void run( State state )
 {
     // If we have a parameter, execute that first.
     state.pushAction( new Step( this, st =>
     AstTry.ThrowException( state, state.popResult() ) ) );
     if( this.param != null )
     this.param.run( state );
     else
     state.pushResult( null );
 }
Example #5
0
 public override void run( State state )
 {
     // We execute by reading the identifier's value from the scope onto the result stack.
     state.pushAction(
     new Step( this, st => st.pushResult(
         new LValue()
         {
             read = st2 => st2.scope.get( this.name ),
             write = ( st2,v ) => st2.scope.set( this.name, v )
         } )
     )
     );
 }