Esempio n. 1
0
 public TokenExpressionNode(TokenWithSpan token)
 {
     _tokens    = new List <Token>();
     StartIndex = token.Span.Start;
     _tokens.Add(token.Token);
     EndIndex = token.Span.End;
 }
Esempio n. 2
0
 protected void AddNonCodeRegionComments(AstNode ret)
 {
     Debug.Assert(_verbatim);
     TokenWithSpan[] arr = new TokenWithSpan[_nonCodeRegionComments.Count];
     _nonCodeRegionComments.CopyTo(arr);
     GetNodeAttributes(ret)[NodeAttributes.NonCodeRegionComments] = arr;
 }
Esempio n. 3
0
        public void Reset()
        {
            _token      = new TokenWithSpan();
            _lookaheads = new List <TokenWithSpan>();

            _parsingStarted = false;
            _errorCode      = 0;
        }
Esempio n. 4
0
 public Token NextToken()
 {
     _token           = _lookaheads[0];
     _tokenWhiteSpace = _lookaheadWhiteSpaces[0];
     _lookaheads.RemoveAt(0);
     _lookaheadWhiteSpaces.RemoveAt(0);
     if (_lookaheads.Count == 0)
     {
         FetchLookahead();
     }
     return(_token.Token);
 }
Esempio n. 5
0
 private void ReportSyntaxError(TokenWithSpan t, int errorCode)
 {
     ReportSyntaxError(t.Token, t.Span, errorCode, true);
 }
Esempio n. 6
0
 private void ReportSyntaxError(TokenWithSpan t)
 {
     ReportSyntaxError(t, ErrorCodes.SyntaxError);
 }
Esempio n. 7
0
 public StringExpressionNode(TokenWithSpan token)
     : base(token)
 {
     _literalValue = new StringBuilder(token.Token.Value.ToString());
 }