37# include <gtest/gtest.h>
50 Compiler_Token_Kind::Identifier);
80 Compiler_Associativity::Right);
82 Compiler_Associativity::Left);
84 Compiler_Associativity::None);
91 tok.
kind = Compiler_Token_Kind::Identifier;
95 EXPECT_EQ(
tok.to_string(),
"Identifier(\"value\")@#1:[4,9)");
97 tok.kind = Compiler_Token_Kind::String_Literal;
98 tok.lexeme =
"\"hi\\n\"";
99 tok.span = {1, 10, 16};
101 EXPECT_EQ(
tok.to_string(),
"String_Literal(\"\\\"hi\\\\n\\\"\")@#1:[10,16)");
Token model and parser-facing metadata for compiler front-ends.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
Main namespace for Aleph-w library functions.
Compiler_Token_Kind classify_compiler_keyword(std::string_view lexeme) noexcept
Classifies a lexeme as a keyword or Identifier.
bool compiler_token_is_keyword(Compiler_Token_Kind kind) noexcept
Predicate: Is the kind a reserved keyword?
int compiler_binary_precedence(Compiler_Token_Kind kind) noexcept
Returns binary precedence for an operator.
bool compiler_token_is_comment(Compiler_Token_Kind kind) noexcept
Predicate: Is the kind a comment?
bool compiler_token_is_literal(Compiler_Token_Kind kind) noexcept
Predicate: Is the kind a literal (number, string, bool, etc.)?
bool compiler_token_is_operator(Compiler_Token_Kind kind) noexcept
Predicate: Is the kind an operator (arithmetic, logical, etc.)?
Compiler_Associativity compiler_binary_associativity(Compiler_Token_Kind kind) noexcept
Returns binary associativity for an operator.
Lexical token representation with its value and location.
Compiler_Token_Kind kind
Logical category (e.g., Kw_If).