Exemplo n.º 1
0
 public TokenExpressionNode(TokenWithSpan token)
 {
     _tokens    = new List <Token>();
     StartIndex = token.Span.Start;
     _tokens.Add(token.Token);
     EndIndex = token.Span.End;
 }
Exemplo 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;
 }
Exemplo n.º 3
0
        public void Reset()
        {
            _token      = new TokenWithSpan();
            _lookaheads = new List <TokenWithSpan>();

            _parsingStarted = false;
            _errorCode      = 0;
        }
Exemplo 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);
 }
Exemplo n.º 5
0
 private void ReportSyntaxError(TokenWithSpan t, int errorCode)
 {
     ReportSyntaxError(t.Token, t.Span, errorCode, true);
 }
Exemplo n.º 6
0
 private void ReportSyntaxError(TokenWithSpan t)
 {
     ReportSyntaxError(t, ErrorCodes.SyntaxError);
 }
Exemplo n.º 7
0
 public StringExpressionNode(TokenWithSpan token)
     : base(token)
 {
     _literalValue = new StringBuilder(token.Token.Value.ToString());
 }