Here is an overview of the source code organization for ksh93.

Directory layout:

	The directory include contains header files for ksh93.
	The files nval.h and shell.h are intended to be public
	headers and can be used to add runtime builtin command.
	The remainder are private.

	The directory data contains readonly data files for ksh93.
	The man pages for built-ins are in builtins.c rather
	than included as statics with the implementations in the
	bltins directory because some systems don't make static const
	data readonly and we want these to be shared by all running
	shells.

	The directory edit contains the code for command line
	editing and history.

	The fun directory contains some shell function such as
	pushd, popd, and dirs.

	The directory features contains files that are used to generate
	header files in the FEATURE directory.  Most of these files
	are in a format that is processed by iffe.

	The directory bltins contains code for most of the built-in
	commands.  Additional built-in commands are part of libcmd.

	The directory sh contains most of the code for ksh93.

	The directory tests contains a number of regression tests.
	In most cases, when a bug gets fixed, a test is added to
	one of these files.  The ksh regression tests can be run by
	invoking the shtests script in the top-level bin directory;
	see 'bin/shtests --man' for documentation about the options.
	They are also run with default options via 'bin/package tests'
	as part of a complete test suite run that also includes tests
	for the build system itself.

	The top level directory contains the mamake Mamfile, the ksh93
	manual page (sh.1) and the nval.3 and shell.3 documentation files.
	The file COMPATIBILITY is a list of all known incompatibilities
	with previous AT&T releases.

Include directory:
	1.	argnod.h contains the type definitions for command
		nodes, io nodes, argument nodes, and for positional
		parameters.  It defines the prototypes for
		all the positional parameters functions.
	2.	builtins.h contains prototypes for builtins as well
		as symbolic constants that refer to the name-pairs
		that are associated with some of the built-ins.
		It also contains prototypes for many of the strings.
	3.	defs.h is the catch all for all definitions that
		don't fit elsewhere and it includes several other
		headers.  It defines a structure that contains ksh
		global data, sh, and a structure that contains per
		function data, sh.st.
	4.	edit.h contains definitions that are common to both
		vi and emacs edit modes.
	5.	fault.h contains prototypes for signal related
		functions and trap and fault handling.
	6.	fcin.h contains macro and function definitions for
		reading from a file or string.
	7.	history.h contains macros and functions definitions
		related to history file processing.
	8.	jobs.h contains the definitions relating to job
		processing and control.
	9.	lexstates.h contains the states associated with
		lexical processing.
	10.	name.h contains the internal definitions related
		to name-value pair processing.
	11.	national.h contains a few I18N definitions, mostly
		obsolete.
	12.	nval.h is the public interface to the name-value
		pair library that is documented with nval.3.
	13.	path.h contains the interface for pathname processing
		and pathname searching.
	14.	shell.h is the public interface for shell functions
		that are documented int shell.3.
	15.	shlex.h contains the lexical token definitions and
		interfaces for lexical analysis.
	16.	shnodes.h contains the definition of the structures
		for each of the parse nodes and flags for the attributes.
	17.	shtable.h contains some interfaces and functions for
		table lookup.
	18.	streval.h contains the interface to the arithmetic
		functions.
	19.	terminal.h is a header file that includes the appropriate
		terminal include.
	20.	test.h contains the definitions for the test and [[ ... ]]
		commands.
	21.	timeout.h contains the define constant for the maximum
		shell timeout.
	22.	ulimit.h includes the appropriate resource header.
	23.	variables.h contains symbolic constants for the built-in
		shell variables.
	24.	version.h contains the version string for this release.

sh directory:
	1.	args.c contains functions for parsing shell options
		and for processing positional parameters.
	2.	arith.c contains callback functions for the streval.c
		library and the interface to shell arithmetic.
	3.	array.c contains the code for indexed and associative
		arrays.
	4.	defs.c contains the data definitions for global symbols.
	5.	(removed)
	6.	expand.c contains code for file name expansion and
		pathname expansion.
	7.	fault.c contains code for signal processing, trap
		handling and termination.
	8.	fcin.c contains code for reading and writing a character
		at a time from a file or string.
	9.	init.c contains initialization code and callbacks
		for get and set functions for built-in variables.	
	10.	io.o contains code for redirections and managing file
		descriptors and file streams.
	11.	jobs.c contains the code for job management.
	12.	lex.c contains the code for the lexical analyzer.
	13.	macro.c contains code for the $ macro expansions, including
		here-documents.
	14.	main.c contains the calls to initialization, profile
		processing and the main evaluation loop as well as
		mail processing.
	15.	name.c contains the name-value pair routines that are
		built on the hash library in libast.
	16.	nvdisc.c contains code related to name-value pair disciplines.
	17.	nvtree.c contains code for compound variables and for
		walking the namespace.
	18.	nvtype.c contains most of the code related to types that
		are created with typeset -T.
	19.	parse.c contains the code for the shell parser.
	20.	path.c contains the code for pathname lookup and
		some path functions.  It also contains the code
		that executes commands and scripts.
	21.	pmain.c is just a calls sh_main() so that all of the
		rest of the shell can be in a shared library.
	22.	shcomp.c contains the main program to the shell
		compiler.  This program parses a script and creates
		a file that the shell can read containing the parse tree.
	23.	streval.c is an C arithmetic evaluator.
	24.	string.c contains some string related functions.
	25.	subshell.c contains the code to save and restore
		environments so that subshells can run without creating
		a new process.
	26.	tdump.c contains the code to dump a parse tree into
		a file.
	27.	timers.c contains code for multiple event timeouts.
	28.	trestore contains the code for restoring the parse
		tree from the file created by tdump.
	29.	waitevent.c contains the sh_waitnotify function so
		that builtins can handle processing events when the
		shell is waiting for input or for process completion.
	30.	xec.c is the main shell execution loop.

edit directory:
	1.      completion.c contains code for command and file generation and
		completion.
	2.      edit.c contains common editing and terminal code for vi and
		emacs.
	3.      emacs.c contains code for the emacs editor.
	4.      hexpand.c contains code for C-shell style history expansions.
	5.      history.c contains code for creating managing the history file.
	6.      vi.c contains the code for the vi editor.
