예제 #1
0
파일: State.cs 프로젝트: kayateia/climoo
        public State()
        {
            _stack = new Stack<Step>();
            _prevStep = null;

            _resultStack = new Stack<object>();

            _constScope = new ConstScope( null );
            _lookupScope = new LookupScope( _constScope );
            _rootScope = new StandardScope( _lookupScope );

            _baggage = new StandardScope();
        }
예제 #2
0
파일: AstWhile.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Returns true if this step represents the marker that ends the whole while loop.
 /// </summary>
 public static bool IsLoopMarker( Step step )
 {
     return step.description == LoopMarker;
 }
예제 #3
0
파일: AstWhile.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Returns true if this step represents the marker that will start a new loop iteration.
 /// </summary>
 /// <remarks>The marker itself should be left on.</remarks>
 public static bool IsBlockMarker( Step step )
 {
     return step.description == BlockMarker;
 }
예제 #4
0
파일: AstTry.cs 프로젝트: kayateia/climoo
 static bool IsTryMarker( Step step )
 {
     return step.description == TryMarker;
 }
예제 #5
0
파일: AstCall.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Returns true if the specified step is a function call scope marker.
 /// </summary>
 public static bool IsScopeMarker( Step s )
 {
     return s.description == ScopeMarker;
 }
예제 #6
0
파일: State.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Push a set of actions onto the step stack. They are pushed in order.
 /// </summary>
 public void pushActions( Step[] actions )
 {
     foreach( Step a in actions )
     _stack.Push( a );
 }
예제 #7
0
파일: State.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Push a single action onto the step stack, creating a new security context.
 /// </summary>
 public void pushActionAndSecurityContext( Step action, ISecurityContext context )
 {
     action.securityContext = context;
     action.description = "security context: {0}".FormatI( context.name );
     _stack.Push( action );
 }
예제 #8
0
파일: State.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Push a single action onto the step stack, creating a new variable scope.
 /// </summary>
 public void pushActionAndScope( Step action, IScope scope )
 {
     action.scope = scope;
     _stack.Push( action );
 }
예제 #9
0
파일: State.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Push a single action onto the step stack.
 /// </summary>
 public void pushAction( Step action )
 {
     _stack.Push( action );
 }
예제 #10
0
파일: State.cs 프로젝트: kayateia/climoo
 /// <summary>
 /// Pop a single action from the step stack.
 /// </summary>
 public Step popAction()
 {
     if( !_stack.Any() )
     throw new InvalidOperationException( "Action stack is empty" );
     _prevStep = _stack.Pop();
     return _prevStep;
 }