Beispiel #1
0
 private Token NextToken()
 {
     _token = _lookahead;
     FetchLookahead();
     return _token.Token;
 }
Beispiel #2
0
 private void FetchLookahead()
 {
     _lookahead = new TokenWithSpan(_tokenizer.GetNextToken(), _tokenizer.TokenSpan);
 }
Beispiel #3
0
        public void Reset(SourceUnit sourceUnit)
        {
            ContractUtils.RequiresNotNull(sourceUnit, "_sourceUnit");

            _sourceUnit = sourceUnit;
            _token = new TokenWithSpan();
            _lookahead = new TokenWithSpan();

            _parsingStarted = false;
            _errorCode = 0;
            _openParen = 0;
        }
Beispiel #4
0
 private void ReportSyntaxError(TokenWithSpan t, int errorCode)
 {
     ReportSyntaxError(t.Token, t.Span, errorCode, true);
 }
Beispiel #5
0
 private void ReportSyntaxError(TokenWithSpan t)
 {
     ReportSyntaxError(t, ErrorCodes.SyntaxError);
 }
Beispiel #6
0
        public void Reset(SourceUnit sourceUnit, ModuleOptions languageFeatures)
        {
            ContractUtils.RequiresNotNull(sourceUnit, "sourceUnit");

            _sourceUnit = sourceUnit;
            _languageFeatures = languageFeatures;
            _token = new TokenWithSpan();
            _lookahead = new TokenWithSpan();
            _functions = null;

            _parsingStarted = false;
            _errorCode = 0;
            _importAllowed = true;
        }