示例#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();
        }