Exemple #1
0
 private Token NextToken()
 {
     _token = _lookahead;
     FetchLookahead();
     return _token.Token;
 }
Exemple #2
0
 private void FetchLookahead()
 {
     _lookahead = new TokenWithSpan(_tokenizer.GetNextToken(), _tokenizer.TokenSpan);
 }
Exemple #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;
        }
Exemple #4
0
 private void ReportSyntaxError(TokenWithSpan t, int errorCode)
 {
     ReportSyntaxError(t.Token, t.Span, errorCode, true);
 }
Exemple #5
0
 private void ReportSyntaxError(TokenWithSpan t)
 {
     ReportSyntaxError(t, ErrorCodes.SyntaxError);
 }
Exemple #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;
        }