Context

Context for the current translation, to avoid global variables

struct Context {}

Constructors

this
this(Options options, Language language)
Undocumented in source.

Members

Aliases

SeenCursors
alias SeenCursors = bool[CursorId]
Undocumented in source.

Functions

aggregateDeclarations
const(typeof(_aggregateDeclarations)) aggregateDeclarations()
Undocumented in source. Be warned that the author may not have intended to support it.
aggregateIsRemembered
bool aggregateIsRemembered(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
debugOutput
bool debugOutput()
Undocumented in source. Be warned that the author may not have intended to support it.
declareUnknownStructs
void declareUnknownStructs()

If unknown structs show up in functions or fields (as a pointer), define them now so the D file can compile See it.c.compile.delayed.

fixAggregateTypes
void fixAggregateTypes()
Undocumented in source. Be warned that the author may not have intended to support it.
fixFields
void fixFields()
Undocumented in source. Be warned that the author may not have intended to support it.
fixLinkables
void fixLinkables()
Undocumented in source. Be warned that the author may not have intended to support it.
fixNames
void fixNames()
Undocumented in source. Be warned that the author may not have intended to support it.
hasSeen
bool hasSeen(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
indent
Context indent()
Undocumented in source. Be warned that the author may not have intended to support it.
indentation
auto indentation()
Undocumented in source. Be warned that the author may not have intended to support it.
isFromIgnoredNs
bool isFromIgnoredNs(Type type)

If this cursor is from one of the ignored namespaces

isFromIgnoredPath
bool isFromIgnoredPath(Cursor cursor)

Is the file from an ignored path? Note it uses file globbing

isUnknownStruct
bool isUnknownStruct(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
isUserDefinedType
bool isUserDefinedType(string spelling)
Undocumented in source. Be warned that the author may not have intended to support it.
log
void log(A args)
Undocumented in source. Be warned that the author may not have intended to support it.
macroAlreadyDefined
bool macroAlreadyDefined(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
namespace
string namespace()
Undocumented in source. Be warned that the author may not have intended to support it.
newAnonymousMemberName
string newAnonymousMemberName()
Undocumented in source. Be warned that the author may not have intended to support it.
popNamespace
void popNamespace(string ns)
Undocumented in source. Be warned that the author may not have intended to support it.
pushNamespace
void pushNamespace(string ns)
Undocumented in source. Be warned that the author may not have intended to support it.
rememberAggregate
void rememberAggregate(Cursor cursor)

Remember this aggregate cursor

rememberAggregateParent
void rememberAggregateParent(Cursor child, Cursor parent)
Undocumented in source. Be warned that the author may not have intended to support it.
rememberAggregateTypeLine
void rememberAggregateTypeLine(string typeName)
Undocumented in source. Be warned that the author may not have intended to support it.
rememberCursor
void rememberCursor(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
rememberField
void rememberField(string spelling)

In C it's possible for a struct field name to have the same name as a struct because of elaborated names. We remember them here in case we need to fix them.

rememberFieldStruct
void rememberFieldStruct(string typeSpelling)

Tells the context to remember a struct type encountered in an aggregate field. Typically this will be a pointer to a structure but it could also be the return type or parameter types of a function pointer field. This is (surprisingly!) perfectly valid C code, even though Foo is never declared anywhere:

rememberLinkable
string rememberLinkable(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
rememberMacro
void rememberMacro(Cursor cursor)
Undocumented in source. Be warned that the author may not have intended to support it.
rememberSpelling
void rememberSpelling(string original, string spelling)
Undocumented in source. Be warned that the author may not have intended to support it.
rememberType
void rememberType(string type)
Undocumented in source. Be warned that the author may not have intended to support it.
setIndentation
void setIndentation(int indentation)
Undocumented in source. Be warned that the author may not have intended to support it.
spelling
string spelling(string cursorSpelling)
Undocumented in source. Be warned that the author may not have intended to support it.
spellingOrNickname
string spellingOrNickname(Cursor cursor)

return the spelling if it exists, or our made-up nickname for it if not

translation
string translation()
Undocumented in source. Be warned that the author may not have intended to support it.
writeln
void writeln(string line)

Writes a line of translation.

writeln
void writeln(string[] lines)

Writes lines of translation.

Variables

accessSpecifier
AccessSpecifier accessSpecifier;
Undocumented in source.
language
Language language;
Undocumented in source.
options
Options options;

Command-line options

Meta