module volt.visitor.prettyprinter

Code Map

module volt.visitor.prettyprinter;


class PrettyPrinter : Visitor, Pass
{
public:
	this(indentText: string, sink: void delegate(scope (const(scope (char)[]))) { }
	fn close() { }
	fn visitingError(n: ir.Node, msg: string) Status { }
	fn transform(m: ir.Module) { }
	fn transformType(t: ir.Type) { }
	fn visit(i: ir.Identifier) Status { }
	fn visit(qname: ir.QualifiedName) Status { }
	fn enter(m: ir.Module) Status { }
	fn leave(m: ir.Module) Status { }
	fn enter(tlb: ir.TopLevelBlock) Status { }
	fn leave(tlb: ir.TopLevelBlock) Status { }
	fn enter(i: ir.Import) Status { }
	fn leave(i: ir.Import) Status { }
	fn enter(u: ir.Unittest) Status { }
	fn leave(u: ir.Unittest) Status { }
	fn enter(c: ir.Class) Status { }
	fn leave(c: ir.Class) Status { }
	fn enter(i: ir._Interface) Status { }
	fn leave(i: ir._Interface) Status { }
	fn enter(s: ir.Struct) Status { }
	fn leave(s: ir.Struct) Status { }
	fn enter(u: ir.Union) Status { }
	fn leave(u: ir.Union) Status { }
	fn enter(d: ir.Variable) Status { }
	fn leave(d: ir.Variable) Status { }
	fn enter(fp: ir.FunctionParam) Status { }
	fn leave(fp: ir.FunctionParam) Status { }
	fn enter(e: ir.Enum) Status { }
	fn leave(e: ir.Enum) Status { }
	fn enter(attr: ir.Attribute) Status { }
	fn leave(attr: ir.Attribute) Status { }
	fn enter(mf: ir.MixinFunction) Status { }
	fn leave(mf: ir.MixinFunction) Status { }
	fn enter(mt: ir.MixinTemplate) Status { }
	fn leave(mt: ir.MixinTemplate) Status { }
	fn enter(c: ir.Condition) Status { }
	fn leave(c: ir.Condition) Status { }
	fn enter(ctl: ir.ConditionTopLevel) Status { }
	fn leave(ctl: ir.ConditionTopLevel) Status { }
	fn enter(e: ir.ExpStatement) Status { }
	fn leave(e: ir.ExpStatement) Status { }
	fn enter(ret: ir.ReturnStatement) Status { }
	fn leave(ret: ir.ReturnStatement) Status { }
	fn enter(b: ir.BlockStatement) Status { }
	fn leave(b: ir.BlockStatement) Status { }
	fn enter(a: ir.AsmStatement) Status { }
	fn leave(a: ir.AsmStatement) Status { }
	fn enter(i: ir.IfStatement) Status { }
	fn leave(i: ir.IfStatement) Status { }
	fn enter(w: ir.WhileStatement) Status { }
	fn leave(w: ir.WhileStatement) Status { }
	fn enter(d: ir.DoStatement) Status { }
	fn leave(d: ir.DoStatement) Status { }
	fn enter(fes: ir.ForeachStatement) Status { }
	fn leave(fes: ir.ForeachStatement) Status { }
	fn enter(f: ir.ForStatement) Status { }
	fn leave(f: ir.ForStatement) Status { }
	fn enter(ss: ir.SwitchStatement) Status { }
	fn leave(ss: ir.SwitchStatement) Status { }
	fn enter(sc: ir.SwitchCase) Status { }
	fn leave(sc: ir.SwitchCase) Status { }
	fn enter(ls: ir.LabelStatement) Status { }
	fn leave(ls: ir.LabelStatement) Status { }
	fn visit(cs: ir.ContinueStatement) Status { }
	fn visit(bs: ir.BreakStatement) Status { }
	fn enter(gs: ir.GotoStatement) Status { }
	fn leave(gs: ir.GotoStatement) Status { }
	fn enter(ws: ir.WithStatement) Status { }
	fn leave(ws: ir.WithStatement) Status { }
	fn enter(ss: ir.SynchronizedStatement) Status { }
	fn leave(ss: ir.SynchronizedStatement) Status { }
	fn enter(ts: ir.TryStatement) Status { }
	fn leave(ts: ir.TryStatement) Status { }
	fn enter(ts: ir.ThrowStatement) Status { }
	fn leave(ts: ir.ThrowStatement) Status { }
	fn enter(ss: ir.ScopeStatement) Status { }
	fn leave(ss: ir.ScopeStatement) Status { }
	fn enter(ps: ir.PragmaStatement) Status { }
	fn leave(ps: ir.PragmaStatement) Status { }
	fn enter(cs: ir.ConditionStatement) Status { }
	fn leave(cs: ir.ConditionStatement) Status { }
	fn enter(as: ir.AssertStatement) Status { }
	fn leave(as: ir.AssertStatement) Status { }
	fn enter(ms: ir.MixinStatement) Status { }
	fn leave(ms: ir.MixinStatement) Status { }
	fn enter(ed: ir.EnumDeclaration) Status { }
	fn leave(ed: ir.EnumDeclaration) Status { }
	fn enter(pointer: ir.PointerType) Status { }
	fn leave(pointer: ir.PointerType) Status { }
	fn visit(nullType: ir.NullType) Status { }
	fn enter(array: ir.ArrayType) Status { }
	fn leave(array: ir.ArrayType) Status { }
	fn enter(array: ir.StaticArrayType) Status { }
	fn leave(array: ir.StaticArrayType) Status { }
	fn enter(array: ir.AmbiguousArrayType) Status { }
	fn leave(array: ir.AmbiguousArrayType) Status { }
	fn enter(array: ir.AAType) Status { }
	fn enter(func: ir.FunctionType) Status { }
	fn leave(func: ir.FunctionType) Status { }
	fn enter(func: ir.DelegateType) Status { }
	fn leave(func: ir.DelegateType) Status { }
	fn leave(array: ir.AAType) Status { }
	fn enter(func: ir.Function) Status { }
	fn leave(func: ir.Function) Status { }
	fn enter(type: ir.StorageType) Status { }
	fn leave(type: ir.StorageType) Status { }
	fn visit(at: ir.AutoType) Status { }
	fn visit(at: ir.NoType) Status { }
	fn enter(asi: ir.AliasStaticIf) Status { }
	fn leave(asi: ir.AliasStaticIf) Status { }
	fn enter(a: ir.Alias) Status { }
	fn leave(a: ir.Alias) Status { }
	fn enter(typeOf: ir.TypeOf) Status { }
	fn leave(typeOf: ir.TypeOf) Status { }
	fn enter(ti: ir.TemplateInstance) Status { }
	fn leave(ti: ir.TemplateInstance) Status { }
	fn visit(td: ir.TemplateDefinition) Status { }
	fn enter(ir.Exp, constant: ir.Constant) Status { }
	fn leave(ir.Exp, ir.Constant) Status { }
	fn visit(ir.Exp, identifier: ir.IdentifierExp) Status { }
	fn enter(ir.Exp, array: ir.ArrayLiteral) Status { }
	fn leave(ir.Exp, array: ir.ArrayLiteral) Status { }
	fn enter(ir.Exp, array: ir.AssocArray) Status { }
	fn leave(ir.Exp, array: ir.AssocArray) Status { }
	fn enter(ir.Exp, _assert: ir.Assert) Status { }
	fn leave(ir.Exp, _assert: ir.Assert) Status { }
	fn enter(ir.Exp, strimport: ir.StringImport) Status { }
	fn leave(ir.Exp, strimport: ir.StringImport) Status { }
	fn enter(ir.Exp, ternary: ir.Ternary) Status { }
	fn leave(ir.Exp, ternary: ir.Ternary) Status { }
	fn enter(ir.Exp, binop: ir.BinOp) Status { }
	fn leave(ir.Exp, binop: ir.BinOp) Status { }
	fn enter(ir.Exp, unary: ir.Unary) Status { }
	fn leave(ir.Exp, unary: ir.Unary) Status { }
	fn leave(ir.Exp, postfix: ir.Postfix) Status { }
	fn enter(ir.Exp, postfix: ir.Postfix) Status { }
	fn enter(exp: ir.Exp, prop: ir.PropertyExp) Status { }
	fn leave(ir.Exp, ir.PropertyExp) Status { }
	fn enter(exp: ir.Exp, inbuilt: ir.BuiltinExp) Status { }
	fn leave(ir.Exp, ir.BuiltinExp) Status { }
	fn enter(exp: ir.Exp, ae: ir.AccessExp) Status { }
	fn leave(exp: ir.Exp, ae: ir.AccessExp) Status { }
	fn enter(exp: ir.Exp, runexp: ir.RunExp) Status { }
	fn leave(exp: ir.Exp, runexp: ir.RunExp) Status { }
	fn enter(exp: ir.Exp, cs: ir.ComposableString) Status { }
	fn leave(exp: ir.Exp, cs: ir.ComposableString) Status { }
	fn enter(ir.Exp, ti: ir.Typeid) Status { }
	fn leave(ir.Exp, ti: ir.Typeid) Status { }
	fn enter(ir.Exp, isExp: ir.IsExp) Status { }
	fn leave(ir.Exp, isExp: ir.IsExp) Status { }
	fn enter(ir.Exp, functionLiteral: ir.FunctionLiteral) Status { }
	fn leave(ir.Exp, functionLiteral: ir.FunctionLiteral) Status { }
	fn enter(ir.Exp, sliteral: ir.StructLiteral) Status { }
	fn leave(ir.Exp, sliteral: ir.StructLiteral) Status { }
	fn enter(ir.Exp, sliteral: ir.UnionLiteral) Status { }
	fn leave(ir.Exp, sliteral: ir.UnionLiteral) Status { }
	fn enter(ir.Exp, cliteral: ir.ClassLiteral) Status { }
	fn leave(ir.Exp, cliteral: ir.ClassLiteral) Status { }
	fn enter(ir.Exp, texp: ir.TypeExp) Status { }
	fn leave(ir.Exp, texp: ir.TypeExp) Status { }
	fn enter(ir.Exp, statExp: ir.StatementExp) Status { }
	fn leave(ir.Exp, state: ir.StatementExp) Status { }
	fn enter(ir.Exp, vaexp: ir.VaArgExp) Status { }
	fn leave(ir.Exp, vaexp: ir.VaArgExp) Status { }
	fn visit(ir.Exp, e: ir.ExpReference) Status { }
	fn visit(ir.Exp, fexp: ir.TokenExp) Status { }
	fn visit(ir.Exp, e: ir.StoreExp) Status { }
	fn visit(type: ir.PrimitiveType) Status { }
	fn visit(tr: ir.TypeReference) Status { }


protected:
	mFilename: string;
	mStream: OutputStream;
	mSink: void delegate(scope (const(scope (char)[]));
	mIndent: i32;
	mIndentText: string;
	mPrintingTemplateDefinition: i32;


protected:
	fn internalPrintBlock(bs: ir.BlockStatement) { }
	fn wf(qn: ir.QualifiedName) { }
	fn t() { }
	fn twf(strings: string[]) { }
	fn twfln(strings: string[]) { }
	fn wf(strings: string[]) { }
	fn wf(i: i32) { }
	fn wf(i: u32) { }
	fn wf(l: i64) { }
	fn wf(i: u64) { }
	fn wfln(str: string) { }
	fn ln() { }
	//! Print storage types.
	fn wStorageTypes(t: ir.Type) { }
	fn wAfterStorageTypes(t: ir.Type) { }
}

fn prettyPrinter(m: ir.Module) { }