class SilicaCore::CppGenerator

Defined in:

silica_core/cpp_generator.cr

Constant Summary

KEYWORDS = ["alignas", "alignof", "and", "and_eq", "asm", "atomic_cancel", "atomic_commit", "atomic_noexcept", "auto", "bitand", "bitor", "bool", "break", "case", "catch", "char", "char8_t", "char16_t", "char32_t", "class", "compl", "concept", "const", "consteval", "constexpr", "constinit", "const_cast", "continue", "co_await", "co_return", "co_yield", "decltype", "default", "delete", "do", "double", "dynamic_cast", "else", "enum", "explicit", "export", "extern", "false", "float", "for", "friend", "goto", "if", "inline", "int", "long", "mutable", "namespace", "new", "noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq", "private", "protected", "public", "reflexpr", "register", "reinterpret_cast", "requires", "return", "short", "signed", "sizeof", "static", "static_assert", "static_cast", "struct", "switch", "synchronized", "template", "this", "thread_local", "throw", "true", "try", "typedef", "typeid", "typename", "union", "unsigned", "using", "virtual", "void", "volatile", "wchar_t", "while", "xor", "xor_eq"] of ::String
LINE_SEPARATOR = ';'

Constructors

Instance Method Summary

Instance methods inherited from class SilicaCore::Generator

block(header : String, separator : Bool = false, &) : self block, close close, comment(line : String) : self comment, constant(type : String, name : String, value : String) : self constant, doc(& : DocGenerator -> ) : self doc, emit(line : String, no_sep = false, no_newline = false) : self emit, escape(str : String) : String escape, escape_keywords(s : String) : String escape_keywords, g_alias(name : String, tgt : String) : self g_alias, g_constant(type : String, name : String, value : String) : self g_constant, g_enum(name : String, type : String, &) : self g_enum, g_enum_member(name : String, value : String) : self
g_enum_member(name : String) : self
g_enum_member
, g_module(name : String, includes : Array(String) = [] of String, &) : self g_module, g_struct(name : String, ancestors : Array(String) = [] of String, &) : self g_struct, generate(&) generate, generic(type : String, args : Array(String)) : String
generic(type : String, *args : String) : String
generic
, include_guard include_guard, instance(type : String, name : String, args : Array(String) = [] of String) : self instance, namespace(name : String, &) : self namespace, path(parts : Array(String)) : String
path(*parts : String) : String
path
, require_file(name : String, local = false) : self require_file, require_support : self require_support, separator : self separator

Constructor Detail

def self.new(io : IO, tab : String = " ", newline : String = "\n") #

[View source]

Instance Method Detail

def block(header : String, separator : Bool = false, &) : Generator #

[View source]
def close #

[View source]
def comment(line) : Generator #

[View source]
def constant(type : String, name : String, value : String) : Generator #

[View source]
def doc(& : DocGenerator -> ) : Generator #

[View source]
def emit(line, no_sep = false, no_newline = false) : Generator #

[View source]
def escape(str : String) : String #

[View source]
def escape_keywords(str : String) : String #

[View source]
def g_alias(name : String, tgt : String) : self #

[View source]
def g_constant(type : String, name : String, value : String) : self #

[View source]
def g_enum(name : String, type : String, &) : self #

[View source]
def g_enum_member(name : String, value : String) : self #

[View source]
def g_enum_member(name : String) : self #

[View source]
def g_module(name : String, includes : Array(String) = [] of String, &) : self #

[View source]
def g_struct(name : String, ancestors : Array(String) = [] of String, &) : self #

[View source]
def generic(type : String, args : Array(String)) : String #

[View source]
def generic(type : String, *args : String) : String #

[View source]
def include_guard : Generator #

[View source]
def instance(type : String, name : String, args : Array(String) = [] of String) : Generator #

[View source]
def io : IO #

[View source]
def namespace(name : String, &) : Generator #

[View source]
def path(parts : Array(String)) : String #

[View source]
def path(*parts : String) : String #

[View source]
def require_file(name, local = false) : Generator #

[View source]
def require_support : Generator #

[View source]
def separator : Generator #

[View source]