CodeGen
 All Classes Namespaces Files Functions Variables Properties Pages
CodeGen.generators.GeneratorConf Class Reference

Holds the configuration of generator More...

Collaboration diagram for CodeGen.generators.GeneratorConf:
Collaboration graph

Static Public Member Functions

static string GetIndent (bool tabs, int tabStop)
 Creates indent using given parameters More...
 
static string ShiftCode (string code, int num, string indent)
 Shifts code using given parameters More...
 
static string NormalizeLang (string lang)
 Converts given language into language which is used for identification of generator More...
 
static Languange GetLanguage (string name)
 Creates generator if it exists, else throws an error More...
 

Static Public Attributes

static readonly Package ExamplePkg
 Contains example package More...
 
static readonly Dictionary
< string, Languange
Languanges
 Dictionary of language names (keys) and its Language objects (values) More...
 

Detailed Description

Holds the configuration of generator

Definition at line 232 of file GeneratorConf.cs.

Member Function Documentation

static string CodeGen.generators.GeneratorConf.GetIndent ( bool  tabs,
int  tabStop 
)
static

Creates indent using given parameters

Parameters
tabsUse tabs or spaces
tabStopNumber of spaces
Returns
Indent string

Definition at line 367 of file GeneratorConf.cs.

static Languange CodeGen.generators.GeneratorConf.GetLanguage ( string  name)
static

Creates generator if it exists, else throws an error

Parameters
namename of a language
Returns
language
Exceptions
IndexOutOfRangeExceptionIf the language is not found

Definition at line 418 of file GeneratorConf.cs.

static string CodeGen.generators.GeneratorConf.NormalizeLang ( string  lang)
static

Converts given language into language which is used for identification of generator

Parameters
langInputed language
Returns
Normalized language

Definition at line 390 of file GeneratorConf.cs.

static string CodeGen.generators.GeneratorConf.ShiftCode ( string  code,
int  num,
string  indent 
)
static

Shifts code using given parameters

Parameters
codeCode to be shifted
numNumber of indents
indentIndent string
Returns
Shifted code

Definition at line 379 of file GeneratorConf.cs.

Here is the caller graph for this function:

Member Data Documentation

readonly Package CodeGen.generators.GeneratorConf.ExamplePkg
static

Contains example package

Definition at line 237 of file GeneratorConf.cs.

readonly Dictionary<string, Languange> CodeGen.generators.GeneratorConf.Languanges
static
Initial value:
= new Dictionary<string, Languange>
{
{"java", new Languange(new JavaGenerator(), "java", "/* {0} */", JavaNormalizer.GetNormalizer())},
{"go", new Languange(new GoGenerator(), "go", "/* {0} */")},
{"ruby", new Languange(new RubyGenerator(), "rb", "# {0}")},
{"python", new Languange(new PythonGenerator(), "py", "# {0}\n")},
{"vb", new Languange(new VbGenerator(), "vb", "' {0}\n", VbNormalizer.GetNormalizer())},
{"csharp", new Languange(new CSharpGenerator(), "cs", "/* {0} */", CSharpNormalizer.GetNormalizer())},
{"js_es6", new Languange(new Es6Generator(), "js", "/* {0} */")},
{"groovy", new Languange(new GroovyGenerator(), "groovy", "/* {0} */")},
{"cpp", new Languange(new CppGenerator(), "cpp", "/* {0} */")},
}

Dictionary of language names (keys) and its Language objects (values)

Todo:

Add languages: JS_ES5, Crystal, Closure, Kotlin, Rust, Scala, Lua,

Add frameworks: Pyhton/Django, Ruby/Rails

Definition at line 345 of file GeneratorConf.cs.


The documentation for this class was generated from the following file: