Esempio n. 1
0
        public virtual int Mark()
        {
            if (markers == null)
            {
                markers = new List <CharStreamState>();
                markers.Add(null);   // depth 0 means no backtracking, leave blank
            }
            markDepth++;
            CharStreamState state = null;

            if (markDepth >= markers.Count)
            {
                state = new CharStreamState();
                markers.Add(state);
            }
            else
            {
                state = markers[markDepth];
            }
            state.p    = Index;
            state.line = Line;
            state.charPositionInLine = CharPositionInLine;
            lastMarker = markDepth;
            return(markDepth);
        }
        public int Mark()
        {
            if (markers == null)
            {
                markers = new List <CharStreamState>();
                markers.Add(null);   // depth 0 means no backtracking, leave blank
            }
            markDepth++;
            CharStreamState state = null;

            if (markDepth >= markers.Count)
            {
                state = new CharStreamState();
                markers.Add(state);
            }
            else
            {
                state = markers[markDepth];
            }
            state.p = p;
#if TRACK_POSITION
            state.line = line;
            state.charPositionInLine = charPositionInLine;
#endif
            lastMarker = markDepth;
            return(markDepth);
        }
Esempio n. 3
0
        public virtual int Mark()
        {
            if (this.markers == null)
            {
                this.markers = (IList <CharStreamState>) new List <CharStreamState>();
                this.markers.Add((CharStreamState)null);
            }
            ++this.markDepth;
            CharStreamState charStreamState;

            if (this.markDepth >= this.markers.Count)
            {
                charStreamState = new CharStreamState();
                this.markers.Add(charStreamState);
            }
            else
            {
                charStreamState = this.markers[this.markDepth];
            }
            charStreamState.p    = this.p;
            charStreamState.line = this.line;
            charStreamState.charPositionInLine = this.charPositionInLine;
            this.lastMarker = this.markDepth;
            return(this.markDepth);
        }
Esempio n. 4
0
        public virtual void Rewind(int m)
        {
            CharStreamState state = (CharStreamState)markers[m];

            // restore stream state
            Seek(state.p);
            line = state.line;
            charPositionInLine = state.charPositionInLine;
            Release(m);
        }
        public void Rewind(int m)
        {
            CharStreamState state = markers[m];

            // restore stream state
            Seek(state.p);
#if TRACK_POSITION
            line = state.line;
            charPositionInLine = state.charPositionInLine;
#endif
            Release(m);
        }
Esempio n. 6
0
        public virtual void Rewind(int m)
        {
            if (m < 0)
            {
                throw new ArgumentOutOfRangeException();
            }
            CharStreamState marker = this.markers[m];

            this.Seek(marker.p);
            this.line = marker.line;
            this.charPositionInLine = marker.charPositionInLine;
            this.Release(m);
        }
Esempio n. 7
0
        public virtual void Rewind(int m)
        {
            if (m < 0)
            {
                throw new ArgumentOutOfRangeException();
            }

            //if (m > markDepth)
            //    throw new ArgumentException();

            CharStreamState state = markers[m];

            // restore stream state
            Seek(state.p);
            line = state.line;
            charPositionInLine = state.charPositionInLine;
            Release(m);
        }
Esempio n. 8
0
        public virtual int Mark()
        {
			if (markers == null)
			{
				markers = new ArrayList();
				markers.Add(null); // depth 0 means no backtracking, leave blank
			}
            markDepth++;
            CharStreamState state = null;
            if (markDepth >= markers.Count)
            {
                state = new CharStreamState();
                markers.Add(state);
            }
            else
            {
                state = (CharStreamState)markers[markDepth];
            }
            state.p = p;
            state.line = line;
            state.charPositionInLine = charPositionInLine;
			lastMarker = markDepth;
            return markDepth;
        }
Esempio n. 9
0
        public int Mark()
        {
            if (_markers == null)
            {
                _markers = new List<CharStreamState>();
                // depth 0 means no backtracking, leave blank
                _markers.Add(null);
            }

            _markDepth++;
            CharStreamState state = null;
            if (_markDepth >= _markers.Count)
            {
                state = new CharStreamState();
                _markers.Add(state);
            }
            else
            {
                state = _markers[_markDepth];
            }

            state.p = Index;
            state.line = Line;
            state.charPositionInLine = CharPositionInLine;
            _lastMarker = _markDepth;
            return _markDepth;
        }
 public virtual int Mark()
 {
     if (this.markers == null)
     {
         this.markers = new List<CharStreamState>();
         this.markers.Add(null);
     }
     this.markDepth++;
     CharStreamState item = null;
     if (this.markDepth >= this.markers.Count)
     {
         item = new CharStreamState();
         this.markers.Add(item);
     }
     else
     {
         item = this.markers[this.markDepth];
     }
     item.p = this.p;
     item.line = this.line;
     item.charPositionInLine = this.charPositionInLine;
     this.lastMarker = this.markDepth;
     return this.markDepth;
 }
 public int Mark()
 {
     if ( markers == null )
     {
         markers = new List<CharStreamState>();
         markers.Add( null ); // depth 0 means no backtracking, leave blank
     }
     markDepth++;
     CharStreamState state = null;
     if ( markDepth >= markers.Count )
     {
         state = new CharStreamState();
         markers.Add( state );
     }
     else
     {
         state = markers[markDepth];
     }
     state.p = p;
     #if TRACK_POSITION
     state.line = line;
     state.charPositionInLine = charPositionInLine;
     #endif
     lastMarker = markDepth;
     return markDepth;
 }