예제 #1
0
        public UnexpectedTokenException(	string msg,
											Token t,
											params TokenKind[] expectedTokenKinds)
            : base(msg)
        {
            Token				= t;
            ExpectedTokenKinds	= expectedTokenKinds;
        }
예제 #2
0
파일: Scanner.cs 프로젝트: pulb/basenji
        /// <summary>
        /// Constructor that initializes the scanner with the given Text.
        /// The first token can be accessed through the CurrentToken property,
        /// the following token through the LookAheadToken property.
        /// Throws ScannerException.
        /// </summary>
        /// <param name="text">
        /// A <see cref="System.String"/>
        /// </param>
        public Scanner(string text)
        {
            if (text == null)
                throw new ArgumentNullException("text");

            wordBuf			= new StringBuilder();

            currentToken	= new Token();
            lookAheadToken	= new Token();

            Reset(text);
        }
예제 #3
0
파일: Scanner.cs 프로젝트: pulb/basenji
        public void ReadNextToken()
        {
            Token tmpToken	= currentToken;
               	currentToken	= lookAheadToken;
               	lookAheadToken	= tmpToken;

               	lookAheadToken.Reset();

               	Scan();
               	SkipWhiteSpace();
        }