l0c_lib.l0
Module: l0c_lib
Source: compiler/stage2_l0/src/l0c_lib.l0 Language: Dea/L0
Imports / Includes
signaturesutil.loglexertokensdiag_printstd.hashmapname_resolverstd.iobuild_driverdriverstd.texttypescodegen_optionsanalysisstd.vectorast_printerstd.fsstd.stringutil.diagsymbolscli_argsbuild_infoastsem_contextsource_pathsutil.stringsbackend
Symbols
- prepared_input_free
- prepared_input_free_opt
- l0c_copy_collector
- l0c_log_effective_roots
- l0c_prepare_input
- l0c_print_token
- l0c_print_module_token_header
- l0c_dump_tokens_for_path
- l0c_cmd_check
- l0c_cmd_tok
- l0c_cmd_gen
- l0c_cmd_sym
- l0c_cmd_type
- l0c_append_c_option_words
- l0c_merge_c_option_words
- l0c_collect_c_option_words
- l0c_cmd_ast
- l0c_cmd_nyi
- run_with_argv
- PreparedInput
Function prepared_input_free
1
func prepared_input_free(self: PreparedInput*)
Free a prepared CLI input bundle.
Parameters:
self: Prepared input to free.
Function prepared_input_free_opt
1
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
1
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
1
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
1
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
1
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
1
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
1
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
1
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
1
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
1
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
1
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
1
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
1
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, ornull.
Function l0c_merge_c_option_words
1
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 fromL0_CFLAGS.cli_opts: Options from--c-options.
Returns: Parsed option words in final order.
Function l0c_collect_c_option_words
1
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
1
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
Parameters:
opts: Parsed CLI options.cfg: Logging configuration.
Returns: Process-style status code.
Function l0c_cmd_nyi
1
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
1
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
1
entry_module: string
PreparedInput Field search_paths
1
search_paths: SourceSearchPaths*