C# Class IronMeta.Generator.CSharpGen

Generates C# code for an IronMeta parser from an abstract syntax tree.
Inheritance: IGenerator
显示文件 Open project: kulibali/ironmeta Class Usage Examples

Public Methods

Method Description
CSharpGen ( AST topNode, string name_space ) : System
CSharpGen ( AST topNode, string name_space, bool add_timestamp ) : System
Generate ( string srcFname, TextWriter tw ) : void

Private Methods

Method Description
Analyze ( AST node, AST currentRule ) : void
GenerateActPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateActualParams ( TextWriter tw, HashSet vars, AST node, int n, string name, string indent, IList actualParams ) : void
GenerateAndPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateAndPre ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateAndShortcut ( TextWriter tw, AST node, int outer_n, bool match_args, string indent ) : void
GenerateAnyPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateArgsPost ( TextWriter tw, HashSet vars, AST node, int n, bool match_args, string indent ) : void
GenerateArgsPre ( TextWriter tw, HashSet vars, AST node, int &n, bool &use_args, bool match_args, string indent ) : void
GenerateBindPost ( TextWriter tw, HashSet vars, AST node, int n, bool match_args, string indent ) : void
GenerateBody ( TextWriter tw, HashSet vars, AST node, int &n, bool &use_args, bool match_args, string indent ) : void
GenerateCallOrVarPost ( TextWriter tw, HashSet vars, AST node, int n, bool match_args, string indent ) : void
GenerateCallPost ( TextWriter tw, HashSet vars, AST node, int n, bool match_args, string indent ) : void
GenerateCondPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateCondPre ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateFailPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateGrammar ( TextWriter tw, string indent ) : void
GenerateGrammarFile ( TextWriter tw ) : void
GenerateInputClassPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateItemClass ( TextWriter tw, string indent ) : void
GenerateLiteralPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateLookPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateLookPre ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateNamespaceUsings ( TextWriter tw ) : void
GenerateNotPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateNotPre ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateOrPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateOrPre ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateOrShortcut ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GeneratePlusPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GeneratePlusPre ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateQuesPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateRegexpPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateRule ( TextWriter tw, string ruleName, AST body, string indent ) : void
GenerateStarPost ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateStarPre ( TextWriter tw, AST node, int n, bool match_args, string indent ) : void
GenerateUsingAliases ( TextWriter tw, string indent ) : void
HoistCalledDisjunctions ( AST currentRule, AST callNode ) : void
IsTerminal ( string ruleName, ISet involved, bool>.IDictionary memo ) : bool
TrimBraces ( string s ) : string

Method Details

CSharpGen() public method

public CSharpGen ( AST topNode, string name_space ) : System
topNode AST
name_space string
return System

CSharpGen() public method

public CSharpGen ( AST topNode, string name_space, bool add_timestamp ) : System
topNode AST
name_space string
add_timestamp bool
return System

Generate() public method

public Generate ( string srcFname, TextWriter tw ) : void
srcFname string
tw System.IO.TextWriter
return void