1 kami
liquibyte edited this page 2026-11-19 16:23:29 -06:00

kami.h

Kami, What Source Code Means.

Copyright (c) 2016-2026 Michael Grey (liquibyte) liquibyte@gmail.com SPDX-License-Identifier: Artistic-2.0 Distributed under the Artistic License 2.0; see LICENSE for terms.

Kami is a C library that reads source code and says what it means. This header includes all the others; each of them can also be included on its own.

Features:

  • lexer.h: the exact tokens of C and C++ (layer 0)
  • preprocessor.h: translation phase 4, with every token mapped back to where it is written, and if decided as the compiler decides it
  • parser.h: the C grammar check, the C++ reader, and a record of every declaration, use and scope
  • semantic.h: every symbol, where it is declared, its documentation, and what each name in the file refers to
  • brace.h, brace_session.h: brace pairs that the language proves, the best answer for broken code, answers kept up to date across edits, and parentheses and brackets
  • language.h: any language described in a language file (which files are in it, a lexer driven by the file, names, folds) and the highlighting of every token; Kami's C and C++ go through the same calls

Internal design notes:

  • No display and no toolkit: Kami reads text and answers questions about it, so an editor, a command-line checker or a language server can all use it. It needs only libc
  • Named for kami (紙), paper: the material that Unryu, the editor, is made of
#include "kami.h"

Constants: KAMI_VERSION

Constants

KAMI_VERSION

#define KAMI_VERSION "1.5"

The library's version, as a string.