C# Class Antlr4.AntlrTool

Show file Open project: sharwell/antlr4cs Class Usage Examples

Public Properties

Property Type Description
ALL_GRAMMAR_EXTENSIONS IList
GRAMMAR_EXTENSION string
LEGACY_GRAMMAR_EXTENSION string
ST_inspector_wait_for_close bool
VERSION string
args string[]
errMgr Antlr4.Tool.ErrorManager
force_atn bool
genPackage string
gen_dependencies bool
gen_listener bool
gen_visitor bool
generate_ATN_dot bool
grammarEncoding string
grammarOptions string>.IDictionary
inputDirectory string
internalOption_PrintGrammarTree bool
internalOption_ShowATNConfigsInDFA bool
launch_ST_inspector bool
libDirectory string
log bool
logMgr Antlr4.Misc.LogManager
longMessages bool
msgFormat string
optionDefs Option[]
outputDirectory string
warnings_are_errors bool

Protected Properties

Property Type Description
grammarFiles IList
haveOutputDir bool
return_dont_exit bool

Public Methods

Method Description
AddListener ( ANTLRToolListener tl ) : void
AntlrTool ( string args ) : System.Collections.Generic
CheckForRuleIssues ( Grammar g ) : bool
CreateGrammar ( GrammarRootAST ast ) : Grammar
Error ( ANTLRMessage msg ) : void
FindOptionValueAST ( GrammarRootAST root, string option ) : GrammarAST
GenerateATNs ( Grammar g ) : void
GetImportedGrammarFile ( Grammar g, string fileName ) : string
GetListeners ( ) : IList
GetNumErrors ( ) : int
GetOutputDirectory ( string fileNameWithPath ) : string
GetOutputFileWriter ( Grammar g, string fileName ) : System.IO.TextWriter
Help ( ) : void
Info ( string msg ) : void
LoadGrammar ( string fileName ) : Grammar
LoadImportedGrammar ( Grammar g, GrammarAST nameNode ) : Grammar
Log ( [ component, string msg ) : void
Log ( string msg ) : void
Main ( string args ) : int
Panic ( ) : void
Parse ( string fileName, Antlr.Runtime.ICharStream @in ) : GrammarRootAST
ParseGrammar ( string fileName ) : GrammarRootAST
ParseGrammarFromString ( string grammar ) : GrammarRootAST
Process ( Grammar g, bool gencode ) : void
ProcessGrammarsOnCommandLine ( ) : void
ProcessNonCombinedGrammar ( Grammar g, bool gencode ) : void
RemoveListener ( ANTLRToolListener tl ) : void
RemoveListeners ( ) : void
SortGrammarByTokenVocab ( IList fileNames ) : IList
Version ( ) : void
Warning ( ANTLRMessage msg ) : void

Protected Methods

Method Description
HandleArgs ( ) : void
HandleOptionSetArg ( string arg ) : void
WriteDOTFile ( Grammar g, Rule r, string dot ) : void
WriteDOTFile ( Grammar g, string name, string dot ) : void

Private Methods

Method Description
AntlrTool ( ) : System.Collections.Generic
GetField ( System.Type type, string name ) : FieldInfo

Method Details

AddListener() public method

public AddListener ( ANTLRToolListener tl ) : void
tl ANTLRToolListener
return void

AntlrTool() public method

public AntlrTool ( string args ) : System.Collections.Generic
args string
return System.Collections.Generic

CheckForRuleIssues() public method

public CheckForRuleIssues ( Grammar g ) : bool
g Antlr4.Tool.Grammar
return bool

CreateGrammar() public method

public CreateGrammar ( GrammarRootAST ast ) : Grammar
ast Antlr4.Tool.Ast.GrammarRootAST
return Antlr4.Tool.Grammar

Error() public method

public Error ( ANTLRMessage msg ) : void
msg Antlr4.Tool.ANTLRMessage
return void

FindOptionValueAST() public static method

public static FindOptionValueAST ( GrammarRootAST root, string option ) : GrammarAST
root Antlr4.Tool.Ast.GrammarRootAST
option string
return Antlr4.Tool.Ast.GrammarAST

GenerateATNs() public method

public GenerateATNs ( Grammar g ) : void
g Antlr4.Tool.Grammar
return void

GetImportedGrammarFile() public method

public GetImportedGrammarFile ( Grammar g, string fileName ) : string
g Antlr4.Tool.Grammar
fileName string
return string

GetListeners() public method

public GetListeners ( ) : IList
return IList

GetNumErrors() public method

public GetNumErrors ( ) : int
return int

GetOutputDirectory() public method

public GetOutputDirectory ( string fileNameWithPath ) : string
fileNameWithPath string
return string

GetOutputFileWriter() public method

public GetOutputFileWriter ( Grammar g, string fileName ) : System.IO.TextWriter
g Antlr4.Tool.Grammar
fileName string
return System.IO.TextWriter

HandleArgs() protected method

protected HandleArgs ( ) : void
return void

HandleOptionSetArg() protected method

protected HandleOptionSetArg ( string arg ) : void
arg string
return void

Help() public method

public Help ( ) : void
return void

Info() public method

public Info ( string msg ) : void
msg string
return void

LoadGrammar() public method

public LoadGrammar ( string fileName ) : Grammar
fileName string
return Antlr4.Tool.Grammar

LoadImportedGrammar() public method

public LoadImportedGrammar ( Grammar g, GrammarAST nameNode ) : Grammar
g Antlr4.Tool.Grammar
nameNode Antlr4.Tool.Ast.GrammarAST
return Antlr4.Tool.Grammar

Log() public method

public Log ( [ component, string msg ) : void
component [
msg string
return void

Log() public method

public Log ( string msg ) : void
msg string
return void

Main() public static method

public static Main ( string args ) : int
args string
return int

Panic() public method

public Panic ( ) : void
return void

Parse() public method

public Parse ( string fileName, Antlr.Runtime.ICharStream @in ) : GrammarRootAST
fileName string
@in Antlr.Runtime.ICharStream
return Antlr4.Tool.Ast.GrammarRootAST

ParseGrammar() public method

public ParseGrammar ( string fileName ) : GrammarRootAST
fileName string
return Antlr4.Tool.Ast.GrammarRootAST

ParseGrammarFromString() public method

public ParseGrammarFromString ( string grammar ) : GrammarRootAST
grammar string
return Antlr4.Tool.Ast.GrammarRootAST

Process() public method

public Process ( Grammar g, bool gencode ) : void
g Antlr4.Tool.Grammar
gencode bool
return void

ProcessGrammarsOnCommandLine() public method

public ProcessGrammarsOnCommandLine ( ) : void
return void

ProcessNonCombinedGrammar() public method

public ProcessNonCombinedGrammar ( Grammar g, bool gencode ) : void
g Antlr4.Tool.Grammar
gencode bool
return void

RemoveListener() public method

public RemoveListener ( ANTLRToolListener tl ) : void
tl ANTLRToolListener
return void

RemoveListeners() public method

public RemoveListeners ( ) : void
return void

SortGrammarByTokenVocab() public method

public SortGrammarByTokenVocab ( IList fileNames ) : IList
fileNames IList
return IList

Version() public method

public Version ( ) : void
return void

Warning() public method

public Warning ( ANTLRMessage msg ) : void
msg Antlr4.Tool.ANTLRMessage
return void

WriteDOTFile() protected method

protected WriteDOTFile ( Grammar g, Rule r, string dot ) : void
g Antlr4.Tool.Grammar
r Antlr4.Tool.Rule
dot string
return void

WriteDOTFile() protected method

protected WriteDOTFile ( Grammar g, string name, string dot ) : void
g Antlr4.Tool.Grammar
name string
dot string
return void

Property Details

ALL_GRAMMAR_EXTENSIONS public static property

public static IList ALL_GRAMMAR_EXTENSIONS
return IList

GRAMMAR_EXTENSION public static property

public static string GRAMMAR_EXTENSION
return string

LEGACY_GRAMMAR_EXTENSION public static property

public static string LEGACY_GRAMMAR_EXTENSION
return string

ST_inspector_wait_for_close public property

public bool ST_inspector_wait_for_close
return bool

VERSION public static property

public static string VERSION
return string

args public property

public string[] args
return string[]

errMgr public property

public ErrorManager,Antlr4.Tool errMgr
return Antlr4.Tool.ErrorManager

force_atn public property

public bool force_atn
return bool

genPackage public property

public string genPackage
return string

gen_dependencies public property

public bool gen_dependencies
return bool

gen_listener public property

public bool gen_listener
return bool

gen_visitor public property

public bool gen_visitor
return bool

generate_ATN_dot public property

public bool generate_ATN_dot
return bool

grammarEncoding public property

public string grammarEncoding
return string

grammarFiles protected property

protected IList grammarFiles
return IList

grammarOptions public property

public IDictionary grammarOptions
return string>.IDictionary

haveOutputDir protected property

protected bool haveOutputDir
return bool

inputDirectory public property

public string inputDirectory
return string

internalOption_PrintGrammarTree public static property

public static bool internalOption_PrintGrammarTree
return bool

internalOption_ShowATNConfigsInDFA public static property

public static bool internalOption_ShowATNConfigsInDFA
return bool

launch_ST_inspector public property

public bool launch_ST_inspector
return bool

libDirectory public property

public string libDirectory
return string

log public property

public bool log
return bool

logMgr public property

public LogManager,Antlr4.Misc logMgr
return Antlr4.Misc.LogManager

longMessages public property

public bool longMessages
return bool

msgFormat public property

public string msgFormat
return string

optionDefs public static property

public static Option[] optionDefs
return Option[]

outputDirectory public property

public string outputDirectory
return string

return_dont_exit protected property

protected bool return_dont_exit
return bool

warnings_are_errors public property

public bool warnings_are_errors
return bool