# Admission by syntax kind: the admit side of jlt-lint, a first cut.
#
# One line per AST node kind the inventory prints: <kind> <class>.  Classes:
#   kernel       a form of FJlt (the grammar of the paper's Figure 2)
#   derived      a derived form: Jlt, rewritten into the kernel
#   scaffolding  organisation without meaning (modules, namespaces, tests)
#   refused      outside Jlt
#   open         not yet decided; counted as not admitted
# A kind is coarser than the grammar: a CallExpr is kernel whatever it calls,
# and the deny-rules judge what the kind cannot (a call whose overload its
# signature leaves undecided).  So "admitted" is "admitted by kind", and inside
# Jlt is admitted and refused by no deny-rule.  A kind not listed here is open.

# ---- kernel: value layer
Stmt:DeclRefExpr kernel
Stmt:CallExpr kernel
Stmt:CXXOperatorCallExpr kernel
Stmt:BinaryOperator kernel
Stmt:IntegerLiteral kernel
Stmt:CXXBoolLiteralExpr kernel
Stmt:ConditionalOperator kernel
Stmt:ReturnStmt kernel
Stmt:CompoundStmt kernel
Stmt:MemberExpr kernel
Stmt:InitListExpr kernel
Stmt:CXXTemporaryObjectExpr kernel
Decl:Function kernel
Decl:ParmVar kernel
Decl:CXXMethod kernel
Decl:CXXRecord kernel
Decl:Field kernel
Type:Builtin kernel
Type:Record kernel
Type:FunctionProto kernel

# ---- kernel: resolution layer
Decl:FunctionTemplate kernel
Decl:TemplateTypeParm kernel
Type:TemplateTypeParm kernel
Type:TemplateSpecialization kernel
Decl:ClassTemplate kernel
Decl:ClassTemplateSpecialization kernel
Decl:ClassTemplatePartialSpecialization kernel
Decl:VarTemplate kernel
Decl:VarTemplateSpecialization kernel
Decl:VarTemplatePartialSpecialization kernel
Decl:Concept kernel
Decl:RequiresExprBody kernel
Stmt:RequiresExpr kernel
Stmt:ConceptSpecializationExpr kernel
Stmt:UnresolvedLookupExpr kernel
Stmt:UnresolvedMemberExpr kernel
Stmt:CXXDependentScopeMemberExpr kernel
Stmt:DependentScopeDeclRefExpr kernel
Stmt:CXXUnresolvedConstructExpr kernel
Type:DependentName kernel
Type:Decltype kernel

# ---- derived forms
# an alias, its declaration and a use of an alias template of the program
# (Table 7: the standard defines it as the type it stands for, [temp.alias])
Decl:TypeAlias derived
# the member using type = T; of a struct: Figure 2's entry of an associated type
Decl:AssociatedTypeEntry kernel
Decl:TypeAliasTemplate derived
Type:AliasTemplateSpecialization derived
Type:Typedef scaffolding
Type:Using scaffolding
Type:Auto derived
Type:DeducedTemplateSpecialization derived
Type:InjectedClassName derived
Type:LValueReference derived
Type:Paren scaffolding
Stmt:ParenExpr scaffolding
Decl:Var derived
Stmt:DeclStmt derived
Stmt:IfStmt derived
# A structured binding has no row in the table of derived forms, and
# rule1-local-state does not yet read a binding as the local it names.
Decl:Decomposition open
Decl:Binding open
Stmt:DesignatedInitExpr derived
Stmt:ParenListExpr derived
Type:PackExpansion derived
Stmt:PackExpansionExpr derived
Stmt:SizeOfPackExpr derived
Stmt:CXXFoldExpr derived
Stmt:CXXRewrittenBinaryOperator derived
Stmt:UserDefinedLiteral derived
Decl:CXXDeductionGuide derived

# ---- operators by spelling (definitions only; the file inventory still
# counts Stmt:BinaryOperator and Stmt:UnaryOperator as a whole)
Op:+ kernel
Op:- kernel
Op:* kernel
Op:/ kernel
Op:% kernel
Op:& kernel
Op:| kernel
Op:^ kernel
Op:<< kernel
Op:>> kernel
Op:== kernel
Op:!= kernel
Op:< kernel
Op:> kernel
Op:<= kernel
Op:>= kernel
Op:<=> kernel
Op:&& kernel
Op:|| kernel
Op:+= derived
Op:-= derived
Op:*= derived
Op:/= derived
Op:= derived
Op:, open
Op:() kernel
# operator[]: an operator like any other, a member operator call (Table 7);
# the reference it returns is how a write or an alias reaches local state, and
# rule1-local-state refuses every such use it does not show to be safe.
Op:[] derived
Op:-> open
Op:u! kernel
Op:u- kernel
Op:u~ kernel
Op:u+ kernel
Op:u& refused
Op:u* refused
Op:u++ derived
Op:u-- derived
Op:u++post derived
Op:u--post derived

# ---- the derived forms no syntax kind shows (definitions only)
Derived:range derived
Derived:view derived
# a conversion between integer types written as a call (decided 2026-11-22)
Cast:integer kernel
# Decided 2026-11-22 (user), Appendix A's table: a lambda (not generic, or
# constrained) is its closure class; a counted for and a range-for over a
# sized range are a fold; an assignment and ++ on a local are the fold's
# state (runST: the local never leaves the call; Rule 1's deny-rules close
# every channel).  The deny-rule rule3-no-loops recognises the counted shape
# and refuses the rest.
# Decided 2026-11-22, to be counted with the library run: an implicit
# conversion between atoms (int to bool, bool promoted to int) and a result
# required only convertible_to<T> are a derived form, the call followed by
# T(...), conditional on rule2-converted-result (the result used at T only).

