213 references to TokenType
Microsoft.Build (74)
Evaluation\Conditionals\Parser.cs (27)
115if (!_lexer.IsNext(Token.TokenType.EndOfInput)) 131if (!_lexer.IsNext(Token.TokenType.EndOfInput)) 155if (Same(expression, Token.TokenType.EndOfInput)) 159else if (Same(expression, Token.TokenType.Or)) 185if (!_lexer.IsNext(Token.TokenType.EndOfInput)) 194if (_lexer.IsNext(Token.TokenType.EndOfInput)) 198else if (Same(expression, Token.TokenType.And)) 244if (Same(expression, Token.TokenType.LessThan)) 248else if (Same(expression, Token.TokenType.GreaterThan)) 252else if (Same(expression, Token.TokenType.LessThanOrEqualTo)) 256else if (Same(expression, Token.TokenType.GreaterThanOrEqualTo)) 260else if (Same(expression, Token.TokenType.EqualTo)) 264else if (Same(expression, Token.TokenType.NotEqualTo)) 284if (Same(expression, Token.TokenType.Function)) 286if (!Same(expression, Token.TokenType.LeftParenthesis)) 294if (!Same(expression, Token.TokenType.RightParenthesis)) 302else if (Same(expression, Token.TokenType.LeftParenthesis)) 305if (Same(expression, Token.TokenType.RightParenthesis)) 315else if (Same(expression, Token.TokenType.Not)) 337if (!_lexer.IsNext(Token.TokenType.RightParenthesis)) 347if (Same(expression, Token.TokenType.Comma)) 356if (Same(expression, Token.TokenType.String)) 360else if (Same(expression, Token.TokenType.Numeric)) 364else if (Same(expression, Token.TokenType.Property)) 368else if (Same(expression, Token.TokenType.ItemMetadata)) 372else if (Same(expression, Token.TokenType.ItemList)) 382private bool Same(string expression, Token.TokenType token)
Evaluation\Conditionals\Scanner.cs (10)
94internal bool IsNext(Token.TokenType type) 140if (_lookahead?.IsToken(Token.TokenType.EndOfInput) == true) 418_lookahead = new Token(Token.TokenType.Property, propertyExpression); 442_lookahead = new Token(Token.TokenType.ItemMetadata, itemMetadataExpression); 569_lookahead = new Token(Token.TokenType.ItemList, _expression.Substring(start, _parsePoint - start)); 654_lookahead = new Token(Token.TokenType.String, originalTokenString, expandable); 709_lookahead = new Token(Token.TokenType.Function, _expression.Substring(start, end - start)); 714_lookahead = new Token(Token.TokenType.String, tokenValue); 726_lookahead = new Token(Token.TokenType.Numeric, _expression.Substring(start, _parsePoint - start)); 753_lookahead = new Token(Token.TokenType.Numeric, _expression.Substring(start, _parsePoint - start));
Evaluation\Conditionals\Token.cs (37)
18internal static readonly Token Comma = new Token(TokenType.Comma); 19internal static readonly Token LeftParenthesis = new Token(TokenType.LeftParenthesis); 20internal static readonly Token RightParenthesis = new Token(TokenType.RightParenthesis); 21internal static readonly Token LessThan = new Token(TokenType.LessThan); 22internal static readonly Token GreaterThan = new Token(TokenType.GreaterThan); 23internal static readonly Token LessThanOrEqualTo = new Token(TokenType.LessThanOrEqualTo); 24internal static readonly Token GreaterThanOrEqualTo = new Token(TokenType.GreaterThanOrEqualTo); 25internal static readonly Token And = new Token(TokenType.And); 26internal static readonly Token Or = new Token(TokenType.Or); 27internal static readonly Token EqualTo = new Token(TokenType.EqualTo); 28internal static readonly Token NotEqualTo = new Token(TokenType.NotEqualTo); 29internal static readonly Token Not = new Token(TokenType.Not); 30internal static readonly Token EndOfInput = new Token(TokenType.EndOfInput); 63private TokenType _tokenType; 70private Token(TokenType tokenType) 82internal Token(TokenType type, string tokenString) 91internal Token(TokenType type, string tokenString, bool expandable) 94type == TokenType.Property || 95type == TokenType.String || 96type == TokenType.Numeric || 97type == TokenType.ItemList || 98type == TokenType.ItemMetadata || 99type == TokenType.Function, 124internal bool IsToken(TokenType type) 142case TokenType.Comma: 144case TokenType.LeftParenthesis: 146case TokenType.RightParenthesis: 148case TokenType.LessThan: 150case TokenType.GreaterThan: 152case TokenType.LessThanOrEqualTo: 154case TokenType.GreaterThanOrEqualTo: 156case TokenType.And: 158case TokenType.Or: 160case TokenType.EqualTo: 162case TokenType.NotEqualTo: 164case TokenType.Not: 166case TokenType.EndOfInput:
Microsoft.Build.Engine.UnitTests (139)
Scanner_Tests.cs (139)
74while (lexer.Advance() && !lexer.IsNext(Token.TokenType.EndOfInput)) 200Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 205Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 210Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 215Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 220Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 225Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 229Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 233Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 237Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 248Assert.True(lexer.IsNext(Token.TokenType.Property)); 251Assert.True(lexer.IsNext(Token.TokenType.ItemList)); 254Assert.True(lexer.IsNext(Token.TokenType.String)); 259Assert.True(lexer.IsNext(Token.TokenType.String)); 264Assert.True(lexer.IsNext(Token.TokenType.And)); 268Assert.True(lexer.IsNext(Token.TokenType.Or)); 272Assert.True(lexer.IsNext(Token.TokenType.And)); 276Assert.True(lexer.IsNext(Token.TokenType.Or)); 287Assert.True(lexer.IsNext(Token.TokenType.LeftParenthesis)); 290Assert.True(lexer.IsNext(Token.TokenType.RightParenthesis)); 293Assert.True(lexer.IsNext(Token.TokenType.Comma)); 296Assert.True(lexer.IsNext(Token.TokenType.EqualTo)); 299Assert.True(lexer.IsNext(Token.TokenType.NotEqualTo)); 302Assert.True(lexer.IsNext(Token.TokenType.LessThan)); 305Assert.True(lexer.IsNext(Token.TokenType.GreaterThan)); 308Assert.True(lexer.IsNext(Token.TokenType.LessThanOrEqualTo)); 311Assert.True(lexer.IsNext(Token.TokenType.GreaterThanOrEqualTo)); 314Assert.True(lexer.IsNext(Token.TokenType.Not)); 324Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); 325Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); 328Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 329Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); 332Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 333Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); 336Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 337Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EqualTo)); 338Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 339Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); 348Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 350Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 351Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 354Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 356Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 357Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 358Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 361Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 363Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 364Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); 365Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 368Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 370Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 371Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); 372Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 375Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 377Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 378Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 379Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 382Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 384Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 385Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 386Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 389Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 391Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 392Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 393Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); 394Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 395Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 398Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 400Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 401Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); 402Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); 403Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 404Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); 405Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 406Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 409Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Function)); 411Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LeftParenthesis)); 412Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); 413Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); 414Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); 415Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); 416Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 417Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); 418Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 419Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Comma)); 420Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 421Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.RightParenthesis)); 430Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 434Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 438Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 442Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); 446Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); 460Assert.True(lexer.IsNext(Token.TokenType.String)); 462Assert.True(lexer.IsNext(Token.TokenType.EqualTo)); 464Assert.True(lexer.IsNext(Token.TokenType.Property)); 466Assert.True(lexer.IsNext(Token.TokenType.EndOfInput)); 470Assert.True(lexer.IsNext(Token.TokenType.Property)); 472Assert.True(lexer.IsNext(Token.TokenType.NotEqualTo)); 474Assert.True(lexer.IsNext(Token.TokenType.String)); 476Assert.True(lexer.IsNext(Token.TokenType.EndOfInput)); 480Assert.True(lexer.IsNext(Token.TokenType.Property)); 482Assert.True(lexer.IsNext(Token.TokenType.LessThan)); 484Assert.True(lexer.IsNext(Token.TokenType.Numeric)); 486Assert.True(lexer.IsNext(Token.TokenType.EndOfInput)); 498Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); 499Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.And)); 500Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); 503Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 504Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); 505Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 506Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); 507Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 508Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThan)); 509Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThan)); 510Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 511Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThanOrEqualTo)); 512Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 513Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThanOrEqualTo)); 514Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 515Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EqualTo)); 516Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 517Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.NotEqualTo)); 518Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput)); 521Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 522Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Property)); 523Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 524Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.ItemList)); 525Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 526Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThan)); 527Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThan)); 528Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 529Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.LessThanOrEqualTo)); 530Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 531Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.GreaterThanOrEqualTo)); 532Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.String)); 533Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EqualTo)); 534Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.Numeric)); 535Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.NotEqualTo)); 536Assert.True(lexer.Advance() && lexer.IsNext(Token.TokenType.EndOfInput));