compiler/stage2_l0/src/l0c_lib.l0

Module l0c_lib

Overview Symbols grouped by source file: compiler/stage2_l0/src/l0c_lib.l0

Module: l0c_lib

Source: compiler/stage2_l0/src/l0c_lib.l0 Language: Dea/L0

Imports / Includes

  • signatures
  • util.log
  • lexer
  • tokens
  • diag_print
  • std.hashmap
  • name_resolver
  • std.io
  • build_driver
  • driver
  • std.text
  • types
  • codegen_options
  • analysis
  • std.vector
  • ast_printer
  • std.fs
  • std.string
  • util.diag
  • symbols
  • cli_args
  • build_info
  • ast
  • sem_context
  • source_paths
  • util.strings
  • backend

Symbols

Function prepared_input_free

func prepared_input_free(self: PreparedInput*)

Free a prepared CLI input bundle.

Parameters:

  • self: Prepared input to free.

Function prepared_input_free_opt

func prepared_input_free_opt(self: PreparedInput*?)

Free a nullable prepared input bundle when present.

Parameters:

  • self: Optional prepared input to free.

Function l0c_copy_collector

func l0c_copy_collector(dst: DiagCollector*, src: DiagCollector*)

Copy every diagnostic from one collector into another.

Parameters:

  • dst: Destination collector.
  • src: Source collector.

Function l0c_log_effective_roots

func l0c_log_effective_roots(cfg: LogConfig*, sys_roots: StringVector*, project_roots: StringVector*)

Log the effective system and project roots for one CLI invocation.

Parameters:

  • cfg: Logging configuration.
  • sys_roots: Effective system-root vector.
  • project_roots: Effective project-root vector.

Function l0c_prepare_input

func l0c_prepare_input(opts: CliOptions*, diags: DiagCollector*, cfg: LogConfig*) -> PreparedInput*?

Normalize CLI input into an entry module and search paths.

Parameters:

  • opts: Parsed CLI options.
  • diags: Diagnostic collector for normalization errors.
  • cfg: Logging configuration.

Returns: Prepared input bundle, or null if normalization fails.

Function l0c_print_token

func l0c_print_token(path: string, tok: Token)

Print one token with source location metadata.

Parameters:

  • path: Source path owning the token.
  • tok: Token to print.

Function l0c_print_module_token_header

func l0c_print_module_token_header(module_name: string, path: string)

Print a header before dumping tokens for a module.

Parameters:

  • module_name: Module being printed.
  • path: Source path for the module.

Function l0c_dump_tokens_for_path

func l0c_dump_tokens_for_path(path: string, include_eof: bool, diags: DiagCollector*) -> int

Lex a source file and print its tokens.

Parameters:

  • path: Source file to read.
  • include_eof: Whether to print the trailing EOF token.
  • diags: Diagnostic collector for I/O and lexing errors.

Returns: Process-style status code.

Function l0c_cmd_check

func l0c_cmd_check(opts: CliOptions*, cfg: LogConfig*) -> int

Execute Stage 2 --check mode.

Parameters:

  • opts: Parsed CLI options.
  • cfg: Logging configuration.

Returns: Process-style status code.

Function l0c_cmd_tok

func l0c_cmd_tok(opts: CliOptions*, cfg: LogConfig*) -> int

Execute Stage 2 --tok mode.

Parameters:

  • opts: Parsed CLI options.
  • cfg: Logging configuration.

Returns: Process-style status code.

Function l0c_cmd_gen

func l0c_cmd_gen(opts: CliOptions*, cfg: LogConfig*) -> int

Execute Stage 2 --gen mode.

Parameters:

  • opts: Parsed CLI options.
  • cfg: Logging configuration.

Returns: Process-style status code.

Function l0c_cmd_sym

func l0c_cmd_sym(opts: CliOptions*, cfg: LogConfig*) -> int

Execute Stage 2 --sym mode.

Parameters:

  • opts: Parsed CLI options.
  • cfg: Logging configuration.

Returns: Process-style status code.

Function l0c_cmd_type

func l0c_cmd_type(opts: CliOptions*, cfg: LogConfig*) -> int

Execute Stage 2 --type mode.

Parameters:

  • opts: Parsed CLI options.
  • cfg: Logging configuration.

Returns: Process-style status code.

Function l0c_append_c_option_words

func l0c_append_c_option_words(dst: StringVector*, raw: string?)

Append whitespace-delimited C option words from one source string.

Parameters:

  • dst: Destination vector for parsed option words.
  • raw: Raw options string, or null.

Function l0c_merge_c_option_words

func l0c_merge_c_option_words(env_opts: string?, cli_opts: string?) -> StringVector*

Merge C option words from environment and CLI with CLI-last precedence.

Parameters:

  • env_opts: Options from L0_CFLAGS.
  • cli_opts: Options from --c-options.

Returns: Parsed option words in final order.

Function l0c_collect_c_option_words

func l0c_collect_c_option_words(opts: CliOptions*) -> StringVector*

Resolve merged C option words from L0_CFLAGS and parsed CLI options.

Parameters:

  • opts: Parsed CLI options.

Returns: Parsed option words in final order.

Function l0c_cmd_ast

func l0c_cmd_ast(opts: CliOptions*, cfg: LogConfig*) -> int

Execute Stage 2 --ast mode.

Without --all-modules , prints the AST for the entry module only. With --all-modules , prints all modules in the compilation unit in sorted order, separated by === Module <name> === headers.

Parameters:

  • opts: Parsed CLI options.
  • cfg: Logging configuration.

Returns: Process-style status code.

Function l0c_cmd_nyi

func l0c_cmd_nyi(mode: CliMode, cfg: LogConfig*) -> int

Report that a requested CLI mode is not implemented in Stage 2 yet.

Parameters:

  • mode: Requested CLI mode.
  • cfg: Logging configuration.

Returns: Process-style status code.

Function run_with_argv

func run_with_argv(argv: StringVector*) -> int

Parse CLI arguments and dispatch the requested command.

Parameters:

  • argv: Argument vector excluding the executable name.

Returns: Process-style status code.

Struct PreparedInput

Represents the PreparedInput structure.

PreparedInput Field entry_module

entry_module: string

PreparedInput Field search_paths

search_paths: SourceSearchPaths*