# ---- scaffolding
Decl:Export scaffolding
Decl:Namespace scaffolding
Decl:UsingDirective scaffolding
Decl:Using scaffolding
Decl:UnresolvedUsingValue scaffolding
Decl:AccessSpec scaffolding
Decl:StaticAssert scaffolding
Stmt:NullStmt scaffolding

# ---- refused
Stmt:CXXThrowExpr refused
Stmt:WhileStmt refused
Stmt:BreakStmt refused
Stmt:ContinueStmt refused
Stmt:CompoundAssignOperator derived
Stmt:CStyleCastExpr refused
Stmt:CXXNullPtrLiteralExpr refused
Type:Pointer refused
Type:MemberPointer refused
Type:RValueReference refused
Decl:CXXConversion refused
Stmt:CXXTryStmt refused
Stmt:CXXCatchStmt refused
Stmt:CXXNewExpr refused
Stmt:CXXDeleteExpr refused
Stmt:CXXReinterpretCastExpr refused
Stmt:DoStmt refused

# ---- open: to be decided
Stmt:ForStmt derived
Stmt:CXXForRangeStmt derived
Stmt:LambdaExpr derived
Stmt:SwitchStmt open
Stmt:CaseStmt open
Stmt:DefaultStmt open
Stmt:UnaryOperator open
Stmt:CXXFunctionalCastExpr open
# a conversion to an arithmetic type written as a call, size_t(e), int(i):
# the kernel's written conversion (Figure 2, Table 7)
Stmt:ArithmeticConversion kernel
# static_cast<T>(e) between arithmetic types: the written conversion T(e) in
# the other spelling, read as it is and under its conditions (a floating
# value to an integer is open, Op:float-to-integer).
Cast:static derived
# A value of a declared type from values for its fields, written with braces
# (Figure 2's own form; in a template the same spelling is an unresolved
# construction, kernel above).
Stmt:BracedValue kernel
# T(x) to a class type, with parentheses, and T(a, b) to an aggregate: the
# construction T{x} or T{a, b}, its arguments' conversions read by the
# narrowing check.
Stmt:ParenValue derived
# Conditions of Table 7's rows that the kinds show (the audit of 2026-11-25).
# A return where the reading of statements has no place for it: in a loop, or
# in a branch that only sometimes returns.  At the end of the function, of
# both branches of a last if, or of a guard (if (c) return e; rest) it is the
# kernel's return.
Stmt:EarlyReturn refused
# An implicit conversion between integer types that does not hold every
# value ([dcl.init.list]): Table 7's row asks that it does not narrow.
Conversion:narrowing refused
# if consteval, and std::is_constant_evaluated() wherever it is called: its
# row trusts that both branches compute one value, and no tool lists that
# trust yet.
Stmt:IfConsteval open
# if constexpr: its two rows ask that both branches have one type, or that
# the test is a shape the signature names, and no check shows either yet; the
# type check leaves a body with one undecided for the same reason.
Stmt:IfConstexpr open
# The standard's variant, a sum: to be a derived form, read as a record with
# a tag and a field for each alternative, std::visit the choice on the tag
# (decided 2026-11-25; not in the kernel).  Open until the row is written
# with its conditions and a tested pair.
Derived:variant open
# value() of a std::optional or a std::expected: it throws where no value is
# held, which Rule 1 keeps out.  Open until the sum has its eliminator
# (#1222), which decides the side before it reads it.
Derived:sum-value open
# A call to a function not declared constexpr: since C++23 the keyword on
# the caller does not require it of the callee, so the linter looks.
Call:NotConstexpr refused
# Integer division and remainder by a value, and a shift by a value: the
# kernel has each by a constant only (not zero; below the width), where it is
# defined at every argument.  Open until division has its row (#1222).
# A floating value converted to an integer, written out (size_t(x),
# static_cast): undefined where the value does not fit ([conv.fpint]), so
# partial as division is.
Op:division-by-value open
Op:shift-by-value open
Op:float-to-integer open
# A generic lambda is a template with no constraint; its row covers a lambda
# that is not generic.
Stmt:GenericLambda open
Stmt:CXXStaticCastExpr open
Stmt:CXXThisExpr open
Stmt:CXXConstructExpr kernel
Stmt:CXXMemberCallExpr derived
Stmt:ArraySubscriptExpr open
Stmt:StringLiteral open
Stmt:FloatingLiteral open
Stmt:CharacterLiteral open
Stmt:CXXStdInitializerListExpr open
Stmt:CXXNoexceptExpr open
Stmt:UnaryExprOrTypeTraitExpr open
# sizeof and alignof of a type that is not dependent: a constant of size_t.
Stmt:SizeConstant derived
Decl:NonTypeTemplateParm open
Decl:CXXConstructor open
Decl:Friend open
Decl:Enum open
Decl:EnumConstant open
Type:Enum open
Type:ConstantArray open
Type:IncompleteArray open
Type:DependentSizedArray open
Decl:CXXDestructor open
# A destructor that does nothing, defaulted or with an empty body, and not
# virtual: scaffolding, as a defaulted copy is.
Decl:EmptyDestructor scaffolding
Stmt:ImplicitValueInitExpr open
