ASTDeserializer

Deserializes a binary AST file.

Constructors

this
this(Token*[] tokens, Diagnostics diag)

Constructs an object.

Members

Aliases

read1B
alias read1B = readXB!(ubyte)

Reads 1 byte.

read2B
alias read2B = readXB!(ushort)

Reads 2 bytes.

read4B
alias read4B = readXB!(uint)

Reads 4 bytes.

readSB
alias readSB = readXB!(size_t)

Reads size_t.sizeof bytes.

Functions

check
bool check(TID tid)

Reads a byte and checks if it equals tid.

error
bool error(cstring msg, ...)

Creates an error message.

read
bool read(out TID tid)

Reads a type id.

read
bool read(out NodeKind k)

Reads the kind of a Node.

read
bool read(out Protection prot)

Reads the protection attribute.

read
bool read(out StorageClass stcs)

Reads the StorageClass attribute.

read
bool read(out LinkageType lnkg)

Reads the LinkageType attribute.

read
bool read(ref Node[] nodes, TID tid)

Reads the mangled array type and then each node.

read
bool read(out char c)

Reads a char.

read
bool read(out bool b)

Reads a boolean.

read
bool read(out uint u)

Reads a uint.

read
bool read(out TOK tok)

Reads a TOK.

read
bool read(out Token* t)

Reads a Token.

read
bool read(out Token*[] tokens)

Reads an array of Tokens.

read
bool read(out Token*[][] tokenLists)

Reads an array of arrays of Tokens.

readXB
bool readXB(out T x)

Reads T.sizeof bytes.

Static functions

generateCtorCall
char[] generateCtorCall(size_t num)

Generates e.g.: _0, _1, _2

generateMixins
char[] generateMixins()

Generates e.g.: mixin visitX!(CompoundDecl);

generateReaders
char[] generateReaders(string[] types)

Generates e.g.:

Variables

diag
Diagnostics diag;

For error messages.

end
const(ubyte)* end;

One past the last byte.

p
const(ubyte)* p;

Current byte.

tokens
Token*[] tokens;

The list of Tokens.

Inherited Members

From Visitor

dispatch
Node dispatch(Node n)

Calls the appropriate visit() method for a node.

dispatch
Node dispatch(Node n, NodeKind k)

Allows calling the visit() method with a null node.

unhandled
Node unhandled(Node n)

Called by visit() methods that were not overridden.

Meta