module diode.vdoc

Code Map

module diode.vdoc;


//! Type of doc object.
enum Kind
{
	Invalid,
	Arg,
	Enum,
	EnumDecl,
	Alias,
	Class,
	Union,
	Group,
	Import,
	Return,
	Struct,
	Module,
	Member,
	Function,
	Variable,
	Interface,
	Destructor,
	Constructor,
}

//! Access of a symbool.
enum Access
{
	Public,
	Protected,
	Private,
}

//! Storage of a variable.
enum Storage
{
	Field,
	Global,
	Local,
}

//! The object that templates accesses the rest of the documentation nodes
//! from.
class VdocRoot : Value
{
public:
	//! Current thing that a vdoc template is rendering.
	current: Value;
	//! Set holding config data.
	set: Set;


public:
	this() { }
	fn modules() Parent[] { }
	fn groups() Parent[] { }
	fn ident(n: ir.Node, key: string) Value { }
	//! Return a named object of the given name.
	fn findNamed(name: string) Named { }
	//! Add a group, mostly used to create groups implicitly.
	fn addGroup(name: string, title: string, raw: string) Parent { }
	//! Sets the children and does any upfront processing needed.
	fn setChildren(children: Value[]) { }
}

//! Base class for all doc objects.
class Base : Value
{
public:
	kind: Kind;


public:
	this() { }
}

//! Base class for all doc objects that can have names.
class Named : Base
{
public:
	//! Printable name of this object.
	name: string;
	//! Ident for looking up this Named thing.
	search: string;
	//! Access of this named object.
	access: Access;
	//! Raw doccomment string.
	raw: string;
	//! Where to find the per thing documentation page, if any.
	url: string;
	//! A unique identifier for this object.
	tag: string;
	//! The content of the doccomment, in markdown form.
	content: string;
	//! The brief in text form.
	brief: string;
	//! The groups this named is in.
	ingroup: Value[];
	//! The sa commands for this Named thing.
	sa: string[];
	//! The throw commands for this Named thing.
	_throw: string[];
	//! The se commands for this Named thing.
	se: string[];
	//! The parsed name of parent class to the class.
	parentStr: string;
	//! The full name of parent class to the class.
	parentFullStr: string;
	//! The parsed name of the interface(s) to the class or interface.
	interfacesStr: string[];
	//! The full name of the interface(s) to the class or interface.
	interfacesFullStr: string[];


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! Regular imports and bound imports.
class Import : Named
{
public:
	//! Is this import bound to a name.
	bind: string;


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! A single freestanding enum or value part of a enum.
class EnumDecl : Named
{
public:
	//! Is this a enum
	isStandalone: bool;


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! Base class for things with children, like Module, Class, Structs.
class Parent : Named
{
public:
	//! The children of this Named thing.
	children: Value[];


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! Argument to a function.
class Arg : Base
{
public:
	name: string;
	type: string;
	typeFull: string;
	//! The doccomment content for this argument.
	content: string;


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! Return from a function.
class Return : Base
{
public:
	type: string;
	typeFull: string;
	//! The doccomment content for this return.
	content: string;


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! A variable or field on a aggregate.
class Variable : Named
{
public:
	type: string;
	typeFull: string;
	storage: Storage;


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! An alias declaration.
class Alias : Named
{
public:
	type: string;
	typeFull: string;


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! A function or constructor, destructor or method on a aggreegate.
class Function : Named
{
public:
	args: Value[];
	rets: Value[];
	linkage: string;
	hasBody: bool;
	forceLabel: bool;
	isFinal: bool;
	isScope: bool;
	isAbstract: bool;
	isProperty: bool;
	isOverride: bool;


public:
	this() { }
	fn ident(n: ir.Node, key: string) Value { }
}

//! A special array that you can access fields on to filter the members.
class Collection : Array
{
public:
	this(vals: Value[]) { }
	fn ident(n: ir.Node, key: string) Value { }


public:
	static fn make(vals: Value[], key: string) Value { }
}

fn accessToString(access: Access) string { }
//! Create a text Value, nil if string is empty.
fn makeNilOrText(text: string) Value { }
//! Create a array Value, nil if string is empty.
fn makeNilOrArray(array: Value[]) Value { }
enum Kind

Type of doc object.

enum Access

Access of a symbool.

enum Storage

Storage of a variable.

class VdocRoot : Value

The object that templates accesses the rest of the documentation nodes from.

current: Value

Current thing that a vdoc template is rendering.

set: Set

Set holding config data.

mNamed: Named[string]

All loaded Named objects.

mModules: Parent[]

All loaded modules.

mGroups: Parent[]

All loaded groups.

mChildren: Value[]

All children as a array.

fn findNamed(name: string) Named

Return a named object of the given name.

fn addGroup(name: string, title: string, raw: string) Parent

Add a group, mostly used to create groups implicitly.

fn setChildren(children: Value[])

Sets the children and does any upfront processing needed.

Any old children are removed.

class Base : Value

Base class for all doc objects.

class Named : Base

Base class for all doc objects that can have names.

name: string

Printable name of this object.

search: string

Ident for looking up this Named thing.

access: Access

Access of this named object.

raw: string

Raw doccomment string.

url: string

Where to find the per thing documentation page, if any.

tag: string

A unique identifier for this object.

content: string

The content of the doccomment, in markdown form.

brief: string

The brief in text form.

ingroup: Value[]

The groups this named is in.

sa: string[]

The sa commands for this Named thing.

_throw: string[]

The throw commands for this Named thing.

se: string[]

The se commands for this Named thing.

parentStr: string

The parsed name of parent class to the class.

parentFullStr: string

The full name of parent class to the class.

interfacesStr: string[]

The parsed name of the interface(s) to the class or interface.

interfacesFullStr: string[]

The full name of the interface(s) to the class or interface.

class Import : Named

Regular imports and bound imports.

bind: string

Is this import bound to a name.

class EnumDecl : Named

A single freestanding enum or value part of a enum.

isStandalone: bool

Is this a enum

class Parent : Named

Base class for things with children, like Module, Class, Structs.

children: Value[]

The children of this Named thing.

class Arg : Base

Argument to a function.

content: string

The doccomment content for this argument.

class Return : Base

Return from a function.

content: string

The doccomment content for this return.

class Variable : Named

A variable or field on a aggregate.

class Alias : Named

An alias declaration.

class Function : Named

A function or constructor, destructor or method on a aggreegate.

class Collection : Array

A special array that you can access fields on to filter the members.

fn makeNilOrText(text: string) Value

Create a text Value, nil if string is empty.

fn makeNilOrArray(array: Value[]) Value

Create a array Value, nil if string is empty.