mokadi.mokadi_parser
¶module botadi.mokadi.mokadi_parser
Parse with Mokadi’sgrammar.
function |
truncated documentation |
---|---|
returns a string which shows the parsed tree |
|
Parse a sentance with mokadi language. |
|
Displays a tree for the parsed text. |
|
Parses the script and intercept standard output and error. |
Parse with Mokadi’sgrammar.
returns a string which shows the parsed tree
MokadiGrammarListener – listener to use
tree – from parse_code()
parser – the parser used to build the tree
format – None or a class ParseTreeListener
string or C# code in Scope script (scope instructions are replace by blank lines)
Parse a sentance with mokadi language.
MokadiGrammarParser – parser for a specific language
MokadiGrammarLexer – lexer for a specific language
content – string
instance of MokadiGrammarParser
Displays a tree for the parsed text.
node – output of parser.parse()
string (see below)
Example of results:
MOKADIbruitdetoilette - <Parse>
MOKADI - <Mokadi>
MOKADI - <TerminalNodeImpl>
bruit - <Expression_stmt>
bruit - <Expression>
bruit - <Anything_stmt>
bruit - <Word_name_ext>
bruit - <Word_name>
bruit - <TerminalNodeImpl>
de - <ErrorNodeImpl>
toilette - <ErrorNodeImpl>
Parses the script and intercept standard output and error.
parser – parser, output of parse_scope()
stdout, stderr, tree
Unfortunately, it is not multithreaded. It should be done in another way than by replacing sys.stdout and sys.stderr.